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:

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:

, , , , ,

No Comments

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!

, , ,

No Comments

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:

, ,

No Comments

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

No Comments

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

, ,

1 Comment

Dialog boxes in jQuery Mobile

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:

Simple Dialog with Buttons

Simple Dialog with text input

Simple Dialog with a list

 

, , ,

No Comments

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.

DeepThought: Case + PSU.

The case with the PSU installed, I didn't realise the PSU had so many cables coming out of it!

 

DeepThought: Case + PSU + Motherboard

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!

 

DeepThought: Case + PSU + Motherboard + Videocard

The videocard had an onboard fan, bringing the total number of fans up to 5.

 

DeepThought: Case + PSU + Motherboard + Videocard + Drives

Both HDDs connected via SATA 3Gb/s and the SDD and Bluray Drive connected via SATA 6 Gb/s.

 

Deepthought: Case with cables tidied up.

And finally we tidied up the cables using the aptly named cable ties.

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: Final setup.

Voilà!

 

, ,

No Comments

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.

 

, ,

3 Comments

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?

 

, , , , ,

No Comments

Dynmap

Dynmap is now up and running on my minecraft server!

Dynmap running on my Minecraft Server.

 

No Comments