This how to shows how to flash an OS image onto an SD card to use on a Raspberry PI, using a Mac (OSX)
sudo diskutil umount /dev/disk1s1
sudo dd if=~/Downloads/2015-02-16-raspbian-wheezy.img of=/dev/disk1 bs=1m
First shows you the mount point
Second unmounts the storage
Third disk dumps it onto the SD card
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.
mysql -u$username -p$password -D $database -e "select basename from recorded;" > $tempfile
for i in `cat $tempfile| grep -v "basename"`
if [ -a $recordings/$i ]
echo "Exists - $i"
echo "Deleteing $i"
mysql -u$username -p$password -D $database -e "delete from recorded where basename = '$i';"
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.
sudo cat /etc/nagios3/conf.d/hostfile.cfg | sed '/^ check/d'| sed 's/ use generic-service/ use passive-service\n check_command dummy_check/' | sed 's/generic/passive/'
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.
for i in `seq 1 254`; do nc -z -w1 192.168.0.$i 3389; if [ $? -eq "0" ]; then echo "192.168.0.$i - $?";fi;done
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.