Thursday, August 18, 2011

Git - Global gitignore

Some types of temporary files are spanding across project, such as .swp (VIM temporary file type).

To put *.swp to every project's repositories makes duplicate job.

One way to solve this issue is to put it to Global gitignore.

From this blog Git global ignores, i will copy to here, also.

- Create .gitignore file at somewhere, mostly at ~/
git config --global core.excludesfile ~/.gitignore


- An pattern of file, you want to do global ignore in to that file.

That's it.

Tuesday, August 16, 2011

[VIM] Mostly use FuzzyFinder and NERDTree shortkeys

Basic VIM
- Open new horizontal split :sp file
- Open new vertical split :vs file
- Switch between split pane: Ctrl-w + { h|j|k|l }
- Rotate pane down/right: Ctrl-w + r
- For more, see Vim documentation: windows

FuzzyFinder
- Open in vertical split: Ctrl-k
- Open in horizontal split: Ctrl-j

NERDTree
- Open in vertical split: s

Friday, August 12, 2011

[Solved] autoscan: not found

If you are in process of compiling something on Ubuntu and you get error similar to these
./bootstrap.sh: 24: autoscan: not found

You have to install autoscan program but you can not find autoscan with
sudo aptitude search autoscan

The package name you have to install is autoconf. I don't know why because I'm not an expert on C/Linux but after below command, the compilation works.
sudo apt-get install autoconf

Monday, August 1, 2011

Create simple Ubuntu(Debian?) start up script

- Create a file at /etc/init.d/<filename>
#!/bin/bash

case "${1:-''}" in
'start')
# put the command to start
;;
'stop')
# stop command here
;;
'restart')
# restart command here
;;
*)
echo "Usage: $SELF start|stop|restart"
exit 1
;;
esac


sudo update-rc.d <filename> defaults


sudo /etc/init.d/<filename> <start|stop|restart>


- To remove
sudo rm /etc/rc*/*<filename>


Credit: Ivan in How do I make sphinx restart when I reboot my Ubuntu server?

Config number of file descriptors on Linux

Check file descriptor limit for a process. Vary depending on owner of the process $ cat /proc/{process-id}/limits Check current number of...