Thursday, December 13, 2012

Tuesday, December 11, 2012

Review - Web based task managers.

Remember The Milk

Doesn't let you add sub tasks.
Adding notes takes three clicks! (Select tasks, Notes Tab, Save)
Doesn't show completed tasks on the same page! (Isn't that feeling of seeing completed tasks what we need?)
Let's you tag them. That's a great feature. But it won't work for me. I don't have that many tasks.
Lists is a great feature.
Priorities is a great feature.

Flowy

Not free!

Todoist

Doesn't let you add notes.

hiTask

It's just too much! Definitly not for me. I need something minimalist.
This will definitely be the starting point, if I started developing one. It has a very intuitive interface  A little less intuitive though.

Tada List

Too simple. Google tasks is much better than this. I like this, but sub tasks and notes functionality missing.

Todo.ly

Doesn't let you add notes in the free version. Also, too busy.

Narvana

So far so good. All the features I want. Plus it follows GTD. But it doesn't have sub tasks. A little too advanced though. Whatever.

Doit.im

So far so good. All the features I want. Plus it follows GTD. But it doesn't have sub tasks. A little too advanced though. Whatever.

Winner: Asana! by far the best Task Management, Team Management software. And Free. And has everything. Hadn't tried it while doing this research, discovered it later.

Sunday, December 9, 2012

Get Process ID on Port basis

To get pid (Process ID) based on port, use the following command:

lsof -i tcp:80
This will return the process ID(s) running this port.

Responding to Saad's comment below:

Add '-n' (no host names) and '-P' (no port names) option and remove tcp to get process ID without providing tcp:
lsof -n -P -i :80

Monday, December 3, 2012

entering passphrase on every ssh

There is a nice html document on this subject here. But basically all it says is if you don't wanna type in your private key everytime you make an ssh connection, you can use ssh-agent to enter it just once when you login to your shell.

Some people say that it should already add your private key into the memory so it can readily be applied, however on my system, I have to add it on every login like so:
ssh-add ~/.ssh/id_rsa



OKAY.

When I ssh to my virtual machine (machine A) from my local machine (machine B), and I need to run ssh-agent, on that ssh (B-A) connection, this is how I do it:

exec ssh-agent bash

Then I need to run ssh-add ~/.ssh/id_rsa, which will add my key for this ssh terminal, and then I will be able to use the key without typing in pass phrase on machine A, from machine B.

Thursday, November 29, 2012

my personal git guide

To mark a file such that you always get its latest versip when you do git pull, but your changes are never comitted or pushed or shown in the diff:
git update-index --assume-unchanged /path/to/file
And to undo the last step:
git update-index --no-assume-unchaged /path/to/file

When you've made a commit in the detached head state

git checkout -b temp-branch-name
git merge
git branch -d temp-branch-name
git push origin master

Stashing

git stash save "Working on so and so. | 70% complete."
git stash list
git pull
git stash apply
Then resolve any conflicts in the reported files, and do
git add
to mark they're resolved. git stash apply applies the last stash by default; if you want to apply any earlier stash do:
got stash apply stash@{3}
Stashes are ordered such that stash@{0} is the latest, stash@{1} is the one before that ans so on. You can delete the stashes with:
git stash drop stash@{0}

To revert to an older commit.

Coming soon!

Wednesday, November 28, 2012

git what changed

So, let's see you just did a git pull, and you have a feeling the last few (let's say 4) commits are by a coupla not-so-bright people, and you want to take a look at the code added by them, commit by commit, file by file. One way would have been to just take the diff between HEAD and HEAD^^^^, but that it will only show you the net change, so what you can do is is this:
git whatchanged -p -4 --pretty=full
By the way, doing the following would get the same output as well:
git log -p4
Also, my boss asked me to come up with a way to find the commit history of just one file. I said, git would provide a functionality right away, let me look. He said no, don't 'waste' time on it. Well, here it is. I just stumbled upon it while fiddling with git log.
git log -p -4 /path/to/file
And if you wanna see the history of a Deleted file...
git log --follow -- /path/to/file
Needless to say, this can only be done for one file.

Sunday, November 11, 2012

Which linux version?

So you're using a linux version on some friend's machine. Or you have just logged in to a remote machine, and your curiosity isn't letting you do the simple cp command you went there to run, and you have to know the flavor and the release of the linux installed. Here's how you do it:
You run this:
cat /etc/*-release

Tuesday, September 18, 2012

Singleton Pattern

In software engineering, the singleton pattern is a design pattern that restricts the instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system. The concept is sometimes generalized to systems that operate more efficiently when only one object exists, or that restrict the instantiation to a certain number of objects. The term comes from themathematical concept of a singleton. 

— From Wikipedia, the free encyclopedia

Thursday, August 30, 2012

mysql tidbits

To list all the database, type the following command
mysql> show databases;
To list all the users, type the following command
SELECT user FROM mysql.user;

Wednesday, August 29, 2012

RFC

If you want to view RFCs for anything, chances are you usually type RFC 5988 in google, and click on the first link that comes up, which is usually: http://www.ietf.org/rfc/rfc5988.txt

Well, truly so, this is the most authentic of results.

If you're a student who wants to acquaint with,  study or memorize the rfc, in which case you'd want a beautifully formatted pdf. But mostly, you want the rfc for a quick reference, or to confirm something you already know. In that case, you'd really like the rfc to be navigable, well if you view it like this:

http://tools.ietf.org/html/rfc5988

It will be, complete with links to references and document sections!

Push and Pull Databases To and From Heroku

by Morten - Mar 18, 2009


A frequent question people ask us is “how do I transfer my database between my local workstation and my Heroku app?”

This is an important question for several reasons. First, you always own your data on Heroku, and we want you to be able to get to it quickly and easily at any time. Also – as you may have noticed from previous posts – we’re obsessive about workflow. Whether you’re debugging an issue with production data or setting up a staging environment, being able to quickly pull/push data between environments is key to a smooth experience.

Previously, we offered yaml_db as a solution. We liked that it was simple and database agnostic, but parsing large YAML files is just too slow. We also wanted something that works with any framework compatible with our Rack-based platform. Ricardo, Blake and Adam came up with Taps, which was released last month as astandalone project. Having collected some quality feedback from the community, we’re now pleased to announce that Taps is officially baked into Heroku, allowing seamless and easy database transfer between Heroku apps and any external environment.

To try it out, install the latest Heroku gem. Then use the “db:pull” command to pull your database down from your Heroku app to your local workstation:
$ heroku db:pull Receiving schema Receiving data 8 tables, 591 records users: 100% |================================| Time: 00:00:00 pages: 100% |================================| Time: 00:00:00 comments: 100% |================================| Time: 00:00:00 tags: 100% |================================| Time: 00:00:00 Receiving indexes Resetting sequences

This loads the schema, data, indexes and sequences of the remote Heroku database down into the local database specified in config/database.yml. You can also specify the destination database using standardURI-syntax:
$ heroku db:pull mysql://root:mypass@localhost/mydb

Because Taps uses ActiveRecord (for schema) and Sequel (for data), it seamlessly transfers between different database vendors. In fact, if you don’t feel like running a local database server, just use SQLite:
$ heroku db:pull sqlite://path/to/my.db
Of course, the syntax for pushing your local database up to Heroku is equally simple:
$ heroku db:push Sending schema Sending data users: 100% |================================| Time: 00:00:00 pages: 100% |================================| Time: 00:00:00 comments: 100% |================================| Time: 00:00:00 tags: 100% |================================| Time: 00:00:00 Sending indexes Resetting sequences

That’s Taps in a nutshell. It’s live right now, so check it out and let us know how you like it. Full docs are available here.

Monday, June 25, 2012

Python Parameters

Python works by passing by value!

So when you pass variables as inputs to procedures, it would evaluate first, and then pass that value to the procedure!

Aliasing commands in windows

You can do so using Doskey command. This used to be standalone external command in earlier versions of Windows, but since the NT based version  have started coming, this has been built into cmd.exe So, this is how you go about it:
C:\Windows\System32>doskey home=cd C:\users\mincho\desktop
C:\Windows\System32>
C:\Windows\System32>home
C:\Users\mincho\Desktop>_

Wednesday, May 30, 2012

Swapping Variables



So ruby offers this great feature I didn't know about (and I have been programming in ruby 'professionally' for past ~4 months) called Parallel Assignment. Which is to say that you can assign multiple variable different values at the same time effectively.

'Cool Story Bro,' you might say. Why is that a noteworthy thing? Because this just allows me to my assignments in one line of code? I could do that in C++/Java too with semi-colons in between the assignments! No sir, that's not the power of it.
The power is that first the values are read from the right side (in the order that they are written) and when all of them are read, then are written to the variables on the left.
Consider the famous swapping variables exercise which is done typically as:
temp = a;
a = b;
b = temp;
Using Parallel Assignment, you can do this as:
a, b = b, a
Well, if it ain't been long since you did this (or made someone do this), you will enjoy this nifty little trick.

That's all for now :)