Email boot log at startup in Ubuntu with bootmail

I’ve been searching for a way to save the output of the console when my Linux system boots up because

  1. I can’t spot errors fast enough at startup and
  2. I don’t notice errors on headless (no monitor) servers.

This shows a list of useful Linux log files, and I believe messages printed to the console at startup is stored in /var/log/boot.log. Don’t bother with bootlogd as described here as there are issues related to it.

To get these messages sent to your whenever the system reboots, one can use bootmail:

sudo apt-add-repository ppa:bootmail/ppa ## for ubuntu < 11.10
sudo apt-get update
sudo apt-get install bootmail ## enter in email address
sudo bootmail ## check

Make sure mail is set up for the root user.

Create bootable USB drives of Windows installation CD’s in Linux

Nearly all netbooks and many laptops don’t come with an optical storage drive (DVD/CD). To re-install an OS, one would need to boot it from a USB drive. In this post, I outline how I could create a bootable usb drive for a Windows 7 disc. The information was taken from a reply on this post. I assume the usb drive is /dev/sdb on the Linux machine. ms-sys is required.

 <pre class="src src-sh"><span style="color: #ff4500;">## </span><span style="color: #ff4500;">Run under root</span>

cfdisk /dev/sdb mkfs.ntfs -f /dev/sdb1 mount -o loop win7.iso /mnt/iso mount /dev/sdb1 /mnt/usb cp -r /mnt/iso/* /mnt/usb/ ms-sys -7 /dev/sdb

Automatically start Asterisk at boot time

Learned how to do so from this thread.

 <pre class="src src-sh"><span style="color: #b0c4de;">cd</span> ~/Downloads/asterisk/1.8/contrib/init.d <span style="color: #ff4500;">## </span><span style="color: #ff4500;">contrib folder is in source directory</span>

sudo cp rc.debian.asterisk /etc/init.d/asterisk sudo chmod 755 /etc/init.d/asterisk # to set the script as boot update-rc.d asterisk defaults

# to remove the script from boot update-rc.d -f asterisk remove

Modify the /etc/init.d/asterisk:

<pre class="src src-sh"><span style="color: #ff4500;"># </span><span style="color: #ff4500;">Full path to asterisk binary</span>