April 26, 2016

Install StartSSL Certificate on Dovecot IMAP Server

wget http://www.startssl.com/certs/sub.class1.server.ca.pem -O sub.class1.server.ca.pem

cat www_certificate.pem sub.class1.server.ca.pem > /etc/ssl/certs/dovecot.pem

cat www_privatekey.pem > /etc/ssl/private/dovecot.pem

chown root:ssl-cert /etc/ssl/private/dovecot.pem

chmod 644 /etc/ssl/private/dovecot.pem

chown root:root /etc/ssl/certs/dovecot.pem

chmod 444 /etc/ssl/certs/dovecot.pem

In /etc/dovecot/conf.d/10-ssl.conf

ssl_cert_file = /etc/ssl/certs/dovecot.pem

ssl_key_file = /etc/ssl/private/dovecot.pem

wget http://www.startssl.com/certs/ca.pem -O /tmp/ca.pem

openssl s_client -CAfile /tmp/ca.pem -connect mail.example.org:993

February 03, 2016

init.d check if mount point exists

# Exit if mount point does not exist
if [ ! -s "/media/media-dupe/freenas" ]; then
  echo "Mount Point not Found"
  exit 0
fi

November 29, 2015

Raw Device Mappings for FreeNAS on ESX


lrwxrwxrwx    1 root     root            74 Nov 29 05:27 vml.0100000000202020202057442d5743415a4144323535373539574443205744 -> t10.ATA_____WDC_WD20EARX2D00PASB0_________________________WD2DWCAZAD255759
lrwxrwxrwx    1 root     root            74 Nov 29 05:27 vml.0100000000202020202057442d574d43315432383637353230574443205744 -> t10.ATA_____WDC_WD20EZRX2D00DC0B0_________________________WD2DWMC1T2867520
lrwxrwxrwx    1 root     root            74 Nov 29 05:27 vml.0100000000202020202057442d574d43344e31373438353032574443205744 -> t10.ATA_____WDC_WD20EZRX2D00D8PB0_________________________WD2DWMC4N1748502


vmkfstools -z /vmfs/devices/disks/vml.0100000000202020202057442d5743415a4144323535373539574443205744 /vmfs/volumes/MB6-1TB/freenas/MB3-2TB.vmdk
vmkfstools -z /vmfs/devices/disks/vml.0100000000202020202057442d574d43315432383637353230574443205744 /vmfs/volumes/MB6-1TB/freenas/MB2-2TB.vmdk
vmkfstools -z /vmfs/devices/disks/vml.0100000000202020202057442d574d43344e31373438353032574443205744 /vmfs/volumes/MB6-1TB/freenas/MB1-2TB.vmdk

November 04, 2015

Mediaworks Radiostation URL's for MusicBox


http://icecast.mediaworks.co.nz:8000/therock
http://icecast.mediaworks.co.nz:8000/theedge
http://icecast.mediaworks.co.nz:8000/radiolive
http://icecast.mediaworks.co.nz:8000/morefmchc

January 12, 2015

ESXi Autologin

 ssh-keygen -t rsa -b 4096 -C "root@192.168.1.33"
 cat ~/.ssh/id_rsa.pub | ssh root@192.168.1.26 'cat >> /etc/ssh/keys-root/authorized_keys'

copy key to any machine that needs to auto login
Perl Script to search a given folder and its sub folders and extract and rar files into the directory they were found in:


#!/usr/bin/perl
use File::Find;
use autodie;
use File::Basename;
use File::Slurp 'read_file';

my $fname = '/home/rarlist.txt';
my $rarfile_text = read_file ($fname); # grep with regular expression

# Search for RAR files

my @content;
find( \&wanted, $ARGV[0]);

open(FILE, ">> $fname");

foreach $filename (@content){
  if ($filename =~ /\.rar/)
    {
    if($rarfile_text !~ $filename) {
      print FILE "$filename\n";
      my($file, $dir, $ext) = fileparse($filename);
      print "Extracting $file to $dir\n";
      chdir $dir;
      `unrar e -u -ai -y $file`;
    }
  }
}

close(FILE);

exit;

sub wanted {
  push @content, $File::Find::name;
  return;
}

January 08, 2015

Configuring PMS for Playz App on LG TV

Once I had purchased the Playz App through my LG TV, I had to configure Plex to work without authentication.

The PMS Version and settings I changed are listed below, the Plex server must be on the same network/subnet/logical network segment.
  • Plex Version
  • Settings / Server / Connect (Show Advanced)
  • Settings / Users / My Home 
    • Delete all users
    • Friends are ok

I then tested this on my laptop with Plex Home Theater to make sure it could connect without being logged in.