Things I do after installing Ubuntu

1. Disable ipv6 and apparmor for speed up

add

ipv6.disable=1 apparmor=0

to linux command line in /etc/default/grub then run

update-grub

and reboot.

2. Disable wireless power saving on battery, because frankly 1 to 2 hundred milliseconds response time is too slow when you’re 20 feet from the access point.

Edit /usr/lib/pm-utils/power.d/wireless and replace any lines containing “power on” with “power off”. Not any update to pm-utils will overwrite this file and change the setting back.

3. Install Chromium as it is quite a bit faster and nicer to use than Firefox.

Remembering to keep Firefox around for the odd site that won’t work in Chromium e.g. some java based sites.

4. Add “noatime” and “commit=900″ to fstab.

Gives performance increase and saves SSDs by not writing to the journal all the time.

Install HP Laserjet CP1215/foo2zjs in Linux Mint Debian Edition

The in-Distro version of foo2zjs has dependency problems at time of writing. Use the one from the foo2zjs home page. From your home directory in a terminal:-

wget -O foo2zjs.tar.gz http://foo2zjs.rkkda.com/foo2zjs.tar.gz

tar zxf foo2zjs.tar.gz

foo2zjs

make

./getweb 1215

sudo make install

Continue reading

Bonding/teaming internet connections

So, perhaps you are too far from your local exchange to get a decent DSL speed, or you have an urgent large download and want to use a secondary internet connection to boost your speed. This article will allow you to combine 2 connections together. No ISP support is required. Connections could be all DSL, 2.4Ghz wireless, or HSDPA or any combination of, indeed any type of internet connection (latency permitting).

There are a number of expensive products on the market which do this. I want to bring this into the realms of the sys admin/computer hobbyist, after all this is the information age.

In this example I am using 1 DSL connection, with 1 HSDPA connection, but assuming you know enough to be able to implement this you should be able to change interface names or implement for more than 2 connections if you want.

You will need:-

  1. A computer of some sort with Ubuntu loaded on it (only for the purposes of this article, could easily be any other distro if you are prepared to adapt it).
  2. A dedicated server of some sort on the internet with Ubuntu (again another distro if you want to adapt, I can recommend a Kimsufi 2G for €14.99 per month ex VAT, can’t get better value than that)
  3. 2 internet connections, obviously.

Watching IPlayer outside the UK

Tor is an anonymising network which allows people living in restrictive regimes to access the internet with relative impunity. If you know what you are doing you can use it to give yourself a UK IP address and watch BBC telly via IPlayer. This article tells you how to achieve same.

Why use Tor over other solutions? – Because it’s free, and because it won’t contain ads or malware, being an Open Source program.

What does this do? – It uses Tor’s Browser Bundle to connect the included web browser through UK only Tor exit nodes, which fools BBC IPlayer into thinking you are in the UK. The actual streaming still goes direct to your real IP address through Flash Player, so don’t use this if you want to remain hidden/anonymous, as it will definitely give you away!

My particular circumstances are that I am an English expat living in Ireland, but even though I can watch BBC channels through Sky or Freesat, the BBC block Irish IP addresses from IPlayer.

The steps are:-

  1. Download and extract Tor’s browser bundle.
  2. Manually copy the flash plugin into the Tor browser plugin directory.
  3. Enable plugins in Vidalia.
  4. Edit Tor’s config to only include UK exit nodes (preferably those with good bandwidth)

Using schroot instead of LXC containers

So, I have been using LXC to host my server services for a period of time, with a view to keeping things portable should I need to change provider. It’s very good in that it’s integrated into the Linux kernel and in Ubuntu at least it’s not too difficult to setup, however there are a number of problems with it.

First and foremost, every time the container operating system upgrades anything to do with init scripts, it won’t boot any more, so you are forced to hold back packages with varying amounts of success. Secondly, there does seem to be some overhead running things in an LXC container, and thirdly it isn’t as portable as it could be i.e. there is no live migration. and you will have to change config files if you move hoster to reflect you new IP address.

As I’m not selling containers as VPS, I only need to run 1 server instance, and therefore don’t really need containerisation at all, enter schroot. Schroot is like chroot without the hassle and with added flexibility, in a nutshell it will mount and start everything correctly for you to the point where you can automate startup and running of services in the chroot, it doesn’t suffer from init script borkage since the init system isn’t used at all, and it’s more portable as networking is irrelevant to a chroot (it simply uses the hosts networking).

Ok so where to start, well if you are already using LXC you can use the directory your container is stored in. I opted to move mine to a sane location before starting, in the interests of convention and easy administration. So, I created a “schroot” directory in the /home directory i.e.

 mkdir /home/schroot

Continue reading

Holy Cow – BTRFS!

Recently I have been experimenting with BTRFS. BTRFS is a relatively new filesystem which has modern features, high performance, scalability, supporting file-system snapshots and on-the-fly compression.

After spending the week running BTRFS on Ubuntu from within a Virtualbox VM I reinstalled my laptop using it. Ubuntu’s installer supports creating btrfs partitions, which is handy, and it is reported to work even as a boot partition. I had problems using BTRFS as the boot partition however, so elected to use ext2 for boot in the real install.

The installer doesn’t support enabling the on the fly compression, so once I had the system installed I edited /etc/fstab adding “compress=lzo”, I added “ssd” as I have an SSD and “space_cache” which is reported to improve performance. After I rebooted I ran a filesystem balance to compress any existing compressible data like so:-

btrfs fi balance /

btrfs fi balance /home

It’s worth pointing out here that there still isn’t a utility which can fix BTRFS filesystem corruption, so although BTRFS is considered stable, you may want to stay away from it just in case. There is also a nasty condition that can cause a kernel crash if the file-system runs out of space, so that is another one to watch for.

Continue reading

Revenue Online Service in Ubuntu

With the release of Ubuntu 11.04 Natty Narwhal on April 28th, it is now possible to use the Revenenue Online Service, hitherto referred to as ROS, on a default install of Ubuntu desktop in Firefox (still doesn’t work in Chromium).

Copy the certificate files into “ROS/RosCerts” (case sensitive) in your home directory. When you go to the ROS website for the first time you will get a security warning, say “yes” or “accept” and enjoy!

Postfix and network biopair interop: error reading x bytes from the network: connection reset by peer

Lately I have been getting “network biopair interop: error reading x bytes from the network: connection reset by peer” in my mail server logs, and my email client unable to send. My email client is Thunderbird configured to send via TLS. Googling the error doesn’t reveal very much other than it’s probably a transient network error/problem, or a broken TLS implementation at the client end, and that developers can be snooty. This is the second time I’ve had the problem. The first time I just disabled TLS and enabled CRAM-MD5 password authentication, so at least the password is sent encrypted. Today I decided to get serious, and find an ultimate answer to the problem.

Trawling through the various mailing lists reveals that “network biopair”, whatever that is, has been removed from Postfix as of December 2010, v2.8. Admittedly a bit of a long shot, I decided “what the hey” upgrading to Postfix 2.8 isn’t going to make things any worse, and it may sort the problem out.

The next problem then was how to upgrade to version 2.8, my mail server runs as part of an LXC container. Upgrading LXC containers is difficult because new versions of upstart, udev, ifupdown et al like to recreate device nodes, change init scripts and what not. Assuming you’re able to successfully complete the upgrade you will still probably be left with a container which doesn’t boot properly, or at all. I was hoping to stay with Lucid Lynx in the container, until support runs out, in the hope that the LXC boys would have made upgrades smoother by then, but how could I easily update to version 2.8 without either running from source, or running the gauntlet of the container upgrade? Further googling revealed that version 2.8 is available via backports so in /etc/apt/sources.list I added the following line and upgraded:-


deb http://ie.archive.ubuntu.com/ubuntu/ lucid-backports main restricted universe multiverse

It’s too early to say whether the problem is completely fixed. If it isn’t I will remove this post!