Arch Linux Virtualbox Update

Posted: November 29th, 2011 | Author: Rob Searles | Filed under: Linux | Tags: | Comments
Gosh! I just found this in my list of draft posts (originally written in early 2010). I thought I might as well post it as it could be useful to someone out there?

Again, this is one of those posts more for me, but hopefully other people might find it useful.

Recently I updated my Arch Linux box

# pacman -Syu

and during this update a new kernel was added – which meant that my VirtualBox installation didn’t work any more, chucking out the following message

The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Re-setup the kernel module by executing

‘/etc/init.d/vboxdrv setup’


Amazon S3: easily bulk delete buckets

Posted: May 11th, 2011 | Author: Rob Searles | Filed under: General, Linux, Tutorials | Tags: , | Comments

With Jabbakam we save a lot of images. All these images are stored in Amazon’s S3. Recently I thought I’d delete some of the test buckets.

Not as easy as I first thought. It turns out that you have to empty buckets before you can delete them. Fair enough, but there didn’t seem to be a way to easily bulk delete hundreds of images.

After some Googling I found Robert LaThanh’s S3Nukem which looked like it would do the job. All I needed to do now was fire up an EC2 instance, install and run. The steps were as follows:

  1. Create an EC2 instance on AWS (I used Ubuntu on a medium instance)
  2. make sure it is all up-to-date
    apt-get update
    apt-get upgrade
  3. install ruby (if not already installed)
    apt-get install ruby1.8 ruby1.8-dev

    (not sure about ruby1.8-dev, but added just in case)

  4. install Ruby Gems
    apt-get install rubygems
  5. install right_aws and s3nukem
    gem install right_aws
    cd /tmp
    wget http://github.com/lathanh/s3nukem/raw/master/s3nukem --no-check-certificate
    chmod +x s3nukem
  6. run
    ./s3nukem -t 20 -a  -s

Several hours and over 15 million deleted images later it was all done and I shut down the instance.


Awesome WM Clicky Widget

Posted: April 6th, 2011 | Author: Rob Searles | Filed under: Linux, Tutorials | Tags: , | Comments

Awesome WM Clicky WidgetAs some of you know, whilst Emacs is my editor (et al.) of choice my favourite window manger is Awesome. Awesome is, according to the website,

.. extremely fast, small, dynamic and heavily extensible using the Lua programming language

I’ve never delved into Lua before, but since using Awesome I’ve had to play around with a bunch of config files. They have always looked very clean and simple so, this weekend, with a spare couple of hours to kill I thought I’d have a play around with Lua and see if Awesome really is as “heavily extensible” as the claims make out.

A couple of weeks ago I set up real time web analytics on a number of sites with Clicky. Clicky have an incredibly simple API which I thought would be perfect to play around with.

I decided to try and build a widget that displays the total visitors and actions for a specified website. Really simple, but also quite useful. I had never written anything in Lua before, or even played around with widgets too much in Awesome. Fortunately both Awesome and Lua made the whole thing fantastically easy and fun. What follows is the code I wrote, use it if you want to, it’s just an example of what I did with my first attempt, so feel free to extend it as you want.

Read the rest of this entry »


Fix: Cannot load from mysql.proc. The table is probably corrupted

Posted: February 17th, 2011 | Author: Rob Searles | Filed under: General, Linux | Tags: , | Comments

Following from my dependency hell problems the other day my new version of MySQL seems to have all its stored procedures corrupted, displaying the following message when any of them are executed:

Cannot load from mysql.proc. The table is probably corrupted

After a bit of research, I found the simple fix is to run

mysql_upgrade

Problem solved.

Posting it to my blog as a reminder to me to RTFM, and just in case it is useful to some other poor soul out there.


Awesome WM & NM Applet: Secret Service Operation Failed

Posted: May 15th, 2010 | Author: Rob Searles | Filed under: Linux | Comments

I am running Awesome window manager on Lucid Lynx and am using the Network Manager applet to manage my wireless connection. There is a strange error that manes that the wireless can never remember my key.

When I initiate the nm_applet from a terminal it displays the following error:

** Message: secret service operation failed: The name org.freedesktop.secrets was not provided by any .service files

After some searching around on the internets I found a hack that seems to fix the problem.

What you have to do is edit the  /usr/share/dbus-1/services/org.gnome.keyring.service file, comment out where it says Name=org.gnome.keyring
and add the line
Name=org.freedesktop.secrets

For example, my /usr/share/dbus-1/services/org.gnome.keyring.service file looks like this:

[D-BUS Service]
#Name=org.gnome.keyring
Name=org.freedesktop.secrets
Exec=/usr/bin/gnome-keyring-daemon --start --foreground --components=secrets

Save this, then you’re done.


My Perfect Desktop Day 1 – The Base System

Posted: March 18th, 2010 | Author: Rob Searles | Filed under: Linux, Tutorials | Comments

arch-linux-logoSo today is the day I start building my perfect system. Before getting going,  I had a good think about which distro to use for the base install. I’ve been using Ubuntu for about 2 years now and love the ease of package management with apt and aptitude. I had a bit of a play around with Ubuntu Karmic yesterday and I must say it looks fantastic, and with Lucid Lynx only a few weeks away it might come as a bit of a surprise to discover that my choice is a distro I’ve never used before: Arch.

Why Arch?

There are three main reasons I’ve picked Arch over Ubuntu, or even Debian.

  1. I really like the idea of Arch’s rolling release system. My laptop is currently running Jaunty and in order to get the latest packages I would have to upgrade to Karmic. With Arch this is less of an issue.
  2. As mentioned in my initial post, the base system should be small, quick and light. With Arch you can pick and choose exactly what you want at installation time, keeping it bloat free.
  3. Finally, Arch will be something new to play with!

After downloading and burning a Net Install ISO I followed the excellent installation guide in the Arch Wiki.

Installation was relatively painless, the only two slight issues being:

I chose Auto prepare for partitioning, but I didn’t really know what filesystem to choose. Eventually I opted for Ext4, with so far, no ill effects.

During Boot Device Selection, again I wasn’t really sure what to do, but after some Googling I found this page, whose advice I followed, but just pressing enter.

I restarted and was greeted with a shell prompt. I quickly pinged Google and my network was still up and running through the ethernet on DHCP.

The next step up a non-root user and X. Again, the Arch documentation is excellent.

Setting up X was relatively simple. I originally decided to not opt for hotplugging, which was a mistake because I only have a USB keyboard and mouse, neither of which I could use in X (muppet of the day award goes to me). After turning off the machine and setting up hotplugging, all was fine!

I have been using the Awesome window manager for about a month now. Awesome is a tiling window manager which is heavily geared towards being keyboard friendly, and as it’s name suggests, it is pretty awesome.

Unlike Jaunty, installing the latest stable version of Awesome was a breeze, I simply ran:

# pacman -S awesome

and edited my ~/.xinitrc file adding:

exec awesome

at the bottom. When I started X again, Awesome was there without any problem.

Sound was equally as simple to install, which was a nice surprise.

So my base system is now setup, with my window manager of choice in place and sound ready and waiting for my music collection. And all this running under 100MB of RAM!

After my first foray into the world of Arch I’m pretty impressed. Pacman is very straight forward to use, after a bit of tweaking here and there it has just worked.

Next time, file management tools.


Installing PHP5.3 on Ubuntu Karmic

Posted: March 17th, 2010 | Author: Rob Searles | Filed under: Linux, PHP, Tutorials | Comments

Following my previous post about installing PHP5.3 on Jaunty, I have had a few requests about installing it on Karmic. I’ve never used Karmic before so I thought it would be a fun excuse to have a poke about whilst also keeping my blog (sort of) up-to-date.

After freshly installing Karmic (the desktop version looks very nice btw) on a new VirtualBox image and then updating with the latest, er, updates I was ready to begin.

The entire installation procedure is very simple, once all dependencies are met.

Firstly you must edit your sources list to include the DotDeb package repository and the old Jaunty security packages to meet dependencies.

$ sudo nano /etc/apt/sources.list
# php5.3
deb http://php53.dotdeb.org stable all
deb-src http://php53.dotdeb.org stable all
deb http://security.ubuntu.com/ubuntu jaunty-security main

Now update and upgrade Ubuntu

$ sudo apt-get update
$ sudo apt-get upgrade

You may find that you get the following warning:

WARNING: The following packages cannot be authenticated!
libevent-1.4-2
Install these packages without verification [y/N]?

I just answered Y and continued as normal

Once successfully upgraded then you can install Apache, MySQL and PHP as normal, feel free to cater the installation line to your tastes.

$ sudo aptitude install libicu38 apache2 apache2-mpm-prefork mysql-client-5.1 mysql-server-5.1 php5 php5-cli php5-mysql libapache2-mod-php5

You will get a warning about untrusted packages being installed but this simply means that the PHP5.3 stuff is not signed, so I typed in “yes” and carried on.

Robmorin commented in my Jaunty post that he had issues when installing PHP MCrypt. The answer can be found within the DotDeb comments

After you have installed everything you need to, test it out, either command line:

$ php -v
PHP 5.3.2-0.dotdeb.1 with Suhosin-Patch (cli) (built: Mar  9 2010 10:14:53)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies with Suhosin v0.9.29, Copyright (c) 2007, by SektionEins GmbH

Or by using phpinfo() page within your Apache installation:

$ sudo nano /var/www/info.php

<?PHP
phpinfo();
?>

then fire up http://localhost/info.php and at the top of the page you should see something along the lines of
PHP Version 5.3.2-0.dotdeb.1

Note: if your browser asks if you want to download info.php, simply restart Apache and try again:

$ sudo /etc/init.d/apache2 restart

All done. Not quite as simple as on Jaunty, but still better than compiling the source!

Post Script: Before starting this post, I did a quick search looking for tutorials to see if the work had already been done, but couldn’t find anything on installing PHP5.3 on Karmic. As there wasn’t anything I decided to continue with my tutorial and I ended up struggling for an hour or so with the dependency issues. Typically, after I had figured it out for myself, whilst searching for another dependency issue I found this post on the JMOZ blog about installing PH5.3 on Karmic Koala.  No idea why it’s not in Google, but either way, damn, I could have saved myself an hour or so!


My Perfect Desktop – Day 0

Posted: March 16th, 2010 | Author: Rob Searles | Filed under: General, Linux, Open Source | Comments

Today is an exciting day. I have in my possession a brand new custom built computer to use exclusively at the office. I currently use the laptop for both home and office work, but since the laptop is getting a bit old and computer components are so cheap these days I decided to build a work station just for me to use at the office. The best thing is that as it is custom built I can put whatever I damn well want on it – no pre-installed Windows or anything else. I can make it absolutely perfect for me.

I’ll be documenting here in my blog exactly the steps needed to take it from a tabula rasa to my perfect desktop system.  Apart from the system being obviously Linux based, there will be a number of things to consider before I get started. If I want it to be perfect, I need to think about what it is that I really need and want from a work only system. So, after a brainstorm this is the breakdown of what I require:

  1. Keyboard Friendly

    I am becoming less interested in using the mouse. This is for a number of reasons, firstly it is quicker to keep your hands on the keyboard rather than always having to find the mouse and point and click. Secondly, using the mouse greatly exacerbates RSI and all that jazz. As such a system designed for maximum keyboard usage is important.

  2. Great Web Development Tools

    As a web developer this is a no brainer. I need to be able to have the tools for developing websites, testing (at code, server and client level) deployment and client side version control.

  3. Base system should be small, quick and light

    Due to point 2, I can see the need for being able to have virtualised instances of Windows running, each running a different version of IE. As such, the base system should be as small, quick and light as possible so it doesn’t get bogged down when I have one (or more) windows running for testing purposes.

  4. Communications

    I have to be able to email, chat, and talk with people via my computer

  5. Music and sound

    I need to listen to music at work!

  6. Must get on with others

    Some strange people out there still use propriety software. My system needs to be able to read Word and Powerpoint and all that stuff.

  7. Not be rude

    This is a strange request, but over the weekend I had a friend staying who is an IT administrator for a large international company. He had to do some work on their Windows based infrastructure, so he powered up Vista on my laptop (which I never use*) to log into their systems via the Remote Desktop. Half way through he had to make a couple of calls. When he came back Vista had rebooted and he had lost everything. We narrowed it down to the fact that Vista had updates, installed them and rebooted without even asking for permission. IMO, that is really fucking rude.

  8. Stable

    Last, but by no means least, the system has to be solid. I can’t have it crashing on me every hour.

And that is pretty much it. Follow me over the next week or so whilst I sort out my ideal perfect work station.

* I just had to make that point

Building My Perfect Desktop


Converting from Mac to Unix line endings

Posted: March 10th, 2010 | Author: Rob Searles | Filed under: Linux, Tutorials | Tags: | Comments

This is more a post for me than anyone else, but I thought I’d share anyway.

In our team we have a mixture of Linux and Mac users, and we are constantly editing the same files. One of the most irritating things is when a file is saved with Mac line endings instead of Unix line endings (displaying as ^M in Emacs). This happens very rarely, but on the occasion it does I can quickly convert back using the following commands on my Linux box:

$ tr '\r' '\n' < file-in-question.txt > tmp.file
$ mv tmp.file file-in-question.txt

Works perfectly

If you want to find more about the tr (Translate) program, visit the man page.


Getting a Windows Refund

Posted: October 18th, 2009 | Author: Rob Searles | Filed under: Linux, Opinion | Comments

I’ve just read quite an interesting article on the Linux Mint blog courtesy of Linux Today. It describes how Clem, a Linux Mint user, managed to get a refund on Windows that was pre-installed on a Dell laptop they purchased, and then donated the money to Linux Mint!

One of the comments tries to argue that Clem shouldn’t have been entitled to a refund as they knew what they were buying. I don’t hold with this argument as last time I tried to purchase any laptop that wasn’t a netbook I found it impossible to buy one without Windows pre-installed – and to make it worse they were pretty much all Vista!

With people like Clem engaging in this kind of action, and with Ubuntu trying to make Linux more accessible to the average user, hopefully one day I’ll be able to purchase a laptop and have a choice of what I put on it.