<?xml version="1.0" encoding="utf-8" ?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:dc="http://purl.org/dc/elements/1.1/"
         xmlns:syn="http://purl.org/rss/1.0/modules/syndication/"
         xmlns="http://purl.org/rss/1.0/">




    



<channel rdf:about="http://lukepomfrey.org/blog/blog/RSS">
  <title>Blog @ http://lukepomfrey.org</title>
  <link>http://lukepomfrey.org</link>
  
  <description>
    
       Luke's blog
       
  </description>
  
  
  
            <syn:updatePeriod>daily</syn:updatePeriod>
            <syn:updateFrequency>1</syn:updateFrequency>
            <syn:updateBase>2008-07-12T16:57:08Z</syn:updateBase>
        
  
  <image>
    <url>http://lukepomfrey.org/logo.jpg</url>
    <title>Blog</title>
    <link>http://lukepomfrey.org</link>
  </image>

  <items>
    <rdf:Seq>
        
            <rdf:li rdf:resource="http://lukepomfrey.org/blog/google-mail-as-default-mail-client"/>
        
        
            <rdf:li rdf:resource="http://lukepomfrey.org/blog/so-i-finally-joined-facebook.."/>
        
        
            <rdf:li rdf:resource="http://lukepomfrey.org/blog/python-and-windows-file-names"/>
        
        
            <rdf:li rdf:resource="http://lukepomfrey.org/blog/good-morning-dave.."/>
        
        
            <rdf:li rdf:resource="http://lukepomfrey.org/blog/hep-packaging-team"/>
        
    </rdf:Seq>
  </items>

</channel>

    <item rdf:about="http://lukepomfrey.org/blog/google-mail-as-default-mail-client">
<title>Google Mail as default mail client  ―  How to use Google Mail's web interface as your default mail client</title>
<link>http://lukepomfrey.org/blog/google-mail-as-default-mail-client</link>
<description>
&lt;p&gt;This is mainly for my dad who hasn't worked out how to stop Evolution from starting every time he clicks a &lt;span class="pre"&gt;mailto:&lt;/span&gt; link and uses Google mail. So here's how to use Google Mail's web interface as your default mail client.&lt;/p&gt;
&lt;p&gt;First of all create a empty text file called &lt;span class="pre"&gt;gmail_compose&lt;/span&gt; in your home folder (or wherever), make it executable, and then copy and paste the following into it…&lt;/p&gt;
&lt;pre class="prettyprint"&gt;#!/usr/bin/env bash
uri=$( echo "$1" | sed -e "s/subject=/su=/" -e "s/^mailto:\([^&amp;amp;?]\+\)[?&amp;amp;]\?\(.*\)$/\1\&amp;amp;\2/" )

firefox "https://mail.google.com/mail?view=cm&amp;amp;tf=0&amp;amp;to=${uri}"&lt;/pre&gt;
&lt;p&gt;Of course you can substitute Firefox for whatever browser you use. Or, if multiple users have access to the script, try &lt;span class="pre"&gt;xdg-open&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;Then set this script as your default mail client for whatever desktop you're using. For example in Gnome go to &lt;span class="pre"&gt;System &amp;gt; Preferences &amp;gt; Preferred Applications&lt;/span&gt;, and then in the "Mail Reader" section select &lt;span class="pre"&gt;Custom&lt;/span&gt; from the drop down box and in the "Command" box put &lt;span class="pre"&gt;/location/to/gmail_compose %s&lt;/span&gt;, e.g. &lt;span class="pre"&gt;/home/&amp;lt;username&amp;gt;/gmail_compose %s&lt;/span&gt;.&lt;/p&gt;
</description>
<dc:publisher>No publisher</dc:publisher>
<dc:creator>lukepomfrey</dc:creator>
<dc:rights></dc:rights>

<dc:subject>google</dc:subject>


<dc:subject>how-to</dc:subject>


<dc:subject>computing</dc:subject>


<dc:subject>gnu/linux</dc:subject>


<dc:subject>email</dc:subject>

<dc:date>2010-04-19T15:02:34Z</dc:date>
<dc:type>Blog Entry</dc:type>
</item>
    <item rdf:about="http://lukepomfrey.org/blog/so-i-finally-joined-facebook..">
<title>So I finally joined Facebook…  ―  …Does that make me a sheep?</title>
<link>http://lukepomfrey.org/blog/so-i-finally-joined-facebook..</link>
<description>
&lt;p&gt;So after a long time spent adhering to my own sensibilities I've finally followed the crowd and joined Facebook… Grudgingly.&lt;/p&gt;
&lt;p&gt;So uh, &lt;a class="external-link" href="http://www.facebook.com/profile.php?id=100000313390943"&gt;add me as a friend or something&lt;/a&gt;, I guess.&lt;/p&gt;
</description>
<dc:publisher>No publisher</dc:publisher>
<dc:creator>lukepomfrey</dc:creator>
<dc:rights></dc:rights>

<dc:subject>facebook</dc:subject>


<dc:subject>general</dc:subject>

<dc:date>2009-10-02T17:12:57Z</dc:date>
<dc:type>Blog Entry</dc:type>
</item>
    <item rdf:about="http://lukepomfrey.org/blog/python-and-windows-file-names">
<title>Python and Windows file names  ―  Fixing up Windows file names so you can work with them in Python.</title>
<link>http://lukepomfrey.org/blog/python-and-windows-file-names</link>
<description>
&lt;p&gt;I recently did &lt;a class="external-link" href="http://crazymusic.co.uk/"&gt;a bit of web design work for a local mobile disco&lt;/a&gt;, the site features a simple gallery page, with a section in an admin control panel where the person that runs the site can add pictures.&lt;/p&gt;
&lt;p&gt;In the backend, I was using Python's &lt;code&gt;os.path.basename()&lt;/code&gt; to obtain the uploaded file name (and prevent directory traversal attacks). I noticed that I was getting files with names like &lt;code&gt;C:\Documents and Settings\User\My Pictures\Picture.jpg&lt;/code&gt; in the gallery. Evidently the PTSD resultant from any use of Windows had given me total amnesia over it's utterly terrible directory structure.&lt;/p&gt;
&lt;p&gt;Whilst the long file names weren't really a problem, it obviously wasn't very aesthetically pleasing. Thankfully, making things look pretty again was nice and simple, for a file name &lt;code&gt;fname&lt;/code&gt; do:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;if fname[1] == ":":
    fname = fname[2:]
fname = fname.replace("\\","/")&lt;/pre&gt;
&lt;p&gt;After that you should end up with a nice *nix looking file name that will cause no problems or general ugliness.&lt;/p&gt;
</description>
<dc:publisher>No publisher</dc:publisher>
<dc:creator>lukepomfrey</dc:creator>
<dc:rights></dc:rights>

<dc:subject>python</dc:subject>


<dc:subject>programming</dc:subject>


<dc:subject>how-to</dc:subject>


<dc:subject>computing</dc:subject>

<dc:date>2010-04-19T15:07:11Z</dc:date>
<dc:type>Blog Entry</dc:type>
</item>
    <item rdf:about="http://lukepomfrey.org/blog/good-morning-dave..">
<title>Good morning, Dave...  ―  Making your PC say hello.</title>
<link>http://lukepomfrey.org/blog/good-morning-dave..</link>
<description>
&lt;p&gt;Independence Day was on TV the other day and Jayne asked why I hadn't set up my computer to say good morning to me like Dave's laptop in the film, obviously an idea stolen from 2001. I'd completely forgotten about it until this morning when I figured I'd have a go at hacking something together, the result is the bash script below.&lt;/p&gt;
&lt;p&gt;The script &lt;em&gt;should&lt;/em&gt; get your name from the &lt;span class="pre"&gt;/etc/passwd&lt;/span&gt; file and use &lt;a class="external-link" href="http://espeak.sourceforge.net/"&gt;espeak&lt;/a&gt; to say "Good morning/afternoon/evening" depending on the time of day. Just add it to the startup programs of whatever desktop environment you use (or add it to &lt;span class="pre"&gt;.bashrc&lt;/span&gt; if you use the console only).&lt;/p&gt;
&lt;p&gt;If anyone knows of an alternative to the ugly way I've managed to get the users first name from &lt;span class="pre"&gt;/etc/passwd&lt;/span&gt; I'd love to know.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update: &lt;/strong&gt;Thanks to the un-named person below who suggested using &lt;span class="pre"&gt;finger&lt;/span&gt; to get the user's name, much better!&lt;/p&gt;
&lt;pre class="prettyprint"&gt;#!/usr/bin/env bash
## Says good morning/afternoon/evening etc.
## Requires the espeak package.

## Set name using finger
name=$(finger -l $USER | sed 's/.*: //;q')
set -- $name
name=$1
## If this doesn't work you could just set the
## name manually.
# name="Luke";

## What time is it? Use the hour to work out 
## whether it's morning, afternoon, or evening.
declare -i time;
time=`date +%H`;
if [[ $time -ge 12 &amp;amp;&amp;amp; $time -le 17 ]] ; then
    timeofday="afternoon";
elif [[ $time -ge 18 &amp;amp;&amp;amp; $time -le 23 ]] ; then
    timeofday="evening";
else
    timeofday="morning";
fi

## Say hello
say="\"Good "${timeofday}" "${name}"...\"";
espeak -s 120 "${say}";

exit 0;&lt;/pre&gt;
</description>
<dc:publisher>No publisher</dc:publisher>
<dc:creator>lukepomfrey</dc:creator>
<dc:rights></dc:rights>

<dc:subject>espeak</dc:subject>


<dc:subject>general</dc:subject>


<dc:subject>bash</dc:subject>


<dc:subject>computing</dc:subject>

<dc:date>2010-04-19T15:09:47Z</dc:date>
<dc:type>Blog Entry</dc:type>
</item>
    <item rdf:about="http://lukepomfrey.org/blog/hep-packaging-team">
<title>HEP Packaging Team  ―  Ubuntu's High Energy Physics PPA</title>
<link>http://lukepomfrey.org/blog/hep-packaging-team</link>
<description>
&lt;p&gt;I joined the &lt;a class="external-link" href="http://launchpad.net/~hep/"&gt;High Energy Physics packaging team&lt;/a&gt; over at &lt;a class="external-link" href="http://launchpad.net/"&gt;Launchpad&lt;/a&gt; recently. I'm currently maintaining packages for &lt;a class="external-link" href="http://projects.hepforge.org/agile/"&gt;AGILe&lt;/a&gt; and &lt;a class="external-link" href="http://projects.hepforge.org/rivet/"&gt;Rivet &lt;/a&gt;for them, and if I get off of my arse and sort it out I may get a package for &lt;a class="external-link" href="http://home.thep.lu.se/~torbjorn/pythiaaux/present.html"&gt;Pythia8&lt;/a&gt; sorted soon (since at the moment the version of AGILe in the PPA doesn't/can't support Pythia8).&lt;/p&gt;
&lt;p&gt;The packages I've put up there are for Intrepid but they should work on any Debian/Ubuntu system with little issue, with the following exceptions:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;If you're running Hardy you might have a problem with Rivet since it depends on &lt;a class="external-link" href="http://root.cern.ch/"&gt;ROOT&lt;/a&gt; which isn't in the Hardy repos. I may make this a recommendation, rather than a dependency, in the next version since you don't necessarily need ROOT support to run Rivet.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Until either myself or Frank Siegert get around to uploading a fixed version of &lt;a class="external-link" href="http://www.lpthe.jussieu.fr/~salam/fastjet/"&gt;Fastjet&lt;/a&gt; a version of Rivet for the lpia arch isn't available.&lt;/li&gt;&lt;li&gt;As I mentioned above AGILe doesn't support Pythia8 or Sherpa, until I get a package for Pythia8 made and upload a version that compiles with Sherpa. If you want Pythia8 support use the version of AGILe from my repos. Of course, if you run the Python rivet and don't use rivetgun (or use
rivetgun with HepMC files as the input), you can use any Pythia8
interface and just pipe it's output to rivet.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Me putting packages up there kind of makes my repos slightly redundant, but I'll continue to put any testing versions of AGILe and Rivet there.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
</description>
<dc:publisher>No publisher</dc:publisher>
<dc:creator>lukepomfrey</dc:creator>
<dc:rights></dc:rights>

<dc:subject>computing</dc:subject>


<dc:subject>debian-ubuntu</dc:subject>


<dc:subject>agile</dc:subject>


<dc:subject>rivet</dc:subject>


<dc:subject>packaging</dc:subject>


<dc:subject>hepforge</dc:subject>


<dc:subject>gnu/linux</dc:subject>


<dc:subject>physics</dc:subject>


<dc:subject>particle physics</dc:subject>

<dc:date>2008-12-22T13:45:57Z</dc:date>
<dc:type>Blog Entry</dc:type>
</item>






</rdf:RDF>
