Tag Archives: format

Ubuntu 12.04: How to Format a USB Flash Drive CodeUnit 22 JUN 2012

If you are a Microsoft Windows user then no doubt you’ll be quite familiar with the concept of right-clicking on a USB flash drive icon under My Computer, selecting the context menu option ‘Format’, and then formatting your flash drive so that it is nice and sparkly empty. Unfortunately for us though, that tried and tested method isn’t quite supported under Ubuntu Desktop.

Using Ubuntu 12.04, this is one of the ways in which you can however format your USB flash drive. First, plug your USB stick in and wait for it to mount. Then open the Ubuntu Unity dashboard and type in “Disk Utility”.

Launch the resulting application and select your USB flash drive which should be listed in the left hand side device list. Scroll down the resulting page until the ‘Format Volume’ button becomes visible.

Click on this button, select the file system you want to use (9 out of 10 times, stick with FAT as this is supported by the widest range of devices) and hit the Format button.

Finally, marvel at how the application merrily discards all data currently on your USB flash drive before returning control of it to you, all sparkly empty.

PHP: Strtotime and Handling Different Date Formats Programming 27 OCT 2010

green php elephants - elephpantsStrtotime is a powerful date manipulating ally of any PHP developer, but unfortunately it doesn’t really respond to locale settings all that well, meaning that should you not be an American, in other words your dates don’t look like the silly MM/DD/YYYY format, it can return some rather strange and unexpected results!

Funnily enough though, there is in actual fact a pretty simple fix to this – and it all lies with the simple joining character you use to specify your date!

If like me you prefer the more logical European layout of DD-MM-YYYY, then make sure to use a dash (-) as your joining character. The usual forward slash (/) signifies American MM/DD/YYYY format while a humble period (or fullstop if you like) (.) indicates ISO YYYY.MM.DD.

And in action?

echo date("jS F, Y", strtotime("11.12.10")); 
// outputs 10th December, 2011 
echo date("jS F, Y", strtotime("11/12/10")); 
// outputs 12th November, 2010 
echo date("jS F, Y", strtotime("11-12-10")); 
// outputs 11th December, 2010  

Who would have guessed?

Still, damn useful now that you know! :)

Convert M4A to MP3 Music Files General Nonsense 05 MAR 2008

iTunes has been around since 2001 now and as an anti-Apple person myself, I’ve pretty much avoided it from the get go. However, I was finally forced to accept defeat, download and install the software after finding myself in possession of more and more .m4a music files.

The reason I conceded defeat and installed this admittedly rather good piece of software is because I like uniformity which means my music file compression of choice is the trusty old MP3 format. Now iTunes has the nifty feature of being able to convert between a number of different formats, including the m4a to mp3 conversion that I am interested in (in fact, iTunes 7 can currently read, write, and convert between MP3, AIFF, WAV, MPEG-4, AAC, and Apple Lossless. It can also convert unprotected WMV to MP3).

So, in order to convert your .m4a files to .mp3 files simply follow this process:

1) Go to the main menu and navigate to Edit -> Preferences. Once the preferences dialog box appears, click on the Advanced tab. Under the Advanced tab, go to the Importing sub-tab. The second dropdown box is labelled “Import Using:” and you need to set this to MP3 (or whatever other format you want to convert to). The “Settings” label allows you to adjust the quality of the generated files.

2) Once you have changed the preferences, simply navigate to the songs you wish to convert, select and right-click. You will see the “Convert Selection to MP3” option on the context menu. Select that and sit back, brew some coffee and wait for the conversion process to finish up.

Sorted. If you couldn’t follow the words completely, I’ve included to images to help you out. Simply click on them to enlarge.

iTunes1 Smaller iTunes2 Smaller
For more information on MPEG-4 Part 14, see: http://en.wikipedia.org/wiki/.m4a
For more information on iTunes, see: http://en.wikipedia.org/wiki/Itunes