24 Dec 2011

Redirect root mail to external address in Debian

To redirect root mail to an external email just use /etc/aliases

# vi /etc/aliases

root: youremail@email.com

# newaliases
17 Apr 2011

Recover Ubuntu Boot Problems

I recently had a problem with my development machine. I haven’t used it in a while and realized I could not VNC or SSH to the box. This is a headless machine so I had to plugin a monitor and keyboard to see what was happening. I was greeted with the following:

Target file system doesn’t have /sbin/init
No init found. Try passing init= bootarg

Busybox v1.13.3 (Ubuntu 1:1.13.3-1ubuntu7) built-in shell (ash)
Enter ‘help’ for a list of built-in commands
(initramfs) _

Not very happy about this. Running “help” didn’t reveal any tools that would repair the boot volume. To recover I booted to an Ubuntu 10.10 CD and select the option to “Try Ubuntu”. Once this started I used Ctrl + Alt + F1 to get to a shell and ran the following:

sudo fdisk -l
sudo fsck /dev/sda1

Running fdisk -l was just to be sure of the naming convention for my main drive, which in this case was /dev/sda1. I had to enter yes a couple times and then rebooted the machine which loaded successfully.

14 Nov 2010

Build pure-ftpd for Debian Lenny running on OpenVZ

Capabilities on OpenVZ causes pure-ftpd not to start when installing with the package manager. Use the following method to download the source and build pure-ftpd without capabilities.

mkdir /usr/src/pure-ftpd
cd /usr/src/pure-ftpd

apt-get source pure-ftpd
apt-get build-dep pure-ftpd

Edit the rules file and add the following to optflags [--without-capabilities]

cd pure-ftpd-1.0.21/debian
vi rules

optflags=–with-everything –with-largefile –with-pam –with-privsep –with-tls –without-capabilities

Build the package and install it.

cd ..
dpkg-buildpackage -uc -b

cd ..
dpkg -i pure-ftpd-common_1.0.21-11.4_all.deb pure-ftpd-mysql_1.0.21-11.4_i386.deb
/etc/init.d/pure-ftpd-mysql restart

Prevent the package manager from trying to update pure-ftpd

echo 'pure-ftpd-common hold' | dpkg --set-selections
echo 'pure-ftpd-mysql hold' | dpkg --set-selections
13 Nov 2010

Debian Keyring

On a new VPS I was getting the following error when running apt-get update

GPG error: http://security.debian.org lenny/updates Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 9AA38DCD55BE302B

To resolve this, install the following package:

aptitude install debian-archive-keyring
aptitude update
aptitude dist-upgrade
18 Sep 2010

Install Google Chrome on Fedora 13

Add the Google Repo

sudo vi /etc/yum.repos.d/google.repo

[google]
name=Google – i386
baseurl=http://dl.google.com/linux/rpm/stable/i386
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

Now run the installation with yum

sudo yum install google-chrome-stable
27 Jul 2010

Ubuntu Lamp Server

Quick and dirty Ubuntu Lamp Server

A lamp server on Ubuntu is pretty simple to setup to get working right away. Simply run the following command:

sudo tasksel install lamp-server

Create a MySQL password:

Tasksel will continue to install the components:

Open your browser and point to http://localhost. You should see the following message:

It works!
This is the default web page for this server.
The web server software is running but no content has been added, yet.

24 Jul 2010

Installing JRE on Ubuntu 10.04

How to install JRE6 on Ubuntu 10.04

Installing Java Runtime Environment and the plug-in on Ubuntu Lucid is pretty straightforward. The first step is to enable the partner repository in /etc/apt/sources.list

## Uncomment the following two lines to add software from Canonical’s
## ‘partner’ repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu lucid partner
deb-src http://archive.canonical.com/ubuntu lucid partner

Once the sources are added, run an update

sudo apt-get update

Run the following command to install the Java Packages

sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts

Run the following to verify the installation

java -version

java version “1.6.0_20″
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)