September 24th, 2008Creating GUIDs in a Bash Script

Like with everything, I am sure there are 101 ones to create a GUID value from within a Bash script.  My method is maybe a bit of a  cheat but it is quite and easy and possibly doesn’t have the overhead of calling a perl script which in turn is calling a CPAN module.  Instead, I am using the UUID() function from within mysql!

GUID=`./mysql -u username -B –silent -e ’select uuid()’`

The overhead of calling and connecting to a mysql server is maybe something to think about if it was going to be used over and over.

I wonder, does anyone else know a native way to create a GUID from within a shell script?

Related Post

A fantastic site, graphJam.com that someone pointed me to - here is just a sample but if you need to waste a minutes on a friday afternoon then this is a great site to do it with!

Related Post

Fantastic website came up on Digg today about what to do if you find someone is using your wireless network.  Of course, you could block them, encrypt everything, but that does seem a bit boring when instead you could have the sort of fun this guy has had:

http://www.ex-parrot.com/~pete/upside-down-ternet.html

Related Post

December 28th, 2006Getting to know your PowerBook

I seem to be getting quite good at dismantling Apple laptops.   First the old iBook had a new disk, and then a new reed cable - and now my G4 Powerbook (which I suppose is actually getting on a bit now) started to have problems just before christmas.  The sound that the hard disk was making didn’t sound good, and the spinning beach ball on the screen showed that it was having problems.   What a bummer I thought, although as I had a 30Gig 2.5inch hard disk laying around doing nothing, it was not a huge problem, esp as the laptops are constantly backed up via cron jobs throughout the day.

There is a great website, FixIt which details, with photos, how to dismantle all the popular Mac laptops, computers and IPods.   I’ve used it loads in the past and I used it this time too.

It took about four hours to do it all. The biggest problem was getting the top cover off the laptop which unless you know where all the tabs are, or you have some Apple jig thing, means you always end up slightly damaging the case, although I’m sure if it was a customer’s laptop then you would probably take a bit more care over it.

dsc00049.JPG

The nice thing, it seems that some of the difficult bits that I found when taking the old iBook to pieces have been re-engineered.  You don’t, for instance, have to take both the top and bottom covers off just to replace the harddisk.   Having a quick look at Fizz’s MacBook (which she kept well out of my way while I had a screwdriver in my hands) it seems that they have really learnt their lesson and to replace the hard disk on the MacBook you just need to remove the battery and open the trap door.  About time Apple made it easier to do basic replacements.

The bad news, there are two very weak connectors that the guide says you have to pull out, when infact if you are carefull you don’t need to do this.  The socket for the on/off button and the socket for the mic are very tight and yet not fixed on the motherboard too well.  I managed to pull the socket for the on/off button right off the motherboard which as you can imagine caused me a bit of concern!   After playing about with some glue and some insulation tape I think I have got away it with.

dsc00052.JPG
I now have a slightly smaller disk in the PowerBook, but it’s all going well.  Nice to have it back too.  Macs seem so much more than a computer, they are like a member of the family, taking them to pieces is just another way to get to know them better :-)

Related Post


© 2007 JTSR | iKon Wordpress Theme by Windows Vista Administration | Powered by Wordpress