Monday, October 26, 2009

Ubuntu mini tips and tricks

This is a list of little pesky tricks I have been using to solve problems: 1. Make a shell-script with relative paths run the same no matter where it is launches from - i.e. change the working directory to the path of the script itself:
# /bin/bash
cd `dirname $0`


2. Enable CRONTAB log to its own file:
#cd /etc/rsyslog.d/
#sudo touch ./cron.conf
#sudo *editor* ./cron.conf
ADD: "cron.* -/var/log/cron" /var/log/cron being the log-file
#sudo touch /var/log/cron
#service rsyslog restart


3. Firefox32 can't find "libqtcurve.so":
-download http://packages.ubuntu.com/jaunty/i386/gtk2-engines-qtcurve/download
-extract it using "sudo dpkg -x gtk*tab* ./gtk2" from the directory you downloaded it.
-press f5 to reload the current directory
-open the gtk2 directory we made, go into the lib directory
-f4 to bring up a terminal
-"sudo cp *current-location*/ /usr/lib32/"
-go up one level, go into the share directory
-"sudo cp *current-location*/ /usr/share/"
-restart firefox32, it should work great


4. Mount a disk on startup
-type "sudo crontab -e"
-add this line: "@reboot mount *device* *mount-point*"
For me this is: "@reboot mount /dev/disk/by-id/dm-name-pdc_dhbhddfagc4 /Data" which mounts my 4th partition, /dev/disk/by-id/dm-name-pdc_dhbhddfagc4 to /Data. Note that your partitions are probably under /dev/sda* or /dev/hda* - use "sudo fdisk -l" to list your disks.


5. Install microsoft fonts
-type "sudo apt-get install msttcorefonts"
-your done.


No comments:

Post a Comment