Logical Volume Management basics

I have explained how to activate an LVM logical volume before, but never talked much about LVM itself. Here is a brief introduction.

I have been playing with LVM for about a couple of years now and I must say I have found it very practical, even for managing simple home desktops and servers. The mai[……]

Read more

How to run a system command in background from PHP

If you are at the command line and want a process to run in the background, you add an & at the end of the command:

sleep 10 && echo "Done!" &

The same approach works from PHP when you need to run a long process without making the user wait:

exec("tar czf /backup/site.tar.gz /var/www > /dev/n[......]

Read more

jQuery shorthand for the document ready wrapper function

If you use jQuery, you know the $(document).ready() wrapper is the standard way to make sure the DOM is fully loaded before your JavaScript runs. But writing it out every time gets repetitive. There’s a shorthand that does exactly the same thing with fewer keystrokes.

The long version

$(doc[......]

Read more

Re-open last tab/tabs closed on Google Chrome/Chromium

We’ve all done it. You’re flicking through tabs, your hand moves faster than your brain, and bam — you closed a tab you still needed. You stare at the screen for a second before remembering there’s a keyboard shortcut for that.

Ctrl + Shift + T (or Cmd + Shift + T on a Mac).

That’s it. Press i[……]

Read more

Install NX server/client on Ubuntu Lucid

My favourite NX server is Freenx.
FreeNX is a GPL implementation of the NX server/client that allows you to graphically access your machine over the Internet.
FreeNX runs natively on SSH, it’s open source and, above all, fast.

So, first of all you need to add the free-nx repository:

sudo add-[......]

Read more

Free 3GB SpiderOak account – (Dropbox alternative)

SpidearOak gives you 2GB to start with. If you want to start with 3GB instead use this link.
Keep reading if you want to find out more.

So, first of all, SpiderOak is a web-based file hosting service “similar” to Dropbox.
You don’t know what Dropbox is? oh well :-). You can have a[……]

Read more

How to install Firefox 5 on Ubuntu Lucid

The Firefox version bundled with Ubuntu Lucid is still 3.6. It is stable but definitely not the fastest browser around, especially with Chrome and Chromium raising the bar on speed.

The best way to keep Firefox up to date is to let Mozilla do the work with their own repository.

sudo add-apt-reposit[......]

Read more

How to fix GRUB 2 with Ubuntu live cd

When GRUB fails and your system won’t boot, the errors can be intimidating. But fixing it with a live CD is straightforward.

Boot from an Ubuntu live CD or USB. Once the desktop loads, open a terminal.

First, mount your root partition:

sudo mkdir /mnt/newroot
sudo mount /dev/sdxy /mnt/newroo[......]

Read more

Linux: what is partition UUID and how to use it

If you have worked with Linux disks, you have seen device names like /dev/sda1. They work fine until you add or remove a disk — then the names can shift, breaking your mount points and scripts. UUIDs solve this because they are permanent and tied to the filesystem itself.

Instead of writing /dev/sda[……]

Read more