Clone an Ubuntu system using Synaptic Markings

synaptic logoHow many times have you had to reinstall the OS on your computer and then had to install all your favorite pieces of software by hand. I’m sure it’s quite painful. And even more so when you forget to install a couple of software and then have to install them in a crunch when you need them the most.

The Synaptic Package Manager bundled with Ubuntu (and available for Debian and most other debian based distributions) has a very cool solution. Synaptic is a graphical package manager for debian based distributions and is the default package manager installed for Ubuntu and is quite popular on that platform.

Synaptic lets the user export (and import) a file which contains details of all the software that is installed on the system.

Continue reading “Clone an Ubuntu system using Synaptic Markings”

How To Recover data from an iPhone backup

My sister lost her iPhone a couple of days back and with that all her contacts, notes and calender entries that she had painstakingly stored on the device.

iphone

Her only hope of getting all that important data back was the backup that she had taken a couple of days earlier and she asked me to help her out.

This was my first time dealing with an iPhone backup and I didn’t know where to get started trying to recover data from the backup.

Well, truth be told. The iPhone is not the most open among gadgets. And it isn’t easy to get your data off it. Apple has tried it’s best to hide any iPhone related information from the user’s view. And they have succeeded to an extent, atleast the primary consumers of Apple’s goods don’t really care where (or more importantly, how) the data is stored, as long as Apple provides an application to access it.

In the iPhone’s case, the application is iTunes and the only way to put this data back on to the device is to use iTunes … unless you know where to look for it.

On a computer running windows vista, the data backup is stored in the following location:

C:\Documents and Settings\USERNAME\Application Data\Apple Computer\MobileSync\Backup

Under the backup directory, you will see a directory which looks like a unique ID. This is the directory in which the backup is created, everytime you backup your iPhone using iTunes.

In this directory, you will see a number of files with the *.mdbackup extension.

The .mdbackup files are the actual backups of all the applications and settings of your iPhone. So, the first thing you should be doing is, make a backup of these files :-)

If you use an editor to view these files right now, all you’ll see is garbage, cause these are not text files. They are what Apple calls Binary plists. And to decrypt them, you ideally need a Mac and this utility.

I used the command line version of the utility since I only had console access to a mac and that worked for me.

I first copied all the *.mdbackup files, that I had collected from the iTunes backup folder, to the Mac and ran the following command to zero in on the files that actually had any useful data. I was the most interested in the Contacts data, so that’s what I searched for first.

grep ‘AddressBook’ *.mdbackup

AddressBook is the name of the application which stores, well, address book data on an iPhone. It is only named Contacts in the interface. The actual application name is AddressBook and when I searched for that string in the backup files, I got three files as a result.

I opened the first file using a text editor and it turned out to be the one I was interested in. The word AddressBook is in the beginning of this binary file and it also mentions the database name, where all the data is stored. Yay !

iphone backup

So, now to get to that data base file, we need to use the decoding utility that we downloaded earlier.

decode iphone

So, we’ve got our database file. The decode iphone utility will put it in the following folder structure

/Users/<username>/MobileSyncExport/Library/AddressBook/

Open the database with the following command:

sqlite3 AddressBook.sqlite

and you’ll be dropped to the sqlite prompt. At this point, you need to understand the schema of this database a bit before you can proceed further. Give “.tables” command and you should see the following output.

iphone backup database tables

At this point, I had to use a bit of trial and error to figure out which table holds what data. To view the schema of a particular table you can use the following command.

.schema <table name>

Using this command on the ABPerson table gave me the following result.

iphone schema

There was other information also, but this is basically what I was interested in. So, this particular table was all the information about the a Person, except the phone number. To look for the phone number, I had to look at another table – ABMultiValue. And the two tables are linked through the ROWID and record_id fields in the ABPerson and ABMultiValue tables respectively.

It turns out that the ABMultiValue tables lists all the phone numbers and a quick “select * from ABMultiValue” gave me the answer I was looking for. So, now I finally know where all the data is. To collect all the data in a single place, I used the following SQL query.

select ABPerson.first,ABPerson.last,ABMultiValue.value from ABPerson,ABMultiValue where ABMultiValue.record_id=ABPerson.ROWID

Once I’d confirmed that this was indeed the correct data, I gave the following command on the sqlite prompt

.output backup.txt

That made sqlite put all output into the backup.txt text file rather than the console. And I was set. Ran the above select statement once again and I had all the phone numbers in a nice text file.

How was that for a weekend project, eh ?

In a future post, we’ll talk about taking out the notes and Calender entries from a backup file. The procedure is almost the same, so if you guys can figure it out yourself till then, post the solution in the comments.

Control firefox with the keyboard using ubiquity

UbiquityWell, actually, Ubiquity can do a lot more.

Ubiquity is a firefox extesion that is can really only be described as a launcher for the Internet, integrated with the web browser, which in this case is Firefox. Confused ?

Well, Let me explain. Ubiquity allows you to use your keyboard to give commands to the browser that’ll let you do anything that you would otherwise use the mouse for. So, for example, if you want to search for something using google. You can Just use the keyboard to instruct ubiquity to do that for you. If you want to search amazon for the latest gadgets, Ubiquity can do that too.

Ubiquity is like Quicksilver (or GNOME Do, if you’re so inclined) for the Internet browser.

To get started with Ubiquity, Install it from this location.

Continue reading “Control firefox with the keyboard using ubiquity”

Zim – Desktop based wiki for Linux

Zim - Desktop WikiApplications to help you take and organize notes on your computer are available dime-a-dozen. Linux purists will, ofcourse, give their vote to text editors such as Vim or Emacs but there are also applications such as Tomboy and BasKet available for the non-geeky users that make taking and organizing notes on Linux a breeze.

Ofcourse, taking things a bit further, using a wiki as a note taking tool sounds like a great idea and depending on your usage, might even prove to be a better solution than the general purpose note taking applications that we’ve mentioned above.

Zim - Desktop wiki

Continue reading “Zim – Desktop based wiki for Linux”

Configure Remote Access to your Ubuntu Desktop

ubuntu Ever tried helping your non-technical friends with their computer problems over phone. If yes, you know how irritating that can be. To solve the problem, Microsoft added an option to one of the Win XP service packs to let remote users take control of your system and made troubleshooting Windows systems much easier.

Microsoft on their part also heavily promoted this new feature and made it seem like something out of a Harry Potter novel.

Linux and cousins have had some kind of VNC server always installed to control remote desktops, but there was never a good GUI option to configure the VNC service. Ubuntu changed that.

Ubuntu has made configuring remote access to the desktop a breeze.

Continue reading “Configure Remote Access to your Ubuntu Desktop”