tEcHrAjEsH's sPaCe

my life within and outside computers…

Resize images from the command line !!

Have you ever found yourself in a trouble of opening softwares such as GIMP even to just resize a single image? This holds very true for me as I regularly upload my images from cameras and other devices into blogs and social engineering websites such as facebook, hi5 and uploading the original image directly can demand a lot of upload bandwidth. So why not just resize the image to about 75 or 50 % of the original and upload onto the websites which consequently does no bad to overall image quality.

For doing this, programs such as GIMP and other image editing tools may not be the best method due to their high memory consumption. So I have come across a very handy command-line tool available for performing this task, and it is called “imagemagick”. In order to install this, type the following code in the terminal:

sudo apt-get install imagemagick

Once installed, you can now resize any image just by writing a line in the terminal. Let us suppose you want to resize an image named “image_large.jpg” to 50% of its original size and name the resized image to “image_resized.jpg”. For doing this, in the terminal, type the following code:

convert -resize 50% image_large.jpg image_resized.jpg

If the image you want to resize is located in the desktop, you should give the path accordingly. The following command does the job for this:

convert -resize 50% /home/user/Desktop/image_large.jpg /home/user/Desktop/image_resized.jpg

Note that the file named “image_resized.jpg” is the new resized file and can be given any name according to your choice.

You can even resize the image to the size greater than the original by giving attributes such as 120% or anything like that, but doing so may reduce the quality of the resized image.

This is how I normally resize my images as it not only saves time but also becomes helpful when you have a low configuration desktop which finds programs such as GIMP to run very hard. If you have any better way of resizing images, please share them in the comments section below.

August 4, 2009 Posted by techrajesh | How to, Tips and Tricks, Ubuntu, linux | , , | 1 Comment

Linux/FOSS cool sTiCkErS….go get ‘em all !

If you are a GNU/Linux fan, the first thing you would  like to do is to reflect your passion for Linux and FOSS in your PC, in your laptop, in your bags, and what else…in everything you could possibly possess. Though it depends upon your choices, but me being a die-hard fan of Linux, I can’t  help myself doing such insane things.

So here’s a good news for all Linux fans. Here later in this post I have provided link to the best Linux/FOSS stickers you could possibly imagine of. There are two whole books of these stickers and trust me, I can’t wait to get them printed ASAP. There is atleast a sticker for every person here, be it a GIMP user, a firefox die hard, a Python addicted, Gentoo users, Ubuntu users, Open Suse users, stickers showing penguin, stickers with Torvalds and Stallman, stickers with 4 freedom laws and the list never seems to come to an end. So explore all of them, and Print It Yourself (PIY)…

L I N U X / F O S S   S T I C K E R S  B O O K  –1

L I N U X / F O S S   S T I C K E R S  B O O K  –2

P.S  Each sticker book is a 10 MB file in ‘odg’ format which needs OpenOffice.org to open.

July 20, 2009 Posted by techrajesh | Tips and Tricks, Ubuntu, linux | , , , , | No Comments Yet

Download YouTube videos : the easiest way !

Things become usually easy if you are an open-source user and for Firefox users, this is not an exception. Thousands of extensions and add-ons that can be integrated in the Firefox browser makes it the best browser for quite some years now and others seem no way near.
Now let me focus the light on the main topic, i.e. downloading YouTube videos in a go using Firefox. All you need to do is install an add-on called GreaseMonkey on Firefox, which can be downloaded HERE. After you are done, restart Firefox. A small GreaseMonkey icon appears at the bottom right of your browser which means the add-on has been installed. Now follow THIS link in your browser and click “Install” which appears at the top right corner of the page. In doing so, a userscript called “Downlaod YouTube videos” is installed inside your GreaseMonkey add-on such that whenever you open any video on the YouTube page, a download option (mp4, 3gp or flv) will be integrated in the YouTube page itself. Select the extension of your choice and you are ready to download your favourite video from the site.
This method is one of the most easiest way to download YouTube videos as the download option is integrated in the YouTube page itself, eradicating the need of third-party download managers.

So, enjoy downloading !!

July 6, 2009 Posted by techrajesh | Firefox, How to, Tips and Tricks | , , , | 1 Comment

Backup your installed linux apps with AptOnCD

Every time I installed a new distro (debian based) in my system, the very first thing that concerned me was installling all those applications and packages from scratch. I used to wonder whether there is an application which would backup all my installed packages in a file and later allow me to restore it in a new system. Then suddenly I stumbled upon an application called AptOnCD which exactly works in the same fashion I used to wonder.

AptOnCD, a deb package which can be downloaded HERE backups all your installed packages (deb files) and their dependencies into a CD, DVD or an ISO image such that if you happen to crash your OS or meanwhile do a fresh install of your distro, you can restore all those packages without the need of an internet connection. Moreover, you do not need to remember what all packages you had installed in your system to replicate it to new system ( I remember myself noting down all the important packages’ name prior to performing a fresh install Ubuntu :P ). The only thing you need to install in your new system before restoring the iso image is AptOnCD application itself and from there, you can restore all your packages by pointing to the iso image where you had earlier stored (removable storage would be the best option to store) and clicking restore.

P.S.After installing the AptOnCD, you can run the application either from System>Adminstration>AptOnCD or in the terminal, type “aptoncd” (without quotes). It is a good idea to backup the aptoncd.deb package which you downloaded from above link in order to avoid the hassle of downloading it again from the new system.

So, do you have any better way of backing up your installed applications in Linux, if yes, please share in the comments below !!!

June 27, 2009 Posted by techrajesh | How to, Tips and Tricks, Ubuntu, linux | , | 1 Comment

Tweet via linux terminal : the geek way

Do you work most of the time via terminal? Do you hardlay get chance to switch to GUI from CLI?  Do you want to look like geek working in terminal even to tweet ur posts? Yes, there is a way now to do it. Below is a step by step instruction on how to do that:

Install a package called Curl (for Debian/Ubuntu) with the command

sudo apt-get install curl

Then, create a file named ‘twitter’ in /usr/bin using the command.

gedit /usr/bin/twitter

Now in the file ‘twitter’, paste the below code by replacing yourusername and yourpassword with your actual twitter username and password respectively.

curl –basic –user “yourusername:yourpasswd” –data-ascii “status=`echo $@|tr ‘ ‘ ‘+’`” “http://twitter.com/statuses/update.json” -o /dev/null; echo Message Sent!

Now give the file executable permission by using the command:

sudo chmod +x /usr/bin/twitter

Thats it. You’re done. Just start tweeting now in the command line by typing twitter{space}{your message}

My first command like tweet reads like:

techrajesh@techrajesh-laptop:~$ twitter my first command line tweet! For command line tweeting, vist www.techrajesh.wordpress.com

What did your first command line tweet read like?

June 21, 2009 Posted by techrajesh | How to, Social Engineering, Tips and Tricks, Ubuntu | , , , , | 2 Comments

How to remove quiz and games notifications from your Facebook page

I was fed up with all those crappy quizzes and games notification in my facebook page. Whenever i logged in to my facebook page, those annoying quizzes notifications were the first ones to appear, so i decided to get rid of it and started my hunt. This is what i found and let me share it with all you guys.

First of all, you need to be a Firefox user to do this. Under firefox, install an add-on called GreaseMonkey. Once installed a small icon will appear on the status bar of your browser. Next, you need to install the Facebook Purity Script for the GreaseMonkey. Then make sure that both the GreaseMonkey and Facebook Purity Script is enabled by right clicking the icon in the status bar and checking the “manage user scripts” option. Once done, open your Facebook page and see the results. The greasemonkey script “Facebook Purity Script” removes all the third pary application’s notifications  such as quizzes and games created by external developers leaving behind your original notifications about status, messages, comments and so on. Now the facebook becomes pure as it should be.

P.S. Facebook Account Settings always do not have the option to strongly disable these third party notifications, so this script for GreaseMonkey really gets the job done. If you have any better ways to do so, please respond in comments below.

June 17, 2009 Posted by techrajesh | How to, Social Engineering | , , | No Comments Yet

12 Useful but almost Unknown Linux commands

This post is especially targetted for new Linux users focussing on some of the most useful Linux commands which can come handy in different situations. So the list goes something like this:

$ df -h   #Displays the hard disk space usage

$ killall [app_name] #Kills a running application by its name

$ whereis [app_name] #Displays the installation directory of any application

$ sudo !! #Runs the last entered command as root

$ ping -i 60 -a [ip address] #Makes an alarm when an ip address goes online

$ mount /path/to/file.iso /mnt/cdrom -o loop #Mounts an iso file into cdrom

$ free -m #Displays free and used RAM

$ whoami #Displays current user

$ uname -a #Displays computer name and OS information including the kernel version

$ ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq /tmp/out.mpg #Records your desktop

$ ls /dev/disk/by-uuid/ -alh #Finds Universal Unique Identifier (UUID) of your partitions

$ history #Displays a list of previously typed commands

June 16, 2009 Posted by techrajesh | linux | , , | 4 Comments

Reset windows administrative password using “Ubuntu”

If you or your friends have lost your windows administrative password, there is a simple hack using ubuntu to reset it back. Although there are various methods of doing this using windows boot cd and other options, but Linux has a simpler and more effective way of doing this.
If you have a dual boot system with Ubuntu and Windows (whose password is to be reset), then just boot from Ubuntu and install a package called chntpw from the terminal using the command:

$ sudo apt-get install chntpw

The windows partition should be already mounted into /media and in terminal, change your path to ‘WINDOWS/system32/config’. Once you are in the config directory in terminal, use the command:

$ sudo chntpw SAM

After you do so, there will be some description text which should not bother you at all. At the end in order to reset the password to blank, press * and click enter. Thats it, you’re done. Now just restart your computer and reboot from Windows.

In case you have no Ubuntu installed in your machine, that’s not a problem. Even an Ubuntu Live CD can work in this case. Just boot from Ubuntu Live CD and follow the above process.

June 15, 2009 Posted by techrajesh | How to, Tips and Tricks, Ubuntu, linux | | No Comments Yet

3.0 Software update for iPod Touch and iPhone

Yes, the long awaited Apple OS update for its dominating gadgets – iPod Touch and iPhone is soon to be announced. This crucial software update patches some annoyances residing in iPod/iPhone and contains some cool features which makes watching videos, playing games and listening to music even more fun and exciting.
The major feature and attraction of 3.0 software is the allowance of “copy, cut, paste” not only between applications, but also within a block of text in a webpage or email. This was badly missed in the previous version of the software but now with that feature enabled, this is just another reason to love your iPod Touch or iPhone. Also the “landscape keyboard” which was not activated in most of the applications gets activated as soon as you rotate your iPod/iPhone. So give your fingers some space now (because i remember typing with a single finger as there was no room for fingers to fit in the portrait keyboard in the earlier version) and type more quickly to write emails and chat with friends. “Stereo Bluetooth” is another hidden feature that the 3.0 software update is about to reveal. With this, you can connect your iPod/iPhone wirelesslely to bluetooth stereo headphones. No more messy wires if you don’t like with this new bluetooth feature uncovered. And now, with the 3.0 software update, you have a search engine for your iPod (just like the Desktop Search in PC) and this is called “Spotlight Search“. With this, you can now search for all your music, videos, contacts, notes, emails from a single spot.
Apart from these noteworthy features, the 3.0 software update has other miscellaneous addons such as parental controls, automatic wifi login, push notifications, shake to shuffle, sync notes, safari enhancements and others.

So all these powerful features and updates to boost your iPod/iPhone will cost you just under $10. I am updating mine on the day of release (which is on 17 June). When are you updating yours?

June 9, 2009 Posted by techrajesh | Apple, iPod Touch and iPhone, wifi | | 5 Comments

bing&google at the same time !!!

Most of us must have been aware that Microsoft has come with a new search engine -  BING !!! But what if you need to compare your search results generated by the new search engine to that of the pre-established search giant -  GOOGLE . As i was just going through my daily browsing, I stumbled upon a cool service called BingAndGoogle. This service offers a combined interface from both Bing and Google such that, you can compare your search results in the same windows side by side. Both the results are displayed in two columns which not only makes comparison easier, but also offers full functionality that the individual search engine offers. So next time, if you would like to compare your search results, do not forget to BING&GOOGLE !!!

June 7, 2009 Posted by techrajesh | google, microsoft, search engine | | 3 Comments