Yesterday I came across this nifty tool to update the version numbers in my Gemfile.


Now you might be wondering why not just use the bundler to take care of stuff.The problem with bundler is firstly its slow and whenever there are transient dependencies it would tell us to update the dependency rather than taking care of it.

Take a look at it Gemfly

Postgres is a really powerful database with a lot of features, One of the most important features which is very rarely found in other databases is “Table inheritance”

Table inheritance is very similar to class inheritance of OOP.In Table inheritance you have a parent table which is inherited by another table with extra columns in it.

By default the pg gem doesnt support table inheritance.

In the current project that I am working on, the business logic required the user to have template using which he could create items.This is where table inheritance shines.It allowed me to create the template model which contained all the generic attributes for the item.So everytime I would update the template the relevant model for the template would also be updated.
Continue reading

Databases are awesome, they are these blackboxes where data is stored and retrieved at really fast rate.Postgresql is one really fast open source database.

Usually when you want to speed up read speed on your database you usually create indexes on the relevant column.But recently I came to this realization that having more indexes increases the time per insert.

Here is the unscientific benchmark I ranContinue reading

Last week I got a keyboard off of Souq which is a local Amazon competitor.I found a really good deal on it for a genuine apple keyboard for 3 times less the original price.The only gotcha was that the keyboard had both Japanese and English characters on it.It didn’t make a lot of difference to me since I was learning some Japanese in my spare time.

The only major issue with the device was the way it was detected on my mac.By default the apple macbook would set the keyboard layout to international pc  which worked well with the keyboard but when I didnt use the keyboard the laptop keyboard would get messed up unless I change it back to US Keyboard. 

My colleague showed me a tool on  the mac called Keyboard Maestro which would automate tasks on my laptop like expanding text or sending tasks to omnifocus.Continue reading

Last week my colleague at TURN8 informed me that his browser was infected with adware.

As eminent from the previous blog post Adware Medic came right to my mind.

So i launched adware medic and it immediately detected the malware in the ` /Users/username/Library/ScriptingAdditions ` .There was folder which contained the malware waiting for me to delete and delete it just what I did.

But after a couple of minutes my colleague asked me I got rid of the malware.So I took a look at the folder and the malware had somehow restored itself.Continue reading

Automated testing an application can be difficult and time consume.Even after writing your tests you will always have to run it again and again to achieve the red green refactor flow.

To make this task easier the ruby ecosystem has a really powerful and versatile test runner called Guard.

Guard run like a daemon on your machine and runs tests whenever your code changes.This helps you maintain concentration and focus on the tests and code rather than monotonous manual running of the test.
Continue reading

LastPass is a really awesome password manager.It takes care of generating a password,saving and syncing it with all your devices.

But yesterday they sent an email explaining that they were hacked.Hacking really popular these days,on an average there are about 9 defacements that happen everyday.But after going through the email.I was happy.

You might be wondering ,why is he so happy.The reason I was happy was due to the architecture LastPass had built to perform all the above mentioned features.

The way LastPass works is it uses a really secure encryption algorithm pbkdf2.As part of this algorithm the content can be encrypted multiple times like a chain.Lastpass made use of this technique really well.

They set the iteration count to 100000, which meant that if you want to decrypt it you have to perform it 100000 times to receive the decrypted content.

Moreover all of the keys that used for encryption is derived from your pass if you have a really long and random password, it will make it near to impossible to decrypt the passphrase.They don’t save the keys on their server.
Having said all of this,I am not gonna change my password,the hacker can have my encrypted blob and hope they are happy cracking it on their ASIC devices

Today one of the startups in our accelerator were infected with an adware.After some digging around it looked like the adware has infected the whole system not just the browser.Chrome, Safari and even Firefox were infected.

After a couple of Google searches I came across Adware Medic.Its a free , donation driven application which working detects adware using signatures similar to antivirus.

The application was very easy to use and within a couple of minutes the application detected all the files that were infected and cleaned it.

The application is highly recommended even for those who are yet to be infected by malware.

Android studio is probably the best IDE for Android.Even with its slow grade tasks and occasional unresponsiveness,Google has added a lot of new features to make life easy

Just a couple of days ago I was working with a team to fix an issue they were facing with their android app.

The issue was very vague, the developer was trying to upload a base64 string to the server.The string was generated from an image.But while testing locally on his machine he faced an issue.

I then asked the dev what he was doing ,he said he was using logcat to copy the base64 string.He would then copy the string from the logcat and run it through the online convertor.

So I sat down with the developer to test the code.I put a breakpoint on the string.The debugger showed the obscure string really easy,I then copied the string and pasted it to a online convertor and voila things worked.Although I had to use to remove extra space set by Android Studio.

Heroku is a really cool service.It lets me snip up servers in a matter of minutes rather than hours.But Heroku has a dark side, as a developer heroku provides you a free instance which should be sufficient for your regular testing and development process.But as soon as you want to launch your application, you will get deterred by the amount of money you will be paying per month

Starting from my last project I have been trying to move away from heroku and build the features that heroku offers.The process would look something like this.

  1. Automatic deployment and running of Tasks (Done)(Thanks to capistrano)
  2. Auto Scaling of website based on CPU usage.
  3. Deployment of code once the test pass.

1.Automatic deployment and running of Tasks

Capistrano plays a huge role in the this step,I was able to deploy the code from my machine without even touching the server.No more ssh and managing different deployment version.

2.AutoScaling of website

This is probably the most difficult part of the whole setup.AutoScaling in the cloud world is very dependent on the service provider you chose.Microsoft Azure , Amazon AWS and DigitalOcean all have a different way to launch and provision website.Currently I have got the server provisioning working but integrating the code deployment and load balancer is still very tedious.

3.Deployment of code once the test pass

This step of the process will also rely on a tool which is mostly gonna be jenkins.Jenkins is very popular and it has huge community of existing plugins which I can make use of.