The purpose of this page is not to replace any of the gazillion of webpages, manuals, books and FAQ related to Ubuntu linux, but mostly to be used by me as a scratchpad for all these things I have to do regularly and never quite manage to remember :)
Ubuntu versionning
Displaying the currently installed version
Upgrading Ubuntu from the command line
Misc
Startup issues
If for some reason your system crashes on startup, you can try the following:
Boot in a fail safe version of the kernel
Wait until your reach the recovery console
Select the “root access”
type “cat /var/log/syslog | less” and look at the end of the file
other useful commands:
Configuration
Static mounting of drives
By default drives are automatically mounted when you plug/access them. Problem is that it gives automatic names and entries that can cause problems, like for example if you have your svn server on “drive 1”, which can happen to not be drive 1 anymore if you plugged an usb key. The solution is to edit /etc/fstab and specify the parameters saying “this disk should be mounted here, use this unique id to recognise the drive”.
If you indicate incorrect parameters in the fstab file, ubuntu will fail to boot. The easiest way to fix the problem is to accept the “manual shell editing”, and edit the file, using # to comment out the lines you added. You can edit the file by calling sudo nano /etc/fstab. If when trying to save the file you get informed that it cannot be saved because the filesystem is read only, then quit, type mount -n -o remount /, and edit again. Should work this time :)
Applications
Apache
sudo apt-get install apache2
sudo apt-get install subversion
sudo apt-get install libapache2-svn
sudo /etc/init.d/apache2 reload
sudo gedit /etc/apache2/apache2.conf
SVN (dav)
sudo gedit /etc/apache2/mods-enabled/dav_svn.conf
sudo htpasswd -m /etc/apache2/dav_svn.passwd <username>
Networking
IP/Mac issues
sudo dhclient -r eth0
sudo dhclient eth0
ifconfig
Dynamic DNS
Shell programming
Scripting
In a .SH script, if you want to run multiple commands in parallel (like launching multiple applications) and then exit without waiting for the other commands to finish, just add a ampersand symbol at the end of the line.
# Launches JungleDisk and XChat, then exits with the applications still running
/bla/blo/jungledisk &
/bla/blo/xchat &
IRC
PISG
PISG is an IRC log parser, used to update http://miniserve.getmyip.com/irclogs/oric.html . To install it, sudo apt-get install pisg should do. Then you need to update the configuration file pisg.cfg which is located in /usr/share/pisg. It's also the location where I keep the runpisg file called by cron to update the html stats.
Here is what the file looks like:
cd /usr/share/pisg/
pisg
echo "$(date) - Irc stats page generated for #oric" << /tmp/cron-events.log
To call this file regularly, all you need is to edit the cron tables using the command sudo crontab -e, when the editor window opens I add a line like that:
01 04 * * * /usr/share/pisg/runpisg
This will run the script at 4:01am on every day of every month.
IRC server
There's a number of IRC daemon around, but I decided to give a try to InspIRCd.
Installation is easy:
sudo apt-get install inspircd
edit “/etc/inspircd” to set the correct configuration
edit “/etc/default/inspircd” to enable the server