A few links
Recently I’ve been looking in to good practice when it comes to writing code and maintaining filesystems and found several handy documents related to this:
- Filesystem Hierarchy Standard – A set of requirements and guidelines for file and directory placement under UNIX-like operating systems.
- GNU Coding Standards - A guide to writing portable, robust, and reliable programs.
I’ve also been trying to improve my knowledge of the C programming language, in particularly good practices relating to memory management, and in the process have posed several questions on StackOverflow which have received very detailed and helpful answers:
Fun with makefiles
I’ve been working on some code in the past few weeks that is to be run on a small embedded linux box. I initially began development on my machine, but soon got tired of compiling to check for errors, transferring to the other machine, and compiling again. So I just did all my development on the other machine. This turned out to be a big mistake as this particular machine wipes its home directory on reboot. After losing a lot of my code I found an alternate solution.
Previously I had just been using simple make files to get the job done, like this:
all:
gcc -llibrary program.c -o program
But after losing a lot of my code, I decided to try something new:
all: remote remote: scp ssh -oStrictHostKeyChecking=no username@othermachine "cd /program; gcc -llibrary program.c -o program" 2>/dev/null scp: local scp -oStrictHostKeyChecking=no *.c *.h username@othermachine:/program 2>/dev/null local: gcc -llibrary program.c -o program
This means that all I have to do now is type make and it compiles locally, transfers it to the other machine, and compiles it there too! Much better!
Dancing kame
Yesterday I configured an IPv6 tunnel on my server, allowing me to browse the internet with IPv6. This doesn’t provide any immediate benefit, but it is a start towards using the technology which will gradually replace IPv4 over the next few decades.
A few resources that are helpful:
- Hurricane Electric Free IPv6 Tunnel Broker provide free IPv6 tunnels, as well as a /64 block of public IPv6 addresses for you to use.
- The tutorial at Chronos Tachyon was very helpful in getting it all working. It also teaches you how to get your server to broadcast router advertisements (the IPv6 version of DHCP).
- Test-IPv6.com will show you if you have it working properly.
- And finally, one of the perks of having IPv6 is that you get to see a dancing turtle.
Minecraft Home
Due to the impending release of Minecraft Version 1.3, my Minecraft server is being reset soon to allow for full enjoyment of all the new features added to the terrain generation.
I took some screenshots of my home before it got lost: http://imgur.com/a/93YWY
Bash one-liners
Earlier this week I found myself wanting to rename a whole bunch of files, something simple like someprefix-*.txt to *-somesuffix.txt.
I somehow assumed that it would be possible to do it simply using mv, like so:
mv someprefix-*.txt *-somesuffix.txt
This does not work, but it is possible to accomplish the desired effect using bash one-liners:
for FILE in `ls someprefix-*.txt`; do X=`echo ${FILE} | cut -d. -f1 | cut -d- -f2`; mv ${FILE} ${X}-somesuffix.txt; done
This strategy can be applied to lots of other problems, e.g. deleting the 100 largest files in a directory:
for FILE in `ls -S | head -n100`; do rm ${FILE}; done
Dialog boxes in jQuery Mobile
Posted by Daniel in Internet, Web Development on March 18, 2012
I’ve been using jQuery Mobile for web development recently, and while it is easy to use and looks great, there are a few features that are lacking.
One is the ability to generate dialog boxes. But luckily there is a plugin called SimpleDialog2 that allows you to do this!
Features: (from the SimpleDialog2 webpage)
Multiple Operation Modes
- Button List Mode – Generate a dialog with a list of buttons
- Button Input Mode – Generate a dialog with a list of buttons and user input
- Freeform Mode – Generate a dailog containing your own custom HTML source
Multiple Display Modes
- Popup Mode – Pop the window “over” the current content
- jQM Dialog – Use the native jQM dialog page interface
- Fullscreen – Use a proprietary full viewport pop “over” method
Collect User Data
- SimpleDialog2 has the ability to collect a user prompt and return it back to your script
Clean DOM Operation
- Perhaps the biggest change from SimpleDialog – SimpleDialog2 takes great pains in cleaning itself completly from the DOM when it closes. These are *single* use dialogs.
Here’s a few examples of dialogs that can be generated with this plugin:
DeepThought: Assembly
So there’s not too much to say about the assembly. With the guidance of the knowledgeable Richard, and the help of several screwdrivers and cable ties, I managed to assemble DeepThought.

This is the motherboard, and the fan for the CPU. You can't really tell, but the fan is only just small enough to fit inside the case!
The RAM isn’t there due to the fact that it was delayed and didn’t arrive until the next day.
And the final product, with screens, mouse, and keyboard, (not to mention Minecraft mousepad) is this:
DeepThought: Arrival
Having had my current computer, an HP 6730b laptop, for the past 3 years, I decided it was time for an upgrade.
I have decided that this computer will be called DeepThought and I will be posting information about the arrival, assembly and configuration.
This post contains pictures of the components of DeepThought as they arrived.
OCSP
When you visit a site over HTTP with SSL (HTTPS), the site has a certificate that is used to verify its authenticity. As it is possible (but unlikely) that a certificate may be compromised i.e. the private key being obtained by someone else, there needs to be a way for the client to check if the certificate has been revoked.
One method of this is Certificate Revocation Lists (CRLs): lists of certificate that have been revoked. These are lists provided by the Certificate Authorities (CAs), and it is the responsibility of the client, or web browser, to update the lists.
Another method, which is implemented in the latest versions of most popular web browsers (Firefox, Chrome, Opera, Safari, IE), is the Online Certificate Status Protocol (OCSP). This enables the browser to check if the certificate has been revoked in realtime by sending an OSCP request to the OSCP server defined in the AIA section of the certificate.
However, as this request has to include the certificate serial number, the OCSP server ends up with records of all the IP addresses that visit the website using that certificate! This article by HR Geeks explains this in more detail, but it comes down to a simple question: security or privacy?




















