Wednesday, January 13, 2010

Recursively Rename Files Linux

I was just doing this today and thought I would post the bash script I wrote to do the job. This particular example finds all jpeg files recursively and renames them to .jpg but you could just change the .jpeg part to anything and / or the .jpg part.

You just have to paste this into a .sh file and run it with sh filename.sh or set it's executable bit and run it with ./filename.sh

#!/bin/bash

find ./ -type f -name "*.jpeg" | while read FILE
do
newname=`echo $FILE | sed s/\.jpeg$/\.jpg/`
echo "renaming $FILE to $newname"
mv "$FILE" "$newname"
done

Friday, January 08, 2010

Great day

Well today turned out a thousand times better than I had expected today. Initially I thought I was having a tooth removed which would have been horrible and then having to wait to look for a new car but in-fact the dentistry had to be postponed and I got myself a new car hehe.

car

Here is a quick pic of it, I will take a few more in the future in the light. It was a bit scary driving it for the first time in all the snow we have been having here recently though and on the motorway for the first time, but it all turned out well.

It's great how quickly you can get taxed and insured these days especially being as I am a new driver I was able to get insured for about 670 pounds would certainly recommend using go compare.

I just hope when I release the new version of my software at work soon I will be so lucky.

Sunday, December 20, 2009

Christmas is almost here!

And I still haven't finished my shopping and wrapping yet booooo. Though in better news I have passed my car driving test at long last. After years of riding motorbikes all year round winters to come should be a lot more pleasant.

Other than that I passed my team leader 2 management course as well so things are all going rather well, especially as now I can chill out all the way until after new year hehe.

It has been snowing loads around here today, I am really hoping it will pause for tomorrow and the next day so I can easily go to town and fit my new scorpion exhausts to one of my bikes, selfish me.

I hope all is well with everyone who comes across this site :) especially my Azizam xxx

Tuesday, December 08, 2009

MD5 Checksums and Windows

Ever downloaded an application realised the site had the MD5 Checksums there but you didn't bother to check them because you couldn't be bothered to install something and faff just to generate MD5 hashes on Windows?

In case you are not familiar with MD5 Checksums, it is basically a number which represents the exact contents of the file, a finger print as it were, often when you download an application a website will provide the checksums and you ideally need to check your downloaded file matches. This ensures that what is about to be run is what the site had intended for you to have and nothing else had been added or removed.

So anyway, I found a really nice easy and free little program to do such checks at the click of a mouse and thought I would share it. http://www.colonywest.us/index.php?option=com_content&view=article&id=46&Itemid=56

Thursday, December 03, 2009

Motorbike Show 2009 - NEC

Yet again I have been a very lazy creature regarding posting anything on my site, but thought I would put a few links to some more recent pics and whitter on a little about the motorbike show over at the NEC I went to this year.



I had a good time over there as usual, still tons of bikes being displayed there as you can see in the pics, particularly BMW, they had a huge stand this year and a massive range of models, also great to see Norton there and Triumph.

With regard to BMW, their sports bikes are looking amazing these days. They are pretty pricey but in the same kind of ball park as the Ducatis. Here's a link to a site about one of their models, I included it just because it's a really novel site take a gander.

It was a little dissapointing to not see Honda, Ducati, Harley Davidson or Aprillia there though. Hopefully it's not a sign of bad things for them economically.

As always they have a huge amount of biking kit on sale at really decent prices, so I ordered myself a pair of scorpion exhausts for my Yamaha really looking forward to their arrival probably early next week!


Thursday, November 19, 2009

Tokyo Sonata

Last night I saw a very interesting Japanese film, Tokyo Sonata, I am not sure I would recommend it from an entertainment perspective, but if you are looking for something curious that really embodies Japanese mentality this seems to me to be one to watch.

The cinematography is superb, a lot of the slower scenes look like excellent photos, one scene showing some high rise buildings with the slow moving of traffic just looked amazing, it's a shame I can't find a still of it on the net to show here.



It just made me realise how completely different the Japanese are to us here in England, if that is indeed a realistic representation of the way they think and act. Honour it seems is so important that it actually clouds their judgement in making rational decisions that could overt the situation becoming worse.

This is really one of the first films I have seen that shows typical contemporary Japanese streets and houses, I think that is what really makes it so intriguing. The people seem so calm and considered, always listening to what another says before answering until they eventually snap under extreme pressure. I think it's actually a storyline that could not work in any setting other than that of modern day Japan.

Labels:

Tuesday, November 10, 2009

MySQL Selective Dump

This is just something I was wondering about, whether I could back up specific rows I am going to modify during test, so I can re-insert them all after I have finished and deleted my test data.

To selectively dump just specifc rows from your mysql table you can use the following:

mysqldump --where=domain_id='7' -t -umyueser mydatabase mytable > mydumpfile.sql

Omitting the "-t" option will also place the drop and re-create table SQL into your dumpfile. It can be handy if you just want to backup a specific set of data from your db. Note it does not create REPLACE INTO's though so you would need to delete the matching rows before restoring from such a dumpfile.