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.

December 08, 2014

ZFS Notes

   28  zpool create -f 2TB-RAIDZ raidz /dev/sdc /dev/sdh /dev/sdi
   29  zpool status datastore
   30  mkdir /media/zfs
   31  zfs create -o mountpoint=/media/zfs/ datastore/zfs
   32  zfs list

Scan for new Hard Disks

ls /sys/class/scsi_host/ | while read host ; do echo "- - -" > /sys/class/scsi_host/$host/scan ; done


zpool status -x datastore
  647  zpool status -v datastore
  667  zpool status -f datastore
  833  zpool health
  834  zpool list
  835  zpool history
 zfs get compressration
 zfs list

August 25, 2014

Raspberry Pi SeedBox

Installed Deluge 1.3.6 as per this post:

http://www.onepitwopi.com/raspberry-pi/installing-deluge-1-3-6-on-a-raspberry-pi/

Find External Hard Drive:

  •  dmesg | grep sd
  • [    4.487833] sd 0:0:0:0: [sda] 488397168 512-byte logical blocks: (250 GB/232 GiB)

Delete existing partitions with cfdisk 
  • cfdisk /dev/sda
and create a single primary partition. Then format:
  • mkfs.ext4 /dev/sda1
Mount it and setup automount:
  1. mkdir /media/usbhdd
  2. mount /dev/sda1 /media/usbhdd/
  3. echo "/dev/sda1       /media/usbhdd   ext4    defaults     0       0" >>/etc/fstab
Move /var/log to external HDD

  1.  /etc/init.d/rsyslog stop
  2. mv log /media/usbhdd/
  3. ln -s /media/usbhdd/log
  4.  /etc/init.d/rsyslog start
Script to update Deluge Interface IP (/etc/network/if-up.d):

#! /bin/sh
/etc/init.d/deluge-daemon stop
oldIP=`cat /etc/network/eth0.ip`
newIP=$(ip -f inet -o addr show eth0|cut -d\  -f 7 | cut -d/ -f 1)
logger "DELUGE Updating Deluge IP Address, $oldIP -> $newIP"
sed -i -e 's/listen_interface": "'$oldIP'"/listen_interface": "'$newIP'"/g'  /root/.config/deluge/core.conf
if [ $? = 0 ]; then
    echo $newIP >/etc/network/eth0.ip
    logger "DELUGE IP BINDING SUCCESS"
    /etc/init.d/deluge-daemon start
else
    logger "DELUGE IP BINDING FAILUE"
fi
Setup folder for Deluge stuff:
  1. mkdir /media/usbhdd/media
  2. ln -s /media/usbhdd/media/
Install FlexGet

  1. apt-get install python-pip
  2. pip install flexget