Misc

Installing older ruby versions via rvm on mac 10.10

If you are installing 2.1.x or 2.2.x versions of ruby from 2014/2015, support is missing for some of them. gem install stops working with the default gem that installs via rvm when installed on Mac OS X 10.10 (OS X Yosemite)

This is the error I faced. You get the error

ERROR:  Could not find a valid gem 'rubocop' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/latest_specs.4.8.gz)

This worked for me

curl https://curl.haxx.se/ca/cacert.pem > /usr/local/etc/openssl/cert.pem

(found via https://github.com/rubygems/rubygems/issues/1800#issuecomment-270617750)

There are a series of steps here which you may want to try out. http://railsapps.github.io/openssl-certificate-verify-failed.html

These steps did not work for me

There is a suggestion to upgrade to the latest ruby gems by installing it from local after downloading. This results in the following error.

ERROR:  SSL verification error at depth 2: certificate has expired (10)
ERROR:  Certificate /C=BE/O=GlobalSign nv-sa/OU=Root CA/CN=GlobalSign Root CA expired at 2014-01-28T12:00:00Z
ERROR:  SSL verification error at depth 2: certificate has expired (10)
ERROR:  Certificate /C=BE/O=GlobalSign nv-sa/OU=Root CA/CN=GlobalSign Root CA expired at 2014-01-28T12:00:00Z
ERROR:  SSL verification error at depth 2: certificate has expired (10)
ERROR:  Certificate /C=BE/O=GlobalSign nv-sa/OU=Root CA/CN=GlobalSign Root CA expired at 2014-01-28T12:00:00Z
ERROR:  Could not find a valid gem 'rubocop' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)
ERROR:  SSL verification error at depth 2: certificate has expired (10)
ERROR:  Certificate /C=BE/O=GlobalSign nv-sa/OU=Root CA/CN=GlobalSign Root CA expired at 2014-01-28T12:00:00Z

installing via rvm was suggested too - rvm install 2.1.2 --disable-binary . It did not work.


Generating Header Images for Blog

Inspired by Sense-Si, the process fills in text into a HTML page and uses a PhantomJS (on a docker container) and takes a screenshot. I wanted to see if I can make these in a simpler way with other tools I currently use already.

Trying out with Image Magick

First, lets download the image

wget -O header-plain.jpg "https://source.unsplash.com/featured/1200x630/?mountains"

single command but overflows

echo -n 'How to generate caption images with ImageMagick?' | composite -background rgba\(255,255,255,0.5\) -font BrushScriptI -pointsize 50 label:"@-" -channel rgba -alpha set  -gravity south -transparent-color white header-plain.jpg header-title1.jpg

But the text overflows when the image is of limited width

echo -n 'How to generate caption images with ImageMagick?'| convert -size 1200 -font BrushScriptI -pointsize 50 -gravity center -background rgba\(0,0,0,0.5\) -fill white caption:'@-' text.png
composite -channel rgba -alpha set -gravity south text.png header-plain.jpg header-title.jpg

This is how it looks with Image Magick

Trying with Cloudinary

Well, its kind of straight forward from the documentation to add text to an image.

Note: this is a dynamic image rendered off of Cloudinary servers, text can be passed in the URL. Text just needs to be encoded.

Trying with CSS

CSS 3 spec has become too powerful and once the layout is set, you need to take a screenshot from the generated style like in the first linked url.


Why I Like go?

I have been reading and listening a lot about GoLang. There are two great projects with good communities and Documentation

Why I like go?

  • The standard library is too powerful
  • Creating a http server is very simple
  • Interfaces are too good and provide the best
  • Structs are the new classes (no inheritance, only composition)
  • Concurrency is a first class citizen (via go method)
  • structs for locks are part of the stdlib
  • Syntax is a first class construct, all go code looks the same
  • Terrific garbage collection in order of nano seconds
  • Data can be passed through streams(channels)

With this power and the speed Go runs at, I started learning Go by writing a simple productivity tool (my first project in Go), Pastebin via API, named it daata (Check daata-server/ directory)


Migrated to Hugo

I have been using OctoPress since a while. Octopress uses ruby and doesn’t work quite well for 1000s of posts (or so the claim goes).

I wanted to try out Hugo because of the hype of great software and fastness of generation of the static site.

Related: Why I like Go?.

Why change?

Change is the only constant

Change of thinking helps you learn and discover new things

Change is what helps the world move forward

Though change is good term to philophise, its hard to embrace change in life.

Community

There is great community for Hugo. All the code is opensource and there are 10s of themes and 100s of open source repositories to refer code from.

If you are planning to start a static website like a website or a Blog, I’d highly recommend Hugo.

Personal Achievements with Hugo

What I feel it lacks?

Jekyll and Octopress have decent ruby code and software like Middleman which is looked as an alternative to Hugo, can do lot of things like extending and writing Ruby code which is possible since Ruby is an interpreted language.

Since Go is a compiled language, you are limited to the front end code although changing the source code is always an option. I wanted to generate new product pages based on ‘Data’ attribute which is not a feature. This is useful more as a template since the philosophy is to translate files into viewable HTML files.


Customer perspective of the Food Startups in India

I live in Bangalore(also known as Bengaluru) which is one of the biggest hubs for startups in India. I reside in Koramangala which is a sub-locality which has one too many restaurants.

People think Food Startups are supposed to solve the problem of

  1. Discovery — To allow the customer to identify what are the restaurants near them and
  2. Conversion — To help order with ease and get the items delivered

There is another problem which is not taken into account and there is no solution. Its the ‘scale’ problem.

The scale problem kicks in when you have hundreds of orders every minute and there are handful of people who take the orders from a portal and call to confirm the restaurants to place and confirm the order (while they miss out the time for delivery which is where the bad CX(Customer Experience) happens).

Dominos used to do have this problem of scale, but tried to solve it with the 30 minute guarantee delivery which was dis-continued. They have other ways to escape this, by pulling off chords from their phone lines or not picking up the phones etc., Online orders started to solve this problem, but there is a case of stupidity and sheer lack of UX in their website.

The Dominos Website

God!, you’d find a website done by a single inexperienced person better in UX than a complete team of people doing it. If someone sues Dominos, they better sue them for their Customer Experience Usability. (This requires a separate post. My hatred towards their website since 7+ years continues)

When you order something in the Mc Donald’s store, they give you an estimate by when your order is going to come. Keeping people in the loop is very good. Some companies try to do this and show couple of steps for the sake of it. Its typically this —

Your item is being prepared. Your order will reach any time between the next 10 minutes — 1 hour

Startups use other startups which is good for the ecosystem and innovation, but since everyone is in a startup state, they usually do not have proper processes for everything. I ain’t blaming anyone, but I am just pointing out the state of the complete system.

Let’s start from the website

Problem#1 — What do I order? — Discovery

  • Every person has different tastes in everything. Zomato is one of the only and best apps which has that information particular to restaurants. What item to order, what are famous, what did people like.

  • I believe Zomato can auto-suggest or personalise the complete experience of suggestions of items along with customisation.

  • Because of the competition between startups to sell more by adding restaurants, no one really cares about personalisation which e-commerce sites are already ahead of.

Problem#2 — Veg / Non-veg on the menu

  • Very few companies have done this in their apps and websites. A consistent user experience is usually nice.

Problem #3 — Address — Instead of the address, if you give a GPS coordinate, it solves your problem. This applies equally for all deliveries alike (E-commerce vs Food) startups.

You are in the middle of an important task or meeting and you get a call —

Sir, where is your address? I am right now near ‘ Signal’

  • I always wonder why there was no startup or service which allows you to fill your address details. Every time, you need to fill in the address or find what is your location and enter it even though you have an exact location of where you are (When ordering from a friend’s house). India does not have addresses well streamlined like the US postal systems have. You cannot identify a house with a 4 digit number + 5 digit pin-code.

Problem #4— Waiting for the food (Refreshing the browser and cursing the company you ordered from).

  • Adding a real-time tracking based on the delivery person’s phone. You have GPS coordinates, you have some servers to get that info, you display those based on the orders he is carrying to the customers. There could be a little extra work if you are integrating with other companies or other apps.

Problem#5 — Offers/Coupons

Everybody loves coupons. There are loads of coupon websites and everyone wants a better price. There are several ways different companies solve this.

  • Flipkart — does not have a concept of coupons or providing different prices to different customers (until now). It auto applies the coupons.
  • Amazon — has it on every product page when applicable.
  • Big Basket / Ola — Providing all eligible coupons to allow customers avail the offer
  • Swiggy / Food Panda — Search on the internet every time you need one.

Some companies use a loyalty program to get you discounts while ordering from their website/apps.

Problem #6 — CASH

  • CASH is a very very hard thing to maintain, give and transact. This is a problem from both the customer and the delivery associate. He might not get enough change to provide change to everyone in the route.
  • Credit Cards ? — They require network, they require good signal, they require you to provide an additional pin to enter. Credit Cards are good if you are performing a big transaction say few thousands or buying stuff online (or standing in line in a store, (but this will change soon too)).
  • People use PayTM. Loads of them do. If not that, Airtel Money, If not that some other wallet. Most people have their phones on them. Companies like CCAvenue have been only doing one thing. A Payment Gateway aggregator and could not get in the Wallet game like Mobikwik or PayTM.
  • Companies which provide Wallet services need to have an offline and simple to transact via SMS or via offline or scan of barcode (ChaiPoint does this via barcode scanner but their service lacks idempotency checks). People would be ready to transact via PayTM as long as I acknowledge the sale of goods which can be by allowing the customer to provide an OTP to the delivery person on receiving of goods. (with the exception cases of partial transaction)

Problem#7 — Lack of End to End Customer Experience Ownership

  • Restaurants get their money through the Food Aggregators which source them orders. They are less about how late its going to reach the customer since its not their problem. They just need to get the food ready. Everyone cares about their own problem. There is no overall feedback loop.
  • I have seen on an instance that Eatlo take the feedback. It’d be good if companies keep the feedbacks open and what they have done which would gain customer trust.

Problem #8 — Healthy and Tasty Food

  • There are couple of startups which provide you Tasty food options for Rs. 100/- ($2). These food options are great, getting used to every day in a month is hard.
  • When a dietician suggest you a diet, they expect you can get all options of food from rice bowls to roti to fruit bowls to eggs. You won’t have a single location for a balanced diet unless you spend good amount of time every day to search, travel and get food.

My Personal experiences

  • You cannot (the API endpoints are down or choked — The app won’t even open) and should not place an order during a rush hour day on Swiggy. The orders only reach the customers only after 2–3 hours once the order is confirmed(not placed). Once their hunger gets killed and this single order becomes a regret.
  • MastKalandar (MK Dabbawala) has started a brand and sells to-be expired pickles (which are going to rot in another week or two) and doesn’t give a damn when you call their Customer Service. MastKalandar is as well very famous for late deliveries even though the customer is < 1 Km away. People are hooked for the consistency of food quality and desserts.
  • As a regular customer and a foodie, I only respect couple of startups which maintain Quality of Service and provide Value for Money. FreshMenu is one of them whose quality of food never degrades. Delivery experience differs from weekdays to weekends.
  • All normal restaurants try to ensure customer experience within the restaurant, but doing it on delivery fails because of the outsourcing or other factors which are outside of their control like Traffic or no. of deliveries a person handles or getting the food cold etc.,




Migrated to OctoPress

Octopress baby!

I finally found time to migrate my wordpress(WP) site to a self hosted (at digitalocean) run via octopress.

What I know about hosting!

I previously hosted at mediatemple, it was getting costly (blame the INR drop compared with USD).

I earlier tried Linode, no bad experiences, but went on with MediaTemple on a hunch and never looked back till DigitalOcean came with super awesome $5/month reliable servers and neat interfaces

Amazon Web Services(AWS) is way too costly for non-commercial purposes.

Heroku is free but, I like to host and configure myself.

Domain Name Servers

Running free DNS on CloudFlare and DigitalOcean.

CloudFlare has faster response times compared to others and its free too.

About Octopress

Well I have lot of things to do because of the migration. I am only getting things done in the night rather than in the mornings 😃

Pros

  • Deploy from CLI
  • Write from CLI
  • No complicated UI to upload and edit html

Cons:

  • Images to be managed from CLI
  • No friendly UI to write simple HTML 😉

TODO:

  • Fix old posts
  • Write newer planned posts
  • Comments migrations from WP
  • Disqus setup for comments
  • Google Analytics



Competition Monitoring

A book costs 11.36 Lakhs. Source: Silence on the Wire | BookAdda.com.

Screenshot:

Something like this happened between two sellers on Amazon.com few years ago. Both of them were thinking about buying the product from the other person and the script increased it thousands of dollars.


Quantum Computers are the upgrades to PCs

For the first time, a commercially available quantum computer has been pitted against an ordinary PC – and the quantum device left the regular machine in the dust.

Read more: Commercial quantum computer leaves PC in the dust - physics-math - 10 May 2013 - New Scientist.




Endless Scrolling in websites

Sites like Facebook set the trend for endless scrolling on their websites. It makes sense for certain news reading sites like Google Reader or Social sites or even Blogs to have endless scrolling.

Sites like Flipkart have implement it in not so good way. If you want to browse all the items in a category or in a search result with 100’s of items. It starts out beautifully with autoloading the pages from 2-8 and then stops. You need to find a line of text which says ‘Load More’ and need to find more

Ecommerce who need customers to browse and select more options don’t do it right. The pagination way of Amazon is one of the more user friendly ways to do it.

May be the infinite scrolling on the mobiles make sense since there are technically no tabs in the apps





acqhiring - the new way of hiring

This practice is so widespread that a term, acqhiring, has entered the industry lexicon to describe it. Even for the skeptics, it’s difficult to argue that these acquis- itions are about anything other than people. In many deals, like Facebook’s acquisition of Gowalla, the technology was not even a part of the transaction. And when the technology is included in the transaction, it is frequently released as open source post-acquisition. The New Kingmakers


Why you should be betting against the rupee now - Firstpost

Source: money/studies/wp0028.pdf

Chronology of India’s exchange rate policies 

• 1947 (When India became member of IMF): Rupee tied to pound, Re 1 = 1 s, 6 d, rate of 28 October, 1945 

• 18 September, 1949: Pound devalued; India maintained par with pound 

• 6 June, 1966: Rupee is devalued, Rs 4.76 = $1, after devaluation, Rs 7.50 = $1 (57.5%) 

• 18 November, 1967: UK devalued pound, India did not devalue 

• August 1971: Rupee pegged to gold/dollar, international financial crisis 

• 18 December, 1971: Dollar is devalued 

• 20 December, 1971: Rupee is pegged to pound sterling again 

• 1971-1979: The Rupee is overvalued due to India’s policy of import substitution 

• 23 June, 1972: UK floats pound, India maintains fixed exchange rate with pound 

• 1975: India links rupee with basket of currencies of major trading partners. Although the basket is periodically altered, the link is maintained until the 1991 devaluation. 

• July 1991: Rupee devalued by 18-19 % 

• March 1992: Dual exchange rate, LERMS, Liberalised Exchange Rate Management System 

• March 1993: Unified exchange rate: $1 = Rs 31.37 

• 1993/1994: Rupee is made freely convertible for trading, but not for investment purposes 

Why you should be betting against the rupee now - Firstpost


The Indian E-commerce - Part 2

There are lots of choices. Ruby on Rails is a famous choice in the US/England for fast development of websites. PHP is the most famous one for Indian startups (I think its mostly because of the number of people). There are many things that lead you to take the programming language for a startup / project lead. 

The ** Cart** on an e-commerce websites is the most important of all along with the **Wishlist**. Amazon.com used to use DynamoDB (not sure if they still do) for saving the shopping cart across millions of users. Simple: If you lose items from the cart, you lose the customer. You cannot show old data. (The paper on DynamoDB published in 2007 was famous because of the architecture it uses. DynamoDB is currently offered as a service as part of AWS).


The Indian E-commerce - Part 1

The current trend in India is e-commerce websites. MySmartPrice (a price comparison site for Indian e-commerce sites) compiled | a list of 343 websites (as of May 2012). There are more than 813 seller listings on Junglee.com. There are so many that are not listed

I found 24 websites(as of April 2013) which do the aggregation of prices from pretty old to the latest Indian e-commerce websites. I found all these through a quick 15 minute search. Well, Junglee is the most famous because its made by Amazon. A base for attracting customers towards amazon.in probably.

From my personal experiences of searching for books and buying in the last 2 months of around 10k spent in total.

Flipkart has a great service, Literally a 2-day delivery to Hyderabad. Though an incorrect pincode might lead it to a different city which you should ensure before clicking on ‘Order’.

SnapDeal spends a great fortune to speed up the site to everyone. Their customer service is a nightmare when you email them. They get back to you only after few days and they prefer to talk to you over phone for things that can be done on email. Adobe and Akamai services for their websites.

Infibeam still offers free shipping for any price and had a headstart on getting up 3rd party sellers.You cannot move an item from the cart to a wishlist.

BookAdda has a lot of books in stock which I needed (OReilly books and Pearson) for a fairly lower price tag and in availability. I had many bad experiences with the website like losing the items in the cart. 

BuyThePrice was shutdown about a month ago.

Shroff Publishers displays the wishlist (w/o truncating it) and items in cart on each and every page. The shipping costs you about 30% more to the value of items in your cart. They use DTDC ( the not-so great courier company which takes 2 days to deliver a package that is < 1km away from the target). You can create a wishlist even though you are not logged in. ( No other site Indian e-commerce does that currently)

The


Return to the blog!

I have been planning since over an year to resume writing blog posts. Being too busy with work, I lost count on how many topics and how many times I wanted to put out something I learned.

Finally I am the proud owner of the awesome domain sairam.com. (yay! dot com, but just when ICANN started the new gTLD revolution) I set a higher priority for writing and reading now that my past work project Bookish was launched in early February 2013.

I have learned a great deal on things while working since the past 5 years in a product based multi national corporation and a service based company. (Past is past, I don’t want to get there now.) Starting March 2013, I have been experiencing rather an unexpected life experiences every day. Rather than a fairly straightforward job, looking forward to a new life as a freelancer :D

Let’s see how that goes!



Hello Jekyll (from 5erver.in)

Note: This post was moved from 5erver.in (spelled server.in)

Intro about 5erver.in

I want to write posts about resources and configurations I find when configuring websites to desktop software.

If you do rate habits, my best one is configuring stuff.

What does this site do ?

I plan to use this site to explain details of configurations and sites, and why I choose that way.

Why not use Tumblr like my other blogs ?

I am finally over my habit of using a rich text editor to write blogs.

What did you choose to blog ?

I chose Jekyll. Jekyll is a parsing engine bundled as a ruby gem used to build static websites from dynamic components such as templates, partials, liquid code, markdown, etc. Jekyll is known as “a simple, blog aware, static site generator”.

You can as well use Ruhoh if you want to set it up faster than I did.

Why Jekyll ?

Its simple static site hosted on github. Github since anyone can just clone this repo

One could use Amazon AWS services (S3 or any CDN ) if they want to conceal the source of the software or if any customisations were made.

Why should I care ?

Since it could be too late when finding answers later than now. This is a reason dropbox always generates extra load to test their production servers .

The world has loads of free software, thanks to the Open Source Software movement. The most important thing is to do it configure it. There are many aspects in the server and the client and everything between that can be configured.

I like giving analogies, here’s one

Would you use the first gear in the car when going at 50 mph ? (Ofcourse I am talking about a car with a manual gear system. In software world, you cannot assume anything since the dependencies are more than you think)

The same way, when you configure a system, you should not deploy software to production till you load test it and know the ins and outs of systems. Although it takes time, its worth the experience.

Can’t I use chef or puppet ?

Yes, if you want to use the base software or already configured software or if you want the vanilla configuration on tens of your servers, thats the way to go.

Can you help configure my server and explain everything step by step ?

Yes, Contact me at sairam at kunala dot com

Can I contribute ?

Yes, send a github pull request or email me an markdown file with your details for reference.