SSH Tunnelling/Forwarding

posted on March 24, 2012

This will forward a port on a remote machine to a local port:
ssh -N user@host -R port:host:hostport

This allows you to forward a local port to a port on a remote machine:
ssh -N user@host -L port:host:hostport

You may need to add GatewayPorts yes to /etc/sshd_config on the remote side.

The -v to -vvv flags show verbose information.

The -N flag is useful for tunnelling as it won’t execute a remote command.

Linux Desktop Latency

posted on January 20, 2011

It seems there are is a lot of activity at the moment in the Linux community to make the desktop as responsive as possible.

In mid-November Mike Galbraith wrote the now-famous 200 line patch that groups processes together to make the desktop experience more interactive. This was accepted by Linus Torvalds and should be in the 2.6.38 kernel when it’s released next month.

Lennart Poettering wrote an alternative shell script soon after that performs a similar operation. I followed the instructions on my Ubuntu machine, as it was easier than recompiling my kernel, and noticed significant improvements on slower machines.

Linus prefers having these improvements in the kernel to make it simpler for users but I’m sure we’ll continue to see the original patch improved for quite a bit longer.

The latest development in desktop scheduling takes a different angle in the form of ulatencyd. The application runs in the background as a daemon, monitors what applications are in use and creates cgroups dynamically. There are several included filters and custom ones can be written in the Lua language.

It is still at an early stage but you can build and run the application right now or download a pre-build Ubuntu package from a PPA. Here’s how you do that:

sudo add-apt-repository ppa:poelzi/ulatencyd-stable
sudo apt-get update
sudo apt-get install ulatencyd

I’ve often thought there could be more intelligent ways of assigning processes priority when my systems are under heavy load. I’ve made several attempts at tweaking memory usage and other schedulers but finally it seems like we may soon have the most responsive desktop as a default. I’ll be excited to see how it progresses over the coming months.

Eee PC optimisations

posted on October 3, 2010

elevator=noop

Disk optimisation for I/O is usually enabled in Linux to try and minimise disk seeking. Since we are on an SSD (solid state drive) we can let the OS read and write without any queueing which will speed things up.

More info on I/O scheduling. More info on elevator=noop: Wikipedia, eeeuser.com, lonesysadmin.net.

This will show the current I/O scheduler:

cat /sys/block/${DEVICE}/queue/scheduler

Set noop on a running system:

echo noop > /sys/block/${DEVICE}/queue/scheduler

Set noop permanently by adding elevator=noop as a kernel boot parameter (Ubuntu 10.04):

nano /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash elevator=noop"

update-grub

Django User Group London Meeting

posted on July 27, 2010

I attended yesterday’s DJUGL meeting, held at the Guardian in London. The evening consisted of three presentations with gaps for discussions and consumption of free beer and pizza. Entry was free and open to all with an interest in making Django better, though registration was strongly advised as the venue was almost full. The best way to find out more about upcoming meetings is probably through the London Django User Group Google newsgroup or the London Python Twitter stream.

The talks were quite inspiring. Nicholas Tollervey’s FluidDB talk had quite an interesting concept, though the company seemed to be at an early start-up phase and I will probably wait to see how it progresses before making my apps feed data to them. Toby White’s Solr talk was an insight into the techniques used by companies that have masses of data the wrangle into searchable formats. The Celery/RabbitMQ talk by Mat Clayton was the most familiar subject to me as I’d read articles on Celery before. It included some practical tips and lessons from their infrastructure experience. I can definately see how implementing a queuing system like this would be beneficial for parts of my apps that have to send emails and communicate with public web APIs.

Introducing: Another Blog

posted on February 2, 2008

I set-up this blog a few months ago and it’s just been kicking ’round doing nothing. So, here we go–my first blog post.

I am a 3rd year undergraduate student studying Computer Science at Essex University. This blog will hopefully allow me to document my thoughts and provoke discussions on matters that are relevant. I have a small web design business that has been running for a few years now, and a wiki which I add to whenever I solve a problem–It’s mainly so I don’t forget, but you may also find it useful. Things that interest me and will be covered in this blog are:

Anyway, thanks for reading so far and hope you have a use for this blog.