Archive for 2009
T’info about Dash
Thursday, December 24th, 2009Once upon a time there was the Bourne command shell. sh as it is known is core at the heart of any UNIXy type operating system and others too. However for some it didn’t do enough so the Bourne Again shell, bash, was written and nearly every system ships with that. These shells are not the same. The have similar syntax but do not behave similarly.
There are other shells which have a completely different syntax and other scripting languages such as Perl and PHP so when writing a shell script you can indicate the correct interpreter using the ‘hash bang bin bash’ comment to indicate you are using bash. I.e.
#!/bin/bash
Some lazy programmers don’t indicate the exact shell they require and use
#!/bin/sh
to mean bash when it means sh.
Ubuntu, in their wisdom, have decided to go for dash as their shell. It is an evolution of the Almquist shell and is smaller and lighter weight than bash however they install bash anyway. dash and bash have the common subset of sh commands but are different. So if you find you have a problem building or similar on Ubuntu it may be that the wrong shell is being used. Ubuntu has a symlink as follows:
lrwxrwxrwx 1 root root 4 Mar 29 2009 sh -> dash
You may need to change this to point to dash as follows:
$ cd /bin $ sudo rm sh $ sudo ln -s bash sh
While we’re handling Ubuntu oddities building against NCurses, the terminal output library, can also be problematical. A little while ago NCurses was split in to two libraries, libncurses.so and libtinfo.so. Some badly written software will try and link explicitly with libtinfo.so directly rather than trying libncurses.so first. Ubuntu does not split these two libraries but provides just the one libncurses.so library so if you have an issue with a missing libtinfo.so you will need to add symlinks in to your library directory as follows:
$ cd /usr/lib $ ln -s libncurses.so.5 libtinfo.so.5 $ ln -s libtinfo.so.5 libtinfo.so
iPhone cosy
Tuesday, December 1st, 2009A short while ago I went down with the ‘flu’. Usually in these cases the best thing for me to do is rest and sleep. But eventually I get bored so I have to find something to do. So this time I sat in a recliner, watching a movie, whilst teaching myself to Purl. I wanted a project I could finish in an evening to use my new found skill so I modified the “Cricket’s Cell Phone Cozy” design and learnt to do stockinette stitch and add and remove stitches in rows. Below is the result.
It has a couple of things I could improve on. I put the cutout for the headphone cable on the wrong side and you have to take it out to charge. The next one will have a button hole type slot in the bottom for the charging cable.
Knowing Purl has meant I can do ribbing so I’ve started knitting a ribbed scarf out of some great multicolour yarn.
Building PHP C extensions on Ubuntu 9.10
Tuesday, December 1st, 2009I have just taken over maintenance of the PECL Direct IO extension as it has been unmaintained for a while. Naturally the first thing I did before writing any new code was to check out the extension from SVN and try and build it. Building the source was fine but when I tried make test it failed producing output like the following:
PHP Warning: PHP Startup: Unable to load dynamic library 'modules/gd.so' - modules/gd.so: cannot open shared object file: No such file or directory in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library 'modules/gd.so' - modules/gd.so: cannot open shared object file: No such file or directory in Unknown on line 0
The default PHP package on Ubuntu 9.10 is fairly minimalist. Most extensions are provided as separate packages which include an INI file and a dynamic library. The dynamic library is stored in:
/usr/lib/php5/20060613+lfs
And the INI file for each extension is in:
/etc/php5/conf.d.
The make tests rule in the generated Makefile in the extension you are compiling modifies the path that PHP searches for extensions by to point to the modules directory within the extension source. So PHP, which is used to run the tests, cannot find the extensions.
I’ve found the easiest way (if slightly hacky) to fix the make test failure is just to copy the .so files from the PHP5 extension directory in to the modules directory within the extension source.
Dancy Happy People
Sunday, November 29th, 2009A November Leeds
Saturday, November 28th, 2009Installing eclipse for multiple programming languages
Friday, November 20th, 2009I can do almost everything I need to do in OS X but just occasionally I need Linux. So I recently installed a VirtualBox VM running Ubuntu 9.10. I use Eclipse as my favoured IDE since I can run it on all three of the major OSes and it has good support for C, C++ and Java which is what I use mostly for work. So the next thing for me was to install Eclipse. This is where things became interesting.
(more…)
First scarf finished!
Monday, November 16th, 2009I finished my first knitting project in a long long while. Its a simple knit scarf of 24 knit stitches per row in Rico Design “Roxy” yarn (73% acrylic/27% new wool – 50gm/60m – Colour violet 007). It took four balls to get a decent length using 8mm needles.
Finishing it off turned out to be problematic. I didn’t realise how much yarn I would need to bind off and ran out half way through. This meant I had to undo the bind off which wasn’t easy and I dropped at least one stitch doing it. I then had to unknit a few rows to give me the length needed and to be able to correct the dropped stitch. Whilst doing this the yarn broke. I ended up having to lay the piece flat, take it off the needle, pull off several rows and then carefully rethread the needle. I succeeded though and here it is.
Announcing LinuxChix North
Wednesday, November 4th, 2009
LinuxChix is a global community of women (and their supporters) who are fans of, users, or just interested in Linux and Open Source Software. LinuxChix has various chapters around the world. Currently there is only one in the UK, based in London, but I am proud to announce the LinuxChix northern chapter, LinuxChixNorth.
LinuxChixNorth is a chapter for LinuxChix members, or potential members, based in and around the M62 corridor in the north of England. This covers the cities of Bradford, Leeds, Manchester, Sheffield and York. It is intend the first meetings will be held in Leeds and Manchester but there is no reason why members shouldn’t organise meetings in other cities. The first meeting will be in Leeds at the beginning of December. I am finalising arrangements for a venue and will announce the date as soon as I know it.
Apart from the website we are on twitter as @linuxchixnorth if you want to follow us. You can also e-mail the current organisers at uberchix at linuxchixnorth dot org dot uk.
Being crafty
Tuesday, November 3rd, 2009Knitting was once a necessity if you were anything other than very rich. My grandmothers’ generation all could knit. My mother can knit but many of her contemporaries do not. Knitting when out of favour especially amongst feminists who saw it as “women’s work” (even though there is a rich history of male knitters) and everything they were trying to fight. But a new generation of feminists have emerged, many of them geeky women, and they are reclaiming knitting. These third wave feminist knitters think that rejecting the craft devalues the work of past women and rather than rejecting it we should reject the opinion that knitting is in any way a second class activity.
When I was very young my mother taught me to knit. I knitted a small red stuffed bear which my mother probably has stored away somewhere. I haven’t really knitted since then, until now.

A couple of months ago I decided to give it another try so I ordered both Stitch’n'Bitch and The Happy Hooker from Amazon. These books, by the same author Debbie Stoller, are partly teach-you-self books and partly pattern books for knitting and crochet respectively. The approach the crafts in a fun way working through from the basics to advanced techniques with instructions and diagrams. The second halves of the books comprise funky patterns, such as hoodies, alien scarves, fingerless gloves and so on. These patterns are devised by young knitters and crocheters, by a new generation for the new generation. They are an excellent buy and thoroughly recommended.
My current project is a beginners scarf. Knitting is like cycling you never really forget how to do it and its amazing how quickly you pick it back up again. I find knitting relaxing and carry wool and needles everywhere. I am learning slowly but it is now something I will stick with. I’ve already had a request for a scarf from my sister and with Christmas two months away there are bound to be a couple of gifts I could make for people. I haven’t really tried crocheting yet so that’s my next challenge.










