Max says…

Avatar

thoughts of a web developer

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.

Gutsy, Realtek HD Audio and the Toshiba U300

This post is really an aide-memoire for me should I need to rebuild my laptop in the future, but it may prove useful to others. My Toshiba U300 laptop seems to have problems with Realtek HD Audio. After some searching and trial-and-error, I found that the following gets things working.

sudo apt-get install linux-backports-modules-generic

Happy New Year and New Year Resolutions

Happy New Year!

I’m not much of a ‘New Years’ person. While I appreciate that Hogmanay is a big holiday for a lot of people, I’m not one of them. I always feel that it is a holiday where you are expected to force yourself to have a good time for the sake of it. Having said that, I did have a good Hogmanay this year! Going hand in hand with my ‘bah humbug’ feeling of New Years, is my opinion of so called resolutions.

Rarely do people manage to stick to resolutions that they make at the beginning of the year, and I tend to make a point of not making resolutions because I’ll just feel guilty when I inevitably break them. Nonetheless, I am going to make a few this year that I will try very hard not to break:

  1. Stop smoking
  2. Lose weight
  3. Play the trombone more
  4. Drink less coffee

Surely I can manage four things! Although I don’t hold out much hope for the first two… we’ll see!

Songbird - a viable Linux alternative to iTunes

As I continue my journey toward migrating to Linux for full time desktop use there are a few applications that I miss, and I can’t always find suitable open source alternatives. One of those applications is iTunes. From reading forum posts and other articles on the web the consensus tends toward either Rhythmbox or Banshee. [Read more]

Ubuntu Applets - Post To Blog

Well, it.s 01:24 and I’m not usually up at this time. Jo is working an inventory tonight and I don’t feel like going to bed yet. So instead, I’m playing with my Ubuntu installation on my laptop.

I’ve just done an “apt-cache search applet gnome” and discovered a load of new Gnome applets. I’m using one of them to write this post. It’s called gnome-blog and lets you specify a username and password for an existing Blog from a number of popular providers, e.g. Blogger, LiveJournal etc.

You can also specify a URL for a your own install of Wordpress, TextPattern and many more. Then, like me, you can post to your blog from your Gnome desktop!

Compiz and Video Playback Problems

There seem to be a number of bugs related to video playback while compiz desktop effects are enabled, specifically on systems using the Intel 965GM chipset.  If desktop effects are enabled, any attempts to play video files result in the player closing.

This problem can be resolved by setting the output module for your player of choice to X11.  In VLC, goto Settings->Preferences->Video->Output Modules.  Check the “Advanced Options” box.  Select “X11 video output” from the drop down box and save the changes.

Compiz on the Intel 965GM Chipset

I recently tried to get compiz working on my laptop; a Toshiba u300 running Ubuntu 7.10 “Gutsy Gibbon”. The Toshiba U300 uses the Intel 965GM chipset which doesn’t seem to be compatible with compiz. After some digging I discovered a repository that contains a modified xorg-xserver-video-intel package. This combined with the 915resolution package allowed me ues the native 1280 * 800 resolution, and enable compiz desktop effects.

# as root / sudo

echo "deb http://ppa.launchpad.net/kyle/ubuntu gutsy main" >> /etc/apt/sources.list"

apt-get update

apt-get upgrade

apt-get install xserver-xorg-video-intel

dpkg-reconfigure xserver-xorg

One reboot later and all was well.