Wednesday, February 27, 2013


This is an awesome speech by Eric Thomas. Re-posting this so that I can read this whenever I feel down.

There was a young man that wanted to make a lot of money, right? So he went to this guru and told him, “I want to be on the same level that you’re on.”
The guru told him, “If you want to be on the same level I’m on, I’ll meet you tomorrow at the beach.”
So the young man got there at 4 A.M, all ready to rock and roll, got on a suit when he shoulda wore shorts. The old man grabs his hand and says, “How bad do you want to be successful?”
He said, “Real bad”
The old man says, “Walk on out into the water.”
So he walks on out into the water, waist deep. So, to himself, he’s like, “This guy is crazy”
He’s thinkin’, “I wanna make money, he’s got me out here swimming. I don’t want to be a life guard, I want to make money.”
The old man says, “Come out a little further.”
He walked out a little further, out to his shoulder area. He’s thinking, “This old man is crazy, he’s makin’ money but he’s crazy.”
The old man says, “Come out a little further.”
He came out a little further, it’s right at his mouth and he’s thinking, “I’m about to go right back, this guys out of his mind.”
So the old man said, “I thought you wanted to be successful?”
He said, “I do!”
The old man said, “Walk a little further.”
He did, he walked a little further. The old man grabbed his head, under water, held him down, the guy was kickin’ and scratchin’, still holding him down, he had him held down and just before he was about to pass out the old man raised him up.
“When you want to succeed as bad as you want to breath, then you’ll be successful.”
I don’t know how many of you have asthema, you have a asthema attack, you’re short of breath, you’re weezin’, the only thing you’re trying to do is get some air. You don’t care about no basketball games, you don’t care what’s on TV, you don’t care about a party. The only thing you care about when you’re trying to breathe is to get some fresh air, that’s it. And when you get to the point of when you want to be successful as bad as you want to breathe, then you’ll be successful.
And I’m here to tell you, number one, that most of you say want to be successful but you don’t want it bad, you just kind of want it. You don’t want it badder than you want to party, you don’t want it as much as you want to be cool, most of you don’t want success as much as you want to sleep! Some of you love sleep more than you love success. And I’m here to tell you that if you’re going to be successful you’ve got to be willing to give up sleep.
You got to be willing to work off of three hours, two hours, of sleep. If you really want to be successful somedays you’re going to have to stay up for three days in a row! Because if you go to sleep you might miss the opportunity to be successful. That’s how bad you have to want it. You’ve got to want it so bad that somedays you forget to eat.
Beyonce said once, on set, that three days had gone by and she was just doing her thing, she had forgotten to eat! Because she was engaged with her work.
When 50 Cent was doing his movie, did a little research, that when he wasn’t doing his movie, he was doing his soundtrack. And they said, “When do you sleep 50!?”
“Sleep?!”, he said, “Sleep?! Sleep is for those people who are broke. I don’t sleep. I got an opportunity to make a dream a reality.”
Don’t try to quit. You’re already in pain, you’re already hurt. Get a reward from it! Don’t go to sleep until you succeed.
You won’t be successful until you say, pointing to self, “I don’t need that money, because I got it in here.

Enhanced by Zemanta

Sunday, February 17, 2013

Enable NTFS write support on Mac OS X

This post will soon be moved to here
This blog has moved to
This post is outdated.

That is really annoying, isin't it? I mean, you plug-in your Disk into your mac, and all you know is you cannot write anything on it. Anyways, I have found an utility to enable mac to write on your NTFS Harddisk. its called ntfs-3g. Here are the steps to install it:

  • brew info fuse4x-kext
  • sudo /bin/cp -rfX /usr/local/Cellar/fuse4x-kext/0.9.2/Library/Extensions/fuse4x.kext /Library/Extensions
  • sudo chmod +s /Library/Extensions/fuse4x.kext/Support/load_fuse4x
  • mount -t fuse4x
  • sudo mv /sbin/mount_ntfs /sbin/mount_ntfs.orig
  • sudo rm /sbin/mount_ntfs
  • brew install fuse4x sshfs
  • sudo kextunload /System/Library/Extensions/fuse4x.kext/
  • sudo kextload /System/Library/Extensions/fuse4x.kext/
  • brew install ntfs-3g
  • sudo ln -s /usr/local/Cellar/ntfs-3g/2012.1.15/sbin/mount_ntfs /sbin/mount_ntfs
Yes, I know I did not give much of explanation here. Thats because I doubt if this is going to useful for some one. If you are reading this and need some explanation, let me know. I ll update this post as needed. But for now. This is for my future reference.

Saturday, February 9, 2013

Install PostgreSQL on OS X using Homebrew

This post will soon be moved to here
This blog has moved to
This post is outdated.

Strong advice: DO NOT use any "installers" for you development purpose. And by installers, I mean GUI based wizards / drag and drop ones. always rely on command-line. If you are not using Homebrew yet, Start using it immediately. For those who have never used it, is it like an "apt-get" for mac. Technically speaking, it is a package-manager. There is an other alternative to Homebrew called MacPorts. But I have never user MacPorts. I am happy with Homebrew. So I dont know much about MacPorts.  

So before installing through Homebrew make sure that you uninstalled the old version completely and restarted (Just to make sure there are no startup items related to postgres) your mac. Open "Activity Monitor" and ensure there are no "postgres" processes. And follow commands. If required run command "brew doctor" just to make sure that everything is OK with Homebrew.

  1. brew update
  2. brew install postgresql
  3. initdb /usr/local/var/postgres
  4. cp /usr/local/Cellar/postgresql/(your-pg-version)/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
  5. launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
  6. pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
Note: When you use Homebrew to install Postgresql, It does not create a "postgres" user for you. If you really need it, you can create one yourself. But normally the user that you are currently logged in as will  have super-user privileges. It comes in handy during development.

Sunday, February 3, 2013

iTerm2 / Bash Line Wrap Bug

UPDATE: Apologies. Looks like this is not a bug. It is an expected behavior. And I failed to read through the documentation properly. Thanks to Jorge for pointing this out. Here is what he replied as you can see in one of the comments below:

    I filed a bug to the iTerm people, and they quickly replied. It turns out is not a bug, just a bash idiosyncrasy. The iTerm2 developers pointed me to this link, where it is clear that the solution is to modify PS1, and surround the non-printing chars between '\[' and '\]', to tell the shell "everything between these escaped square brackets, including the brackets themselves, is a non-printing character.

    I have been using iTerm2 for about some 8 months now. It is the tool that I use for most of my day's work. I kind of dislike IDEs and GUIs. Honestly, I feel that they are sluggish. I love to work on terminal with Vim / Emacs. All these days, I have been ignoring a bug. A bug that is caused by the line that is longer than the width of terminal. And this bug is caused only when you customize the color of your command prompt (PS1). You can have a look at my .bash_profile file. in the first line, I have customized my PS1 as follows:

    `export PS1="\e[1;36m\W\e[m \e[1;35m>\e[m "`

    Lately, I had to break up long lines using `\`. But I sooner found that this was messing up the history too. When you scroll through the history, you can see some weird stuffs happening. Got me really annoyed. Having been annoyed enough, I decided to fix this. I went to iTerm2's GitHub repo. I checked the issue list, there was no issue like that. So I forked the repo and tried running through the source code myself and fix this bug. I went through the code, and there was nothing that I could really find to fix this. Then I had to rely on my old friends Google and StackOverflow. After some lame results, I landed on a SO page where this bug was explained. Looks like it was not an issue with iTerm, but with bash itself. You see, the bash counts the prompt symbols to determine the total line length and breaks the line according to width of terminal and line width. When you set a color \e[1;36m\e[m \e[1;35m[m which is equivalent to blue and pink, bash tends to treat them printable characters and cont it along with the command prompt. While the truth is it does not add length to command prompt, it just adds up color which is not countable. This messes up the buffer and causes the line wrap bug. So I have temporarily changed my prompt to just

    `export PS1=" \W > "`

without any color. I ll wait for some time. If no one else fixes this, I ll have to do it myself. I really need the prompt color. Because, for me, it is a visual distinction between the consecutive commands. I will post my update if I ever fix it. So for now, if you experience this bug, just delete all the colors. And send me a mail, I ll reply you If I happen to fix this.