<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>prupert &#187; Scripts</title>
	<atom:link href="http://www.prupert.co.uk/category/code/scripts/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.prupert.co.uk</link>
	<description>putting the know back in technology</description>
	<lastBuildDate>Sat, 04 Feb 2012 14:58:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>XBMC Ubuntu Minimal Maverick Install Script</title>
		<link>http://www.prupert.co.uk/2011/01/01/xbmc-ubuntu-minimal-maverick-install-script/</link>
		<comments>http://www.prupert.co.uk/2011/01/01/xbmc-ubuntu-minimal-maverick-install-script/#comments</comments>
		<pubDate>Sat, 01 Jan 2011 20:12:39 +0000</pubDate>
		<dc:creator>prupert</dc:creator>
				<category><![CDATA[HTPC]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[xbmc]]></category>

		<guid isPermaLink="false">http://www.prupert.co.uk/?p=451</guid>
		<description><![CDATA[As a little New Year&#8217;s present, I have updated a script that has been knocking around to allow you to install XBMC on a minimal version of Ubuntu Maverick. If you simply install Ubuntu from the mini.iso containing the basic Ubuntu Maverick install, then on reboot, download my script using: wget www.prupert.co.uk/scripts/xbmcmaverickrevo.sh make it executable, [...]]]></description>
			<content:encoded><![CDATA[<p>As a little New Year&#8217;s present, I have updated a script that has been knocking around to allow you to install XBMC on a minimal version of Ubuntu Maverick.</p>
<p>If you simply install Ubuntu from the mini.iso containing the basic Ubuntu Maverick install, then on reboot, download my script using:</p>
<p><code>wget www.prupert.co.uk/scripts/xbmcmaverickrevo.sh</code></p>
<p>make it executable, using:</p>
<p><code>chmod a+x xbmcmaverickrevo.sh</code></p>
<p>then finally run it using:</p>
<p><code>sudo ./xbmcmaverickrevo.sh</code></p>
<p>I find it is best to run it again, once the script reboots the machine, as this fixes a few issues.</p>
<p>It is still a work in progress, as you can&#8217;t yet shutdown / restart etc via XBMC since it seems the method to add permissions in Ubuntu 10.10 have changed and they conflict with the setup here, so I am still looking into that. To shutdown / reboot at the moment, I log in via SSH and issue:</p>
<p><code>sudo shutdown -hP now</code></p>
<p>Also, it is designed to work just with the Acer Aspire Revo 3610, but there is no reason why it wont work with any other device (apart from maybe the audio configurations).</p>
<p>Enjoy.</p>
<p><a title="xbmcmaverickrevo.sh" href="http://www.prupert.co.uk/scripts/xbmcmaverickrevo.sh" target="_blank">Download It Here</a></p>
 <img src="http://www.prupert.co.uk/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=451" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.prupert.co.uk/2011/01/01/xbmc-ubuntu-minimal-maverick-install-script/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>FINALLY: A Bash Progress Indicator for ffmpeg that WORKS</title>
		<link>http://www.prupert.co.uk/2010/05/11/finally-a-bash-progress-indicator-for-ffmpeg-that-works/</link>
		<comments>http://www.prupert.co.uk/2010/05/11/finally-a-bash-progress-indicator-for-ffmpeg-that-works/#comments</comments>
		<pubDate>Tue, 11 May 2010 16:39:40 +0000</pubDate>
		<dc:creator>prupert</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Transcode]]></category>

		<guid isPermaLink="false">http://www.prupert.co.uk/?p=352</guid>
		<description><![CDATA[I decided to write a progress indicator for ffmpeg video conversions. This was much much much harder than I ever anticipated. I was in for a tough time. Annoyingly, for what ever reason, ffmpeg doesn&#8217;t use Carriage Returns and Line Feeds in the expected way when it outputs its output during a conversion, resulting in [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to write a progress indicator for ffmpeg video conversions. This was much much much harder than I ever anticipated. I was in for a tough time. Annoyingly, for what ever reason, ffmpeg doesn&#8217;t use Carriage Returns and Line Feeds in the expected way when it outputs its output during a conversion, resulting in two days of stress for a noobie bashophile like me.</p>
<p><img class="alignleft size-medium wp-image-357" title="ffmpeg-logo" src="http://www.prupert.co.uk/wp-content/uploads/2010/05/ffmpeg-logo-300x75.png" alt="" width="300" height="75" /></p>
<p>Eventually, after hours of googling, I came across the solution. This script should be a very accurate indicator of the progress of a ffmpeg video conversion. It currently only tells you how far the conversion has progressed as a percentage, <span style="text-decoration: line-through;">but I will soon add an ETA and time to it as well (now added, see update below)</span>. It does this, by looking at the number of frames your input video file has, and then reading what frame ffmpeg is currently on every ten seconds, and printing out the percentage.</p>
<p><img class="size-medium wp-image-355 alignright" title="ffmpeg-progress" src="http://www.prupert.co.uk/wp-content/uploads/2010/05/Screenshot-2-300x134.png" alt="" width="300" height="134" /></p>
<p>You have to put in your own ffmpeg command if you want, mine is just for converting .mpg DVB-T recordings from MythTV to mkv files.<br />
To use the script, call the script with the full path of the file to be converted afterwards, e.g.: &#8220;./ffmpeg-progress.sh /home/prupert/FIVE.mpg&#8221; and it gives you something like this:</p>
<p>UPDATE:</p>
<p>I have now added an ETA function, which, as far as I can tell, should be pretty accurate, I&#8217;ll be testing it tomorrow to see how well it works. It is based on the remaining number of frames to process and the current fps that ffmpeg is working at. I also plan to convert the script to python, if possible, to make it cross platform and give it a GUI. It will also be called YAFF (Yet Another Ffmpeg Frontend).</p>
<p>Essentially, the script turns ffmpeg output from this:</p>
<p><code>frame=42992 fps= 21 q=29.0 size=  217692kB time=1717.72 bitrate=1038.2kbits/s dup=12 drop=0<br />
frame=43002 fps= 21 q=29.0 size=  217692kB time=1718.12 bitrate=1038.0kbits/s dup=12 drop=0<br />
frame=43018 fps= 21 q=29.0 size=  217756kB time=1718.76 bitrate=1037.9kbits/s dup=12 drop=0<br />
frame=43036 fps= 21 q=29.0 size=  217788kB time=1719.48 bitrate=1037.6kbits/s dup=12 drop=0<br />
frame=43050 fps= 21 q=29.0 size=  217820kB time=1720.04 bitrate=1037.4kbits/s dup=12 drop=0<br />
frame=43062 fps= 21 q=29.0 size=  217852kB time=1720.52 bitrate=1037.3kbits/s dup=12 drop=0<br />
frame=43078 fps= 21 q=29.0 size=  217884kB time=1721.16 bitrate=1037.0kbits/s dup=12 drop=0<br />
frame=43090 fps= 21 q=29.0 size=  217916kB time=1721.64 bitrate=1036.9kbits/s dup=12 drop=0<br />
frame=43106 fps= 21 q=29.0 size=  217948kB time=1722.28 bitrate=1036.7kbits/s dup=12 drop=0<br />
    Last message repeated 2 times<br />
[mpeg2video @ 0x8f7ebf0]ac-tex damaged at 15 0<br />
[mpeg2video @ 0x8f7ebf0]concealing 90 DC, 90 AC, 90 MV errors<br />
frame=43122 fps= 21 q=29.0 size=  217981kB time=1722.92 bitrate=1036.4kbits/s dup=12 drop=0<br />
frame=43140 fps= 21 q=29.0 size=  218045kB time=1723.64 bitrate=1036.3kbits/s dup=12 drop=0<br />
frame=43155 fps= 21 q=29.0 size=  218077kB time=1724.24 bitrate=1036.1kbits/s dup=12 drop=0<br />
frame=43168 fps= 21 q=29.0 size=  218141kB time=1724.76 bitrate=1036.1kbits/s dup=12 drop=0<br />
frame=43182 fps= 21 q=29.0 size=  218205kB time=1725.32 bitrate=1036.1kbits/s dup=12 drop=0<br />
frame=43194 fps= 21 q=29.0 size=  218237kB time=1725.80 bitrate=1035.9kbits/s dup=12 drop=0<br />
frame=43207 fps= 21 q=29.0 size=  218269kB time=1726.32 bitrate=1035.8kbits/s dup=12 drop=0</code></p>
<p>In to this:</p>
<p><code>/home/rupert/Downloads/Village of the Damned.mpg..mpg has 172447 frames, now converting<br />
ffmpeg PID = 24868<br />
ffmpeg: 43062 of 172447 frames, progress: 24% and ETA: 1h 42m 41s</code></p>
<p>Which must be a good thing in anyone&#8217;s book <img src='http://www.prupert.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>The script is hosted at github, enjoy:<br />
<script src="http://gist.github.com/397509.js?file=ffmpeg-progress.sh"></script></p>
<p><a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.0/uk/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-sa/2.0/uk/88x31.png" /></a><br /><span xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://purl.org/dc/dcmitype/Text" property="dc:title" rel="dc:type">YAFF</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="www.prupert.co.uk" property="cc:attributionName" rel="cc:attributionURL">Rupert Plumridge</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.0/uk/">Creative Commons Attribution-Non-Commercial-Share Alike 2.0 UK: England &amp; Wales License</a></p>
 <img src="http://www.prupert.co.uk/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=352" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.prupert.co.uk/2010/05/11/finally-a-bash-progress-indicator-for-ffmpeg-that-works/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Simple Bash Progress Script</title>
		<link>http://www.prupert.co.uk/2010/04/21/simple-bash-progress-script/</link>
		<comments>http://www.prupert.co.uk/2010/04/21/simple-bash-progress-script/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 12:27:49 +0000</pubDate>
		<dc:creator>prupert</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://www.prupert.co.uk/?p=305</guid>
		<description><![CDATA[So, I wanted a way to monitor the progress of a Bash script I was running, since it could take a long time to run on occassion and I wasn&#8217;t sure if it had failed or not. After some Ubuntu Forum googling, I came up with this: #!/bin/bash time=( $(tac /var/log/rsback/work-daily &#124; grep -m 1 [...]]]></description>
			<content:encoded><![CDATA[<p>So, I wanted a way to monitor the progress of a Bash script I was running, since it could take a long time to run on occassion and I wasn&#8217;t sure if it had failed or not.</p>
<p>After some Ubuntu Forum googling, I came up with this:<br />
<code><br />
#!/bin/bash<br />
time=( $(tac /var/log/rsback/work-daily | grep -m 1 "total runtime" | awk '{ print $6 }') )<br />
echo "last running time was" $time<br />
/bin/rsback -v work-daily >> /var/log/rsback/work-daily &#038;<br />
pid=$!<br />
trap "<br />
	#[ -e /proc/$pid ] &#038;&#038; kill $pid<br />
#" EXIT</code><br />
<code><br />
while [ -e /proc/$pid ]; do<br />
	sleep 10<br />
	runtime=( $(ps ax | grep -m 1 zenity | awk '{print $4}') )<br />
	echo "#" $runtime<br />
done | zenity --width 500 --progress --pulsate --title="work-daily running time: $time" --text="running time:" --auto-close<br />
retval=$?</code><br />
<code><br />
# If the progress bar was canceled, give a warning.<br />
if [ $retval -ne 0 ]; then<br />
	zenity --title="work-daily rsback" --error --text="the work-daily rsback was cancelled" || exit 1<br />
	kill $pid<br />
fi<br />
time=( $(tac /var/log/rsback/work-daily | grep -m 1 "total runtime" | awk '{ print $6 }') )<br />
zenity --info --title "Work rsback" --text "work rsback done in $time"<br />
exit</code></p>
<p>It seems to work pretty well, though obviously this is customised for my particular needs (so it uses the command&#8217;s own log location etc). I thought I would share it with the world, since it took me a while to figure out. When I get the chance, I&#8217;ll update it to it can work with any command or script <img src='http://www.prupert.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
 <img src="http://www.prupert.co.uk/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=305" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.prupert.co.uk/2010/04/21/simple-bash-progress-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatically Update FFMPEG and x264 From Source / SVN In Ubuntu</title>
		<link>http://www.prupert.co.uk/2010/04/16/automatically-update-ffmpeg-and-x264-from-source-svn-in-ubuntu/</link>
		<comments>http://www.prupert.co.uk/2010/04/16/automatically-update-ffmpeg-and-x264-from-source-svn-in-ubuntu/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 15:55:28 +0000</pubDate>
		<dc:creator>prupert</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Transcode]]></category>

		<guid isPermaLink="false">http://www.prupert.co.uk/?p=289</guid>
		<description><![CDATA[Whenever I wish to install and use the rather excellent video and audio transcode programs ffmpeg and x264 I have used FakeOutdoorsman&#8217;s excellent How To from the Ubuntu Forums. However, constantly typing out all the commands, especially when updating, is a pain in the arse. I thus decided, with FakeOutdoorsman&#8217;s permission, to write some scripts [...]]]></description>
			<content:encoded><![CDATA[<p>Whenever I wish to install and use the rather excellent video and audio transcode programs ffmpeg and x264 I have used FakeOutdoorsman&#8217;s excellent How To from the <a href="http://ubuntuforums.org/showthread.php?t=786095" target="_blank">Ubuntu Forums</a>. However, constantly typing out all the commands, especially when updating, is a pain in the arse.</p>
<p>I thus decided, with FakeOutdoorsman&#8217;s permission, to write some scripts to automate the task. They are, I hope, fairly comprehensive and allow a user to build and install the latest version of ffmpeg and x264, from source for Ubuntu Hardy, Intrepid, Jaunty, Karmic and Lucid. They allow this to be done automatically, after a few questions have been answered.</p>
<p>There are four scripts in total, one for the initial install, one for keeping everything up-to-date, one to reverse the changes with minimal impact and one to completely reverse all changes (this one I recommend no-one using, hence it is depreciated, but it is there in case some one wants it).</p>
<p>I am certainly not the best at bash, but I have done lots of Googling and I think the script is fairly robust, though I am sure there are errors.</p>
<p>I will be adding to the script over time, adding new features, combining things, adding better error checking etc, so for now consider them BETA releases. They have been tested on Lucid and Karmic only, but they appeared to work.</p>
<p>Please submit any questions here or at the project hosting page.</p>
<p>So, where are the files?</p>
<p>You can get all the scripts here:</p>
<p><a title="Google Code Page" href="http://code.google.com/p/x264-ffmpeg-up-to-date/" target="_blank">http://code.google.com/p/x264-ffmpeg-up-to-date/</a></p>
<p>Have fun!</p>
 <img src="http://www.prupert.co.uk/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=289" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.prupert.co.uk/2010/04/16/automatically-update-ffmpeg-and-x264-from-source-svn-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>MythTV Recordings: Rename, Move and Delete From The Database</title>
		<link>http://www.prupert.co.uk/2009/11/12/mythtv-recordings-rename-move-and-delete-from-the-database/</link>
		<comments>http://www.prupert.co.uk/2009/11/12/mythtv-recordings-rename-move-and-delete-from-the-database/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 15:35:49 +0000</pubDate>
		<dc:creator>prupert</dc:creator>
				<category><![CDATA[HTPC]]></category>
		<category><![CDATA[MythTV]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://www.prupert.co.uk/?p=216</guid>
		<description><![CDATA[So, I have been using MythTV for a while now and it is a.w.e.s.o.m.e.. However, I had one problem, since I transcode and store all my videos on my Ubuntu server and not my MythTV box (which is off most of the time via mythwelcome) I had to manually transfer recorded files to my Ubuntu [...]]]></description>
			<content:encoded><![CDATA[<p>So, I have been using MythTV for a while now and it is a.w.e.s.o.m.e.. However, I had one problem, since I transcode and store all my videos on my Ubuntu server and not my MythTV box (which is off most of the time via mythwelcome) I had to manually transfer recorded files to my Ubuntu server via mythweb.</p>
<p>I thought this was a bit of a hokey solution, so I asked around if there was a script that allowed you to rename MythTV recordings (to a more human readable version), move them to another location and remove them from the MythTV database. There were some solutions out there, but they all involved the recorded files being kept in the MythTV database.</p>
<p><a href="http://www.prupert.co.uk/wp-content/uploads/2009/11/mythtv.png"><img class="alignleft size-full wp-image-217" title="mythtv" src="http://www.prupert.co.uk/wp-content/uploads/2009/11/mythtv.png" alt="mythtv" width="180" height="64" /></a></p>
<p>So, I wrote my own script. This script renames the MythTV files to a nice human understandable version using mythrename.pl, it then moves the recordings to a folder of your choice (in my case a mounted samba share on my server), it then uses myth.find_orphans.pl to delete the moved recordings from the mythTV database (I don&#8217;t know if it will still remember that these files were previously recorded so it doesn&#8217;t rerecord them or not, I guess time will tell).</p>
<p>So, without further ado, here is the script, in lovely Bash (the script is called mythtvremodel (mythtv REname MOve DELete, geddit?):</p>
<p><code><br />
#! /bin/sh<br />
### BEGIN INIT INFO<br />
# Provides: mythtvremodel<br />
# Required-Start:    $local_fs $syslog $remote_fs dbus<br />
# Required-Stop:     $local_fs $syslog $remote_fs<br />
# Default-Start:     2 3 4 5<br />
# Default-Stop:      0 1 6<br />
# Short-Description: rename, move delete recordings<br />
### END INIT INFO<br />
# script to rename files recorded from mythtv and then to move them and delete them<br />
#made by prupert.co.uk<br />
#creative commons licence, whichever is the most FREE (as in beer)</code><br />
<code><br />
#lets put in some variables so others can use this<br />
#location of log file, you can choose anything and any name<br />
log=/path/to/mythtvremodel.log<br />
#this is the full path to mythrename.pl<br />
mrename=/location/to/mythrename.pl<br />
#this is the full path to your recordings folder<br />
record=/var/www/mythweb/data/recordings/<br />
#this is the extension your recordings are stored as, usually mpg or nuv<br />
ext=mpg<br />
#this is the full path to where you want your files moved to<br />
dest=/path/to/folder/to/move/recordings/to/<br />
#this is the full path to myth.find_orphans.pl<br />
morphan=/path/to/myth.find_orphans.pl<br />
#mythtv database password for myth.find_orphans.pl<br />
pass=yourmythtvdatabasepassword</code><br />
<code><br />
# first, run mythtvrename to get nice names for the recordings<br />
echo starting mythtvremodel on `date "+%m/%d/%y %l:%M:%S %p"` &gt; $log<br />
perl $mrename --underscores --format %T-%S-%d%m%y &gt;&gt; $log<br />
# use find to search for all recorded files in the recording folder and move them to the TV folder<br />
find "$record" -name "*.$ext" &gt;&gt; $log<br />
find "$record" -name "*.$ext" -exec mv {} "$dest" \; &gt;&gt; $log<br />
# use mythorphan to remove the now missing recorded files from the database<br />
perl $morphan --pass=$pass --dodbdelete &gt;&gt; $log<br />
#that should be it<br />
echo stopping mythtvremodel on `date "+%m/%d/%y %l:%M:%S %p"` &gt;&gt; $log<br />
exit 0</code></p>
<p>And there you have it. Now, since I run mythbuntu, I have put this script in /etc/rc0.d (thats rc zero . d) and have named it K03mythtvremodel, thus it is run when my system shuts down, but before all the samba shares and drives are unmounted. As I said, since I use mythwelcome to shutdown my machine when idle, this seemed like the best solution.</p>
<p>Hope it helps someone!</p>
 <img src="http://www.prupert.co.uk/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=216" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.prupert.co.uk/2009/11/12/mythtv-recordings-rename-move-and-delete-from-the-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MediaPortal Comskip and Transcode Bat and Bash Scripts</title>
		<link>http://www.prupert.co.uk/2009/09/08/mediaportal-comskip-and-transcode-bat-and-bash-scripts/</link>
		<comments>http://www.prupert.co.uk/2009/09/08/mediaportal-comskip-and-transcode-bat-and-bash-scripts/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 09:37:11 +0000</pubDate>
		<dc:creator>prupert</dc:creator>
				<category><![CDATA[HTPC]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://www.prupert.co.uk/?p=171</guid>
		<description><![CDATA[As I mentioned earlier, I use MediaPortal to record DVB-T broadcasts. As these end up quite big, I then use two scripts to check the recordings for adverts and to transcode the recordings to a mkv file (smaller and better supported). This solution isn&#8217;t very elegant, since it is for my personal setup which is [...]]]></description>
			<content:encoded><![CDATA[<p>As I mentioned earlier, I use <a href="http://www.team-mediaportal.com/">MediaPortal</a> to record DVB-T broadcasts. As these end up quite big, I then use two scripts to check the recordings for adverts and to transcode the recordings to a mkv file (smaller and better supported).</p>
<p>This solution isn&#8217;t very elegant, since it is for my personal setup which is a little unusual, in that the recordings are done via a Windows XP MediaCentre PC, they are then analysed for adverts using <a title="Comskip" href="http://www.kaashoek.com/comskip/" target="_blank">Comskip</a> and are then transferred to my Ubuntu-based server, which then transcodes the files to an MKV file and the adds Chapter markers to those MKV files using the file from Comskip. Thus there script is in two parts, one a Windows Bat script and the other is a Ubuntu Bash script.</p>
<p>The scripts are below. First, the Windows Bat script that runs the recorded file through Comskip and then copies it over to the server. Since I wanted to only run one script for all the recordings made in an evening, the script takes the file name from MediaPortal, which passes it to the script after the file is finished recording, using the Comskip plugin. This explains all the weird &#8220;Echo&#8221; in front of all the terms, since basically it is putting all the commands into another script, which is then run early each morning.</p>
<div id="attachment_174" class="wp-caption alignleft" style="width: 219px"><a href="http://www.prupert.co.uk/wp-content/uploads/2009/09/bash.jpg"><img class="size-medium wp-image-174" title="bash" src="http://www.prupert.co.uk/wp-content/uploads/2009/09/bash-209x300.jpg" alt="BASH" width="209" height="300" /></a><p class="wp-caption-text">BASH</p></div>
<p><code>@ECHO OFF<br />
ECHO ECHO.<br />
ECHO Rem Batch commands for %1 START &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
ECHO CD "C:\scripts\comskip" &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
ECHO START "" "C:\Program Files\VideoLAN\VLC\vlc.exe" &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
ECHO %%SystemRoot%%\explorer.exe "Z:\" &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
ECHO ECHO ************************** ^&gt;^&gt; "%~dpn1.PostLog.txt" &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
ECHO ECHO Post Processing started on %%date%% %%time%% ^&gt;^&gt; "%~dpn1.PostLog.txt" &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
REM ECHO ECHO Starting mpeg2repair %%date%% %%time%% ^&gt;^&gt; "%~dpn1.PostLog.txt" &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
REM ECHO mpeg2repairHelper.exe %1 %1-fixed.ts &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
REM ECHO ECHO mpeg2repair finished on %%date%% %%time%% ^&gt;^&gt; "%~dpn1.PostLog.txt" &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
ECHO ECHO Comskip started on %%date%% %%time%% ^&gt;^&gt; "%~dpn1.PostLog.txt" &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
ECHO comskip %1 &gt;&gt;"%~dpn1.PostLog.txt" &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
ECHO ECHO Comskip finished on %%date%% %%time%% ^&gt;^&gt; "%~dpn1.PostLog.txt" &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
ECHO ECHO %%date%% %%time%% ^&gt;^&gt; "Z:\new_files.log" &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
REM ECHO ECHO ComClean started on %%date%% %%time%% ^&gt;^&gt; "%~dpn1.PostLog.txt" &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
REM ECHO mencoder "%~dpn1.ts" -edl "%~dpn1.edl" -alang eng,nar -noskip -vf harddup -oac copy -ovc copy -of mpeg -o "%~dpn1_clean.ts" &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
REM ECHO ECHO ComClean finished on %%date%% %%time%% ^&gt;^&gt; "%~dpn1.PostLog.txt" &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
ECHO ECHO New file %1 being moved to Server ^&gt;^&gt; "Z:\new_files.log" &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
ECHO ECHO Tidying started on %%date%% %%time%% ^&gt;^&gt; "%~dpn1.PostLog.txt" &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
ECHO %%SystemRoot%%\explorer.exe "Z:\" &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
ECHO CD "%~dp1" &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
REM ECHO ren *.edl *.ts.edl &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
REM ECHO ren *.txt *.ts.txt &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
ECHO ren *.chap *.ts.chap &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
ECHO ECHO Moving Clean TS to Server directory on %%date%% %%time%% ^&gt;^&gt; "%~dpn1.PostLog.txt" &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
REM ECHO IF EXIST "%~dpn1_clean.ts" del %1 &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
ECHO xcopy %1 Z:\ &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
ECHO IF EXIST "Z:\%~n1.ts" del %1 &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
REM ECHO xcopy "%~dpn1.edl" Z:\ &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
ECHO del "%~dpn1.txt" &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
ECHO xcopy "%~dpn1.ts.chap" Z:\ &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
ECHO ECHO TS and others moved to Server directory on %%date%% %%time%% ^&gt;^&gt; "%~dpn1.PostLog.txt" &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
ECHO ECHO %~n1.ts moved to Server on %%date%% %%time%% ^&gt;^&gt; "Z:\new_files.log" &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
ECHO TASKKILL /IM vlc.exe &gt;&gt; "C:\scripts\comskip\trans.bat"<br />
ECHO Rem Batch commands for %1 FINISH &gt;&gt; "C:\scripts\comskip\trans.bat"</code></p>
<p>Thus this script creates the trans.bat file, which is then run via a scheduled task. All the stuff starting with REM are lines that the script no longer uses, but that contain interesting code that might be useful in the future. This includes using a program called mpeg2repair, that was meant to clean the recording in-case there were any errors during transmission, but the program error-ed out too many times. Another line was also meant to use Mencoder to cut the adverts out directly using an EDL file created by comskip, but this resulted too often in audio/video sync problems, I think as a result of the original .ts file having some errors in it, so I REMed out that line as well.</p>
<p>The second script is my Ubuntu bash script, which is run every morning, after the trans.bat script (created by the script above) is run.</p>
<p><code>#!/bin/bash<br />
# Written by FakeOutdoorsman and updated by mysoogal further updated by prupert<br />
# Attribution-Noncommercial 3.0 Unported<br />
# http://creativecommons.org/licenses/by-nc/3.0/deed.en<br />
# trackback http://ubuntuforums.org/showthread.php?t=960627<br />
echo trans.sh started on `date "+%m/%d/%y %l:%M:%S %p"` &gt; /mnt/media/documents/ruperts/TV/trans.log<br />
find /mnt/media/documents/ruperts/TV -name "*.ts" &gt;&gt; /mnt/media/documents/ruperts/TV/trans.log<br />
chmod -R 777 /mnt/media/documents/ruperts/TV<br />
find /mnt/media/documents/ruperts/TV -name "*.ts" -exec /home/server/Desktop/handbrake/HandBrakeCLI -i {} -t 1 -c 1 -o {}.mkv -f mkv -e xvid -b 1200 -2  -a 1 -E faac -B 160 -R 0 -6 dpl2 -D 1 -C 2  -v '{}' \; &gt;&gt; /mnt/media/documents/ruperts/TV/trans.log<br />
echo trans.sh finished on `date "+%m/%d/%y %l:%M:%S %p"` &gt;&gt; /mnt/media/documents/ruperts/TV/trans.log<br />
echo attempting to add advert chapter markers on `date "+%m/%d/%y %l:%M:%S %p"` &gt;&gt; /mnt/media/documents/ruperts/TV/trans.log<br />
find /mnt/media/documents/ruperts/TV -name "*.mkv" -exec /home/server/scripts/mkvmerge.sh "{}" \; &gt;&gt; /mnt/media/documents/ruperts/TV/trans.log<br />
echo advert chapter markers added on `date "+%m/%d/%y %l:%M:%S %p"` &gt;&gt; /mnt/media/documents/ruperts/TV/trans.log<br />
echo starting clear up on `date "+%m/%d/%y %l:%M:%S %p"` &gt;&gt; /mnt/media/documents/ruperts/TV/trans.log<br />
cd "/mnt/media/documents/ruperts/TV/" || { echo &gt;&amp;2 "Source folder not found"; exit 1; } &gt;&gt; /mnt/media/documents/ruperts/TV/trans.log<br />
find . -type f -name "*.ts" -exec sh -c '[ -f "${1%.ts}.ts.mkv" ]' _ {} \; -delete &gt;&gt; /mnt/media/documents/ruperts/TV/trans.log<br />
find . -type f -name "*.ts" -exec sh -c '[ -f "${1%.ts}.mkv" ]' _ {} \; -delete &gt;&gt; /mnt/media/documents/ruperts/TV/trans.log<br />
find . -type f -name "*.ts.mkv" -exec sh -c '[ -f "${1%.ts.mkv}.mkv" ]' _ {} \; -delete &gt;&gt; /mnt/media/documents/ruperts/TV/trans.log<br />
find . -type f -name "*.ts.chap" -exec sh -c '[ -f "${1%.ts.chap}.mkv" ]' _ {} \; -delete &gt;&gt; /mnt/media/documents/ruperts/TV/trans.log<br />
find /mnt/media/documents/ruperts/TV -name "*.mkv" -exec mv {} /media/video/Video \; &gt;&gt; /mnt/media/documents/ruperts/TV/trans.log<br />
find /mnt/media/documents/ruperts/TV -name "*.edl" -exec rm {} \; &gt;&gt; /mnt/media/documents/ruperts/TV/trans.log<br />
find /mnt/media/documents/ruperts/TV -name "*.txt" -exec rm {} \; &gt;&gt; /mnt/media/documents/ruperts/TV/trans.log<br />
echo ts files deleted and moved script stopped on `date "+%m/%d/%y %l:%M:%S %p"` &gt;&gt; /mnt/media/documents/ruperts/TV/trans.log</code></p>
<p>This is run by a cron job every morning. It uses Handbrake to transcode the .ts file to a .mkv file. It then runs a third script (below called mkvmerge.sh) to use <a title="mkvmerge" href="http://www.bunkus.org/videotools/mkvtoolnix/doc/mkvmerge.html" target="_blank">mkvmerge</a> to add chapter markers to the mkv file that Handbrake created. Finally, it moves the mkv file to where all my Videos are stored. At the very end, there are some commands to delete the .ts files and the intermediate .mkv files ONLY if the mkv file has been correctly created.</p>
<p>Here is the mkvmerge.sh script:<br />
<code><br />
#!/bin/bash<br />
echo mkvmerge.sh started on `date "+%m/%d/%y %l:%M:%S %p"` &gt;&gt; /mnt/media/documents/ruperts/TV/trans.log<br />
VIDEO=$1<br />
ENC=${VIDEO##*/}<br />
mkvmerge --chapters "${VIDEO%/*}/${ENC%%.*}.ts.chap" "$VIDEO" -o "/mnt/media/documents/ruperts/TV/${ENC%%.*}.mkv"</code></p>
<p>This script is called by the main Ubuntu trans.sh script above.</p>
<p>I also have a separate script that I use to transcode the .m2ts files produced by the Sony PS3&#8242;s PlayTV program:<br />
<code><br />
#!/bin/bash<br />
echo transm2ts.sh started on `date "+%m/%d/%y %l:%M:%S %p"` &gt; /mnt/media/documents/ruperts/TV/transm2ts.log<br />
find /mnt/media/documents/ruperts/TV -name "*.m2ts" &gt;&gt; /mnt/media/documents/ruperts/TV/transm2ts.log<br />
chmod -R 777 /mnt/media/documents/ruperts/TV<br />
find /mnt/media/documents/ruperts/TV -name "*.m2ts" -exec /home/server/Desktop/handbrake/HandBrakeCLI -i {} -t 1 -c 1 -o {}.mkv -f mkv -w 720 -e xvid -b 1200 -2  -a 1 -E faac -B 160 -R 0 -6 dpl2 -D 1 -C 2  -v '{}' \; &gt;&gt; /mnt/media/documents/ruperts/TV/transm2ts.log<br />
echo transm2ts.sh finished on `date "+%m/%d/%y %l:%M:%S %p"` &gt;&gt; /mnt/media/documents/ruperts/TV/transm2ts.log<br />
echo starting clear up on `date "+%m/%d/%y %l:%M:%S %p"` &gt;&gt; /mnt/media/documents/ruperts/TV/transm2ts.log<br />
cd "/mnt/media/documents/ruperts/TV/" || { echo &gt;&amp;2 "Source folder not found"; exit 1; } &gt;&gt; /mnt/media/documents/ruperts/TV/transm2ts.log<br />
find . -type f -name "*.m2ts" -exec sh -c '[ -f "${1%.m2ts}.m2ts.mkv" ]' _ {} \; -delete &gt;&gt; /mnt/media/documents/ruperts/TV/transm2ts.log<br />
find . -type f -name "*.m2ts" -exec sh -c '[ -f "${1%.m2ts}.mkv" ]' _ {} \; -delete &gt;&gt; /mnt/media/documents/ruperts/TV/transm2ts.log<br />
find /mnt/media/documents/ruperts/TV -name "*.mkv" -exec mv {} /media/video/Video/TV \; &gt;&gt; /mnt/media/documents/ruperts/TV/transm2ts.log<br />
echo m2ts files deleted and moved script stopped on `date "+%m/%d/%y %l:%M:%S %p"` &gt;&gt; /mnt/media/documents/ruperts/TV/transm2ts.log<br />
exit</code></p>
<p>Because Comskip can&#8217;t be run on .m2ts files, I don&#8217;t call the mkvmerge.sh script, since there is no .chap file to use.</p>
<p>I would freely admit that these scripts aren&#8217;t very user friendly, since they are customised just for my setup. However, if readers would prefer a useful version that was more user-friendly, I could create that. It is possible to convert the Ubuntu Bash script into a Bat script for Windows. However, I don&#8217;t think there is any alternative to the mkvmerge file for Windows that the Ubuntu script uses.</p>
<p>Also, sadly, the devs of Handbrake are a little blinkered. They created the CLI interface so you can run Handbrake via the commandline, which is great. The CLI also creates Exit codes, which is very useful for scripting. However, the Exit codes only tell you if the CLI worked correclty, not if Handbrake worked correctly. So if the transcode failes, but the CLI worked corretly, it will exit as if nothing went wrong. Sadly the Handbrake devs don&#8217;t see this as a problem. Kind stupid imho, but hey, it&#8217;s their loss. Thus, there is no way of telling if the transcode worked correctly or not, the only way to check is to see if the file you want to be created is there&#8230;doh!</p>
 <img src="http://www.prupert.co.uk/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=171" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.prupert.co.uk/2009/09/08/mediaportal-comskip-and-transcode-bat-and-bash-scripts/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Bash and Windows batch script file name variable conversion</title>
		<link>http://www.prupert.co.uk/2009/07/15/bash-and-windows-batch-script-file-name-variable-conversion/</link>
		<comments>http://www.prupert.co.uk/2009/07/15/bash-and-windows-batch-script-file-name-variable-conversion/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 11:17:41 +0000</pubDate>
		<dc:creator>prupert</dc:creator>
				<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://www.prupert.co.uk/?p=151</guid>
		<description><![CDATA[I&#8217;ve been getting into Bash and Windows Batch scripting recently (as part of my ongoing battle to get my HTPC working correctly with MediaPortal). One problem I kept on coming across was how to pass different variations of the variable you pass to your script, sometimes I wanted the full path to the file, other [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been getting into Bash and Windows Batch scripting recently (as part of my ongoing battle to get my HTPC working correctly with MediaPortal).</p>
<p>One problem I kept on coming across was how to pass different variations of the variable you pass to your script, sometimes I wanted the full path to the file, other times I just wanted the filename with the file extension, other times I wanted just the folder the file was located in.</p>
<p>It took a fair bit of googling and experimentation with terms to find the right information, so I have decided to amass it all here to help others (and me).</p>
<p><strong>For Bash Scripting</strong></p>
<p>(taken from <a title="linuxgazette" href="http://linuxgazette.net/issue18/bash.html">linuxgazette</a>)</p>
<ul> Given:</p>
<ul> foo=/tmp/my.dir/filename.tar.gz</ul>
</ul>
<ul> We can use these expressions:
<dl>
<dt> path = ${foo%/*} </dt>
<dd> To get: /tmp/my.dir (like <em>dirname</em>)</dd>
<dt> file = ${foo##*/} </dt>
<dd> To get: filename.tar.gz (like <em>basename</em>)</dd>
<dt> base = ${file%%.*} </dt>
<dd> To get: filename </dd>
<dt> ext  = ${file#*.} </dt>
<dd> To get: tar.gz </dd>
</dl>
</ul>
<p><strong>For Windows Batch Scripting</strong></p>
<p>(taken from<strong> </strong><a title="imagemagick" href="http://www.imagemagick.org/Usage/windows/">imagemagick</a>)</p>
<table border="0" align="center">
<tbody>
<tr>
<td>%~1</td>
<td>expands %1 removing any surrounding quotes (&#8220;)</td>
</tr>
<tr>
<td>%~f1</td>
<td>expands %1 to a fully qualified path name</td>
</tr>
<tr>
<td>%~d1</td>
<td>expands %1 to a drive letter only</td>
</tr>
<tr>
<td>%~p1</td>
<td>expands %1 to a path only</td>
</tr>
<tr>
<td>%~n1</td>
<td>expands %1 to a file name only</td>
</tr>
<tr>
<td>%~x1</td>
<td>expands %1 to a file extension only</td>
</tr>
</tbody>
</table>
<p>These two pieces of info can thus be used to pass any variable or variation of that variable to a command in your script.</p>
<p>Using these tools I have been able to get MediaPortal to automatically scan each new recording for adverts using comskip and then transfer the recording, alongside the necessary advert info files to my network hard drive on my server using a batch script. Then the server runs a bash script each morning to scan for new files on the new recordings file, convert them to MKV using Handbrake and add chapter markers and then move the MKV files to my networked videos file. Cool!</p>
 <img src="http://www.prupert.co.uk/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=151" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.prupert.co.uk/2009/07/15/bash-and-windows-batch-script-file-name-variable-conversion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Bluetooth controlled motion start-up script</title>
		<link>http://www.prupert.co.uk/2009/03/19/bluetooth-controlled-motion-start-up-script/</link>
		<comments>http://www.prupert.co.uk/2009/03/19/bluetooth-controlled-motion-start-up-script/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 18:04:25 +0000</pubDate>
		<dc:creator>prupert</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Motion Video]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://www.prupert.co.uk/?p=135</guid>
		<description><![CDATA[So, after messing with ZoneMinder and creating a bluetooth script for it, I am now messing with motion instead, and have modified the script accordingly. For kicks, I have hosted it on google code http://code.google.com/p/bluetoothmotion/ It also details a fix for the problem with motion on Ubuntu and the /etc/init.d/motion stratup script.]]></description>
			<content:encoded><![CDATA[<p>So, after messing with ZoneMinder and creating a bluetooth script for it, I am now messing with motion instead, and have modified the script accordingly.</p>
<p>For kicks, I have hosted it on google code <img src='http://www.prupert.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><a title="http://code.google.com/p/bluetoothmotion/" href="http://code.google.com/p/bluetoothmotion/">http://code.google.com/p/bluetoothmotion/</a></p>
<p>It also details a fix for the problem with motion on Ubuntu and the /etc/init.d/motion stratup script.</p>
 <img src="http://www.prupert.co.uk/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=135" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.prupert.co.uk/2009/03/19/bluetooth-controlled-motion-start-up-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Turn programs on and off with Bluetooth in Ubuntu</title>
		<link>http://www.prupert.co.uk/2009/03/15/ubuntu-bluetooth-presence-activation-script/</link>
		<comments>http://www.prupert.co.uk/2009/03/15/ubuntu-bluetooth-presence-activation-script/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 20:29:06 +0000</pubDate>
		<dc:creator>prupert</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[bluetooth]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.prupert.co.uk/?p=124</guid>
		<description><![CDATA[Having recently been messing around with ZoneMinder for home security, I wanted to turn on and off the program using Bluetooth. Basically, the idea being that when I am around, the server will sense my presence (no Darth Vadar jokes please ) via the Bluetooth on my phone and turn off ZoneMinder. Then, if I [...]]]></description>
			<content:encoded><![CDATA[<p>Having recently been messing around with <a title="ZoneMinder" href="http://www.zoneminder.com/">ZoneMinder</a> for home security, I wanted to turn on and off the program using Bluetooth. Basically, the idea being that when I am around, the server will sense my presence (no Darth Vadar jokes please <img src='http://www.prupert.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ) via the Bluetooth on my phone and turn off ZoneMinder. Then, if I leave the location of the server, it will no longer be able to sense Bluetooth on my phone and thus will turn on ZoneMinder.</p>
<p>So, I hunted around for such a program, I came across <a title="bluemon" href="http://www.matthew.ath.cx/projects/bluemon/">bluemon</a> and <a title="BlueProximity" href="http://sourceforge.net/projects/blueproximity/">BlueProximity</a>, but they both only worked on proximity, i.e. they relied on you being near by, as far as I could tell, there was no option of running an action when the phone was completely unavailable.</p>
<p>So, I decided to write my own script to do what I wanted. Now, bear in mind I have very little skill when it comes to Bash and scripting and what I wrote was a result of trial and error. It all revolves around a tool called hcitool that can be used in Linux to control Bluetooth connections.</p>
<p>The first attempt at my script can be found <a title="here " href="http://www.prupert.co.uk/code/bluetoothscan.sh">here</a> and with another link below.</p>
<p>It is only designed to work with ZoneMinder and there isn&#8217;t much advice within the code, but I shall update it as time goes by to make it more useful <img src='http://www.prupert.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Here is the full link to the script:</p>
<p><a title="bluetoothscan" href="/code/bluetoothscan.sh">bluetoothscan</a></p>
 <img src="http://www.prupert.co.uk/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=124" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.prupert.co.uk/2009/03/15/ubuntu-bluetooth-presence-activation-script/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

