Monday, August 22, 2011

Ubuntu Tricks

Create a shortcut with customized icon in Ubuntu
Right click -> Create a launcher
Type in the command, e.g.,
/home/owen/Programs/FRD/./frd.sh
Click on the left-top figure to change the icon
Unzip rar file
$ sudo apt-get install unrar
Grant a user root privilege
To enable a user run a sudo command without password, just run:
$ sudo visudo
Then add the following line after "root ALL=(ALL) ALL" like this:
username ALL=(ALL) ALL
After a logout or reboot, it will take effect.
Run a script at the system startup
Put the script example.sh into /etc/init.d/ and change its mode to executable by:
$ sudo chmod +x example.sh
Then update the rc by:
$ sudo update-rc.d example.sh defaults 80
Note: since example.sh is a shell script, it should start with: #! /bin/sh.
To remove this script from startup:
$ sudo update-rc.d example.sh remove
Set environment variable
Set a temporary environment variable:
$ export PATH=$PATH:another_path
Set a permanent environment variable for your own:
$ cd~
$ echo "export PATH=$PATH:another_path" >> .bashrc
Set a permanent environment variable for system-wide:
$ cd /etc
$ echo "export PATH=$PATH:another_path" >> bash.bashrc

No comments:

Post a Comment