Archive for the ‘Computing’ Category

Save MySQL

Computing | Posted by Pep
Jan 01 2010

Quote:

If Oracle buys MySQL as part of Sun, database customers will pay the bill.

In April 2009, Oracle announced that it had agreed to acquire Sun. Since Sun had acquired MySQL the previous year, this would mean that Oracle, the market leader for closed source databases, would get to own MySQL, the most popular open source database.

If Oracle acquired MySQL on that basis, it would have as much control over MySQL as money can possibly buy over an open source project. In fact, for most open source projects (such as Linux or Apache) there isn’t any comparable way for a competitor to buy even one tenth as much influence. But MySQL’s success has always depended on the company behind it that develops, sells and promotes it. That company (initially MySQL AB, then Sun) has always owned the important intellectual property rights (IPRs), most notably the trademark, copyright and (so far only for defensive purposes) patents. It has used the IPRs to produce income and has reinvested a large part of those revenues in development, getting not only bigger but also better with time.

If those IPRs fall into the hands of MySQL’s primary competitor, then MySQL immediately ceases to be an alternative to Oracle’s own high-priced products. So far, customers had the choice to use MySQL in new projects instead of Oracle’s products. Some large companies even migrated (switched) from Oracle to MySQL for existing software solutions. And every one could credibly threaten Oracle’s salespeople with using MySQL unless a major discount was granted. If Oracle owns MySQL, it will only laugh when customers try this. Getting rid of this problem is easily worth one billion dollars a year to Oracle, if not more.

PHP Server Monitor version 2.0 released

Computing, Programming | Posted by Pep
Oct 19 2009

Source: PHP Server Monitor project page

It’s been a while since the last release, but finally the new version has arrived: PHP Server Monitor 2.0 has been released.

PHP Server Monitor is a script that checks whether the servers on your list are up
and running on the selected ports.
It comes with a web based user interface where you can add and remove servers or websites from the MySQL database,
and you can manage users for each server with a mobile number and email address.

With version 2.0 comes the support for websites as well. On the “Add server” page, you can choose
whether it’s a “service” or a “website”:

* service
A connection will be made to the entered ip or domain, on the given port. This way you can check if certain services on your machine are still running. To check your IMAP service for example, enter port 143.

* website
The previous version only tried to establish a connection to the server on port 80. If you are running multiple websites on 1 machine, there was no proper way to check each website for possible errors. Also it was impossible to make sure your site was really up and running, all you knew was that the server was still online.
This function takes care of that.
You can enter a link to a website (for example http://sourceforge.net/index.php), it will use cURL to open the website and check the HTTP status code (see http://en.wikipedia.org/wiki/List_of_HTTP_status_codes for details).
If the HTTP status code is in the 4xx range, it means an error occured and the website is not accesible to the public.
In that case the script will return a “status offline”, and will start sending out notifications.

The previous version sent you a notification every time a server was down or unreachable. Version 2 allows you to choose for a different setting. You can choose to only receive notifications if the status changes, if the server goes offline for the first time only, or the way it used to be.

Each server has it’s own settings regarding notification.
You can choose for email notification or text message (SMS). As of version 2.0, there are 3 gateways
available:
* Mollie – http://www.mollie.nl
* Spryng – http://www.spryng.nl
* Inetworx – http://www.inetworx.ch
For these gateways you need an account with sufficient credits.

If logging is enabled in the configuration, it will log any connection errors, emails and text messages sent.
The latest log records will be displayed on your web interface.
The cron/status.cron.php can be added as a cronjob which will keep the server status up to date.

This version of the monitor features 2 languages: English and Dutch. Unfortunately it is not compatible with the old version, since it’s been rewritten from scratch.

I’d appreciate any feedback you might have regarding this script. Please leave it on the sourceforge
project page (tracker), or send me an email (ipdope[at]users.sourceforge.net).

See: http://phpservermon.sourceforge.net

Nominate PHP Server Monitor on SourceForge

Computing, Programming | Posted by Pep
May 14 2009

PHP: Only variable references should be returned by reference

Computing, Programming | Posted by Pep
Apr 24 2009

Take the following code example:

<?php
class myClass {
	public $var = 1;

 	public function &getVar() {
 		return($this->var);
        }
}

$obj = new myClass;
$value = &$obj->getVar();
?>

This looks like valid code, right? PHP wants you to use the & in both places to indicate that you want to return by reference, and that’s what we have. But how come that this code still generates the notice?

Quote from php “return” manual (http://php.net/return):

Note: You should never use parentheses around your return variable when returning by reference, as this will not work. You can only return variables by reference, not the result of a statement. If you use return ($a); then you’re not returning a variable, but the result of the expression ($a) (which is, of course, the value of $a).

While it’s a very simple mistake, it did took me while to figure this out.

Google Earth 100% CPU [solution]

Computing | Posted by Pep
Mar 26 2009

So I had just finished installing Google Earth on my laptop and was about to explore the brand new street view here in Holland, when, as soon as I open Google Earth, my CPU shoots to 100%. The program did start up but the graphics took ages to load and there was no possibility to navigate at all. After 5 unresponsive minutes I killed the application and restarted it. Same thing, no way to get anything to work.
But, thanks to Google, here’s the deal.. When you go to Tools -> Options, on the right side of your screen you’ll see “Graphics mode” with 2 options and “OpenGL” as the default selected one. Switch to “DirectX”, restart Google Earth and you’re ready to rock!

Hope this works for you!