If this blog helped you in any way, please donate a dollar here

Thursday, November 24, 2016

Showing Images on the terminal

So I just found a post on Hacker News where someone installed FreeBSD on their Mac, apparently because of this cool terminal thingy called Terminology. It can apparently show images on the terminal, using something called the EFL (Enlightenment Foundation Libraries), which are basically a  set of graphics libraries on the Enlightenment Window Manager. Now being the lazy dude I am, I decided I am not going to spend hacking UEFI today, rather why not spend hacking iTerm instead? I know iTerm shows me beer emoji when I do brew installs.


So surely, there must be some way of showing images right?

Well here we go:


Right on! Here's the amazing script which does this: https://raw.githubusercontent.com/gnachman/iTerm2/master/tests/imgcat

Happy Hacking!

Friday, January 8, 2016

One line youtube video downloader

Okay, so this might be illegal in certain places. I just decided to try this out for fun, and here we have it, download youtube videos with 1 line of shell script (and some perl)

The script looks like this:
curl -H 'Upgrade-insecure-requests: 1' -H 'Cache-control: max-age=0' -H 'Accept-language: en-US,en;q=0.8,bn;q=0.6' -H 'Accept-encoding: gzip, deflate, sdch' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36' "https://www.youtube.com/watch?v=II3L1noJlYQ" | gunzip | egrep -o 'https%3A%2F%2F[^\.]*\.googlevideo.com%2F[^,\]*' | perl -pe 's/\%(\w\w)/chr hex $1/ge' | head -n1  | xargs wget -O out.video
One line.

Get it here:

Thursday, October 29, 2015

Free SQL Query tool for SQL Server

I found this rather nifty tool: dBeaver which is pretty awesome for database queries, an alternative to RazorSql which the folks at my company used. Now, RazorSQL is not free and requires a license after the trial period ends, so I kept searching for an alternative which works. After fiddling around with thing like Squirrel and the likes, dBeaver impressed me majorly.

The tool is Eclipse based, so a bit slow to startup but apart from that, the software kicks ass!

Here's a few screenshots:


Hope you find this useful :)

Saturday, May 23, 2015

[OFF] The Universe Conspiracy and how Paolo Coelho tricked us

Paolo Coelho, in alchemist talked about the greatness of man and his will power. The fact that the whole Universe somehow takes on a supernatural role in fulfilling ones' wishes, if the person tried hard enough, if the person was willing enough. This was like saying that God helps those who help themselves. However, let me make it clear, I am an atheist and have no illusion of "God" or you may call me a non-believer.

However, the fact still remains for many of us out there, who have the will power and the motivation to get something done, still face failure. Sometimes no matter how hard we try, the Universe keeps conspiring against us.

There is no easy way to digest this fact that our failures are a part of our lives, we keep hoping we won't though just for our heart's sake. Be it a failed job interview, a failed attempt at hailing a taxi in the busy streets of Calcutta, failing in the exams or a lost lover, failures are a part and parcel of our lives. No matter how much we deny this, it still comes back to haunt us. The failures keep occurring.

I used to agree with Sir Paolo on the regard that maybe somehow we are not trying hard enough, maybe something still remained to be done. However, sometimes time makes me wonder if he was indeed right. What about the not so intelligent person who is trying to make a living playing chess? Maybe he loves to play the game, but is just not good enough at it. Others are blessed with something which he does not have, yet he still loves playing the game. Did he not try hard enough?

Take for example, your local slum-boy. He was unprivileged. Maybe he tried. Maybe he tried so much that it would make you wonder what would have happened to you, if you had tried so hard. Let me site the example of our beloved Prime Minister, who was a "Chai-Wala". He made it. However, for the majority of the people, the universe does the exact opposite.

Probably it is just human nature to look at the positive side of things, to feed our brain with "hope" in-spite of all odds. We would like to be hopeful even when we know it might not be useful. Probably that is why people believe Sir Paolo when he said that the Universe will help you. I am not sure they would have done the same, if he would have said, it won't.

Okay, on a more practical note, I would like it as well. I would like to be hopeful.