Convert Short Urls to Long Urls

How to get a long/actual url from a short url?

Sometimes when we try to fetch short urls, using curl, we get a blank page as reply or a 301 ERROR. The reason being that there is no html file stored at that location,only a header with details ,on where the person who has opened the url would be redirected to.

So to get the actual url or long url from the short url, we just have to read the location stored in the html header.

When My Alarm Was Found to Be Not Working

Due to some unfortunate events

  1. Loosing my phone
  2. K-alarm crashing

I faced a common problem for many people “No alarm to wake me up in the morning”. Like every single man, I love sleeping. So unless an alarm or person wakes me up, I will continue to enjoy sleeping - until the urge from my second passion (hunger) wakes me up.

Despite the fact that I love sleeping, my team mates at Ruby Kitchen, won’t be happy with me coming late to work. Challenged with such a problem, I did what every computer hacker would do.

Wrote a program to wake me up, at 6:00 AM 😁

Model Update_attribute Update_attributes

Lot of people might have a confusing between the functionality of update_attribute and update_attributes. The purpose of these functions can be understood from their name itself. the first one update_attribute would update a single attribute of the model

Make Self Executing Ruby Scripts Linux

To run a ruby program we use the command ruby

ruby program_name.rb.

Ruby being an interpreter style language, each line is interpreted(read) one after the other and executable object code file is created for reuse like in case of compiler languages C, C++, etc.. To run a ruby code you need a ruby interpreter installed in your system.