User Tools

Site Tools


ubuntu:main

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

  • sudo do-release-upgrade

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:

  • cat /var/log/messages
  • dmesg | less ← shows he boot sequence with hardware detection
  • lsmod | less ← list of loaded drivers
  • lspci | less ←

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

  • To install apache, with the SVN dav, the easiest way is the command line:
sudo apt-get install apache2
sudo apt-get install subversion
sudo apt-get install libapache2-svn
  • Restarting apache (after having changed any parameter)
sudo /etc/init.d/apache2 reload
  • Edit apache settings
sudo gedit /etc/apache2/apache2.conf
  • If things don't work, you can check the apache log in /var/log/apache2/error.log

SVN (dav)

  • Edit SVN Dav settings
sudo gedit /etc/apache2/mods-enabled/dav_svn.conf
  • Add a user on SVN
sudo htpasswd -m /etc/apache2/dav_svn.passwd <username>

Networking

IP/Mac issues

  • How to renew the IP address (equivalent of “ipconfig /renew” in windows)
sudo dhclient -r eth0
sudo dhclient eth0
  • How to get the MAC address (and other network related information)
ifconfig

Dynamic DNS

  • The ddclient can be installed from the Ubuntu Software Center, it will automatically show a wizard to setup the parameters.

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:

  1. sudo apt-get install inspircd
  2. edit “/etc/inspircd” to set the correct configuration
  3. edit “/etc/default/inspircd” to enable the server
ubuntu/main.txt · Last modified: 2010/08/09 17:20 by dbug