Death and Divorce Unix style

When you break up with your significant other you go through the motions of living your life, but in a daze. At some stage you need to let go and move on, no matter how hard it is. (from xkcd)

userdel

PS. Congrats Elly on the move to WordPress! A pity this cartoon wasn’t published before your talk at BarCamp!

PPS. But seriously, a friend just broke up with his girlfriend of over 4 years. She was cheating on him, I hope he listens to how to dump a cheating girlfriend!

Cannot load mysql extension. Please check your PHP configuration.

A friend recently had a problem configuring a new server. He installed PHP, Apache, MySQL and phpMyAdmin but when he launched it he got the following error:

phpMyAdmin – Error
Cannot load mysql extension. Please check your PHP configuration.

If you’ve installed all of the above more than once you’ll know what is more than likely wrong. The MySQL PHP module isn’t loaded. First of all, you must find your php.ini. It could be anywhere but if you create a small php file with the phpinfo(); command it will tell you where it is. Common places include /etc/apache/, /etc/php4/apache2/php.ini, /etc/php5/apache2/php.ini or even /usr/local/lib/php.ini

Edit your server’s php.ini and look for the following line. Remove the ‘;’ from the start of the line and restart Apache. Things should work fine now!

;extension=mysql.so

should become

extension=mysql.so

Linux Ubuntu Dapper to Edgy – no problem

I upgraded my Ubuntu 6.06 install to the new Edgy soon after it’s release using the simple command gksu "update-manager -c". Several hours later, and after clicking on a few dialog boxes to update files in /etc/, I’m not running Ubuntu Edgy on my desktop box.

Initially I wondered where Firefox 2.0 was hiding, but on my upgraded system it’s /usb/bin/firefox.ubuntu so it’ll live alongside version 1.5. I also noticed that when saving files in the GIMP the filename would disappear when I clicked on a new folder in the “bookmark” folder of the Gnome file dialog. Once I noticed, ctrl-c to record the filename and ctrl-v to paste it in again worked fine. I rename my files when saving so it’s not much of a hardship.

My machine seems slightly faster but I haven’t delved too deeply into what has been upgraded but Firefox, xchat, terminal, GIMP and Gthumb all work fine! Did your upgrade go as well?

GNUCash 2.0 on Ubuntu Dapper

It’s that time of the month again when I have to do a VAT return, so my attention is drawn towards accounting software for Linux. Having just got the latest and greatest version of GNUCash installed on Ubuntu I’d like to share how I did it:

  1. Open http://www.yourfilelink.com/get.php?fid=151771 and http://www.yourfilelink.com/get.php?fid=151772 and download gnucash-common_2.0.1-1_all.deb and gnucash_2.0.1-1_i386.deb from there. (via)
  2. Install the .deb files using the following command: sudo dpkg -i gnucash-common_2.0.1-1_all.deb gnucash_2.0.1-1_i386.deb
  3. You may get an error like this:

    dpkg: dependency problems prevent configuration of gnucash:
    gnucash depends on g-wrap; however:
    Package g-wrap is not installed.
    dpkg: error processing gnucash (–install):
    dependency problems – leaving unconfigured
    Errors were encountered while processing:
    gnucash

    If you do, run the command sudo apt-get -f install which will download g-wrap guile-1.6-dev guile-library libffi4-dev libgwrap-runtime0-dev libncurses5-dev libreadline5-dev and any other dependencies.

  4. Finally, you’ll be greeted with the following message:

    Setting up libgwrap-runtime0-dev (1.9.6-3) …
    Setting up g-wrap (1.9.6-3) …
    Setting up gnucash (2.0.1-1) …

Happy budgeting and accounting!

While on the subject of VAT, since Google is a US company, Europeans don’t have to pay VAT on our Adsense earnings, yet. This article by Jennifer Slegg suggests that some EU countries may decide to charge VAT on online earnings. That’s a little crazy because Google doesn’t add VAT to the invoices of European publishers. If something like that happened in Ireland I’d be out of pocket by an extra 21% plus the normal 42% tax I pay on earnings at the top level. Ouch. (via)

More Linux eye candy: CGWD Themes

If you’ve seen my desktop machine at home you’ll realise I’m a big fan of the Xgl and compiz stuff and now thanks to a Linux Journal article I’ve discovered the CGWD Themer.

Installing it in Ubuntu is as easy as adding a new site to your apt-get repository list and firing up apt-get in the usual way and grabbing the binaries from their repository. Then either launch it from the command line using the command “gcompizthemer” or go to System->Preferences where a new menu item called “CGWD Themer” can be found. The themer does nice things to the borders of and bars of your windows. I love the glow of the min/max/close buttons that spills over the side of the window!
Oh, and just because I bought a Mac laptop doesn’t mean I’m abandoning Linux. I fell in love with my Gnome+Xgl desktop once again when I came home from San Francisco!

Later – two articles features on digg and delicious which might be of interest:

  1. An Overview of modern fancy Unix desktops – good summary of the competing technologies that make the 3d and special visual effects possible
  2. The Linux Desktop Myth – a long essay on one man’s experience with switching to Linux and GPLed software.
  3. Suse Compiz page – has lots more info and lists all the options and configurable bits! (via)

Reboot me when I panic!

The VPS this site is hosted on has a tendancy to kernel panic since I upgraded the kernel to 2.6. I'm not sure why, and the ticket I opened requesting help was replied by someone saying I should check the console. Fat lot of good that did me when this site was down for a few hours.

Help is at hand however in the shape of Mark Ferlatte who mentioned that adding the following to /etc/sysctl.conf and running sysctl -p will make Linux reboot after 5 seconds! Adjust to taste:

kernel.panic = 5

Hopefully we'll have less downtime here.

Xgl on a live CD

If you want to try Xgl to see what all the fuss is about, then you should download the Kororaa live CD. I downloaded the 441MB iso, burned it on CD and rebooted into Xgl.

Wow. All the eye candy looks great, the cube revolved when I switched desktops or dragged the background with CTRL pressed. Dragging windows from one side of the cube to another desktop was really cool, but not as much fun as watching a sticky window bend and deform as I dragged it!

As someone pointed out on digg, it’s not just eye candy. The openGL powered desktop uses my video card to move pixels around and feels responsive. I’m very tempted to upgrade to Ubuntu Dapper so I can install the Xgl binaries! (via)
Later… I updated my Ubuntu install to the latest Dapper release using apt-get dist-upgrade and after some minor fighting with a customized xorg.conf and following the instructions I have an Xgl powered desktop! Nice.
Slightly Later… I found a showstopper bug. It doesn’t do full screen image viewing. At least as far as gthumb or f-spot is concerned anyway. Gthumb just dies and F-spot displays a thumbnail in the corner of a grey screen.

Some people had the same problem playing movies and the solution was to use openGL as the full screen driver but I don’t think the same can be done with an image viewer, can it?
It’s alpha software so hopefully this will be worked around sooner or later!

InnoDB: Starting shutdown…

Calling all MySQL admins! When you’re working with InnoDB tables you may have noticed that MySQL takes an extraordinary amount of time to shutdown. Don’t panic! It’s normal.
InnoDB has extensive logs that it must run through and if your server is at all busy these logs can be quite big.
After you’ve started the equivalent of “/etc/init.d/mysql stop” it may not return for quite a while. Simply open another terminal and examine the system log. On a Debian or Ubuntu box, look at /var/log/daemon.log and you’ll see the “InnoDB: Starting shutdown…” message.
Now, go off and make a cup of tea because this could take a while. On a fairly large and busy database it might be half an hour or more!
Please, please, please don’t be tempted to killall -9 mysqld because bad things will happen! Even if your boss is looking over your shoulder, and you’ve promised that the company webserver will be online in 2 minutes, don’t do it.
However, cases where it is ok to kill the database with a “kill -9”:

  • International terrorists are planning on robbing the World Bank and you’re the only secret agent who can bring down the database which will stop them.
  • Lassie will be run over by the evil farmer who plagued the local village with his monster cows unless you can corrupt his database in time.
  • Or finally, you like hard work and restoring from backups!