How to install and configure irssi

irssiirssi is a command-line IRC client.  When properly configured, it can automatically reconnect and re-identify to channels without any user intervention.  It is ideal for use within a reliable server shell, where your session is maintained between uses.

Step 1 – Install irssi

Not using aptitude?  Download from

Step 2 – Install a theme

I use the Zenbarn theme.  Save this theme (or another theme of your preference) in  ~/.irssi/

Step 3 – Install scripts

I use the following scripts.  Scripts are placed in  ~/.irssi/scripts/

Open any scripts you decide to use with a text editor and read the first few lines.  Some scripts require configuration to be used properly.  For example, you will need to set your email address to have private messages emailed to you.

To start a script automatically, create a symbolic link to it in  ~/.irssi/scripts/autorun/


If you prefer to start your scripts manually, or irssi is already running and you don’t want to restart it, use  /script load

Step 4 – Configure irssi

The following is my  .irssi/config  file.  Add your commonly used networks and enter your personal information.  If you decided against zenbarn, set the theme attribute to the your custom theme.

Step 5 – Start irssi within a screen session

screen keeps a shell running even after you’ve disconnected from it.  If you’re running irssi locally, you may not need to use screen.  Enter the single command  screen and read any information it prints.  Once you are prompted for a command, start irssi by entering  irssi 


There is already an excellent guide on using irssi with screen, so I will only go over the basics below.

  • Detach from the screen and return to your normal shell with Control+A, then press D
  • Re-attach to the running screen with  screen -rd
  • Switch the currently active channel with Alt+(Channel #)

How to speed up package updates using apt-fast (Debian & Ubuntu)

apt-fast downloads repositories (package sources) and packages in parallel, which can greatly shorten the time it takes to update a system.  In contrast, the default package manager (apt-get or aptitude) downloads repositories and packages sequentially.


Step 1 – Install apt-fast

Add the apt-fast repository to your package sources.


If you don’t have the add-apt-repository tool, install it by running  sudo apt-get install software-properties-common

If the package configuration asks which package manager to use, choose apt-get if you are running Ubuntu, or aptitude if you are running Debian.

When asked for how many connections to use, enter a reasonable number based on your connection.  If you have a fast connection, the default of 15 will most likely suit you.  If you’re on a slower connection, consider entering 5 or 10.  Try different values to find what works best.

You can reconfigure at any time by running  sudo dpkg-reconfigure apt-fast


Step 2 – Create an alias

Add the following to the end of your  ~/.bashrc file to perform a normal upgrade by typing uu


Note the  -y argument.  This causes any prompts (such as the download confirmation) to be answered yes automatically.

If you want a more thorough upgrade (which installs new kernels) use  dist-upgrade rather than  upgrade


lonniebiz on reddit writes:

If you’d like to see this in the main repositories and Ubuntu Software Center, add some heat to this bug by indicating that it affects you:

How to install Cacti with Nginx


Cacti provides an exceptionally easy to use system monitoring solution.  Essential graphs are included by default, such as load average and memory usage.  For additional graphs, download templates from Cacti’s website/forum or create your own.


This tutorial assumes MySQL and Nginx have been installed.

Step 1 – Install SNMPD

Step 2 – Configure SNMPD

Edit  /etc/default/snmpd, find the following line:

Replace it with:

Then add the following line to the ACCESS CONTROL area of  /etc/snmp/snmpd.conf:

Step 3 – Download non-free MIB files

Step 4 – Install Cacti and Spine (Cacti poller)

During the installation of Cacti, you will be asked if you’d like dbconfig-common to setup MySQL for Cacti automatically.  This creates a user and database for Cacti, and then imports the necessary data.  If dbconfig-common is unable to configure the database, or you decline to use it, visit this guide for help setting up MySQL on your own.

Step 5 – Add a symbolic link to Cacti’s web interface

Choose a location to access Cacti from, such as  /cacti or  /stats and create a symbolic link with that name.

  • Line 1: Change directory to the root of our site
  • Line 2: Create a symbolic link to Cacti’s web interface named cacti
  • Line 3: Optional Change owner and group of Cacti’s web interface to www-data

Step 6 – Finish configuration via Cacti’s web interface

Visit your Cacti installation with your browser of choice.  Log in to the default administrator account:

  • Username: admin
  • Password: admin

Click Settings in the menu on the left.  Verify each page of settings are correct, then visit this guide for more information on creating your first graphs.

How to install a mail server (postfix) supporting IMAP and POP3 (Ubuntu)

Step 1 – Create

Add an MX record to your DNS using the following parameters:

  • Hostnamemail
  • Priority10


Step 2 – Install and configure postfix

Don’t enter anything during the installation.  In the next step we will be configuring postfix more precisely, and any configuration set now will be overwritten.


Reference my configuration if you aren’t sure what to enter:

  • General type of mail configurationInternet site
  • System mail
  • Root and postmaster recipient: notblog  (Your sudo-privileged account, not root)
  • Other destinations to accept mail forlocalhost,,
  • Force synchronous updates on mail queue?No
  • Local networks: [::ffff:]/104 [::1]/128
  • Mailbox size limit
  • Local address extension character+
  • Internet protocols to useall


Step 3 – Change spool format to Maildir


Step 4 – Install IMAP and POP3 support

Answer No when asked about setting up a web interface.  There are much better alternatives to using courier for web mail.  I recommend roundcube.  Check back soon for a guide on using web mail.


Step 5 – Add aliases for multiple domains and mail accounts

This step is optional.  Following it will allow you to:

  • Handle mail for multiple domains with a single mail server.
  • Forward multiple mailboxes (webmaster, sysadmin, etc.) to a single mailbox.


  •  Line 1: Enter the domain name this mail server will be used for as well as any other domains hosted on this machine.  This will allow you to configure all of the domains to send mail to a single account.  Separate the domains with spaces.  If you aren’t using any other domains, enter the main domain only.
  • Line 2: This points postfix to the alias map at  /etc/postfix/virtual which we will be creating in the next step.  This file will describe where to forward mail sent to certain domains and/or mailboxes.


Write the following to /etc/postfix/virtual, adding domains and mailboxes you’d like to be forwarded:


Then run  postmap to optimize the alias map.  Postfix will read the file much more quickly if this step is taken.


Step 6 – Install dovecot


Step 7 – Restart postfix

How to monitor bandwidth usage with web-based (HTML) status reports

Example report

BandwidthD renders great bandwidth usage reports and is a breeze to install.

Step 1 – Install bandwidthd to monitor bandwidth usage

You most likely won’t need to enter any custom configuration values during installation.  Just make sure the interface to monitor is properly set, usually eth0.

Step 2 – Set up reverse DNS

By following this step your machine’s hostname will be displayed in the reports.  Without this step, only an IP address will be displayed.  Add a line to  /etc/hosts, consisting of your machine’s public IP address and its hostname.


Step 3 – Create symbolic link to status report directory

Bandwidthd writes its reports to  /var/lib/bandwidthd/htdocs/ by default.  We can easily serve these reports from a website by creating a symbolic link.

In this example, reports would be served at


How to log failed login attempts (Ubuntu)

  • Login: Attempted login user
  • Failures: Failed login attempts
  • Maximum: Allowed login failures before disabling the account
  • Latest: Date and time of last failed login
  • On: Where the failed login occurred

Step 1 – Enable in /etc/pam.d/common-auth

Add the following lines to the top of the file:


Step 2 – Enable in /etc/pam.d/sshd

Add the following lines immediately before  @include common-auth:


Step 3 – Enable PAM in /etc/ssh/sshd_config

Step 4 – Restart ssh