Archive for the ‘Ubuntu’ Category

There is an alternative for editing runlevels that can be used just like chkconfig:

To install:

$sudo apt-get install sysv-rc-conf

Excerpt from the manual:
sysv-rc-conf gives an easy to use interface for managing /etc/rc{runlevel}.d/ symlinks. The interface comes in two different flavors, one that simply allows turning services on or off and another that allows for more fine tuned management of the symlinks. It’s a replacement for programs like ntsysv(8) or rcconf(8).
sysv-rc-conf can also be used at the command line when the desired changes to the symlinks are already known. The syntax is borrowed from chkconfig(8).





If you actually want the chkconfig command in ubuntu, do the following:
$ apt-get install libnewt0.51
$ ln -s /usr/lib/libnewt.so.0.51 /usr/lib/libnewt.so.0.50
$ wget http://www.tuxx-home.at/projects/chkconfig-for-debian/chkconfig_1.2.24d-1_i386.deb
$ dpkg –force-all -i chkconfig_1.2.24d-1_i386.deb


1. Download chkconfig-1.2.24h-7.i386.rpm from http://rpmfind.net//linux/RPM/PLD/dists/ac/ready/i 386/chkconfig-1.2.24h-7.i386.html
2. Convert rpm to deb with: sudo alien chkconfig-1.2.24h-7.i386.rpm
3. Double-click on the deb file. This will invoke the package installer.

Read Full Post »

SShmenu for Gnome

SSHMenu is written entirely in Ruby so no compilation is required. Once you have the prerequisite libraries installed then it’s just a matter of putting the SSHMenu files in the right place.

If you are planning to package SSHMenu, then please split it into two packages (in whatever naming scheme works for your distribution):

  • sshmenu
  • sshmenu-gnome

The standalone sshmenu program does not rely on GNOME libraries and works quite happily in other desktop environments. It will work in any panel that has the ability to ‘swallow’ other application windows.






Ubuntu Installation


The core code with no GNOME dependencies (runs as a standalone application in its own window)


The GNOME-specific additions to the core (including the panel applet)

If you like doing things the hard way, you can go and grab the latest .deb files directly from here.

Or you can add this entry to your /etc/apt/sources.list:

  deb http://sshmenu.sourceforge.net/debian stable contrib

Import our repository key:

  gpg --keyserver subkeys.pgp.net --recv-keys 4CC00851
  gpg --export --armor 4CC00851 | sudo apt-key add -

And then install the relevant package and dependencies with these commands:

  sudo apt-get update
  sudo apt-get install sshmenu-gnome

Read Full Post »

Installing Perl modules from CPAN

There are several ways to get Perl modules from CPAN installed on your unix-based system. Keep in mind that there is always more than one way to do it with Perl, and this is no different. Before embarking upon any installation, it’s a good idea to download the module, unzip it and check out the documentation. In general, though, most modules are installed in the same method.
The simplest way to get Perl modules installed is to use the CPAN module itself. If you are the system administrator and want to install the module system-wide, you’ll need to switch to your root user. To fire up the CPAN module, just get to your command line and run this:

perl -MCPAN -e shell

If this is the first time you’ve run CPAN, it’s going to ask you a series of questions – in most cases the default answer is fine. Once you find yourself staring at the cpan> command prompt, installing a module is as easy as install MODULE::NAME – for example, to install the HTML::Template module you’d type:

cpan> install HTML::Template

CPAN should take it from there and you’ll wind up with the module installed into your Perl library.
Let’s say you’re on your system command line and you just want to install a module as quickly as possible – you can run the Perl CPAN module via command line perl and get it installed in a single line:

perl -MCPAN -e ‘install HTML::Template’

As I mentioned earlier, it’s always advisable to download a module yourself, especially if you’re having problems installing with CPAN. If you’re on the command line, you can use something like wget to grab the file. Next you’ll want to unzip it with something like:

tar -zxvf HTML-Template-2.8.tar.gz

This will unzip the module into a directory, then you can move in and poke around – look for the README or INSTALL files. In most cases, installing a module by hand is still pretty easy, though (although not as easy as CPAN). Once you’ve switched into the base directory for the module, you should be able to get it installed by typing:

perl Makefile.PL
make test
make install

Read Full Post »

This guide is intended to provide you with simple instructions on how to install Nagios from source (code) on Ubuntu and have it monitoring your local machine inside of 20 minutes. No advanced installation options are discussed here – just the basics that will work for 95% of users who want to get started.
These instructions were written based on an Ubuntu 6.10 (desktop) installation.
What You’ll End Up With
If you follow these instructions, here’s what you’ll end up with:
* Nagios and the plugins will be installed underneath /usr/local/nagios
* Nagios will be configured to monitor a few aspects of your local system (CPU load, disk usage, etc.)
* The Nagios web interface will be accessible at http://localhost/nagios/
Required Packages
Make sure you’ve installed the following packages on your Ubuntu installation before continuing.
* Apache 2
* GCC compiler and development libraries
* GD development libraries
You can use apt-get to install these packages by running the following commands:
sudo apt-get install apache2
sudo apt-get install build-essential
sudo apt-get install libgd2-dev

1) Create Account Information

Become the root user.

sudo -s

Create a new nagios user account and give it a password.

/usr/sbin/useradd nagios
passwd nagios

On Ubuntu server edition (6.01 and possible newer versions), you will need to also add a nagios group (it’s not created by default). You should be able to skip this step on desktop editions of Ubuntu.

/usr/sbin/groupadd nagios
/usr/sbin/usermod -G nagios nagios

Create a new nagcmd group for allowing external commands to be submitted through the web interface. Add both the nagios user and the apache user to the group.

/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -G nagcmd nagios
/usr/sbin/usermod -G nagcmd www-data

2) Download Nagios and the Plugins

Create a directory for storing the downloads.

mkdir ~/downloads
cd ~/downloads

Download the source code tarballs of both Nagios and the Nagios plugins (visit http://www.nagios.org/download/ for links to the latest versions). At the time of writing, the latest versions of Nagios and the Nagios plugins were 3.0rc1 and 1.4.11, respectively.

wget http://osdn.dl.sourceforge.net/sourceforge/nagios/nagios-3.0rc1.tar.gz
wget http://osdn.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz

3) Compile and Install Nagios

Extract the Nagios source code tarball.

cd ~/downloads
tar xzf nagios-3.0rc1.tar.gz
cd nagios-3.0rc1

Run the Nagios configure script, passing the name of the group you created earlier like so:

./configure –with-command-group=nagcmd

Compile the Nagios source code.

make all

Install binaries, init script, sample config files and set permissions on the external command directory.

make install
make install-init
make install-config
make install-commandmode

Don’t start Nagios yet – there’s still more that needs to be done…

4) Customize Configuration

Sample configuration files have now been installed in the /usr/local/nagios/etc directory. These sample files should work fine for getting started with Nagios. You’ll need to make just one change before you proceed…

Edit the /usr/local/nagios/etc/objects/contacts.cfg config file with your favorite editor and change the email address associated with the nagiosadmin contact definition to the address you’d like to use for receiving alerts.

vi /usr/local/nagios/etc/objects/contacts.cfg

5) Configure the Web Interface

Install the Nagios web config file in the Apache conf.d directory.

make install-webconf

Create a nagiosadmin account for logging into the Nagios web interface. Remember the password you assign to this account – you’ll need it later.

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

Restart Apache to make the new settings take effect.

/etc/init.d/apache2 reload

6) Compile and Install the Nagios Plugins

Extract the Nagios plugins source code tarball.

cd ~/downloads
tar xzf nagios-plugins-1.4.11.tar.gz
cd nagios-plugins-1.4.11

Compile and install the plugins.

./configure –with-nagios-user=nagios –with-nagios-group=nagios
make install

7) Start Nagios

Configure Nagios to automatically start when the system boots.

ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios

Verify the sample Nagios configuration files.

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

If there are no errors, start Nagios.

/etc/init.d/nagios start

8) Login to the Web Interface

You should now be able to access the Nagios web interface at the URL below. You’ll be prompted for the username (nagiosadmin) and password you specified earlier.


Click on the “Service Detail” navbar link to see details of what’s being monitored on your local machine. It will take a few minutes for Nagios to check all the services associated with your machine, as the checks are spread out over time.

9) Other Modifications

If you want to receive email notifications for Nagios alerts, you need to install the mailx (Postfix) package.

sudo apt-get install mailx

You’ll have to edit the Nagios email notification commands found in /usr/local/nagios/etc/commands.cfg and change any ‘/bin/mail’ references to ‘/usr/bin/mail’. Once you do that you’ll need to restart Nagios to make the configuration changes live.

sudo /etc/init.d/nagios restart

Configuring email notifications is outside the scope of this documentation. Refer to your system documentation, search the web, or look to the NagiosCommunity.org wiki for specific instructions on configuring your Ubuntu system to send email messages to external addresses.

Read Full Post »

Given are the following steps if you ever happen to forgot the root password:

  1. Turn your computer on.
  2. Press ESC at the grub prompt.
  3. Press e for edit.
  4. Highlight the line that begins kernel ………, press e
  5. Go to the very end of the line, add rw init=/bin/bash
  6. press enter, then press b to boot your system.
  7. Your system will boot up to a passwordless root shell.
  8. Type in passwd username
  9. Set your password.
  10. Type in reboot

There you go, relax and enjoy your time

Read Full Post »

  • Edit /etc/apt/sources.list file:
		gksudo gedit /etc/apt/sources.list
  • and add these lines to the end of it:
		deb http://debian.websterwood.com/ feisty main
		deb-src http://debian.websterwood.com/ feisty main
		sudo apt-get update
  • If your are using the Gnome Desktop then run this command:
		sudo apt-get install webilder webilder-gnome
  • If you are using the KDE Desktop then run this command:
		sudo apt-get install webilder webilder-kde
  • Right-click on the GNOME panel and choose “Add to Panel”
  • Under “Utility” near the bottom, you need select “Webilder Webshots Applet” and click on “Add”
  • You should see one small camera icon added to your desktop panel
  • Right-click on Flickr and select “Preferences” to edit it.

Read Full Post »

When Ubuntu freezes

  1. Is the computer frozen? Try going into one of the VTs by pressing <Ctrl><Alt> and F1. This way you may still have control of the computer and manage to kill the application which caused the problem. More on killing applications later.
  2. If you can’t change into a VT, try to kill the X session. This can be done by pressing <Ctrl><Alt><Backspace>. All applications that were opened during the session will automatically be killed, so you should gain control over the computer after you’ve been sent back to the login screen.
  3. OK, so you can’t kill X or go into VT. Let’s do a reboot, which can safely be done by pressing <Ctrl><Alt><Delete>. The machine will beep and start running the shutdown scripts.
  4. If for some reason one or more of the shutdown scripts should die, and the computer stops the rebooting process, press the key combination again to force a reboot. This not safe if the scripts haven’t gotten around to unmount the local filesystems.
  5. Final way out: Your computer doesn’t obey and none of above methods seem to give any response. Here’s a little trick that might help, not known to many Linux users! The kernel has a small userspace communication line opened, so even if the computer has crashed badly (I haven’t tried this during kernel-panic, though, can anyone confirm?) you can make it reboot safely. This method is safe, but should be used only if everything else fails! Hold down <Ctrl>, <Alt> and <PrtScrn/SysRq>. While holding down these, type the following letters – in order – R E I S U B. The computer will unmount any filesystems that are locally mounted, and safely bring down the system. If you have trouble remembering the letter combination; think busier, only backwards.

Read Full Post »

Older Posts »