Latest project

So, I’ve just started work on my latest project, a digital thermometer. The circuit diagram (Drawn at 4AM, so don’t blame me) is at http://www.flickr.com/photos/23154926@N04/2272526886/. (Blame aidsmonkey for the dragons.)

I’ll be getting the rest of the bits on tuesday, so far I’ve just done the display (On the right, here 3x7seg display system)

Oh, and tell me, what colour LED should I use for the status indicator? I have red, green, yellow, blue and can produce orange.

GHOP

I’ve just finished my last task on Google’s GHOP, and I thought I’d mention a few things.  Firstly, massive thanks to google for doing this, as they are really giving back to the open source community that (I belive) has helped them a lot.  I’m sure there are many companies out there using open source software and doing very little, if anything, in return.

Secondly, even more massive thanks to the task mentors.  They’ve been patient, friendly and extremely helpful, throughout my memory leaks and stupid questions.  I hope they get some sort of reward from google, in addition to the students.  The ones who I’ve particularly been impressed with have been Andre Klapper, Xavier Claessens, Nickolay Shmyrev, Michael Chudobiak and Fred Peters.

Thirdly, thanks to the other students doing this who have also been very friendly and nice – I’m very impressed how mature everybody seems considering they are generally aged 13-18, probably considered the “worst” age group on the internet by many people (Especially on IRC).  It’s been very interesting to meet a wide variety of people from a staggering amount of countries, including Israel, the US, and all over Europe, to name a few.

One amusing symptom of the mix of cultures, however:

Comment 43, Yesterday (24 hours ago)
btw, what the “shagadelic” effect is?

(If you don’t get this joke, watch an Austin Powers movie or two.)

On a side note, my cello bow’s end is splitting slightly, and although it probably doesn’t affect the structural integrity or playability, I’ve been considering a new bow for a while and this has pushed me over the edge.  The one thing I’m curious about is carbon fibre bows – I’ve never touched one, and barely anyone I’ve talked to ever has.  I’m a student, taking grade 8 soonish, and am looking for a bow for between 100 and 500 GBP – anybody know if a carbon fibre bow is worth looking at in these circumstances?  Any brands to look at or avoid?

Cheers

Cillian

Reason #110 I love linux

for i in `ldd GHOP/jhs/gthumb/libgthumb/.libs/libgthumb.so | cut -d’ ‘ -f3`; do if ldd $i | grep glib | grep “\/usr\/lib” >/dev/null; then echo $i; fi; done

This little beauty, I hacked together to take all the deps of a particular library which was producing linker errors, see which of them were the culprit(s), and tell me.

Though I’m sure windows has a piece of $20 software which does something like this.  :)

iPod iCharge iCable

You know how when you plug your iPod into a computer, it goes into disk mode, whether you like it or not. Well, sometimes, maybe you want to charge your iPod while still listening to music. I know some wall-plug-chargers can do this, but I don’t have one and don’t want one.

I remember reading a while back about how they do this, it was something to do with grounding the data pins. Well, I decided to do it my own way

You will need:

  • Scissors
  • Nail clippers (Or wire cutters, but I prefer the former)
  • Screwdriver(s)
  • USB extension cable (Comes with every USB item under the sun, cheap as heck)
  • iPod + dock cable (Not included)
  • Terminal block (Two lumps)

First, lop the USB extension cable in half. I did mine near the male connector, so I don’t have to stare at my shoddy hack too much when it’s plugged in behind the computer

Second, strip the ends of both stubs so you can get at all the internal wires. You should have 4 wires + shielding. The four wires are something along the lines of:

  1. Red: Juice (VCC)
  2. White: Bits (Data-)
  3. Green/yellow: Bobs (Data+)
  4. Black: Lack of juice (GND)

Strip off enough of 1 and 4 that you can screw them into the two bits of the terminal block. Do this for both stubs of the cable. Leave 2 and 3 disconnected (I originally thought you had to ground these two for the hack to work, but it seems to work with them left floating on the ipod (female) side).

Trim off any trailing shielding, 2 and 3, tighten up your terminal block connections.

Hope for the best, plug the extension cable into an old computer and ipod (Well, I used my main workstation and my expensive ipod video, but hey, why not), and hope for the best. Worked first time for me (I actually tried it out before using terminal block, just holding the wires, and that worked fine too).

Finish using any means necessary. You could make a nice little neat box, or even replace some insulation or something to make the hack invisible. Me, I just stuck a wire tie around the two cables and covered the whole lot in bright red electrical tape (Why won’t people let me charge my iPod on their computers…?).

Good luck, happy hacking.

Edit: I just had a thought, it would’ve been quite cool to actually use a double throw switch so you can choose whether you want to charge or transfer data, rather than having to use a different extension cable. Oh well.

GHOP, part 2

Well, I just completed my first issue on GHOP, to fix 12 bugs from bugzilla. There are some things that have annoyed me, like there not being many bugs to choose from, some bugs taking a *lot* longer than others, but overall I’ve really enjoyed myself. I should be getting a report on my results some time soonish.

Even though it’s a lot of work, and you really have to spend quite a lot of time a day to finish the issues within the timelimit, I think this is a great alternative to SOC for younger people. It is unfortunate that most tasks require quite a lot of programming skill and prior knowledge of open source software and the projects in particular – therefore I don’t think it serves the purpose of getting young people interested in open source software so much as getting those already into open source software and programming into contributing to projects.

I’d like to say thanks to Andre Klapper for giving me some pointers along the way, and massive hugs to grep and vim for being awesome :)

Edit: Andre just marked my results as completed – thanks :)

GHOP

So, (Yes, I know I started with so, it was deliberate), I just read about Google’s GHOP and signed up.  By working on open source projects we all love, I can earn cold hard cash, supposedly – cool.  There are a number of tasks – for one you get a T-shirt, for each three you get $100 up to a max of $500.

Designed for over 13s but before university, it’s a brilliant way to get some of the many teen computer enthusiasts into open source coding by giving them an incentive and some bite size chunks.  For me, it’s a great way to spend my free time whilst making decent money and having fun.  It’s a pity the projects and issues available are limited – the only ones written in C/C++ are glade and apache, and apache has very few code issues.  I’m mostly looking at GNOME, as I know and use it, and it should be a good way to learn GTK programming too.  Oh, and now I can spell mnemonic perfectly :D .

I’ve just claimed my first task (Or “issue” as they call it), and am hacking away at glade while waiting for confirmation.  :)

Cello pickups

Well, I got my cello pickups, more or less put them together (selotape…) and borrowed (stole) a smallish guitar amp.  It sounds pretty decent as a rock-distorted guitar, or like a bass guitar, depending on where I put the pickup and how I configure the amp.  Pity I can’t get a decent acoustic cello sound out of it.  Hopefully I’ll be able to whip out my soldering iron at some point and fix up the joints.  Also a decent cable and preamp would probably help.  If anybody knows anything about amping acoustic instruments or analog electronics and building a preamplifier, give me a shout.

Adventures with kexec

You may know, my laptop is in a rather horrible state – it has no harddisk, and the BIOS only boots off harddisks and CD-ROMs.  It seems difficult/impossible to find a replacement harddisk due to the strange size and connector.  So, I use a PCMCIA (PCCARD) CFCard adapter for a root filesystem and knocked together a boot CD for the kernel and initrd.  In the initrd I wrote a custom linuxrc script to bootstrap PCMCIA, mount the root fs, and hand over to init.

The obvious problem with this solution is, every time I want to update the kernel or change a compiled in feature, I have to reburn the boot CD, which gets boring very quickly.  I heard about something called “kexec” a while back, and suddenly realized this morning (While hung over after a party and having been woken up at 9AM to help with heavy lifting…) that kexec could solve a number of these problems.

What I do is, the boot CD loads up PCMCIA stuff, mounts the PCMCIA drive, then finds a new kernel and initrd and uses kexec to then boot that newer kernel and initrd.  Therefore, all I need to do to update my kernel is copy the new kernel to /superduperbootcd on the root filesystem – dead easy.

There are a couple of drawbacks, mainly that going through two partial boot cycles takes a while, and any bugs in the kernel which appear during the first boot will need me to burn the boot CD again.  But it’s still quite a neat solution, very cool, and a reason I love linux.

Speaking of bugs which appear during booting, occasionally my kernel segfaults on boot, before it even executes INIT – the backtrace mentions sony_laptop_init, or something similar.  Has anybody heard of this bug, or know of a way to fix it?  It seems more common when my power cable is not connected, but that could just be me.

(Waiting for my pickups from rapid….)

Cheers

Pimp My Music Stand

So, I was bored one Sunday afternoon and decided my music stand was boring. It’s a useful structure which is nearly always present when I’m playing the ‘cello, so why should it only hold music? Music stands can hold bows, but they have a tendancy to fall off, knock off the music, or other bad things. So, I began to customise.

Firstly, you will need:

  • Lots of sticky tape. Gaffer tape is a plus, but might not be so removable
  • Lots of spare paper. I use small notelets, but plain A4 would do the job.
  • Scissors – I got by with tearing, but scissors are certainly helpful

So, the first feature I added was… (drumroll) The Bow Holder. This is very simple to do – take one unused pencil, pen or other straight object, and sticky tape it horizontally to the top of the stand. If done correctly, this does not interfere with the stand folding or music on it. The more tape used, and the tighter, the less the bow holder wobbles. Warning: If you generally have your music stand very low, as I do, the bow might hit the floor. Solution: Raise the music stand (or just let the bow rest on the floor).

After encountering problems with the bow falling off the holder when the stand is knocked or moved, I added an addition to the end – this small piece of [Pencil/Pen/knex/chopstick] goes perpendicular to the original holder, on the end. It being horizontal provides more security against the bow falling off, but makes taking the bow off a pain. If it is vertical, as mine is, the bow can simply be lifted (taking care to avoid mashing the hair). If horizontal, the bow must be angled then removed.

Secondly, the pencil holder – I simply rolled up some paper, added a lot of sticky tape, stuck more paper on the bottom, and taped it to the back of the music stand, at the top, in pride of place.

Lastly, the rosin holder – this depends on the shape of your rosin – mine is in a very nice round, metal tin. I made a paper cylinder with a bottom, and taped it to the bottom of the stand, with small nips out the edges to ease removal – it is a bit too tight, but you don’t want your rosin falling out.

No pictures, as my camera is dead (thanks to my antics with a screwdriver, but that’s another story for another blog – that and my antics with a soldering iron to try and resurrect it).

rectv

Here is a nice script I wrote, which I figured I’d share with the world – it’s for doing TV related stuff with just mplayer/mencoder rather than needing a special program (It could probably be done inside cron too):

#!/bin/bash

mencoder tv://$1 -tv driver=v4l2:norm=PAL:quality=100:input=0 -of avi -ovc lavc -oac mp3lame -lavcopts vbitrate=10000 -o tv.`date +%S%M%H%d%m%y`.avi -ffourcc DX50

Nice, eh? This records the channel specified on the command-line on my tuner, which in my case is always 60 since that’s where sky is plugged in. It captures (not sure which codec it encodes with, probably some variety of mpeg4) to a file named from the current date and time to the current directory.

One thing I want to do is add an option so I can specify which sky channel it’s recording on the command line, and it’ll look up TV listings on the net and name the file after the program name. Heck, maybe even give it a beamer and let it control the sky box.

Any idea how exactly to get it to encode properly so my files aren’t massive and will play in a sane media player, please tell me.  I suck at mencoder options.

Edit: I’ve recently figured out some encoding with lavc and mpeg4. The quality seems rather nice, and the file size isn’t /too/ massive. Also I figured out nice deinterlacing. Here is the updated script

mencoder tv://$1 -tv driver=v4l2:norm=PAL:quality=60:input=0 -of avi -ovc lavc -oac lavc -lavcopts vqscale=5 -o tv.`date +%S%M%H%d%m%y`.avi

And to play the videos with deinglacing I use:

mplayer -vf lavcdeint tv.<dateandtime>.avi

You can modify the original command to let you watch TV with mplayer too (can’t figure out deinterlacing with this one, lavcdeint only works when playing video, not live TV):

mplayer -tv driver=v4l2:norm=PAL:quality=60:input=0 tv://$1
Follow

Get every new post delivered to your Inbox.