Grab the net with Arduino

How to access a website with multiple virtual hosts from Arduino Ethernet Shield. The problem is if you have used Arduino Ethernet Shield, then you know that you can connect a IP, But if the IP has multiple virtual hosts, it will only connect to default virtual host. If it is commercial shared VPS, You wont be able to make your site default.

Gist is use of HTTP protocol which allows you to define host in your request on virtual host server. Here are the possible headers.

You should also provide basic debugging info like “User-Agent” etc.

IRB Console with history and logging

I spend most time with IRB or Rails/console. These are good settings on which I have settled with over the time. These will allow you to have basic logging and IRB history. Just put these in the ~/.irbrc file (If file doesn’t exist then create one).

Power Programming with Tags

Source tagging is very powerful source code navigation system, it beats any state of the art IDE. If you are using Emacs, Vim and TextMate then you can use source tagging for navigation. Here are the few simple steps to do it.

Step 1. Install ctags in your system. For mac

$ sudo port install ctags

Step 2. Create A tag file

$ cd /Users/username/Workspace/rails-project
$ ctags -e -a --Ruby-kinds=+f -o TAGS -R app/ lib/ config/

It is best to add this in crontab for this around 11:30am

Step 3.1 emacs

M-. Follow a tag
M-* Jump back to source.

Step 3.2 vim
just add this in your ~/.vimrc

set tags=TAGS;/

Once this is done you can navigate to source of tag by using.

C-] - go to definition
C-T - Jump back from the definition.
C-W C-] - Open the definition in a horizontal split

Hope you will be able to use this awesome feature.
C is ctrl
M is Meta/Alt/Ecs

Prevent Googlebot following links in Gmail

How to prevent googlebot following links in gmail messages? Well bad news is “Googlebot is following links sent to subscribers of a mailing list by email and it is causing those subscribers to receive an unsubscribe meesage or a added download from the list or server”.

Bigger Bad news is that age old trick will NOT work here, we can not solve this simply by adding

<a href="signin.php" rel="nofollow">sign in</a>

Best way in my opinion is to reject download count based on the user agent. Which is Googlebot in case of Google Crawler.

find long answer here.


Hands on Flex

I’ve been very busy for last 4-5 months. But I have been hacking around with many things; Emacs, Vim, Python, Bash, Flex, Silverlight etc… No I am not trying to impress anyone here. Of course I am not master of these things. :).

Adobe Flex aka Fx is a great open source tool. I happen to understand the Ajax/PHP and Curl so I can compare Flex with these.

In my opinion Flex is great. You can create a application with minimum ActionScript coding. Basic layout of a flex application is in MXML and ActionScript is used for more control just like we use HTML and JavaScript.

I have been trying the Flex charting API. I will say that they are extensive and very easy to use. Flex platform is Open Source and licensed under Mozilla Public license.

I will keep readers updated in Flex as soon as I get to something new.

Desktop Calculator

I always appreciate coding in standard C++. Desktop Calculator is a application coded in Standard C++. It is a application based on the example 6.1 in the book “The C++ Programming Language”, Third Edition by Bjarne Stroustrup. Desktop Calculator is a GPL software.