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.

http://en.wikipedia.org/wiki/List_of_HTTP_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).

Customizing Command Prompt

Well many times this happens that we want to work with the command prompt. Sometimes we wanna work with many CLI (command line interface). We usually SET the %PATH% variable of system or specific user for this. Things get really worse when we wanna work with more them one version of same Application/Compiler/System. We can’t set the variable as all have similar directory structure and almost same binary/executable names.

Working with command prompt on windows is messy. Working with multiple version of a language/compiler on windows is a trip to hell.

Possible workarounds are:

  • Set all the paths and add tags in names of binaries
    (stupid. You would have to remember all names or you will have to use some naming convention; still you will keep guessing).
  • Create users and set different versions in each user’s paths
    (Foolish. Then changing version will be like logging as different user).
  • Use a Customized Command Prompt
    (Elegant. Developers friendly)

How to Customize Command Prompt.

Create a file Called YOURSYSTEM-VER-cofig.bat. Where YOURSYSTEM is the name of the system you are using and VER is the version of that specific system like python-2.6-config.bat.
Now put some codes in the file. Like:

Then create a new shortcut Right click on empty space or File -> New -> Shortcut.

Create new shortcut
Create new shortcut

Then type %COMPSPEC% /K "C:pathtoyourfile" in it

shortcut
Creating shortcut

Then Rename the shortcut to a proper name.

Rename shorcut to a Proper name
Rename shorcut to a Proper name

Then click on Finish. Now Right click on the shortcut.

Command prompt shortcut
Command prompt shortcut

Select shortcut properties.

Shortcut properties
Shortcut properties

We can set the Fonts of the Command prompt.

Shortcut properties.
Shortcut properties.

We can set the color of the command prompt. like BACKGROUND, FOREGROUND.

Shortcut properties
Shortcut properties

We can even set the buffer and the screen layout of the shell window.

Shorcut properties
Shortcut properties

Example.

Costomized command prompt
Customized command prompt

Now you are ready to enjoy this very good feature.

I recommend you to keep all these files in one folder say with name config-all and with attribute as hidden.