Skip to content


How to relay mail from an ubuntu server running postfix to gmail servers

Edit /etc/postfix/main.cf with the following

smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = secure
smtp_tls_mandatory_protocols = TLSv1
smtp_tls_mandatory_ciphers = high
smtp_tls_secure_cert_match = nexthop
smtp_tls_CApath = /etc/ssl/certs
relayhost = smtp.gmail.com:587

echo “smtp.gmail.com:587 smtp_user:smtp_passwd” > /etc/postfix/sasl_passwd
postmap hash:/etc/postfix/sasl_passwd
service postfix restart
echo “Test mail from postfix” | mail -s “Test Postfix” you@example.com

Posted in General.


Build mythbuntu 14.04 frontend

Installed from 14.04 (usb drive, cd-rom or pxe boot)
reconfigure sources.list to point to local repo and install aptitude
apt-get update
apt-get upgrade
apt-get install openssh-server rpcbind nfs-common snmpd smartmontools mutt postfix ssh dstat iptraf logwatch dselect mailutils sysv-rc-conf gparted ntp iftop apcupsd ethtool libauthen-pam-perl libio-pty-perl apt-show-versions libnet-ssleay-perl
mkdir /dvr /offline
nano /etc/fstab
192.168.1.220:/offline /offline nfs soft,intr,rsize=32768,wsize=32768,async,nfsvers=3,bg,actimeo=0,tcp
192.168.1.220:/dvr /dvr nfs soft,intr,rsize=32768,wsize=32768,async,nfsvers=3,bg,actimeo=0,tcp

mount -a
copy blootube theme
cp -R /dvr/files/blootubelite-wide/ /usr/share/mythtv/themes/

RSYNC
cp /offline/files/rsync/rsyncd.conf /etc
cp /offline/files/rsync/rsyncd.secrets /etc
chmod 600 /etc/rsyncd.secrets
nano /etc/default/rsync and enable
/etc/init.d/rsync restart

SNMP
cp /offline/archive/common/snmpd.conf /etc/snmp
/etc/init.d/snmpd restart

SMARTD
cp /offline/archive/common/smartd.conf /etc/smartd.conf
nano /etc/default/smartmontools
start_smartd=yes
/etc/init.d/smartmontools restart

APCUPSD
cp /offline/archive/common/apcupsd.conf /etc/apcupsd
nano /etc/default/apcupsd and make isconfigured=yes
/etc/init.d/apcupsd restart

WEBMIN
dpkg -i /offline/files/webmin_1.610_all.deb

Mythtv log files changes
rm /etc/logrotate.d/mythtv-*
cp /dvr/scripts/logrotate.d/mythtv /etc/logrotate.d/
mkdir /var/log/mythtv/old
chown syslog.adm /var/log/mythtv/old
cp /dvr/files/lirc/mythtv.precise /home/desktop/.lirc

Wake on lan if supported
echo ‘ethtool -s eth0 wol g’ >> /etc/rc.local

Posted in Linux, Mythtv.


backuppc errors

If you find your backuppc log filling up with entries like the ones below, you can fix these warnings with one command thanks to a entry I found at http://www.nooblet.org/blog/2012/backuppc-use-of-qw-as-parentheses-is-deprecated/

Use of qw(…) as parentheses is deprecated at /usr/share/backuppc/lib/BackupPC/Storage/Text.pm line 302.
Use of qw(…) as parentheses is deprecated at /usr/share/backuppc/lib/BackupPC/Storage/Text.pm line 302.
Use of qw(…) as parentheses is deprecated at /usr/share/backuppc/lib/BackupPC/Storage/Text.pm line 302.
Use of qw(…) as parentheses is deprecated at /usr/share/backuppc/lib/BackupPC/Lib.pm line 1425.
Use of qw(…) as parentheses is deprecated at /usr/share/backuppc/lib/BackupPC/Lib.pm line 1425.
Use of qw(…) as parentheses is deprecated at /usr/share/backuppc/lib/BackupPC/Lib.pm line 1425.
Use of qw(…) as parentheses is deprecated at /usr/share/backuppc/lib/BackupPC/Storage/Text.pm line 302.
Use of qw(…) as parentheses is deprecated at /usr/share/backuppc/lib/BackupPC/Lib.pm line 1425.
Use of qw(…) as parentheses is deprecated at /usr/share/backuppc/lib/BackupPC/Storage/Text.pm line 302.
Use of qw(…) as parentheses is deprecated at /usr/share/backuppc/lib/BackupPC/Lib.pm line 1425.
Use of qw(…) as parentheses is deprecated at /usr/share/backuppc/lib/BackupPC/Storage/Text.pm line 302.
Use of qw(…) as parentheses is deprecated at /usr/share/backuppc/lib/BackupPC/Lib.pm line 1425.

grep -ril ‘qw(‘ /usr/share/backuppc/lib/BackupPC/|while read file; do sed -i “1i no warnings ‘deprecated’;” $file; done

Posted in General.


Building mythbuntu 12.04 frontend

Installed from 12.04 (usb drive, cd-rom or pxe book)
reconfigure sources.list to point to local repo and install aptitude
aptitude update
aptitude upgrade
aptitude install openssh-server rpcbind nfs-common snmpd smartmontools mutt postfix ssh dstat iptraf logwatch dselect mailutils sysv-rc-conf gparted ntp iftop apcupsd ethtool
mkdir /dvr /offline
nano /etc/fstab
192.168.1.220:/offline /offline nfs soft,intr,rsize=32768,wsize=32768,async,nfsvers=3,bg,actimeo=0,tcp
192.168.1.220:/dvr /dvr nfs soft,intr,rsize=32768,wsize=32768,async,nfsvers=3,bg,actimeo=0,tcp

mount -a
copy blootube theme
cp -R /dvr/files/blootubelite-wide/ /usr/share/mythtv/themes/

RSYNC
cp /offline/files/rsync/rsyncd.conf /etc
cp /offline/files/rsync/rsyncd.secrets /etc
chmod 600 /etc/rsyncd.secrets
nano /etc/default/rsync and enable
/etc/init.d/rsync restart

SNMP
cp /offline/archive/common/snmpd.conf /etc/snmp
/etc/init.d/snmpd restart

SMARTD
cp /offline/archive/common/smartd.conf /etc/smartd.conf
nano /etc/default/smartmontools
start_smartd=yes
/etc/init.d/smartmontools restart

APCUPSD
cp /offline/archive/common/apcupsd.conf /etc/apcupsd
nano /etc/default/apcupsd and make isconfigured=yes
/etc/init.d/apcupsd restart

WEBMIN
aptitude install libauthen-pam-perl libio-pty-perl apt-show-versions libnet-ssleay-perl
dpkg -i /offline/files/webmin_1.610_all.deb

Mythtv log files changes
rm /etc/logrotate.d/mythtv-*
cp /dvr/scripts/logrotate.d/mythtv /etc/logrotate.d/
mkdir /var/log/mythtv/old
chown syslog.adm /var/log/mythtv/old
cp /dvr/files/lirc/mythtv.precise /home/desktop/.lirc

Wake on lan if supported
echo ‘ethtool -s eth0 wol g’ >> /etc/rc.local

Posted in General, Mythtv.


setting up sslh on ubuntu

1. aptitude install sslh
2. change line in /etc/default/sslh to RUN=yes
3. update DAEMON_OPS line to listen and forward from correct ip/port to correct ip/port
4. change /etc/apache/ports.conf from Listen 443 to Listen 127.0.0.1:443

Posted in General, Linux.


Building new backend 12.04 machine

Install using mythbuntu media
verify frontend works
exit frontend and start backend config, add cards, lineups etc
apt-get install aptitude
aptitude install cacti phpmyadmin backuppc
aptitude install openssh-server portmap nfs-common snmpd smartmontools mutt postfix ssh dstat iptraf logwatch dselect mailutils sysv-rc-conf gparted ntp iftop apcupsd xfsprogs

mkdir /dvr /offline
nano /etc/fstab

192.168.1.210:/offline /offline nfs soft,intr,rsize=32768,wsize=32768,async,nfsvers=3,bg,actimeo=0,tcp
192.168.1.210:/dvr /dvr nfs soft,intr,rsize=32768,wsize=32768,async,nfsvers=3,bg,actimeo=0,tcp

mount -a

nx debs
sudo dpkg -i /offline/files/nx/nxclient_3.5.0-7_amd64.deb
sudo dpkg -i /offline/files/nx/nxnode_3.5.0-9_amd64.deb
sudo dpkg -i /offline/files/nx/nxserver_3.5.0-11_amd64.deb

RSYNC
cp /offline/files/rsync/rsyncd.conf /etc
cp /offline/files/rsync/rsyncd.secrets /etc
chmod 600 /etc/rsyncd.secrets
nano /etc/default/rsync and enable
/etc/init.d/rsync restart

SNMP
cp /offline/archive/common/snmpd.conf /etc/snmp
/etc/init.d/snmpd restart

SMARTD
cp /offline/archive/common/smartd.conf /etc/smartd.conf
nano /etc/default/smartmontools
start_smartd=yes
/etc/init.d/smartmontools restart

APCUPSD
cp /offline/archive/common/apcupsd.conf /etc/apcupsd
nano /etc/default/apcupsd and make isconfigured=yes
/etc/init.d/apcupsd restart

WEBMIN
aptitude install libauthen-pam-perl libio-pty-perl apt-show-versions libnet-ssleay-perl
dpkg -i /offline/files/webmin_1.590_all.deb

Posted in General.


Mythbuntu 12.04 frontend build

1. to get autologin just add the following two lines to the /etc/lightdm/lightdm.conf
autologin-user=
autologin-user-timeout=0

2. to allow shutdown or reboot http://ubuntuforums.org/showthread.php?p=8690700

nano /usr/share/polkit-1/actions/org.freedesktop.consolekit.policy

<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE policyconfig PUBLIC
“-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN”
“http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd”><policyconfig><action id=”org.freedesktop.consolekit.system.stop”>
<description>Stop the system</description>
<message>System policy prevents stopping the system</message>
<defaults>
<allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>

<action id=”org.freedesktop.consolekit.system.stop-multiple-users”>
<description>Stop the system when multiple users are logged in</description>
<message>System policy prevents stopping the system when other users are logged in</message>
<defaults>
<allow_inactive>no</allow_inactive>
<!–<allow_active>auth_admin_keep</allow_active>–>
<allow_active>yes</allow_active>

</defaults>
</action>

<action id=”org.freedesktop.consolekit.system.restart”>
<description>Restart the system</description>
<message>System policy prevents restarting the system</message>
<defaults>
<allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>

<action id=”org.freedesktop.consolekit.system.restart-multiple-users”>
<description>Restart the system when multiple users are logged in</description>
<message>System policy prevents restarting the system when other users are logged in</message>
<defaults>
<allow_inactive>no</allow_inactive>
<!–<allow_active>auth_admin_keep</allow_active>–>
<allow_active>yes</allow_active>

</defaults>
</action>

</policyconfig>

Posted in Mythtv.


Sprint change radios

1. In the phone dialpad press: *#*#4636#*#*
2. Press Phone Information
3. In the upper right hand corner, press the (ICS) Menu icon
4. Choose “Select radio band”
5. Switch it to Cellular (800-Mhz Band)
6. Viola, you should now have stronger signal!

Posted in General.


How to get ubuntu precise running on a computer that does not support APCI

From the following posts I was able to get a computer to first install and then boot after installed due to the APCI errors it was getting.

http://ubuntuforums.org/showthread.php?t=1565089

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/348694

hit F6 when the cd reaches the purple screen with the human and the keyboard. This should bring up the usual boot menu with all the options for what to do with the live CD. Here press F6 again, and boot options will come up. The “acpi=off” option should allow you to boot. Now you can install if you want to. You will need to also fix the install as changing the installer does not also set the same requirements on the installed os.

Hold “Shift” while booting and you will be able to edit the boot options. Selecting the version you want to boot, and pressing e on it. In these boot options, add “acpi=off” to the end of the line that starts with “linux”. The should enable you to boot into your installation.

Lastly, you need to make this change permanent. Once booted, navigate to /etc/default/ and edit the “grub” file.
Look for the line that says “GRUB_CMDLINE_LINUX=”””
Change it to GRUB_CMDLINE_LINUX=”nolapic”

Now you should be able to boot this box every time.

Posted in General.


Generating a cert request to submit to startssl.com

Create the server key (in this example RSA 1024 bit):
openssl genrsa -out host.key 4096
Make a certificate out of it (it won’t be signed yet):
openssl req -new -key host.key -out host.csr
Create your CA certificate (will be valid for a year):
openssl req -new -x509 -days 365 -key host.key -out host.crt
Copy info from host.csr and plug it into startssl.com website. It will create text you will put in a .csr file

Create the .csr file in the /etc/apache2/ssl area, in this case I called it my host name webvm1.csr.

cp host.key webvm1.key

Enable the SSL module

sudo a2enmod ssl
Listen to port 443

echo “Listen 443″ | sudo tee -a /etc/apache2/ports.conf
Create and enable the SSL site

sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/ssl
Modify it so it looks something like this

NameVirtualHost *:443

ServerAdmin webmaster@localhost

SSLEngine On
SSLCertificateFile /etc/apache2/ssl/webvm1.newy.org.startssl.csr
SSLCertificateKeyFile /etc/apache2/ssl/webvm1.key
SSLCertificateChainFile /etc/apache2/ssl/sub.class1.server.ca.pem
SSLCACertificateFile /etc/apache2/ssl/ca.pem

…and enable it

sudo a2ensite ssl

don’t forget to modify /etc/apache2/sites-available/default

NameVirtualHost *:80

Posted in General.