Monday, November 4, 2013

Introducing Super Secure File - One File, Completely Secure, Access Anywhere!

Super Secure File gets you a really secure password protected file that you can access anywhere with an internet connection. Smartphone, Tablet, Laptop, SmartTV, anything!

To cut to the chase and create your Super Secure File, go to: http://secure.foamsnet.com.

How does it work?

Super Secure File basically uses Google Drive to store your encrypted file and does all the encryption and decryption locally in Javascript. The key never ever leaves your computer. Once you close the tab, boom, the key is gone. Nobody knows the key but you (and probably your spouse if you are married).

Motivation

This is not a big feat or anything, this is merely a mashup of a few libraries to prove a point to myself. The motive behind this app is to build a secure mechanism to store my passwords and credit card numbers on the cloud so that I can access it anywhere. I do not trust anyone who links me up to a server when it comes to information like this. Which is why i wanted a completely static HTML page with no server access whatsoever to provide me with this functionality.

Feel free to examine the source code here (and please let me know if you find anything utterly stupid): https://github.com/vickyg3/super-secure-file

Hosting and Links

Since this is a static page, I have not hosted this on my server. This is merely hosted as a github page (if you look at the repo, you'll see the default branch to be gh-pages and not master). Hosting it as a github page also proves that it has no server interaction whatsoever and cannot steal your key by any mean.

So, all you need is to remember your password and one of these URLs (they all redirect to the same Github Page): http://bit.ly/securefile or http://bit.ly/supersecurefile or http://secure.foamsnet.com or http://vickyg3.github.io/super-secure-file/super_secure_file.html

Get your Super Secure File and make your life a little easier! :-)


-Vignesh

Wednesday, October 23, 2013

Open sourcing Social Photos

I have been working on a lot of open source projects lately (chromium, AOSP, ffmpeg, etc.) and I have had this tremendous change in the way i look at software projects now. I am all the more convinced that open source is the only right way of doing software.

With that in mind, I've made a pledge to myself that no matter what I do, I am going to put the source out there. As a first step, i'm open sourcing the one big project of mine, Social Photos.

The source can be found here: https://github.com/vickyg3/social-photos

It is a snapshot of the one that's currently powering the live site: http://socialphotos.net (with API keys redacted). Feel free to fork and use as you please. Although i'd appreciate a link back, it's not mandatory. Also, i'll be more than happy to look at Pull Requests.

One of the main reasons that developers (including myself) don't post our code out there is that we are ashamed of our code. I was really ashamed by the number of hacks i did in this project that i couldn't even think of making it public. I'm over it. I'm ready to accept people fixing my mistakes.

Happy Coding!



-Vignesh

Tuesday, October 8, 2013

Why do we always have to f*** the opponents?

Note: This article is related to soccer (and other American sports).

I have always been a football (soccer) fan. In fact, i refuse to call it soccer, but for the sake of convenience, I am going to mention it as soccer the whole of this post.



I have been going to a lot of games lately (soccer, football as well as baseball). One common behavior I see across all these sports is that, the home fans always have an attitude that the opponents suck and we gotta f*** them. There are loads of banners, tifos, chants, etc. which are particularly targeted against the opponent players. Usually, fans just pick on random opponent players. They wouldn't know anything about that player, they merely look at the back of the jersey for his name and start yelling "hey <name>, you suck". For no reason.

Is yelling vulgarity at opponents really called passion?

I am an Arsenal fan by heart. I have been following Arsenal ever since i started watching soccer. As much as I want Arsenal to win, that doesn't mean i feel that the opponents suck. As much as I hate Robin Van Persie leave Arsenal, It doesn't mean that I don't enjoy watching him score quality goals for Manchester United.

I really enjoy the positive passion in local home games, but why can't the passion and support be just about us? About how good our players are? Do we really need to pick on the opponents to show that we are passionate about the sport and the team?

Consider this post by the 1906ultras. Before I say anything, I really want to make this very clear: I am a big San Jose Earthquakes fan. I take it really personally when they lose. I love the Ultras and the passion that they put in to Buck Shaw. But for such a wonderful and passionate supporter group like the Ultras, do we really need such vulgarity? There's nothing wrong in hoping Colorado will lose, but do we really need to f*** Seattle? If you look at all the other posts by them, they are all really positive and it actually ignites passion in the heart of every fan. And not to forget the recent letter to the players written by the ultras. It even gave my wife goosebumps (she just started following sports and she has never been so passionate about a team before). Why can't it just be about these good things? Why do we need to f*** the opponents?

Just to be clear, I am all for booing the referee when he makes a mistake, or even yelling at an opponent when he behaves in an unsporting manner. But not because he plays extremely well causing trouble to our team. I recently happened to be in Seattle and went for an MLS game there. They have their own supporters groups who are as passionate as us (ok, may not be as much as us). That doesn't make them our enemies or anything. Even though I liked the atmosphere there, I couldn't join them on even a single chant because it just didn't feel right. That's the kind of passion we want. We don't have to hate others to be passionate about our team.

Even in India, where people are crazy about Cricket, butchering and yelling at opponent players does not happen. The Indian Premier League (it is the major cricket tournament in India), has teams and players from all over the country as well as the word. But there the fans don't yell that opponents suck, instead they cheer their players, they say good things about their players no matter what. They respect the opponents.

I love San Jose Earthquakes. My heart will never cheer for another MLS team ever. I love ultras. Even though I don't sit in section 109, i always chant with them involuntarily throughout the game. But i'd really love it if the fans (not just the ultras, everyone) can focus more about the good stuff on our side rather than yelling at opponents.

It is called "home advantage" for a reason. It is not called "away disadvantage". Even the players exchange jerseys with opponents after the game. Why should we see them as enemies? Let's make the opponents feel welcome. Let's beat them in the sport on the field, not with words off the field.

As Eric Raymond said in Cathedral and Bazaar, Any energy you spend hating the opponents would be better spent on loving our team's craft (rephrased to fit into context).

Even though this post talks vastly about soccer, I have seen this happen in all the American games (baseball, football and probably hockey too).

For the first time in life, I have the opportunity to follow a team I love passionately by going to the stadium week after week. This is just my 20 cents for making real passion come out of any sport. Supporting your team is one thing, but bashing the opponents.. doesn't make you sound like a good person. Just think about it for a second before yelling.


-Vignesh

Friday, September 20, 2013

Bucket List of People to Meet in Lifetime!

We all love meeting celebrities. Because of the geography that I live in right now, I have had the opportunity to meet quite a few of them over the past year.

I always had this list of people to meet in person before I die in my mind. Until a year ago, It was mostly more of a fantasy list. But once I moved to where I am now, the fantasy started becoming reality. So I wanted to transfer that list from my brain to a document so that I don't miss out on anyone if an opportunity knocks on the door.

Here is the list (in no particular order):

PersonWho/What/Why?Met/Been There?Note/Souvenir
Thierry HenryThe person I respect the most in the world.No-
Don KnuthFather of modern computer science.No-
Dennis RitchieFounder of C (The R in K&R).Not possible anymore!-
Brian KernighanFounder of C (The K in K&R).Yes2013-06-20: Autograph
Linus TorvaldsFounder of Linux and Git. Strongly believes in whatever he believes in.No-
Robert LoveA huge contributor to the Linux kernel.Yes2013-06-13: Autograph
Bjarne StroustrupFounder of C++.Yes2013-08-15: Picture with him & Autograph
Randall MunroeHe is a hero of mine and worship his sense of Sarcasm and WitNo-
Matthew PerryMy most favorite actor in the world.No-
Lisa KudrowMy most favorite actress in the world.No-
Michael SchumacherHe was a huge inspiration as i grew up watching him win.No-
Larry & SergeyMy role models in life.YesEvery Fridays (now every Thursdays).
Matt CuttsOne of the early employees of Google and famous for his work on Web Spam.Yes2012-12-20: Lunch
Jeff DeanThe most bad-ass engineer ever.Yes2013-01-22: A walk around Charleston Park
Stade De FranceMy most favorite football stadium in the world.No-
Nou CampThe holy grail of football.No-
The Corrs (Sharon Corr)My most favorite band and most favorite violinist.No-
Felicity HuffmanHer character's attitude in Desperate Housewives resembles almost 100% that of my wife.No-
Jim ParsonsWho wouldn't wanna meet him?No-
Ramsus LerdorfFounder of PHP. The language i have written most of my code in.No-
Jeffrey ArcherMost favorite author in the world.No-
Paolo MaldiniI grew up watching him play. Perfect combination of style and class.No-
Arsene WengerI grew up watching him. One of the most inspirational people.No-
Vint CerfThe reason why we all have a job. Founder of TCP.Yes2012-11-20: Said hi and shook hands
Kunnakudi VaidyanathanA person who can talk with violin.Not possible anymore!-
Ron RivestThe R in RSA.No-
Petr MitrichevHas been Topcoder #1 for many years.No-
Mary Lynn RajskubSecond most favorite actress.No-

I will try to keep this list updated mostly as a record for myself rather than for the world to see.


-Vignesh

Wednesday, September 11, 2013

VLC Media Player: Automatically Skip Songs in Indian Movies!


I watch a lot of movies. Really a lot. And VLC Media Player is my (and many others') favorite. Indian movies are plagued with songs in irrelevant times and most of the time it just interrupts the pace/flow of the movie. No offense to music lovers/music makers, I like listening to songs in general. But I don't like them in the middle of an important scene in the movie.

The Problem

Whenever a song starts, inevitably I try to use the seek bar (using the seek bar is really one of the big pain points of any media player as it almost never takes you to where you want) and seek to the end of the song. Most of the time I end up seeking either just after the song (thereby missing something important) or to some portion in between the song (thereby having to wait for some more time for the song to end).

As an engineer, I naturally wondered, Wouldn't it be wonderful to have an automated way (preferably a keyboard shortcut) to just skip the song and move to the more important stuff?

This is exactly what I sat down to solve. Based on this xkcd, it seemed like it would be worth the time.And I (sort of) have a perfect solution that helps me skip songs automatically in the press of a button in VLC Media Player.

The Solution

As hard as the problem might seem, I ended up using a very simple heuristic. Start analyzing the audio stream, and whenever there is a silence for about a second or so, it's likely that the song ends there. I just came up with this heuristic based on the fact that most Indian movie songs are continuous (either lyric or the music goes on throughout the song without any breaks) and when the song ends, there is usually a small interval of silence before the next scene starts. And if there is a silence somewhere in between the song, just do the analysis again and it will take you to the next silence which is most likely the end of the song.

Is it perfect? Absolutely not. It's not even a solution, it's more of a heuristic (aka hack) which exploits some pattern in the Indian movie songs. And in my observation (I have been using this for quite a while now), It seems to be working correctly 99% of the time.

Implementation Details

Note: This section has technical jibber-jabber. If all you care about is how to use the script in your VLC media player, skip ahead to the "Usage" section.

First things first, I chose VLC media player, because that's the one I use. If you aren't using it, then you should start using it too. To begin with, we need to query VLC Media Player.

The overall flow goes something like this:
  1. Get the name of the file that VLC is currently playing
  2. Get the time point of the current playback from VLC
  3. Analyze the audio stream of the file and detect the next silence beginning from the time point of current playback
  4. Seek VLC to the determined duration where silence was detected (this is likely the end point of our song)
As complex as these steps might seem, they are fairly trivial to accomplish. To perform steps 1, 2 and 4 all we need to do is enable the HTTP interface in VLC. Once that's done, it is straightforward to get details of playback and control the player through a simple HTTP interface. The 2nd step is a little more tricky as it involves analysis of the audio stream of a file. Fortunately, we have a swiss army knife in our hands which will not only analyze the audio stream, but pin point us to the exact location of silence that we are looking for. The tool is none other than FFmpeg. The silence detect filter in ffmpeg has been used to accomplish this.

Here is a rough sketch of the ffmpeg command that I use:

ffmpeg -ss <start_time> -i <input_file> -t 600 -vn -af silencedetect=noise=0.1 -f null -

Let me break that up:
  • -ss <start_time> :- seeks to the specified time in the input file. this value for this is obtained from VLC's HTTP interface
  • -i <input_file> :- absolute path of the file that VLC is currently playing. this value is obtained from VLC's HTTP interface
  • -t 600 :- analyzes only 600 seconds (10 minutes) of audio to detect for silence (as Indian movie songs are hardly longer than 10 minutes).
  • -vn :- ignore the video
  • -af silencedetect=noise=0.1 :- enable the silence detection filter with a threshold of 0.1dB. this value was picked by trial and error.
  • -f null - :- just print the output of the filter in stdout rather than a file.

We then grep for the exact duration and then seek VLC based on this output.

Code

Look into the variables on top of the file and change them as per your environment if required.

Usage

To use this script, you need to install the following (fairly straightforward if you are tech-savy, but doable even if you are not).


Once you do the above steps, all you need to do is to bind a keyboard shortcut such that the script will execute. For Mac, I used Keyboard Maestro to set up a global keyboard shortcut which will invoke the script. There should be an equivalent program for Windows/Linux too. So that whenever a song starts, I merely use the keyboard shortcut to skip it.

Hope you enjoy it.


-Vignesh


Education is a cure for all problems. Donate for the cause of Educating kids: Computer Kindness Foundation is helping schools to build Libraries. Follow the link to contribute.

Monday, July 29, 2013

Our Story!


Circa May 2005 - The Characters

Boy - A 10th standard student in Coimbatore, who moves to Madurai for higher secondary schooling.

Girl - A 10th standard student in Chennai. No prizes for guessing where she moves for her higher secondary schooling!

May 2005 to June 2007 - The Beginning

As many would anticipate, they both ended up being classmates in their new school. Despite that, sadly, nothing interesting happened in this period of time (we know, they were such idiots back then!). They just looked at each other on random days and barely spoke.

June 2007 - The Actual Beginning

The girl moved back to Chennai and the boy moved back to Coimbatore for college. As with most couples of this generation, they started conversing with each other in the form on SMS'es and phone calls. Few days after that, they felt they were really close to each other. Few months after that, they realized they can't live without each other.

Few Months (or years) Later

The boy was on a late night train journey and as it was always, they were talking over phone (despite the annoying train noise). He felt something spontaneously and popped the question. It took a while for him to get an answer, but it was an answer that he rejoices till today!

P.S. The time frame of the above paragraph is omitted intentionally. ;-)

September 2011 - LGTM

The girl told about her life choice to her parents and the boy did the same to his parents. Both of them were genuinely happy instantaneously. No hesitation, No fuss, Pure happiness. It was then they realized how gifted they were to have such wonderful parents!

September 2012 - Its Official

The boy and the girl got engaged on September 2nd, 2012. It was a small but wonderful ceremony with family and friends.

December 2012 to March 2013 - The Present

We are writing this draft over a video chat (damn you geography!). We are really excited about the brand new phase of our lives that we are about to step on to. So please mark your calendars and try to be there on our special day, as your wishes would mean a whole world to us!

By the way, the girl's name is Gayathri and the boy's name is Vignesh! :-)

March 2013 and Beyond

We are undergoing our "Happily ever after" phase. :-)

P.S.: I didn't write this now. I am just copying this from my wedding website. Since that domain expired, I wanted this to live somewhere on the internet.


-Vignesh

Sunday, July 14, 2013

Announcing Social Photos v2!

I have been working on this side project for quite a while now and I am happy to announce that it is launch ready now!

Visit http://socialphotos.net to manage all your digital photos across Social Networks in one roof using a simple intuitive user interface.

Features Include:

  • Transfer Photos
  • Transfer Albums
  • Download selective albums as a zip file
  • View Slideshow of your albums
  • Monitor progress in a simple pane
  • And much more!

Please do feel free to give feedbacks/suggestions. Use it and Share it!


-Vignesh