Posted (Updated ) in Linux

OK so this is an issue I’ve had for a very long time now (since Firefox 4 beta) whereby Google keeps defaulting to a strange language and seemingly completely ignoring my preference for English:

Incorrect language on in Firefox 4


The reason for this is a bad language string in Firefox’s settings. You can fix it by doing the following:

Edit - Preferences 
Content - 
Choose... (under Languages)

You’ll see the following language:


Delete it. It’s wrong and it’s causing you problems. Once deleted, time to add your language of choice:

Select Language to add... -
<pick your desired language>

You should now be greeted with a much easier to read google index page!

Here’s hoping this post will make it out in time to save the flood of Ubuntu Natty users on their shiney new Firefox 4 installs 🙂

Read More »

Posted (Updated ) in Linux

When performing various actions on a clean install of Ubuntu 10.10 on my web server, I kept being presented with the following message:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = "en_US:en",
	LC_ALL = (unset),
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

After some googling, many people (in this thread suggested:

sudo locale-gen
sudo dpkg-reconfigure locales

however the solution that worked for me was:

export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
dpkg-reconfigure locales

You might need to reset your machine before changes take effect:

sudo shutdown -r now

Read More »

Posted (Updated ) in Linux, Uncategorized

Firstly the background: I own a HTC Magic (32B) running Cyanogenmod 6.1. My internet connection is 1.5Mbit down, 256k up ADSL. My router is a Billion 7401VGPR3 with strong signal and several PCs connected to it – each with flawless internet.

The issue: Around the time I bought a new Billion 7401VGPR3 router, the phones wifi started performing so badly it became unusable. DNS lookups would take anywhere in the vicinity of 45-60 seconds or often simply time out and once the download did somehow get going, it would also occasionally time out. I figured this was just an issue with the hardware in my phone – being 2+ years old, it’s getting a bit dated by android smartphone standards. I was wrong.

During my recent trip to Japan, I happened to score free wireless in one of the hotels (Ahh free wireless, how I love thee) and the wifi unexpectedly worked perfectly. Puzzled by this, I did a bit of research. As it tuns out, this appears to be a common issue with HTC phones. I came across this thread on the issue.

The fix: A few suggestions were made on how to fix it. One member suggested trying a different router, which I did (A Netgear FWG114P) and suddenly wifi worked fine. This was all the proof I needed that the Billion was the culprit. I switched the encryption scheme on the Billion from WPA2 to WEP 128 as per another users suggestion (yes, yes, I know. Flame me if you must, but I already know) and my Android is now lightning fast again.

Thank you androidforums, I was on the verge of giving up and buying a new phone but now I’m good to go for several more years 🙂

Read More »

Posted (Updated ) in Linux

Setting up chroot jailed FTP access on linux (especially Debian-based distros) is remarkably easy. All you’ll need is proftpd:

sudo apt-get install proftpd

Install as standalone (the default option) and once complete, make sure /bin/false is in your shells list – if not, add it:

sudo nano /etc/shells

Set up the FTP account with desired chroot:

sudo useradd <user> -p <password> -d /path/to/chroot -s /bin/false

By this point you’ll have a working FTP account but no chroot. Let’s add that now. In /etc/proftpd/proftpd.conf make sure the following is uncommented:

DefaultRoot			~

Restart proftpd service and you’re good to go:

sudo service proftpd restart

Thanks to frodon of the Ubuntu Forums for his tutorial found here.

Read More »

Posted (Updated ) in Linux

In this second post of my lazy man’s series, I’ll explain an easy way to batch rename files in any linux distribution with the rename command. For users of the sed tool, this will look very familiar. You’ll also need a bit of knowledge of regular expressions:

rename 's/_/ /g' *.mp3

The above example replaces every underscore with a space character in all mp3’s of the current directory. The command works as follows:

rename 's/<search_term>/<replacement_text>/g' <regex_filename_match>

Thanks to jazzmusik of the Ubuntu Forums for his little tutorial found here.

Read More »

Posted (Updated ) in Linux

Ubuntu 10.10 was the first release of Ubuntu not to have ‘Mark Packages by Task’ working in the Synaptic Package Manager. For those who don’t know, ‘Mark Packages by Task’ is a handy little menu option that allows you to install pre-configured groups of applications very quickly – such as the Samba file server, video and audio creation suites but more importantly to us: a LAMP stack.

To get this nifty tool back where it belongs, just install the tasksel package:

sudo apt-get install tasksel

It should now be where it belongs.

Happy installations.

Read More »

Posted (Updated ) in Linux

I’m a developer. That makes me lazy. Here is the code to recursively tar and untar files (with and without compression):

tar -cvf filename.tar target1 target2 #without compression
tar -cvzf filename.tar.gz target1 target2 #with compression (Just add z)

To untar, simply replace c with x:

tar -xvf filename.tar path #without compression
tar -xvzf filename.tar.gz path #with compression (Just add z)

Read More »

Posted (Updated ) in Linux

Update 2011-10-30: Added instructions for Ubuntu 11.04+

An issue has crept up in the latest version of Ubuntu (10.10 as of writing) whereby installing beta versions of Firefox causes the browser to become the default application for FTP addresses. This is a real annoying development that I’m sure alot of you have a beef with. There’s a very simple fix to change it back to trusty ol’ nautilus:

Open ~/.gconf/desktop/gnome/url-handlers/ftp/%gconf.xml and change the stringvalue link to/usr/bin/nautilus like so:

<?xml version="1.0"?>
	<entry name="needs_terminal" mtime="1287534317" type="bool" value="false"/>
	<entry name="enabled" mtime="1287534317" type="bool" value="true"/>
	<entry name="command" mtime="1287534317" type="string">

In 11.04+, you’ll also need to open ~/.local/share/applications/mimeapps.list and under [Default Applications] add:


Courtesy of radu cotescu.

Read More »

Posted (Updated ) in Linux, PHP

This tutorial will show *nix users how to get a nice notification displaying on their screen when people visit their site using a PHP and a Python script. This isn’t practical for sites with large numbers of visitors but it’s great for people running small sites on their local machines.

Read More »

Posted (Updated ) in Database, Linux

UPDATE: This script has been superseded by my Cloud Database Backup script. It’s advised you use that instead.

If you’re a developer you should back up your data. Go ahead – do it, do it now. Okay, now that we’ve got that out of the way here’s a nice automated solution to backing up your MySQL databases and optionally uploading to Amazon S3 for added safety.

Read More »

Page 5 of 512345