19. April 2015

Setting up MOSH on Koding.io

Using a remote server for development is so much cooler for obvious reasons. Using MOSH on top of it naturally makes the experience much better.

Koding.com + MOSH = Ecstasy

Here is how you can get mosh to work on koding.com

  1. SSH into the koding server from your client machine. If you haven’t added ssh keys yet checkout their tutorial.

    ssh <username>@<username>.koding.io
  2. Setup uncomplicated firewall in the remote machine.

    sudo apt-get install ufw
    sudo ufw status verbose
    sudo ufw enable
  3. Open up critical ports first viz. HTTP, SSH and 56789 for koding.

    sudo ufw allow ssh
    sudo ufw allow http
    sudo ufw allow 56789/tcp
  4. Open up the port (60001 is used by mosh in most cases) on the remote machine for the client machine to access it via udp.

    sudo ufw allow 60001/udp
  5. Connect the remote machine by running the mosh command from the client machine. This will automatically ssh into the remote server and start the mosh-server.

    mosh <username>@<username>.koding.io

That’s it, you are done.

02. April 2015

Random Ramblings

Astrology vs Machine Learning ~ 2 Apr 2015

Is astrology an age old machine learning (ML) algorithm that is predicting the future, just like ad networks, that predict the click thru rate of an ad for the current user? Have I been ignorant all this while, failing to find the logic of causation in astrology, without realizing that:

Correlation does not imply causation

the premise on which ML exists.

more

28. May 2014

Schemaless scheduling for repeated events

Consider a case where one wants to schedule repeated events in a calendar. For example - a yearly birthday or a fortnightly appointment with the dentist. Though, these cases are quite simple and most of the current solutions such as — Google Calendar, handles them quite well, the problem arises when you want to integrate a system like this with your own application.

This stackoverflow question — Calendar Recurring/Repeating Events - Best Storage Method — gives a good picture of the complexity of the problem.

One thing that I observed, is that you could draw parallels between this problem and the problem of selecting elements in a DOM tree. The latter been solved already using css selectors. So I started developing a language inspired by CSS Selectors but tailored for selecting dates.

This language ultimately gave me a lot of flexibility in terms of writing repetition logic and applying filters. Moreover this setup din’t require any complex schema and thus no schema migrations, with every new feature. Its just one rule, defining any convoluted logic as you may like and still taking up only a single row in the table.

The rules for the language (Named it SHEQL) and a parser prototype has been open sourced and is also available via npm. Though the prototype has been written in javascript one could easily write a version in python or some other language.

21. May 2014

Date a boy who codes

The author of the following content din’t have a blog of her own, I loved it so much that I thought I’ll post it here.

more

05. December 2013

Using Passbook at Indian Airports

Apple’s passbook is something that I was not expecting to work in India anytime soon. I was travelling to Bangalore, and decided to test this time if the app has any credibility, in the eyes of the security at the Jaipur International Airport, my boarding point.

more