Media Wiki /var/www/includes/db/Database.php: DatabaseBase::factory no viable database extension found for type ‘mysql’

I just upgraded Ubuntu and unfortunately the MediaWiki installation broke. There was no debugging output on the screen (for obvious security reasons). So, I just had a blank page on the screen.

The first thing that I did was show the debugging output but editing the LocalSetting.php to enabling

$wgShowExceptionDetails = true;

After refreshing the page, the error appeared as

/var/www/includes/db/Database.php: DatabaseBase::factory no viable database extension found for type 'mysql'

It turns out the problem was php not connecting to MySQL properly.

sudo php5enmod mysql
sudo service apache2 restart

How to remove Ubuntu Landscape Client *

I have started to remove the Ubuntu / Cannonical Landscape Client from all my Ubuntu servers because otherwise it is just another service:

  1. Running in the background using power
  2. Potiential security hole with root permission
  3. I don’t actually use it

It is quite simple:

sudo apt-get remove landscape-client landscape-client-ui landscape-client-ui-install landscape-common

If Cannonical open sourced the service for Landscape then I would actually start using it but in the meantime…

Strange Conveyor User Ubuntu

I have just been looking at the processes on my laptop and noticed a python process running as a user called ‘conveyor’. I can’t remember adding a user or installing a program called conveyer. It turns out that it was a Makerbot process. So, a quick…

apt-get remove makerbot* 

…helped sort that out. Why Makerbot doesn’t make a user called Makerbot, I have no idea.

How to reset your Apple password

I forgot the password to my Macbook Pro and it turns out that there aren’t very many short guides on this. However, it turns out that it is very easy to reset the password on a Macbook.

Step 1 – Boot to the Recovery HD:
Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.

Step 2 – When the menu bar appears select Terminal from the Utilities menu. Enter reset password at the prompt and press RETURN. Follow instructions in the dialog window that will appear.

Visualising your source code with gource…

This is the settings that worked for me when running gource

xvfb-run -a -s “-screen 0 1280x720x24” gource -s 0.4 -p 0.01 -1280×720  –auto-skip-seconds .4 –multi-sampling –stop-at-end –highlight-users –hide mouse,progress,filenames,dirnames –file-idle-time 0 –background-colour 111111 –font-size 20 –title “Omlet Lib 4_1” –output-ppm-stream – –output-framerate 60 | avconv -y -r 60 -f image2pipe -vcodec ppm -i – -b 8192K movie.mp4

How to install optipng on Ubuntu from source

Optipng is in the Ubuntu repositories but is you want an up to date version then it can be worth installing Optipng from source. This is essentially a script but you can use the commands on there own if you want.

wget --quiet http://downloads.sourceforge.net/project/optipng/OptiPNG/optipng-0.7.3/optipng-0.7.3.tar.gz
tar xf optipng-0.7.3.tar.gz

cd /root/scripts/optipng-0.7.3
./configure > /dev/null 2>&1
make > /dev/null 2>&1

cp /root/scripts/optipng-0.7.3/src/optipng/optipng /usr/bin/
ln -s /usr/local/bin/optipng /usr/bin/optipng

rm /root/scripts/optipng-0.7.3.tar.gz
rm -rf /root/scripts/optipng-0.7.3

How to send a test email from the command line Ubuntu

If you have just installed Postfix or Sendmail it can be helpful to test if everything is configured correctly. Often you want to do this from the commandline without having to install an entire email client. You can do this by installing a few simple command line mail utilities.

apt-get update
apt-get install mailutils

Then pipe a message to the command:

echo testing | mail -s test_subject myemail@example.com

If the mail doesn’t arrive then you can reconfigure postfix and try again.

dpkg-reconfigure postfix

I hope this helps someone.