Copyright

Creative Commons License

This work is licenced under a Creative Commons Licence.

User login

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
ten + three =
Solve this math question and enter the solution with digits. E.g. for "two plus four = ?" enter "6".

Nginx as Name Based Proxy

I recently moved ISP, and whilst this is saving me a lot of money, one of the major sacrifices is that I have lost my /29 range, and now only have 1 static IP. Because of the previous /29 range, I have several webservers of various sorts floating around my network, and I wanted to retain access to these without going through the hassle of moving everything onto a single server. Having recently played with nginx for the first time, I realised that it would be simple to do using nginx's proxy functions.

Got attacked by Cylons

Bought an arduino uno. Got attacked by Cylons.

Change Timezone on Jailbroken AppleTV

XBMC runs great on my jailbroken AppleTV. I was, however, irritated by the incorrect time being displayed. While the time set was maintained by ntp, the timezone was set to Pacific time (seems that Apple never intended for people to see the time, and give no method for a normal user to set their timezone).

A dig around the filesystem revealed a familiar system of setting the timezone. The directory /usr/share/zoneinfo contains various timezone files, which need to be symlinked to /private/var/db/timezone/localtime:

#To change timezone to UK
rm /private/var/db/timezone/localtime
ln -s /usr/share/zoneinfo/Europe/London /private/var/db/timezone/localtime

Linking MAC Addresses to Hostnames

If you have many servers or other devices plugged into your network devices, and people have been remiss in the past in their labelling of ports, you can end up in a situation where you have no idea what is connected to what. Particualrly for large switches with hundreds of ports, this is unnacceptable. A common method (and I believe the correct method) for solving this problem is using LLDP, but if you have hundreds of servers without LLDP installed (and for whatever reason are unable/unwilling to install it), it is of little to no use.

Automatically Backing up Network Configurations with RANCID

RANCID is a very useful tool for automatically backing up your network configurations. If you follow the default installation instructions, it will grab the current configuration of your network devices every hour, diff them against the previous ones, and check any changes into subversion or cvs. Under the hood, it's just a bash script that runs various expect scripts, logs into each network device, and gets their configuration in a vendor-specific manner.

Apt Segmentation Fault

Unfortunately I didn't do a full debug of the problem, but I had problems where both apt-get and aptitude were dying when run. Further investigation lead me to notice segmentation faults in my logs, for example:

May 1 18:34:57 ebony kernel: [249491.980426] apt-get[10391]: segfault at 7f2b59c95474 ip 00007f2b56d9bf37 sp 00007fff4401aa80 error 4 in libapt-pkg.so.4.10.1[7f2b56d4f000+10a000]

This was fixed as follows:

sudo rm /var/cache/apt/*.bin

Ubuntu Unity Bar on Wrong Screen: Fix

If you have multiple monitors in Ubuntu and are using the new Unity graphical interface, you may find that the "vertical bar" is appearing upon the left hand side of a screen not the left-most. This is weird, and means you have a vertical bar in the middle of two monitors. Even worse, as it auto-hides by default, you have to hit a very small area (possibly as little as a single pixel) between two monitors to activate it.

Restrict Domains Postfix Sends To

Another entry tagged "Er, I can't believe I didn't know that" with a side note in "bleedin' obvious".

To arbitrarily restrict which domains a postfix instance will send to (when receiving email via SMTP) you can simply add the following lines to your main.cf:

relay_domains = example.com,lunarlamp.co.uk,google.com
smtpd_recipient_restrictions = reject_unauth_destination

I promise to post some interesting stuff soon, rather than these banal little snippets!

Working config for Bethere static IP on a Cisco 877

Below is part of the configuration that I use for my Cisco 877 on be*, with some thoughts and tips following it.

Minicom "break" sequence to cisco device

I was trying to reset a password that I had forgotten on a cisco 877. Standard procedure is to turn it off, wait 5 seconds, turn it back on, and hit the Break key. However, I use minicom to access my cisco devices over serial cables, and this did not work. It took me a while to work out that, because I was using minicom, I needed to send it 'ctrl-A' and then 'F' instead (it will display "sending break" if done correctly).

Just a reminder to myself really, and here in case someone finds this via google.