Archive for August, 2007

Copying a MySQL database to a new database locally

Friday, August 31st, 2007

Today I needed to rename a database in MySQL. I’m not sure if it’s possible but I decided to create a copy of the database instead with a new name and then drop the old one. This is really easily done using the following commands:

mysqladmin -h <hostname> create <new_dbname>
mysqldump --opt -h <hostname> <old_dbname> | mysql -h <hostname> <new_dbname>

The first command creates a new database on <host> called <new_dbname> and the second dumps <old_dbname> from <hostname> and sends the output directly into the third command, which simply executes the SQL statements into <new_dbname>.

Note that other parameters such as -u and -p are needed when security is enabled, and that the -h parameter can be excluded if both target and destination are the local machine.

The official documentation for mysqldump can be found here.

Excellent Examples of Blog Designs

Thursday, August 30th, 2007

I’m lazy. I enjoy designing websites but I normally either don’t finish them or change them all too soon. This is why I’m currently using a default Wordpress design for this blog - I wanted the content to be the most important aspect and let a design come to me in the future.

When I do look to design something from scratch I’ll definately be taking inspiration from Smashing Magazine’s list of 45 Excellent Blog Designs. I have to agree that they’re all great examples of how it should be done, with my favourites being Dave Shea’s organic mezzoblueThe Freelance Blog, and Circle Six Design.

Using Macs for Security

Wednesday, August 29th, 2007

Whilst digging through the archives of Security Monkey’s posts at ITToolBox I found a great article where Chief explains the benefits of using a Macbook Pro for his security work. I’m hoping to buy my first Mac this year and this article has certainly given me even more reason to ’switch’. Here are a just a few of his reasons:

  1. Mac users are less of a target - Malware mainly targets M$ operating systems.
  2. Parallels - you can install any operating system you want, which is great for testing.
  3. They’re just stylish!

Employment

Tuesday, August 28th, 2007

I’ve been reading a lot of job specs recently as I’m looking for something new and have to agree with Guy Kawasaki’s post about How to Not Hire Someone with a totally unattainable list of requirements.

I had a job spec recently asking for a ‘master of all trades’ and it wouldn’t surprise me if the only people actually that applied for the role would be chancers where one of their only skills would be having a way with words. This means that the role would likely be filled by someone who would end up frustrating most of their co-workers by being incompetant in their job. I’ve worked with such people in the past and I’m sure there’s at least one person you’ve worked with and thought “How on earth did they manage to convince anyone they could do this job?”.

At the end of the day, interviewing is tough and the only way you can really find out if someone can do a job is to give them a chance, but you can at least test all candidates and really push them in the interview. I had an interview recently that I left feeling exhausted because I’d had so many technical questions thrown at me as well as a 50+ question written test. Now even if I don’t get an offer I at least know more about how I can cope under that pressure. I’m sure many would crumble…

Are Firewalls Always Necessary?

Monday, August 27th, 2007

I’m shattered from a long weekend camping so I’m cheating with a very short post today, and just linking to an interesting article at ITToolBox attempting to answer the question “Do We Really Need A Firewall?”. I would agree with the answer given, and always recommend a firewall for that extra security and peace of mind.

How to solve the World’s Hardest Soduku

Friday, August 24th, 2007

According to Andrew Welch at Thoughts on XSLT he’s cracked the world’s hardest sodoku puzzle in less than a second using XSLT. He used his own open source utility to put his Sodoku.xslt against ’Al Escargot‘.

You can try this out for yourself, or see if you can find a puzzle that Welch’s solution can’t solve by downloading Kernow and Saxon.

Mandylion Password Manager

Thursday, August 23rd, 2007

I’m really into security and have been for some time. Every so often I wonder if I’m really doing enough to keep my passwords secure and consider buying a Mandylion Password Manager. It’s just another toy to geek-out over but also has the practical use of securing all my passwords in a really manageable way as well as reminding me when they need to be changed. Considering its relatively low price I think I’ll give in and order one soon. When I do I’ll be sure to review it here.

iTunes has detected an audio configuration problem

Wednesday, August 22nd, 2007

A late post today as I’ve been away from the computer and am now about to get about 3 hours sleep before driving to Reading for the music festival. I have already queued up a post for Friday and will also write another short one for tomorrow.

Whilst at my parents earlier today I solved an issue my mum was having with iTunes. Basically she installed the latest version and since doing so it refused to load and instead gave the error message “iTunes has detected an audio configuration problem”. Initially she just thought to uninstall iTunes and reinstall however this failed to resolve the issue.

Fortunately Apple have acknowledged this issue as a fault with QuickTime. After following the advise given by Apple (uninstall and reinstall QuickTime) the problem went away and mum was happy!

eBay Boobie Prize

Tuesday, August 21st, 2007

Security Monkey over at ITtoolbox has posted about an eBay phishing scam that will strike paranoia into the hearts of bidders. The item in question was listed with a picture of a topless model, which would increase the chances of it being clicked on. The seller then included some Flash in the listing that redirected the user to their own web page, which funnily enough looks just like the eBay log on form.

As Security Monkey points more and more users open links in a new tab, and this hack actually takes advantage of the page not being immediately displayed. An eBay item that flashes up with a description and then immediately disappears only to be replaced with a log on form would be suspicious to most security conscious people.

Resize images from the command line

Monday, August 20th, 2007

The other day I needed to resize a few dozen images. I was using someone elses laptop and as I didn’t have Photoshop to hand I had to improvise. I had already downloaded GIMP and used it (for the first time) to do some simple cropping and cloning, and so decided to look into creating a script in much the same way as I would have used an action in PS. After a bit of reading online I discovered that the performance of GIMP scripting in Windows was less than ideal and came across another Wordpress blog that mentioned ImageMagick, which is free and allows image manipulation from the command line.

The mentioned blog entry contained a batch operation, which will convert all images in a specified directory. I have improved this command for use with files that contain spaces (as mine did).

for /f "tokens=*" delims= " %i in ('dir /b *.jpg') do convert "%i" -resize 50% "%i"

Note that if you are using the above in a batch file, variable names are indicated using double percent symbols (%%) instead of just one.