Computing

Better than grep

Anybody who has used command-line systems for a serious amount of time will love grep. But today I stumbled across ack, which (for many things) is better than grep and a whole lot nicer to use. The best bit? It’s pure Perl, therefore also uses real Perl regular expressions. Yes, there might be grep --perl-regexp, but nobody bothers compiling that in. Plus ack has some other neat features. See more at the ack website.

Limiting command runtime in Linux

It is sometimes useful to limit the running time of a process, either to stop it from using up all resources or to make sure nightly cron jobs don’t continue into working hours. I needed this for rsync, to let a remote backup server slowly catch up if large amounts of data were added to the live server during the day. A useful post on the rsync mailing list discusses an rsync patch but also the timeout command.

Obtaining DNS servers automatically on Cisco ADSL routers

I noticed tonight that my Cisco 837 was using hard-coded DNS servers which were no longer valid, hence breaking my internets. In order to keep them updated automatically, I added the following to the appropriate dialer configuration (interface Dialer0 on an 8xx): ppp ipcp dns request This causes the router to request DNS server addresses when the PPP session is negotiated (when it “dials up” to ADSL). After reconnecting the PPP session (either reload or shutdown the interface and then bring it back) it is possible to check that DNS servers have been obtained using sh host:

dspam integration with dovecot

In a previous message I spoke about training dspam automatically. The script I posted there works, but it’s not brilliant so I started looking for other ways of achieving spam training from the client.

Training dspam from Thunderbird junk messages

Recently I have installed and configured dspam on my mailserver. It seems to work nicely but needs occasional training. I wanted to integrate this with Thunderbird so that users could automatically train dspam from their mail client.

Updates to libnids

Much of the code I have written as part of my day job uses the rather excellent libnids. However, there are a few bugs in version 1.23 relating to packets with radiotap headers or code which tries to read from multiple pcap files in sequence.

Contributing [to CPAN] is easy!

The following article is a repost of an original that I wrote for blogs.perl.org. I thought I would share my experience of submitting a module to CPAN for the first time. In summary: it’s stupidly easy and if I can do it, so can you.

Syncing the iPhone addressbook with Horde

Since I’d had my iPhone I’ve wanted to be able to sync my contacts with my Horde Webmail install. This post is about setting up the Funambol application in order to do so.

Modifying fields in the Turba addressbook

I have recently started using the Funambol iPhone app to keep my contacts in sync with my webmail addressbook. However, some fields aren’t included in Turba by default and need adding. This post is for system administrators rather than users, so if you don’t run your own webmail then point your friendly geek at this post.

Blocking SSH brute forcing using denyhosts

Tired of seeing repeated attempts to login to a Linux server you run? There are a number of options, all with their own benefits and disadvantages. The easiest way is to move the port that the SSH server runs on, perhaps to 2222 instead of 22. However. this can be annoying behind some firewalls and means that you need to specify the port each time you SSH to a host. This post looks at denyhosts, a viable alternative.