Download youtube videos to your computer on Linux

YouTubeYoutube is by far the most popular site for sharing videos. The only problem with uploading your videos to youtube is that there really is no easy way to download those videos back to your computer. Your only option than is to view them online. There are also times when you watch a video so hilarious/interesting that you want to keep a copy for your own use.

To get over these restrictions, a lot of people have written really neat utilities which let the user download videos directly from the site. In this post, we’ll be talking about one such utility for Linux.

Youtube-dl

Youtube-dl is a console only application which is the simplest utility I’ve found till now for downloading videos from youtube.

To install youtube-dl, if you’re using Ubuntu, use apt-get.

apt-get install youtube-dl

Now, using a browser, browse to the video that you want to download. Copy the URL of the video page.

Now, at the console, give the following command.

youtube-dl <URL of the video>

Youtube-dl

That’s all. youtube-dl will now download the video to your computer and save it in the default .flv format which Youtube uses to save it’s videos. FLV files can be easily played back on Linux using the excellent VLC media player.

How to create a secure and private network

hamachiPicture this – You’re out on the road for work or pleasure and have this sudden urge to listen to that one song from your collection which is stored on your desktop back at home. Or you’re a freelancer and need access the draft proposal you made for a client which is again on your desktop sitting in your home office.

You can’t keep your desktop or other machines at home exposed to the outside world over the Internet, because, franklt speaking, it’s a dangerous world out there. But you still need safe and easy (and secure) access to all your data. How do you do that ? Did someone say – “Create a VPN!”

Enter Hamachi.

Continue reading “How to create a secure and private network”

How to schedule tasks in GNOME using gnome-schedule

gnomeMost Linux/Unix veterans use cron to schedule tasks on their machines and it is a very powerful utility for what it does.

The problem with cron is the cryptic syntax which tends to scare away most new users and the fact that a user has to use the terminal to create a new job.

In this tutorial we will explain how to use a graphical front end to cron, called gnome-schedule.

Continue reading “How to schedule tasks in GNOME using gnome-schedule”

Elisa – Open Source Cross platform Media center

Elisa media center Ellisa is an open source media center that can play DVDs, VCDs, video files and even display your photos. The support for video files is extensive and the player can handle almost any video that you might throw at it.

Elisa is extensible and is based on a very neat plugin architecture, which means that if there are features that you miss from the default install, they’re usually just a plugin away.

In the true spirit of open source, Elisa is available for both Linux and Windows with a Mac OS X port on the way.

Continue reading “Elisa – Open Source Cross platform Media center”

Play Space Invaders in Openoffice Calc

OpenOffice LogoWho said open source developers were a boring bunch of people. I’m quite sure that person hasn’t met the developers of Calc.

For those of you who’ve been living under a rock until now, Calc is the Spreadsheet part of the OpenOffice.org suite and today we are going to unearth a very cool easter egg game programmed within Calc by the developers.

Open a Calc Spreadsheet and type =GAME(“StarWars”) into any cell. The text should be typed exactly as written.

Continue reading “Play Space Invaders in Openoffice Calc”

Create rounded corners for DIV elements using Javascript

curvyCornersMost websites these days use rounded corners for almost all website elements. Creating rounded corners isn’t easy since it requires creating perfectly aligned images and well, you need to be a photoshop or a GIMP ninja, which I’m definitely not.

So, I went looking for a better solution and found a Javascript which would do the same for me.

Continue reading “Create rounded corners for DIV elements using Javascript”

How to install *.rpm files in Ubuntu

UbuntuUbuntu (and all Debian based) distributions use the .deb format for application packages and these days most developers writing applications for Linux provide a .deb package.

But, even then there might be times when you want to install an application which is available only in the .rpm format. If you use Ubuntu or any other Debian distribution, Alien might be able to help you.

Alien is a program that converts between the rpm, dep, stampede slp, and slackware tgz file formats. If you want to use a package from another distribution than the one you have installed on your system, you can use alien to convert it to your preferred package format and install it.

Alien is available in the Ubuntu repository so you can install it by using the following command

$ sudo apt-get install alien

To convert an rpm file to deb, use the following command

$ alien -d -k package.rpm

Where package.rpm is the rpm package that you want to convert. The ‘-k’ option is to tell alien to keep the same version number on the resulting .deb as the rpm file.

Alien can also convert .deb packages to .rpm and the command to do that is

$ alien -r package.deb

Where package.deb is the deb package that you want to convert.

Disable spatial mode in GNOME’s Nautilus file browser

gnomeI’m a big GNOME fan and have been using it ever since it was first released.

Ofcourse, like all software, not all is good with the GNOME project also and some of the decisions made by the developers are just plain absurd to me. One such decision was making the Spatial mode on Nautilus as the default.

Nautilus, for those not familiar with it, is the default file browser/manager bundled with GNOME and the spatial mode basically means that each folder or file opens in a window of its own. There are other advantages to the spatial mode, I agree, but this is the one that I found the most irritating.

Nautilus Spatial mode

To make Nautilus behave and get rid of the spatial mode, open the gconf-editor application from the run menu and browse to the following key: apps -> Nautilus -> Preferences

Now, check the always_user_browser property.

gconf editor

That’s all. Now, go ahead and enjoy Nautilus and GNOME the way they’re meant to be.

Nautilus

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.