Flashing an SD card for a Raspberry PI on OSX

This how to shows how to flash an OS image onto an SD card to use on a Raspberry PI, using a Mac (OSX)

First shows you the mount point

Second unmounts the storage

Third disk dumps it onto the SD card

Mythtv and HDhomerun

I use a combination of a HDhomerun tuner by Silicon Dust and a PC with mythtv backend setup, the tuner is network based.

Problem is the hdhomerun only works with DHCP, no static IP setup. So what happens is when I have a power outage the unit resets and comes back with a different IP.

I know I should setup my own DHCP server instead of using my routers, but cbf

So, what was happening was when the IP changed my mythtv would still record…. But nothing was recorded.

So I wrote the following script which would log on to the database check the recorded files and compared them to the files in the directory. If it existed in the database and not in the directory it will remove the entry from the database.

It just works and keeps your mythtv db nice and clean.

 

Nagios master / slave configuration files

I run a large Nagios setup, currently running one master server and around 10 slaves in a distributed monitoring setup.

The problem is when you setup your check on the slave for active monitoring you need to do the some on the master for passive monitoring, it takes ages.

So I wrote a single live stripper which changes the field to a passive format which change then be cut-n-pasted into the master. The one thing I put in as an extra is the parent relationships.

 

Network scanning using Netcat

I started a windows vm on my network which I needed RDP access to, I didnt know its IP address. I could have used Nmap but it was not installed so I decided to use Netcat instead.

I have not had a chance to test it but network scanned my entire subnet in 2.5 minutes.

So the above command with scan each IP in the submit and probe port 3389 (RDP) to see if its open, if it is it will display the IP.