OpenWRT is a fantastic open source distribution for embedded devices, such as the Linksys WRT-54G series of wireless routers. One of its many features is the use of dnsmasq, a combined DNS and DHCP server, useful on small networks that are sitting behind a NAT connection.
The downside of dnsmasq on OpenWRT, however, is that the default configuration uses your ISP's DNS servers, which can be problematic, if your ISP, like many others, is adopting bad habits of redirecting non-existent domains to their servers, or is blacklisting / censoring websites without asking you.
For this, and for so many other reasons, it's a much better idea to run your own local DNS resolver. Unfortunately, dnsmasq isn't cable of doing this, so it's necessary to install a DNS server that can do this on its own. In this article, I describe how to do this.
Ever had a situation where you need to rebuild a Debian or Ubuntu package on a regular basis, but it takes an incredibly long time because it's running automatic tests - tests that you don't need until your final build?
For many of these packages, there's a simple way to disable the tests, by setting the DEB_BUILD_OPTIONS to "nocheck", before you build the package:
apt-get source openldap
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -rfakeroot
Not all packages support this, however, and some packages might use 'notest' instead.
There are a number of other values that can be used with DEB_BUILD_OPTIONS, too, if the package supports them:
noopt - turn off optimisation
nodocs - don't build documentation
nostrip - do not strip debugging symbols from binaries
parallel=n - use n parallel processes to build the package
Fortunately, sch_htb, the Hierarchical Token Bucket is available on OpenWRT, which can do the same thing, but it's a lot more complicated to configure.
The following script will rate limit the single IP address of 192.168.0.67 to 128kbps. All other addresses on the network will remain unlimited. Set the name of the inside interface on your Linux router in DEV, the IP address in IP, the maximum rate on your inside network in MAXRATE and the limit that you want to apply in LIMIT.
I don't know what it is with the Ubuntu developers; they seem to be going out of their way to make their distribution as unpleasant to use as is humanly possible. If it wasn't bad enough that they slow it down by running the default desktop with pointless animations, and playing annoying drumbeats at boot time, they disable potentially useful features like menu tearoffs and then move everyone's titlebar buttons across to the left side, ignoring their previous defaults.
Here's a script to fix up these inanities:
# Put the buttons on the right, where they should be
gconftool-2 --type string --set /apps/metacity/general/button_layout ":minimize,maximize,close"
Every new release of Ubuntu seems to break something that was working on my systems, and it was no different with the 10.04 release of Ubuntu: my Huawei e169 mobile broadband modem, which can be used in Australia on the Optus, Vodafone and Virgin mobile networks, and in Europe almost everywhere, stopped working.
The device would appear in the filesystem, but no matter what I did, it refused to connect.
It's quite easy to fix this, in fact. Firstly, install the usb-modeswitch package:
sudo apt-get install usb-modeswitch
Then create the file /etc/udev/rules.d/75-e169.rules with the following contents: