Makefile Tricks: Arithmetic – Addition, Subtraction, Multiplication, Division, Modulo, Comparison
While working on a project, I needed to do some calculations inside a Makefile. Took me sometime to figure out how, hence jotting it down. Here’s a sample makefile where I have show examples of standard calculations. NUMBER1 := 10 NUMBER2 := 5 #Addition ADD := $(shell echo ${NUMBER1}+${NUMBER2} | bc) #Subtraction SUBTRACT := $(shell [...]
Highlight and Search – Google Search from Any Ubuntu Linux Application
Some time ago, I wrote a post to show how to modify terminator to enable easy google searching. However I have trumped myself and have an even better solution now. Google Search from any application. Modus Operandi is: Highlight Text => Press Key Combination => Script picks up the query from the clipboard => Formats [...]
Setup Default Browser for Non-GUI Applications in Ubuntu Linux (x-www-browser)
KDE and Gnome provide GUI to setup the default browser in Ubuntu. However for the default browser settings to be accessible in bash scripts, a further step is required. That is to setup x-www-browser. Set the default x-www-browser using the update-alternatives command. sudo update-alternatives –config x-www-browser Enter the number corresponding to the browser you want [...]
Custom Key Bindings / Keyboard Shortcuts in Bash
Bash is so powerful that you can keep digging and finding out newer secrets all the time. We already use bash keyboard bindings – Ctrl d to exit the terminal, Ctrl r for reverse search and so on. Now won’t it be convenient if you could assign keyboard bindings to commands of your choice, to [...]
Enable Alt Key in Xterm
Normally, if you try the key sequence Alt+1 in xterm, it will output a special character. To enable the Alt key: Add the following to the .inputrc file in your home directory. Create one if it doesn’t exist already. set meta-flag on set convert-meta off set output-meta on Add the following to the .Xdefaults file [...]
Advanced Title for Linux Terminals with Meminfo, Loadavg and more
A lot of Linux Users script the PS1 variable to see different kinds of info in their Linux Prompt. However I like to keep my prompt very simple. Instead I prefer to view all that information as part of the Terminal Title. The title of my terminal can be see in the below image. It [...]
Adding Custom Post Types to Sitemap
The Google Sitemap Generator WordPress Plugin is the most widely used plugin to generate a sitemap for a wordpress site. However it doesn’t support custom types yet. Hence the Google Bot hasn’t been visiting my website as frequently coz the sitemap doesn’t have the posts I add on my custom microblog. So I modified the [...]
Redirect WordPress XMLRPC Clients to a Custom Post Type
Lets say you want to post from your Android or Iphone WordPress clients to a custom post type instead of the the defualt ‘post’ type. Paste the code below in your functions.php and you should be good to go function redirect_xmlrpc_to_custom_post_type ($data, $postarr) { $p2_custom_post_type = ‘custom_post_type’; //Change this to the custom post type you [...]
Run Unique/Multiple Instances of Okular
Usually, when you open PDF files in Okular, it opens in the same okular window all the time. However there are times when you want to refer to more than one pdf file at the same time and would need multiple instances of the software to run. The way to get Okular to run unique [...]
Host Custom Gems with Dreamhost – Your Own Gem Server
I have started working on a webapp on Heroku. Heroku requires you to specify where your external gems come from. This is nice as you can specify a RubyForge, RubyGems, GitHub or any repository for that matter. However RubyGems is the de-facto gem host these days. All the gems on RubyGems have owners/co-owners and only [...]

Recent Comments
(1 weeks ago)
(1 weeks ago)
(2 weeks ago)
(3 weeks ago)