Monday, January 11, 2010

Linux - Blocking IP addresses

Ever need to block an IP address from connection to you linux box?

This is quite easy and simple to acheive, with IPTABLES...

# sudo iptables -A INPUT -s 1.2.3.4 -j DROP

just modify the ip address to the one required.


Need to view what IP Addresses have been added to the system

# sudo iptables -L



Remove the blocked IP Address from the chain

# sudo iptables -D INPUT -s 1.2.3.4 -j DROP

Friday, January 8, 2010

MythTV 0.22 - mythrename.pl

Setting up and installing mythrename.pl

This makes a directory of links to the recordings the directory structure is the program name and the episode name is the filename, this makes it a breaze to find episodes over a network share.

Create a folder for the links to be placed into and make the script executable

sudo mkdir /home/showlinks
sudo chown mythtv:mythtv /home/showlinks
sudo chmod -R a+rw /home/showlinks/
sudo chmod a+x mythrename.pl

Chose a convenient time to run the script and add the scrip to the crontab scheduler,

sudo crontab -e

# m h dom mon dow command
0 3 * * * /usr/share/doc/mythtv-backend/contrib/user_jobs/mythrename.pl --link /home/showlinks/ --format '%T/%Y%m%d-%H%i-%eH%ei-%S' --separator '-' --replacement '_'

Use the system->shared folders application to add the showlinks directory to the list of network shares.

Run it now to check how it will all work...