Monday, July 8, 2013

Tmux Cheat Sheet

Cheat sheets:

tmux a -t
eg. tmux a -t 0

Wednesday, May 1, 2013

Change Ubuntu Time Settings

Change Timezone
# dpkg-reconfigure tzdata

Sync Time
# ntpdate

if the system does not have this, then run this command before the above
# sudo aptitude install tzdata

Sunday, April 7, 2013

MongoDB Errors Debug


JavaScript execution failed: Error: couldn't connect to server
couldn't connect to server shell/mongo.js

OS: Debian Squeeze 32 Bit

1. Due to improper shutdown.


Remove the Lockfile /var/lib/mongodb/mongod.lock:
# sudo rm /var/lib/mongodb/mongod.lock

Repair the database - run the command as the user 'mongodb':
# sudo -u mongodb mongod -f /etc/mongodb.conf --repair

Then start server
# sudo service mongodb start

Friday, January 4, 2013

Tips for using Git


git config core.filemode false //to disable file permission tracking

Managing remote repo

git remote add given-repo-name
git push given-repo-name master

Managing History

Rollback 'n' commits:
#git reset --hard HEAD~n
e.g. rollback 3 commits # git reset --hard HEAD~3

Rollback to a commit-id:
git reset --hard
local code and local history to that commit.

git reset --hard c1122334

git reset --soft
local code changes to that commit, but leave the history.
git reset --soft c4556677

Friday, October 26, 2012

Apache Website Settings


# find . -type f -exec chmod 644 {} \;     - for files
# find . -type d -exec chmod 755 {} \;    - for directories

Changing Group:

sudo chgrp -R www-data .    - change only if needed

Thursday, August 9, 2012

Advanced Google Search Tips

1. Search the exact word or phrase:
Example: "text to search"

2. Excluding Words in Search:
Example: "text to search" -word-to-exclude

3. Searching only inside a website:
Example: "text to search"

4. Combining two search results:
Example: "first search" OR "second search"

5. Searching with a range:
Example: wars 1850..1947

Tuesday, February 28, 2012

How to Get Remove the Smell Of Paint?

1. Chop an onion in half and put them in the room.

2. Try cutting up some onions, yes ok sounds strange and put a t light candle in the bottom, then water in the top with a few drops of oil just choose a smell you like

3.Chop up a few onions & a few cloves of garlic leave them in a bowl of water overnight, this will absorb the smell.

(from: )