Max says…

Avatar

thoughts of a web developer

Hardy and Firefox

As I mentioned in my last post, I have had issues getting Firebug working in Firefox 3.0b5.  Unfortunately at the moment Firebug isn’t compatible with the beta release of Firefox 3.  To be honest, I’m quite happy with Firefox 2.x.  From what I’ve read, Firefox 3 is more stable and less memory-hungry that its predecessor, and it does look nice (especially so according to Mac users).  Unfortunately, these benefits are outweighed by my love of the Firebug extension.  It is, in my opinion, the best debug tool for web developers bar none.  To that end, I’ve chosen to remove Firefox 3 (and all the bits and bobs that come with it) and install Firefox 2.

A few apt-gets later, I had got rid of Firefox-3 and related packages, and installed Firefox-2, symlinked to /usr/bin/firefox.  However, Firefox-2 still used the profile created by Firefox-3 in my home directory.  I started Firefox from the terminal, with the ‘-ProfileManager’ switch.  I created a new profile, renamed default, and renamed my new profile to default.  I then copied my bookmarks and related data from the old profile directory to the new one.  Once this was done, I started Firefox with my new default profile,  installed my favourite plugins and all was good - Firebug now works like a dream!

Hardy Upgrade

The latest stable release of Ubuntu linux (Hardy Heron) was released this week, and having eagerly awaited its release I decided to upgrade my desktop and laptop from Ubuntu 7.10 to 8.04.  I’m going to keep my server on 7.10 for the time being however.

The upgrade went surprisingly smoothly.  It was just a matter of ’sudo apt-get update’, ’sudo apt-get upgrade’ and ’sudo apt-get dist-upgrade’.  After an hour or so, the installation was complete and I rebooted.

I had a few issues with both my laptop and desktop, but these were resolved fairly easily.  The Realtek sound on my laptop was supported via linux-backports-modules-generic.  This didn’t seem to be available in Hardy, and neither the old ALSA, nor the new Pulse Audio Server seemed to support my Realtek onboard audio.  A bit of searching on the Realtek website revealed linux drivers, which I promptly downloaded, unzipped and installed.  Success!

When my desktop came back up after the reboot, the keyboard seemed to have a delay of a number of seconds, and would intermittently behave as if a key had held down.  Also, Gnome didn’t come up properly, with the desktop being black.  I rebooted again and everthing seemed fine… for now.

Firefox 3.0b5 comed preinstalled with Hardy.  Unfortunately, the brilliant Firebug web developer extension isn’t compatible with this version of Firefox.  I hope that the final release of Firefox will fix this compatibility issue.  For the time being, I will have to install Firefox 2.x to allow me to use Firebug.

In summary, I’m very impressed with how easy and smoothly the upgrade went.  Aside from a few small issues everything worked fine after the upgrade, it’s just a shame about including a prerelease web browser in a LTS release of Ubuntu.  Perhaps they should have stuck with Firefox 2.x until Mozilla officially released version 3 of their excellent browser.

Hoveroceros

Hoveroceros
Fantastic!

My New Monitor



I’ve finally decided to get a new monitor, a 22″ Hyundai Widescreen. It’s brilliant!

Firefox 2 on Gutsy: Bugfix

I would expect that the Ctrl+Backspace key combination would behave in Firefox as it does in other GTK applications, and indeed Firefox under Win32. The expected behavior is that Ctrl+Backspace will delete one word backwards from the cursor (more specifically it will delete backwards until a punctuation character). However, when I use this combination in the Firefox address bar under Gutsy, the whole URL is deleted. After some digging I came up with a solution: add the following to the bottom of /etc/firefox/pref/firefox.js:


// Make Ctrl+Backspace behave as expected.
pref("layout.word_select.stop_at_punctuation", true);

Hope this helps.

The New Look

I decided some time ago that I wasn’t happy with the way this site looked.  Unfortunately I haven’t had much time to do anything about it.  I’ve finally got around to making some changes, the most important of which you may notice is the minimalist design.  I don’t know if I plan to change this any time in the future, but for now it will do.

I’ve also tried to pull in some data from other services I use (perhaps not as frequently as I would like) such as Twitter, Facebook and Flickr.  To that end, my recent Twitter tweets are now displayed, together with my Facebook status.  I’ve also pulled in some random images from my public Flickr collection.

sshfs

If you don’t want the trouble of configuring NFS or Samba, then sshfs is a good option. sshfs (ssh File System) makes use of Fuse (File System in Userspace) to allow you to locally mount a directory that you have remote access to using ssh. To install sshfs in Ubuntu use:

sudo apt-get install sshfs

Once this is done, you will need to add yourself to the new group (fuse) that has been created:

sudo adduser <user> fuse

Create a local directory in which to mount your remote directory and make sure it is owned by you:

mkdir [-p] /path/to/directory
chown <user>.<group> /path/to/directory

Now you can mount your remote directory as follows:

sshfs <user>@<remote_host>:/path/to/directory/ /path/to/directory

Moving To Dreamhost

After some months of being unhappy with the service from Hostgator, I decided yesterday to move to Dreamhost.  While Hostgator are very affordable and for the most part reliable, the ssh connection was always painfully slow; it took me considerable effort in the beginning to even get ssh access (having been required to justify my need to them); the control panel they provided (cPanel) made it difficult to get anything done; and as far as I know I could only host a single site with them.

After a recommendation from a colleague at work, I decided to switch to Dreamhost.  I opted to pay for a year in advance, as the monthly direct-debit payments are a little more expensive otherwise, and there is an initial setup fee if you pay monthly.  The control panel is far more intuitive and a lot easier to use.  I can host as many sites and sub-domains as I like with as many users, email accounts and MySQL databases as I like.  Once I had created the account and switched my name servers with my domain registrar everything was underway.  Within half an hour I had shell access, an initial account with which I could create more accounts, an initial email address of my choosing (thus reducing email outage to a minimum) and a general impression that Dreamhost were a lot more professional and experienced.

Obviously it will take up to 48 hours for the new name server settings to propagate to the root name servers, but despite this within about four hours the name server change had been effective for me.  After about 15 minutes work making changes to my local copy of my Wordpress installation and MySQL dump, I rsync-ed everything to the new server, got the database up and running, and job done!

I Can Haz Trombone?

As a trombone player, this made me smile!

SSH Tunneling

Another aide memoire, but again may be useful to some. I’d like the ability to work from home on some web development projects I’m doing at work. Getting the code locally is not a problem thanks to Subversion over ssh However viewing the results can be tricky when you consider that the development server is behind the work network. The answer is SSH tunneling.

Let’s say you can access SERVER_A directly over ssh The service you want to access is on SERVER_B which you can’t access directly via SSH from your local machine. However, you can access SERVER_B from SERVER_A. I’ll assume that you want to access the service locally on port 12345, and that the remove port is port 80. The following command will allow you to access a service on SERVER_B from your local machine.

ssh -Nf -L 12345:SERVER_B:80 username@SERVER_A

The ‘-Nf’ switch says don’t execute a command with this ssh session, and run this ssh process in the background. The first port is the port you want to use locally; the first server is the usually inaccessible remote server you want access to; and the third port is the remote port you want to use. The final argument gives the login to the remotely accessible server you have ssh access to directly.

One caveat to this is if you are trying to access a web site that is defined using Apache virtual hosts. With this command alone, requesting localhost:12345 in Firefox would only direct you to the site that is listening remotely for requests that match ‘localhost’. If you would ordinarily access this site using mysite.server_b, then you need to use that as the address in Firefox on your local machine. Therefore, this needs to be added in /etc/hosts. With that done, you should be able to request mysite.server_b:12345 in Firefox and be directed to the remote “virtual host” site.

Next,