Categories
Uncategorized

How Emacs changed my life

I became aware of Emacs in my college days but kept using ViM, I was naive and thought no one uses Vim except me. I was proud because I was using something a hacker uses.

I actively started using Emacs in the first year of my job. I was working for Curl project in Persistent Systems. At that time I had a choice between Curl IDE and Emacs. I am being inspired by all the movies immediately decided to use Emacs. Slowly and gradually I learned a thing or two about in Emacs. I learned philosophy and learned to customise my own editor.

Emacs has a good learning curve. At first, you will struggle just to close the editor, save files. The absence of tabs will confuse you. But in the long run, you will have a deep understanding of the language/platform you are working on. I, like most people, started setting up emacs the way I want it. I experimented with various Modes. Since then I have worked in many languages like C++, Ruby, Python, C#, Javascript/Node; But my editor stayed the same.

I have never felt limited with emacs, Partly cause I am good at using Emacs and partly I don’t like IDEs. I always find interesting people using emacs, a great example will be Yukihiro Matz, Inventer of Ruby. He shared a SlideShare on Emacs, go take a look.

Categories
Uncategorized

Batch Convert Image to PDF

One of my friend was looking for a way of batch converting images in to pdfs. Well, This is how you can do it. That’s a simple algorithm how to convert jpg to pdf. I use mac, so tutorial is for Mac/Linux.

Mac: Install Brew From here

Linux: Install imagemagick and poppler-utils

Use this one line script to convert all the image in current folder

Categories
Tinkering Tutorial

WordPress Author-Info

WordPress as a very nice Author-info, I like it. By default it is off unless there are more then one author post on your blog. You can turn it on without installing any stupid plugin or code edit. Follow these steps.

  • First you should update description in your WordPress user profile
  • Open phpmyadmin or equivalent.
  • Open your WordPress database.
  • Navigate to table wp_options.
  • Search for option_name field for value _transient_is_multi_author
  • Set this value to 1 (for true)
Categories
Motorbike Technology

2012 Royal Enfield Classic 500 specifications

I am a proud owner of 2012 Royal Enfiled Classic 500cc . I rarely find complete specification on Internet so I uploaded myself.

Royal-Enfield-Classic-500-UCE

Categories
Customization Emacs

Melpa for emacs

Melpa is a Emacs mode repository. If you are not using Melpa on Emacs 24 you are really missing something.

Put this in your .emacs file.

Restart and run M-x list-packages

Categories
Bash

Tmux with native scrollback

Here is how to get colors working and allow native scrollback in terminal.app

file: .tmux.conf

Show sort hostname in tab title of tmux. Really helpful trick.

file: .bashrc

Categories
Bash Customization MAC org2blog Tutorial

Share shell history across multiple sessions

I use iTerm and a lot of terminal tabs. Terminal history is something which is important to me, it lets me backtrack my steps. Just add the following code in your .profile

Categories
Customization Programming Ruby Tutorial

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.

Categories
Customization Programming Ruby Web

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).

Categories
Ardoino Arduino Platform Projects

Arduino Ethernet Shield and Webclient

First thing you do when you get a Ethernet Shield for Arduino (in my case Duemilanove). You will be uploading various example sketches. I was doing the same Ardoino was working flawlessly and then I got stuck in WebClient sketch.

I did all the things I could do.

  • Reset Arduino.
  • Reset Ethernet Shield.
  • Change Ethernet cat5 cable to shorter one.
  • Change Router setting.
  • Change MAC address in program.
  • Change last 2 octets of IP 192,168,6,xxx to 192,168,1,xxx.
  • At last Google about this issue.

Point to be noted I was able to run WebServer sketch and it was flawless. So I was sure shield is good.

With a quick google found this thread on http://www.arduino.cc.

Some one said that don’t connect google ;). Bingo. Its Google.

Fcuk that.  But WebClient too works flawlessly.