Archive for the ‘Tips’ Category
Kill all processes of a user
The following command will kill all processes belong to a single user on Linux.
pkill -u username
Playing .ass subtitles with mplayer
$ mplayer -ass -sub subtitle.ass file.avi
Change default editor in Debian
# update-alternatives --config editor
There are 7 alternatives which provide `editor’.
Selection Alternative
———————————————–
1 /bin/ed
+ 2 /bin/nano
3 /usr/bin/vim.tiny
* 4 /usr/bin/vim.basic
5 /usr/bin/nedit
6 /usr/bin/emacs21
7 /usr/bin/xemacs21
Press enter to keep the default[*], or type selection number: 6
If someone comes and tells you “I can’t login to my Linux box” what would you do?
You can do many things, but one of them has to be:
check the bloody log file.
Enable sudo insults
$ sudo visudo
Look for line begins with Defaults, and append insults to the end.
Defaults env_reset,insults
Save it, and clear the sudo session (sudo -K), and try sudo with a wrong password.