When learning to make bash scripts, at one point or other you’d like to know how to suspend your computer from terminal. Well, there are quite some methods available for Ubuntu. You can choose whatever suits your needs. I prefer method 3 (look below). Method 1: sudo sh /etc/acpi/sleep.sh force Method 2: sudo pm-suspend This… Continue reading [HowTo] Suspend Ubuntu from terminal or keyboard shortcuts
Category: tips-and-tricks
[HowTo] Find number of files inside a folder in Linux
I wanted to find out the number of files inside a folder. I didn’t want the folders to be included in the result. A blog post on zimbio.com shows us how to do it with ls command which is not only downright inaccurate, it is also slower than what I am going to show you. I… Continue reading [HowTo] Find number of files inside a folder in Linux
[SOLVED] ‘Unknown’ filesystem in gparted
I had a primary NTFS partition with windows 7 installed on it. Somehow, its bootloader went corrupt so I used install-mbr in ubuntu to fix that but it only made the problem worse. Now my system didn’t recognise the partition as NTFS partition and I couldn’t access the partition. I modified the partition ID using… Continue reading [SOLVED] ‘Unknown’ filesystem in gparted
[HOWTO] Delete all unstarred emails from Inbox or Label in GMail
Its easy to delete all mails from a label/folder or inbox, but sometimes we’d like to save our starred mails and delete all the rest. The search box in gmail comes in handy in such situations. Its really a very powerful tool with various operators to make the search more efficient. The gmail search really… Continue reading [HOWTO] Delete all unstarred emails from Inbox or Label in GMail
Extract almost any archive through terminal using a single command in linux
I came across this simple script on ubuntuforums which I thought was really very useful and worth sharing it on my blog. You can either make a function out of it and put it in .bashrc file or make an executable script and put it in /usr/bin/. Method 1: Open your ~/.bashrc file using any editor. gedit… Continue reading Extract almost any archive through terminal using a single command in linux
[HOWTO] 5 methods to find out your linux distribution name and version through command line
There are lots of commands to find out your ditribution name and distribution version. Some work on some distros, some work on others. Here are some of the methods: lsb_release -a cat /etc/*release cat /etc/issue cat /proc/version uname -a One of these methods will surely tell you your linux distribution name and current version. Cheers!
[How-To] Find windows live (hotmail) contacts on twitter
Twitter removed its hotmail/msn contact importer tool last year which was a very useful tool. However, there are few tricks which enables you to do just that. The easiest one is: Twitter allows you to import gmail contacts. Gmail allows you to import MSN contacts. Hence, you can indirectly import MSN contacts in twitter by… Continue reading [How-To] Find windows live (hotmail) contacts on twitter
Passing variable number of arguments to a function in PHP
We all know about functions and how we can pass arguments to it. But did you know that we can pass variable number of arguments in a function? Consider a function sum() which adds numbers passed into its arguments. Now we want it to add all the numbers passed onto the arguments. Eg; if we… Continue reading Passing variable number of arguments to a function in PHP
Find PageRank of all outbound and multiple links
Latest Google PageRank update was on April 3rd 2010, that is 2 days back. I wanted to check out the PR of all my subpages as well. However, I was too lazy to check one by one. I had 2 solutions for this. Either make a PHP-curl script and put all the links in a… Continue reading Find PageRank of all outbound and multiple links
Type in Devanagari in any field on any site
Now, you can type directly in Devangari script on any text field on any website. Thanks to http://code.google.com/p/t13n/ Just drag the link below to your bookmarks bar: Drag this link to your bookmarks bar How to use After a webpage loads, just click on the bookmarklet to enable it. After enabling it, you can type… Continue reading Type in Devanagari in any field on any site