Debian /etc/ Cleanup

After upgrading a Debian system, it is a good idea to clean up any old configuration files that remain in /etc/. The following one-liner should find most of them for you:

find /etc/ -name "*.dpkg-dist" -o -name "*.dpkg-new" -o -name "*.dpkg-old" -o -name "*.ucf-dist" -o -name "*.ucf-new" -o -name "*.ucf-old" | sort

Running it on my desktop yields the following files:

root@lambda:/etc# find /etc/ -name "*.dpkg-dist" -o -name "*.dpkg-new" -o -name "*.dpkg-old" -o -name "*.ucf-dist" -o -name "*.ucf-new" -o -name "*.ucf-old" | sort

New packages in Debian 7.0 Wheezy

Given that Debian 7.0 Wheezy will be released in a few hours, I thought it would be a good time to take part in Michael Prokop's #newinwheezy effort to publicise the new packages that have uploaded to Debian as part of Wheezy. I have introduced two new packages to Debian for this release:

  • nyancat - nyancat is a program to display an animated poptart cat in your terminal
  • transmission-remote-cli - ncurses interface for the Transmission BitTorrent daemon

I've also have become (co-)maintainer of the following packages, updating them for this release:

  • dhex - ncurses based hex editor with diff mode
  • figlet - Make large character ASCII banners out of ordinary text
  • lcd4linux - Grabs information and displays it on an external lcd
  • libconfig - Parsing and manipulation of structured configuration files
  • wavemon - Wireless Device Monitoring Application

I hope you find them useful. Enjoy!

WordPress IPv6 Issues

In recent days I noticed that my site, and other WordPress sites were failing to properly load. I've debugged the issue, and found that recent versions of Jetpack require this javascript file on every page load. This file is served from a WordPress content distribution network run by Edgecast. While Edgecast claim to support IPv6, in reality, they don't.

As shown below, they have major issues with MTU size on their IPv6 network. This is a major inconvenience and affects IPv6 users regardless of whether the site they are visiting is IPv6 enabled or not. In addition, it affects other Automattic sites hosted on Edgewall such as Gravatar and Akismet.

Ping6 works ok:

jmccrohan@lambda:~$ ping6
PING 56 data bytes
64 bytes from 2606:2800:234:1922:15a7:17bf:bb7:f09: icmp_seq=1 ttl=55 time=34.9 ms
64 bytes from 2606:2800:234:1922:15a7:17bf:bb7:f09: icmp_seq=2 ttl=55 time=21.6 ms
64 bytes from 2606:2800:234:1922:15a7:17bf:bb7:f09: icmp_seq=3 ttl=55 time=25.9 ms
64 bytes from 2606:2800:234:1922:15a7:17bf:bb7:f09: icmp_seq=4 ttl=55 time=21.7 ms
--- ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 21.600/26.050/34.968/5.438 ms

Wget over IPv6 fails:

jmccrohan@lambda:~$ wget -6
--2012-11-12 01:05:08--
Resolving ( 2606:2800:234:1922:15a7:17bf:bb7:f09
Connecting to (|2606:2800:234:1922:15a7:17bf:bb7:f09|:80... connected.
HTTP request sent, awaiting response... 

There is, however, a httpd listening on tcp6/80:

jmccrohan@lambda:~$ telnet 80
Trying 2606:2800:234:1922:15a7:17bf:bb7:f09...
Connected to
Escape character is '^]'.
GET /index.html HTTP/1.1


telnet> quit
Connection closed.

This leads me to believe there is a MTU issue somewhere. Thankfully I'm not the only one who is experiencing this. It has been discussed here and here too. If you are having issues, please get in touch via the comments below. I'd like to compare traceroutes.

EDIT: Edgecast have gotten back to me and are investigating the issue.

EDIT 2: Edgecast have followed up via email to confirm that they have fixed the issue. Thanks Edgecast. :)


recode is a simple program for performing conversions between many different character sets.

I often use it to encode HTML and other code snippets before uploading them to the web.

jmccrohan@lambda:~$ echo '<strong>Hello, World!</strong>' | recode utf8..html
&lt;strong&gt;Hello, World!&lt;/strong&gt;

XML reindent

XML is designed to be human-readable. However, to minimise data transfer, the indentation and newline characters are often discarded during transmission. This results in a difficult-to-read XML file such as the one below:

<?xml version="1.0" encoding="ISO-8859-1"?><note><to>Tove</to><from>Jani</from>
<heading>Reminder</heading><body>Don't forget me this weekend!</body></note>

This XML file can be both checked for validity, and reindented using xmllint. Debian/Ubuntu users can find this as part of the libxml2-utils package.

xmllint --format input.xml > output.xml

This results in the following, more-sane output:

<?xml version="1.0" encoding="ISO-8859-1"?>
  <body>Don't forget me this weekend!</body>