<?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>Robin&#039;s BlogRobin&#039;s Blog &#187; Linux</title>
	<atom:link href="http://blog.rtwilson.com/category/computing/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.rtwilson.com</link>
	<description>A remote-sensing PhD student talking about interesting things...</description>
	<lastBuildDate>Sat, 11 May 2013 18:36:08 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Announcing DateRangeParser: Parse strings like &#8220;27th-29th June 2010&#8243;</title>
		<link>http://blog.rtwilson.com/announcing-daterangeparser-parse-strings-like-27th-29th-june-2010/</link>
		<comments>http://blog.rtwilson.com/announcing-daterangeparser-parse-strings-like-27th-29th-june-2010/#comments</comments>
		<pubDate>Tue, 01 May 2012 19:03:37 +0000</pubDate>
		<dc:creator>Robin Wilson</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.rtwilson.com/?p=264</guid>
		<description><![CDATA[In a project recently I was struggling to find a way to parse strings that contain a date range, for example: 27th-29th June 2010 Tuesday 29 May -&#62; Sat 2 June 2012 From 27th to 29th March 1999 None of the Python modules I investigated (including parsedatetime) seemed to be able to cope with the [...]]]></description>
				<content:encoded><![CDATA[<p>In a project recently I was struggling to find a way to parse strings that contain a date range, for example:</p>
<ul>
<li>27th-29th June 2010</li>
<li>Tuesday 29 May -&gt; Sat 2 June 2012</li>
<li>From 27th to 29th March 1999</li>
</ul>
<p>None of the Python modules I investigated (including <a href="http://code.google.com/p/parsedatetime/">parsedatetime</a>) seemed to be able to cope with the range of strings that I had to deal with. I investigated patching parsedatetime to allow it to do what I wanted, but I found it very hard to get into the code. So, I thought, why not write my own&#8230;</p>
<p>So I did, and I&#8217;ve released it under the LGPL and you can install it right now by running:</p>
<p><tt>pip install daterangeparser</tt></p>
<p>Or you can visit the <a href="http://pypi.python.org/pypi/DateRangeParser">DateRangeParser PyPI page</a> to download it manually, read the <a href="http://readthedocs.org/docs/daterangeparser/en/latest/">documentation</a>, or hack on the <a href="https://github.com/robintw/daterangeparser/">code</a>.</p>
<p>The current version will parse a wide range of formats (see the <a href="http://readthedocs.org/docs/daterangeparser/en/latest/#what-formats-will-this-work-with">examples</a> in the documentation) and will deal with individual dates as well as date ranges. The API is very simple &#8211; just import the parse method and run it, giving the date range string as an argument. For example:</p>
<pre class="brush: python;">from daterangeparser import parse
print parse("14th-19th Feb 2010")</pre>
<p>This will produce an output tuple with two datetime objects in it: the start and end date of the range you gave.</p>
<p>The parser is built using <a href="http://pyparsing.wikispaces.com/">PyParsing</a> &#8211; a great Python parsing framework that I have found very easy to get to grips with. It is incredibly powerful, very easy to use, and really shows how limited regular expressions can be! Now that I&#8217;ve done this I have an urge to use PyParsing to write parsers for all of the horrible scientific data formats that I have to deal with in my PhD&#8230;.watch this space!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rtwilson.com/announcing-daterangeparser-parse-strings-like-27th-29th-june-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reading data from instruments via RS-232 simply in Linux</title>
		<link>http://blog.rtwilson.com/reading-data-from-instruments-via-rs-232-simply-in-linux/</link>
		<comments>http://blog.rtwilson.com/reading-data-from-instruments-via-rs-232-simply-in-linux/#comments</comments>
		<pubDate>Tue, 05 Jul 2011 23:07:14 +0000</pubDate>
		<dc:creator>Robin Wilson</dc:creator>
				<category><![CDATA[Academic]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Remote Sensing]]></category>

		<guid isPermaLink="false">http://blog.rtwilson.com/?p=188</guid>
		<description><![CDATA[As part of my research I do a fair amount of data collection in the field. Some of the instruments I use are very modern and connect to a computer via USB, interacting with custom-written client software which allows such luxuries as timed logging, triggered logging and local calibration. However, a number of the instruments [...]]]></description>
				<content:encoded><![CDATA[<p>As part of my research I do a fair amount of data collection in the field. Some of the instruments I use are very modern and connect to a computer via USB, interacting with custom-written client software which allows such luxuries as timed logging, triggered logging <a href="http://blog.rtwilson.com/wp-content/uploads/2011/07/Delta-T_Sunshine-Sensor-BF3.jpg"><img class="alignright size-full wp-image-189" title="Delta T_Sunshine Sensor - BF3" src="http://blog.rtwilson.com/wp-content/uploads/2011/07/Delta-T_Sunshine-Sensor-BF3.jpg" alt="" width="361" height="367" /></a>and local calibration. However, a number of the instruments are older and don&#8217;t have computer-based logging capability, requiring you to log data to their internal memory and then download it later.</p>
<p>This is often perfectly satisfactory, but timing can be an issue. For example, when taking measurements using a number of instruments it is often important to make sure that measurements are taken at the same time. For example, if spectral measurements are being taken and other instruments (for example sunshine sensors, like the sensor shown below) are being used to gather data which can then be used to atmospherically correct the spectra, then it is very important to ensure that measurements are taken at the same time. This is particularly a problem in areas of fast changing weather like the UK, where sky conditions can change very quickly.</p>
<p>A tool called <a href="http://sjinn.sourceforge.net/index.html">SJinn</a> allows you to send simple strings over a RS-232 (standard serial port) connection and then obtain data sent back by the instruments. One of the examples given by SJinn is the following:</p>
<pre>rs232 -b600 -p7n2 -s"\n" -r16</pre>
<p>This sends a newline character over the serial port (at 600 baud with 7 data bits and 2 stop bits) and then returns the next 16 characters send on the line. In this case, it would provide the voltage measured by a digital voltmeter. As this is simply a command-line tool, it is very easy to combine into scripts, and thus use to collect timed measurements (eg. via the use of the cron daemon). I have used similar techniques to obtain measurements from the sunshine sensor shown above &#8211; a script for which will be available on my website soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rtwilson.com/reading-data-from-instruments-via-rs-232-simply-in-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Amazing software you haven&#8217;t heard of</title>
		<link>http://blog.rtwilson.com/amazing-software-you-havent-heard-of/</link>
		<comments>http://blog.rtwilson.com/amazing-software-you-havent-heard-of/#comments</comments>
		<pubDate>Sun, 03 Apr 2011 17:54:50 +0000</pubDate>
		<dc:creator>Robin Wilson</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.rtwilson.com/?p=133</guid>
		<description><![CDATA[Every so often, on my travels around the internet, I come across a piece of software which is so great that I wonder why on earth I haven&#8217;t heard of it before. The software listed below falls into this category, and hopefully by posting the list here I will allow more people to find them. [...]]]></description>
				<content:encoded><![CDATA[<p>Every so often, on my travels around the internet, I come across a piece of software which is so great that I wonder why on earth I haven&#8217;t heard of it before. The software listed below falls into this category, and hopefully by posting the list here I will allow more people to find them.</p>
<h2>AeroFS</h2>
<p><a href="http://blog.rtwilson.com/wp-content/uploads/2011/04/AeroFSPrefs.png"><img class="aligncenter size-medium wp-image-135" title="AeroFSPrefs" src="http://blog.rtwilson.com/wp-content/uploads/2011/04/AeroFSPrefs-300x257.png" alt="AeroFS Preferences Window" width="300" height="257" /></a>This is an online file-synchronisation service similar to Dropbox but with one key difference: nothing is stored on a cloud server unless you specify that it should be. That is, the synchronisation takes place through a securely encrypted tunnel between your computers running AeroFS, and is never stored in the cloud. This has a number of benefits: it means you can store as much as you want on your AeroFS drive without having to pay for cloud storage, and it means that data is not stored on third party computers (essential for some business applications). It is cross-platform (Windows, Linux, Mac) and free &#8211; what more could you want?</p>
<p><a href="http://www.aerofs.com/">Download AeroFS</a></p>
<h2>Caffeine</h2>
<p><a href="http://blog.rtwilson.com/wp-content/uploads/2011/04/Screen-shot-2011-04-03-at-18.49.00.png"><img class="aligncenter size-full wp-image-136" title="Caffeine on Menu bar" src="http://blog.rtwilson.com/wp-content/uploads/2011/04/Screen-shot-2011-04-03-at-18.49.00.png" alt="Caffeine on Menu bar" width="728" height="22" /></a></p>
<p>This simple app does one simple thing, but is invaluable. Do you ever find that your MacBook screen&#8217;s backlight goes off while you&#8217;re busy watching a film, showing your family photos, or busy watching a process complete. By clicking the coffee cup icon that Caffeine puts in your menu bar you can stop the screen backlight from switching off. Simply click the icon again to get it back to normal.</p>
<p><a href="http://lightheadsw.com/caffeine/">Download Caffeine</a></p>
<h2>Max</h2>
<p><a href="http://blog.rtwilson.com/wp-content/uploads/2011/04/Max.png"><img class="aligncenter size-medium wp-image-137" title="Max" src="http://blog.rtwilson.com/wp-content/uploads/2011/04/Max-300x225.png" alt="Max Window" width="300" height="225" /></a>We&#8217;ve all done it: suddenly needed to convert an audio file and googled &#8220;Convert from X to Y&#8221; and found a huge list of ad-riddled pages explaining how to do it if you buy their ghastly shareware software. Although I sometimes like to stick to good-old command-line tools like ffmpeg, I quite like finding a nice GUI tool to do this. Max allows you both to rip CDs (through a variety of methods) and convert audio files that you already have, all through a nice GUI interface, with no dependencies on other software. Unfortunately it&#8217;s Mac only.</p>
<p><a href="http://sbooth.org/Max/">Download Max</a></p>
<h2>Evom</h2>
<p><a href="http://blog.rtwilson.com/wp-content/uploads/2011/04/Evom.png"><img class="aligncenter size-medium wp-image-138" title="Evom" src="http://blog.rtwilson.com/wp-content/uploads/2011/04/Evom-203x300.png" alt="Evom Window" width="203" height="300" /></a>Similar to Max, but for video &#8211; this program will convert any video files you have to other formats, and download YouTube videos to any format you want. It&#8217;ll even let you convert files into just the right format for playing on various hand-held devices (iPods, iPads, mobile phones etc).</p>
<p><a href="http://thelittleappfactory.com/evom/">Download Evom</a></p>
<h2>DTerm</h2>
<p><a href="http://blog.rtwilson.com/wp-content/uploads/2011/01/DTermAndGit.png"><img class="aligncenter size-medium wp-image-100" title="DTermAndGit" src="http://blog.rtwilson.com/wp-content/uploads/2011/01/DTermAndGit-300x173.png" alt="Screenshot of DTerm running GIt commands" width="300" height="173" /></a></p>
<p>I&#8217;ve mentioned DTerm <a title="Git + DTerm = Great Source Control in OS X" href="http://blog.rtwilson.com/git-dterm-great-source-control-in-os-x/">before</a> on my blog, and I really can&#8217;t live without it on my Mac now. It allows you to quickly open a simple command prompt in any directory, and execute a command there (with full output shown), or switch immediately to a terminal focussed on that folder, ready to do any other processing you might need. It does full command-line completion, and I haven&#8217;t yet found a command that won&#8217;t work in DTerm&#8217;s terminal.</p>
<p><a href="http://decimus.net/DTerm/">Download DTerm</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rtwilson.com/amazing-software-you-havent-heard-of/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to: Set up a simple service to run in the background on a Linux machine (using daemontools)</title>
		<link>http://blog.rtwilson.com/how-to-set-up-a-simple-service-to-run-in-the-background-on-a-linux-machine-using-daemontools/</link>
		<comments>http://blog.rtwilson.com/how-to-set-up-a-simple-service-to-run-in-the-background-on-a-linux-machine-using-daemontools/#comments</comments>
		<pubDate>Sat, 19 Mar 2011 11:38:55 +0000</pubDate>
		<dc:creator>Robin Wilson</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.rtwilson.com/?p=123</guid>
		<description><![CDATA[I have just set up a new home server (a review of which will be coming soon) and have been installing various programs that I want to run on it. A number of these are servers, such as sshd, apache, samba etc. All of these have fairly easy installs under Debian and will automatically run [...]]]></description>
				<content:encoded><![CDATA[<p>I have just set up a new home server (a review of which will be coming soon) and have been installing various programs that I want to run on it. A number of these are servers, such as <tt>sshd</tt>, <tt>apache</tt>, <tt>samba</tt> etc. All of these have fairly easy installs under Debian and will automatically run at startup, and can be controlled by <tt>/etc/init.d</tt> scripts.</p>
<p>However, I also have a number of other programs I want to run as services, constantly in the background, which don&#8217;t come with nice Debian init.d scripts. After asking a question on SuperUser I found that one fairly simple solution would be to use a set of tools called <a href="http://cr.yp.to/daemontools.html">daemontools</a>. These tools provide a simple way of defining services which run constantly, and can be controlled by an administrator (in a similar way to /etc/init.d services). daemontools seem to be designed very well, and are quite easy to use, but the documentation on the website seems to lack a simple quickstart guide&#8230;so I thought I&#8217;d write my own.</p>
<p>At this point I should mention that I have only been using daemontools for a few hours, so I could be completely wrong about anything I say below. These instructions will be for Debian, but should be fairly easily to use with other distros (the only bit that will be significantly different is exactly how to install it with the package manager). Anyway, proceed at your own risk!</p>
<ol>
<li><strong>Install daemontools
<p></strong>In debian you will need to run <tt>apt-get install daemontools daemontools-run</tt> (both packages are important &#8211; I didn&#8217;t install the latter package and it caused me lots of frustration). This will install the tools themselves and also add the required lines to startup files to ensure that all of the required daemontools services start when the machine boots.</li>
<li><strong>Create a service directory
<p></strong>You will probably find that the installer has created a /service directory for you. If it hasn&#8217;t then create one yourself. Then create a directory under that directory for each service that you want to run. Here we will be creating a test service, so create a directory called test. Run <tt>chmod 1755</tt> on this directory.</li>
<li><strong>Create the service run file
<p></strong>daemontools needs to know what command(s) you need to run for this service, and these commands should be put inside a shell script called run in the service directory. For example, the file could contain:</p>
<p><tt>&nbsp;</p>
<pre>#!/bin/sh
echo Running service
exec some-command-here</pre>
<p></tt><tt></tt></li>
<li><strong>Finished!
<p></strong>That should be all you need to get the service running. You should probably restart the machine now as that will ensure that all of the daemontools monitoring services have started correctly. Once the machine has started the new service should have started running. If it crashes or ends for some reason it will restart after one second. Any new services you add (which you can do exactly as above) should start within five seconds. You can use the <tt>svc</tt> command to control the services you have created (see <tt>man svc</tt> for details)</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.rtwilson.com/how-to-set-up-a-simple-service-to-run-in-the-background-on-a-linux-machine-using-daemontools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

 Served from: blog.rtwilson.com @ 2013-06-19 04:44:15 by W3 Total Cache -->