Monday, 6 February 2012

Book Review: The Alchemist

Book Review: The Alchemist
Paulo Cohelo

 "No heart has ever suffered when it goes in search of its dreams, because every second of the search is a second's encounter with God and with eternity."

"And when you want something, all the universe conspires in helping you to acheive it."

The alchemist is a book about, amongst many other things, listening to your heart and following your dreams. The story takes several twists, but in the grand scheme of things the book itself is a representation of the circle of life. And once you've read it, you will see why the saying 'its not the end results that matter, but the journey' holds true.

Although the book was first published in 1988, the story itself is set in a period much earlier in the history of spain and the middle-east. The book starts off with our young hero, Santagio, a poor shephard boy sleeping the night in a run down barn with his sheep, in Andalusia, southern Spain.

A recurring dream about gold and treasure takes the boy to a local gypsy who intrepretes the dream at the cost of a small share of the treasure, should the boy find it. There is a strong sense of belief in omens and 'the language of the universe' - the ability for all things to communicate via signs, symbols and timely actions. This intrepetation takes the boy on a journey to the Egyptian pyramids, along which he meets many new and interesting people, some of which are helpful on his quest - and a few who turn out to have a shady disposition.

Towards the end of the book, the boy meeets the alchemist who teaches him the final lessons Santiago needs on his journey to find his own destiny. The boy's understanding of the universe around him and the ability to speak the language of the universe and to communicate to the soul of the world, really brings home the message, that when the boy really desires his treasure, all the forces of the universe conspire to help him achieve it. I shant spoil the ending for you, as things do not always have a happy ending with Paulo Cohelo's writing.

This can easily be described as my favourite book and with good reason too, the book reads almost like an inspirational parable or a self help book. There were some recent speculation about the book being turned into a film, but I find it hard to see how any amount of direction can best such a masterpiece in the transition from the written word to on screen visuals.

 

I give this book a 5/5, it is definitely worth a read. 




Sunday, 5 February 2012

Installing Custom Android ROMs

My previous post discussed why and how to root your android phone.
An even older post looked at a test run of Android Ice Cream Sandwich

Do you want a more feature-rich, customisable, faster, better Android? Read on... 

Android phones are designed so that the Android system resides on what is called Read Only Memory (ROM), however once you have rooted your phone, (links to instructions can be found at the top of the article), you now have permission to overwrite the ROM on your phone. You will have to check online to see what ROM images are available for particular make and model of phone. There are hundreds of different ROM's floating around the Internet providing many different features. 

I have an 18 month old HTC desire and recently found an Android 4.0 ROM for it, with a few features cut back, which made my phone a lot faster and aesthetic, so I put that on just to give it a quick test run. But alas it is not stable and until it is, I am going to go for perhaps the most recommended and best supported custom ROM available, Cyanogenmod

As always, take precaution and back up your data. Upgrading the the ROM on your device will void your warranty and may cause hardware issues. Please research your specific make and model carefully to see if anyone else has had problems rooting and installing a ROM, as I cannot be held liable should anything go wrong. 

1. Research and get your ROM 
The very first thing I would suggest you do is to research a little about your device, see how well it is supported and if anyone has run into any issues whilst upgrading it. Cyanogenmod supports a huge number of phones and has an excellent wiki and forum. 

Next your phone needs to be rooted, so go and make sure you do that. A great resource for researching phone and ROM issues is the XDA developers forum

Go to the homepage for your ROM of choice and download the .zip file for the ROM for your phone and read any instructions/warnings provided. 

2. Install ROM Manager 
You will need to install ROM Manager from the android market, this is an app that lets you make backups of your ROM image and install new ROMs. Once installed, you will want to select the option to ‘Flash ClockworkMod Recovery’ - this is a lifesaver if the ROM does not install properly as it provides an interface to install ROMs and so on, before booting into the ROM (for my phone, I power down the phone and power back up whilst holding the volume-down button to access the hidden console, it should be the same for you but may vary depending on make and model). Google up on Clockworkmod recovery should you need to use it (hopefully you wont). 

3. Backup 
Backup!
At this point, and I cannot emphasise this enough, you need to backup your personal data - Flashing a ROM on your phone wipes out everything! Photo’s, videos, music, notes, contacts and any other files you put on your phone. This was quite easy for me, since most of my data (calendar/docs/contacts) is synced automatically to my google account and my multimedia synced with my dropbox. No cables needed :) 

It is also a good idea to backup a snapshot of your phones state (called a Nand backup) from within ROM manager; select ‘Backup Current ROM’ - this will make a byte for byte copy of your current ROM image from which you can restore your phone should things not go to plan. You will at this point want to connect your phone to your computer via USB cable and copy that backup folder to somewhere safe on your computer. 

4. Install the new ROM 
I wont cover formatting your SD card here, as Cyanogenmod doesn't require any complex partitioning to install, even for its apps2sd feature - but should you decide to install another ROM that does, use the ROM Managers partitioning feature - this will erase all data on the SD card. 

With your phone connected to your computer, copy the ROM zip file to the top level folder on your SD card. Finally using the ROM Manager, select ‘install ROM from SD card’ and choose your ROM, and let it do its thing. This may take a few minutes and then the first boot will take a few more minutes - but the wait will be worth it.


As always comments are welcome, let us know your thoughts on installing a custom ROM and about any problems, issues or successes you faced. 

Viva la Android - or rather ‘viva la Cyanogenmod!’

Tuesday, 31 January 2012

Rooting Android

My previous post on testing Android 4.0 generated a huge buzz (huge for this blog), so I thought I'd follow up on how to begin rooting and customising your phone

Warning: If you choose to root your phone, unlock the bootloader or install a custom ROM on it, be forewarned -  there is a minute chance that something may go wrong. Backing up your data is not optional, it is mandatory. Do it now, then backup your backup, and make a backup of that too. Also, this WILL void your warranty.

What is rooting and why I should do it?
Rooting (Apple users read: Jailbreak) is a term used to denote taking administrative control of your phone. A smart phone is akin to a modern computer, in that it has an Operating System and user accounts and account permissions that stop you from reading certain files and writing certain files - just as Microsoft windows or any other operating system does. Typically when your phone is switched on your logged in automatically (very much like a computer, without a login screen) to a normal user account, with a fwe restrictions on what parts of the phone you can make changes to. So gaining Root is like logging in to your phone with the admin account, you have full control of it and you can read system files and overwrite them - which will let us do some cool things, as we will see soon enough.

How is it done?
Typically someone has written a program for you, which you will download and put on your PC or laptop, then you connect your phone to your computer and and run the downloaded program. What happens in the background is the PC will run a (kind of) malicious program on your phone, that exploits a bug or flaw on your phone (this varies according to make and model of phone). But the exploit essentially grants higher privileges to whatever account is using the phone.

How is it done (step-by-step)?
I have used a few rooting applications and have had great success with unrevoked and revolutionary. Other tools to consider are SuperOneClick and UnlockRoot. UnlockRoot seems to support the most number of phones, so you may just want to stick with that. But read the forums to see if your chosen application supports your phone

HTC Super Tool - a great tool, designed just for HTC phones
Now, you will need USB drivers for your phone from the manufacturers website. In most cases, your phone will come with a CD with the drivers on it. Just google for the drivers if you do not have the CD.





 Next you will need to go to your phones settings menu and enable USB debugging, which for my phone is under Settings > Applications > Development

Enabling USB debugging mode
Connect the phone to your computer via the USB cable, run the program and your phone is now rooted.

So, what now?
Well with a rooted phone you have admin priveleges, so theres quite a bit you can do:
Install a custom ROM on there, to get additional features.
Overclock your phone to speed it up
Underclock the phone to conserve battery
Tether your data connection
Remove annoying pre-installed apps
Setup VPN and or TOR and other security features
plus loads more....

Next time I will walk you through downloading and installing a custom ROM for your phone. Ciao.

Sunday, 29 January 2012

A taste of Ice Cream Sandwich

Its no secret that I am a fan of Android, I like all things android. The open culture, the price, the apps, the ease of building for the system and the ability to mod the software and hardware to my hearts content. No other mobile platform provides any serious hacker with the ability to tinker with the system as much as Android does.

Sure, it has drawbacks too, and at some point in a future article, it would be good to compare the strengths and weaknesses of Android versus other mobile OS's.

Well anyhow, my HTC Desire GSM from mid 2010 was running the leedroid ROM for some time (I chose Leedroid after having experimented with both cyanogenmod and leedroid and decided I prefered the aesthetics of HTC sense). The stock ROM that came with my HTC desire didnt support moving apps to SD card, hence I decided to root the device and put a ROM on there that would allow me to install lots of apps without complaining about space. Leedroid had come to the end of its life, as there had been no update for a few months plus my phone was getting clogged up and needed some spring cleaning. So I thought I'd investigate what the Ice Cream Sandwich buzz was all about.

After a short google search, I found a beta version of ICS for the HTC desire. Stability was not promised, but I figured I would give it a go. Installation was easy as my phone was rooted, all I had to do was put the zip file on my SD card and boot into recovery and install it.

After a short while of playing around with it, I found that the new interface was a very welcome addition. The features that I liked best:
  • Lockscreen - can open up certain apps, like text messaging directly, so it saves a few taps on the screen, if u receive a message and want to check it.
  • Updated Marketplace - The new interface looks very nice, although the pricing for some of the content was disagreeable - classic books for example were pretty expensive, compared to what is available for free on project gutenberg.
  • Notification bar - This was pretty awesome. It lets you control many features of your phone directly, like sounds, music player, data connectivity as well as lets you see the notifications and clear them out with a very innovative slide (shame apple ripped this off completely for iOS5 and are now suing android for tonnes of other patent breaches)
  • Voice - The voice search is vastly improved and well integrated into the OS.
  • Interface lift - The interface was given a much needed uplift (so much that the default ICS interface pars well with HTC sense, my long time favourite look for android) - it has awesome animations, subtle interface tweaks and is so much smoother than before.
  • Settings - This part of the OS recieved a lot of love from the developers, and now includes a data monitoring section (I will be very sorry to see 3G watchdog go from my phone). Battery and memory information has nice graphical data to display usage, which is quite aesthtic.
Ive added a few screenshots of my experimentation below (click to enlarge thumbnails), for the full set of images, visit the album on my google+ account.

Overall, the new interface was much to my liking, the beta version meant that there were a few crashes, especially the camera app - which managed to take 2 pictures before crashing. I dont think this is ready for day to day usage, but its clearly on the way. Id be more than happy to put a more stable version on this and use it for a little longer, before making the jump to a newer handset.

For more details on how to install and run this yourself, use the comments below to direct specific questions at me.

I'll try and get a video of this up and running soon.

Friday, 20 January 2012

CLKF: Splitting files in linux

Command Line Kung Fu: Splitting files in linux

So I have a flash drive thats pretty irrevocably damaged, and for some reason or another it wont format into NTFS, but happily formats into FAT32 (exFAT is an option that I chose to ignore). And I have a 4.4GB file to transfer.

We all know that storing a file larger than 4GB is not possible on a partition formatted in FAT32 (which is a pretty old Microsoft file system type, when no-one actually had files larger than a few megabytes, now superseded by NTFS in an age when video files, Operating System images and games come at several Gigabytes in size, and a Terabyte is becoming the norm for any PC sold); In any case the solution to this problem was to split the large file into several smaller chunks that would fit on the drive or several drives.


There is a whole heap of tools available to this end, both freeware and commercial. A quick search on google reveals that the choices available are numerous. Any compression program (7Zip ftw!) does file splitting too. What I want is a command line tool, that will do the task as minimalistically as possible.

One of the original linux tools created for this purpose was 'tar', which stands for Tape ARchive, which is able to bundle a file or a collection of files into one (or several) file (essentially a precursor for ZIP without compression) ready to be stored on what was the best form of backup medium in those days, magnetic tape.

So using tar on the command line, heres how to split a file up:

$ tar -cvM --tape-length=1024000 --file=OUTPUT_FILE1.tar ORIGINAL_FILE

The --tape-length parameter accepts data in kilobytes, so 1024000 = 1GB. Just keep entering sequential filenames when it asks for another filename for each part it creates.
And to join files back up:


$ tar -xvM --file=INPUT_FILE1.tar ORIGINAL_FILE


So that works, but it isn't the most simplistic solution; there is also the much more simpler, split and cat commands:


$ split -b 1024m debian.iso debiansplit


and then when I had to join the files back:


$ cat debiansplit* > debian.iso


split command (click to enlarge)


Some more awesome Command Line Kung Fu to the rescue!





Wednesday, 18 January 2012

On the Wikipedia Blackout, SOPA, PIPA and Firebug

So this SOPA and PIPA thing is threatening the Freedom of people across the globe and people are making their voices heard. I'm one of the ones that believe that the internet should remain free, and I think its important for awareness of this evil vile act to be propagated. GoDaddy got slated a few weeks back as thousands of customers left and changed domain providers (I didnt change my domains held by them, but im just going to let them expire since I no longer need them), and now Wikipedia is making a stand, great.


However during the course of the day I came to realise how much Wikipedia really means to me. I've never contributed a single article to the site but I use it on a frequent basis. So frequent that I panicked at the loss of Wikipedia for 24 hours.


With a heavy heart and the pain and loss of Wikipedia urging me to do something, I decided to investigate how the blackout was created. Assuming its for 24 hours only, it would make sense for the designers to add some sort of CSS trick to overlay the blackout image over the normal content. So that come tomorrow morning they could remove the said CSS code and have the site return to normal.



I investigated this angle using the good old 'firebug' add-on for firefox. This is an invaluable tool for any person interested in web development or design, and I have been a faithful user since 2007. Lo and behold, the code showed the addition of some 'display: none' css styles for the content and the addition of a new Div element that overlays the entire page with the SOPA message. The solution for quick access? Change the content div style to 'display:block' and the sopaOverlay div to 'display:none'. (Click on images to enlarge)


Although this gave me access to a single wikipedia page, the larger issue at hand regarding SOPA and any similar law's still remains unresolved. Here's hoping that freedom is handed back to the people. Happy CSS Hacking!

Friday, 30 December 2011

Command Line Kung Fu

Recently I had to migrate hard drives, due to a disappointing Samsung Spinfoint F3 hard drive failure (this is the second Samsung F3 1TB hard drive that I've had, thats gone on to meet its maker). This drive wasn't fully dead, and I figured I'd take what I could whilst it was on its last leg. Thanks in part due to Amazons speedy delivery of  a 2TB Seagate Barracuda Eco-Green Sata 3 (6Gb/s) drive.

Now in my opinion, windows copy and paste, just doesn't cut it for copying large files. It may say it has copied the files but I have had MD5 hashes fail before, and given that this hard drive wasn't performing optimally I just didnt want to risk copying and then pasting corrupt data. I usually prefer copying from the command line as I find it a bit more effective.

There are win32 versions of md5 hash checking programs available, but doing singular hash checks sucks when you have multiple files in multiple folders, hidden in multiple depths. I needed a recursive program to check md5 sums for files with certain extensions only... hmmmn.

Batch file with some sort of for loop? Nah, since every windows box I have has a copy of the excellent cygwin program installed, why not go all out and do it the linux way? I mean I have the Bash shell, with a whole load of unix utilies installed on the computer, including md5sum; So ladies and gentlemen, I now produce below, for your perusal, the extravagant single liner I used to alleviate my problems (not all of them, mind you, I still have to claim on my Samsung's warranty, but this command solved one of my many problems):

#find ./ -maxdepth 5 -type f -name "*.iso" -exec md5sum {} \;

This should ideally be piped into some sort of text file for comparision to the source, to ensure that the files were copied exactly bit-for-bit as opposed to a logical copy. Cygwins 'cp' command outdid windows default file copy routines, since all of the md5 hashes checked out. Attached is a screenshot of the sort of output this command produces. (Click to see enlarged version)

Once again, some awesome Command Line Kung Fu saves the day. Happy new year!

I should point out a few things here:

Cygwin is a great tool, built upon greater tools with some excellent  (and ancient) Unix heritage.

Windows 'just works' most of the time, perhaps the file copy errors were hardware faults (i.e. temperature, seek speeds, time of day) - so this is by no means a comprehensive or fair experiment.

I'm aware there is a utility (with a cygwin port) called md5deep, but it wouldn't search recursively for .iso files. Their 'man' page states 'Please note that recursive mode cannot be used to examine all files of a given file extension'.

And finally Samsungs spinpoint drives have recieved some excellent reviews, I was perhaps unlucky with 2 faulty drives (bought at different times), dont let this put you off Samsungs hard drives, they are an awesome company coming up with some awesome products (foreshame on Apple for trying to stall competition in court by some very underhanded techniques against Samsung).