<?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>Matt Shirley</title> <atom:link href="http://mattshirley.com/feed/" rel="self" type="application/rss+xml" /><link>http://mattshirley.com</link> <description>An n=1 science blog</description> <lastBuildDate>Sat, 18 May 2013 11:31:14 +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>Tutorial: uploading NGS data to Amazon S3 for use in Galaxy</title><link>http://mattshirley.com/uploading-ngs-data-to-amazon-s3-for-use-in-galaxy/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=uploading-ngs-data-to-amazon-s3-for-use-in-galaxy</link> <comments>http://mattshirley.com/uploading-ngs-data-to-amazon-s3-for-use-in-galaxy/#comments</comments> <pubDate>Thu, 14 Feb 2013 18:18:54 +0000</pubDate> <dc:creator>matt</dc:creator> <category><![CDATA[bioinformatics]]></category> <category><![CDATA[aws]]></category> <category><![CDATA[galaxy]]></category> <category><![CDATA[s3]]></category> <category><![CDATA[tutorial]]></category><guid
isPermaLink="false">http://mattshirley.com/?p=492</guid> <description><![CDATA[So, you&#8217;ve managed to launch Galaxy on Amazon Web Services EC2, and now you&#8217;re trying to upload all of your RNA-seq files to run TopHat and Cufflinks. Great! But it&#8217;s taking 5 (five!) days to transfer your data. That&#8217;s going to cost a ton of money if you keep your Galaxy instance running on EC2 [...]]]></description> <content:encoded><![CDATA[<p>So, you&#8217;ve managed to launch Galaxy on Amazon Web Services EC2, and now you&#8217;re trying to upload all of your RNA-seq files to run TopHat and Cufflinks. Great! But it&#8217;s taking 5 (five!) days to transfer your data. That&#8217;s going to cost a ton of money if you keep your Galaxy instance running on EC2 the entire time. Luckily for you there is a better way.<span
id="more-492"></span></p><h1>Amazon S3</h1><p>Amazon S3 is the service behind cloud storage giant <a
href="http://dropbox.com">Dropbox</a> and a number of other companies. Once your data are hosted on S3, you can quickly and cheaply import it into your Galaxy instance running on Amazon EC2. For $0.01 per gigabyte per month you can host your data on S3. Compare this to approximately $0.30 &#8211; $2.00 per <em>hour</em> for running your Galaxy instance on the cloud, and you will quickly realize that uploading your large data to S3 before running Galaxy will save you big time.</p><h2>Uploading your data to S3</h2><p>Go to the <a
href="https://console.aws.amazon.com/s3/home?region=us-east-1#">S3 link</a> in your <a
href="https://console.aws.amazon.com/console/home?#">AWS dashboard</a>.</p><p><a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/02/Screen-Shot-2013-02-14-at-12.46.55-PM.png"><img
src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/02/Screen-Shot-2013-02-14-at-12.46.55-PM.png" alt="Screen Shot 2013-02-14 at 12.46.55 PM" width="334" height="175" class="aligncenter size-full wp-image-493" /></a></p><p>You will see a management page for your S3 &#8220;buckets&#8221;. Create a new bucket. You can think of a bucket like a hard drive &#8211; you can place files and folders inside a bucket.</p><p><a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/02/Screen-Shot-2013-02-14-at-12.48.05-PM.png"><img
src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/02/Screen-Shot-2013-02-14-at-12.48.05-PM.png" alt="Screen Shot 2013-02-14 at 12.48.05 PM" width="257" height="116" class="aligncenter size-full wp-image-494" /></a></p><p><a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/02/Screen-Shot-2013-02-14-at-12.50.00-PM.png"><img
src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/02/Screen-Shot-2013-02-14-at-12.50.00-PM.png" alt="Screen Shot 2013-02-14 at 12.50.00 PM" width="526" height="403" class="aligncenter size-full wp-image-495" /></a></p><p>Now select your new bucket. You&#8217;ll drop in to a page telling you that your bucket is empty, and allowing you to select &#8220;upload&#8221; to add files to the bucket.</p><p><a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/02/Screen-Shot-2013-02-14-at-12.51.14-PM.png"><img
src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/02/Screen-Shot-2013-02-14-at-12.51.14-PM.png" alt="Screen Shot 2013-02-14 at 12.51.14 PM" width="877" height="293" class="aligncenter size-full wp-image-496" /></a></p><p>Add some files using the file selector, and then click &#8220;start upload&#8221;.</p><p><a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/02/Screen-Shot-2013-02-14-at-12.53.56-PM.png"><img
src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/02/Screen-Shot-2013-02-14-at-12.53.56-PM.png" alt="Screen Shot 2013-02-14 at 12.53.56 PM" width="826" height="531" class="aligncenter size-full wp-image-498" /></a></p><p>You might want to use the &#8220;advanced uploader&#8221; if your files are rather large. The length of the uploading process will depend the speed of your internet connection. <em>Don&#8217;t try this at your local Starbucks</em>. Once your files appear in S3, you can select a file and view its properties. You&#8217;ll want to choose &#8220;actions&#8221; and &#8220;make public&#8221; so that we can import this file later into Galaxy. <em>Note</em> this will allow anyone on the internet to see your file. I won&#8217;t cover file permissions in this guide, but you may be able to keep your data private and still import them into Galaxy on AWS.</p><p><a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/02/Screen-Shot-2013-02-14-at-1.01.03-PM.png"><img
src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/02/Screen-Shot-2013-02-14-at-1.01.03-PM.png" alt="Screen Shot 2013-02-14 at 1.01.03 PM" width="155" height="427" class="aligncenter size-full wp-image-500" /></a></p><p>Now that your uploads have finished, let&#8217;s <a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/02/Galaxy-for-NGS-Analysis.pdf">initialize your Galaxy cluster on AWS</a> and import your files into your history. You can simply select your file and copy its S3 URL (in blue) to your clipboard.</p><p><a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/02/Screen-Shot-2013-02-14-at-12.58.38-PM.png"><img
src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/02/Screen-Shot-2013-02-14-at-12.58.38-PM.png" alt="Screen Shot 2013-02-14 at 12.58.38 PM" width="578" height="517" class="aligncenter size-full wp-image-499" /></a></p><p>Then in Galaxy, select the &#8220;upload file&#8221; tool under &#8220;get data&#8221; and paste the S3 URL of your file into the text box and click &#8220;execute&#8221;.</p><p><a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/02/Screen-Shot-2013-02-14-at-1.14.51-PM.png"><img
src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/02/Screen-Shot-2013-02-14-at-1.14.51-PM.png" alt="Screen Shot 2013-02-14 at 1.14.51 PM" width="648" height="544" class="aligncenter size-full wp-image-502" /></a></p><p>That&#8217;s it! The file should almost immediately appear in your Galaxy history and you can start working with your data.</p> ]]></content:encoded> <wfw:commentRss>http://mattshirley.com/uploading-ngs-data-to-amazon-s3-for-use-in-galaxy/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Automating Apple time machine backups to Amazon Glacier using python, tar, and zfs</title><link>http://mattshirley.com/automating-apple-time-machine-backups-to-amazon-glacier-using-python-tar-and-zfs/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=automating-apple-time-machine-backups-to-amazon-glacier-using-python-tar-and-zfs</link> <comments>http://mattshirley.com/automating-apple-time-machine-backups-to-amazon-glacier-using-python-tar-and-zfs/#comments</comments> <pubDate>Wed, 23 Jan 2013 21:14:51 +0000</pubDate> <dc:creator>matt</dc:creator> <category><![CDATA[hacks]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[aws]]></category> <category><![CDATA[backup]]></category> <category><![CDATA[boto]]></category> <category><![CDATA[glacier]]></category> <category><![CDATA[python]]></category> <category><![CDATA[zfs]]></category><guid
isPermaLink="false">http://mattshirley.com/?p=456</guid> <description><![CDATA[In a previous post I played around with Amazon Glacier, using a tool called glacierFreezer. Since then, I&#8217;ve wanted to automate backups of my Time Machine archives, as well as my photos and home directories. Looking around for more current Glacier interfaces I noticed a project called glacier-cmd which looks promising. The core utilities are written [...]]]></description> <content:encoded><![CDATA[<p>In a <a
href="http://mattshirley.com/cold-storage-freezing-my-backups-in-amazon-glacier/" title="Cold storage: freezing my backups in Amazon Glacier">previous post</a> I played around with Amazon Glacier, using a tool called <a
href="http://www.glacierfreezer.com">glacierFreezer</a>. Since then, I&#8217;ve wanted to automate backups of my Time Machine archives, as well as my photos and home directories. Looking around for more current Glacier interfaces I noticed a project called <a
href="https://github.com/uskudnik/amazon-glacier-cmd-interface">glacier-cmd</a> which looks promising. The core utilities are written in Python, and provide means to upload, download, and query Glacier vaults.</p><p><span
id="more-456"></span></p><pre><code>git clone https://github.com/uskudnik/amazon-glacier-cmd-interface.git 
cd amazon-glacier-cmd-interface 
sudo python setup.py install  
</code></pre><p>After we install <em>glacier-cmd</em>, let&#8217;s start creating our backup script to upload files located in a certain directory, as well as check that we don&#8217;t have too many copies of those files stored already on Glacier. We should keep the last three months of Glacier archives, since deletion prior to three months results in a pro-rated charge. First we need to create a SimpleDB domain to store the glacier-cmd cache:</p><pre><code>python
&gt;&gt;&gt; import boto
&gt;&gt;&gt; sdb = boto.connect_sdb('your_access_key', 'your_secret_key')
&gt;&gt;&gt; sdb.create_domain('glacier-cmd')
&gt;&gt;&gt; quit()
</code></pre><p>Now let&#8217;s start our script. We want a wrapper script that passes all of our AWS information, as well as some information about logging and AWS region. We&#8217;ll set SimpleDB domain we created so we can have a cached inventory of our vaults and their contents. We&#8217;ll want a function that creates a new vault (based on the date and name of the backup set) and uploads some data to it. I&#8217;ve written two methods: (1) Using <em>tar</em> and (2) using <em>zfs send</em>. Both methods compress the backup using <em>bzip2</em>, although the zfs method uses a more advanced &#8220;snapshot&#8221; of the filesystem which will accurately reflect the state of the backup set even if data are added or removed during our upload. We will also want a function that cleans up backup sets. I&#8217;ve hard-coded this to a value of 3 months old backup sets, since Glacier expects that data will reside for this minimum period.</p><pre><code>#!/bin/bash
# Usage:
# glacier_backup.sh backup-job-name action folder-to-backup
# action=(backup,cleanup,zfsbackup)

# AWS access keys
access_key='your_access_key'
secret_key='your_secret_key'

# glacier-cmd configuration
region='us-east-1'
bookkeeping_domain='glacier-cmd'
logfile=/var/log/glacier.log
loglevel=INFO
output=print

# Command line invocation of glacier-cmd with variables passed
glacier_cmd="
/usr/local/bin/glacier-cmd\
 --aws-access-key $access_key\
 --aws-secret-key $secret_key\
 --region $region\
 --bookkeeping\
 --bookkeeping-domain-name $bookkeeping_domain\
 --logfile $logfile\
 --loglevel $loglevel\
 --output $output
"

# Debugging options
if [ "$1" == "debug" ]; then
    $glacier_cmd $2
    exit 0
fi

# The name of the backup job
backup_job=$1
path_folder=$3

if [ "$2" == "backup" ]; then
    hello=`date --date='now' +%b%g`
    vault="$backup_job$hello" # A unique vault name created from today's date plus job name
    $glacier_cmd 'mkvault' $vault # Create this vault
# Tar and compress directory, then upload from stdin
    tar cjf - $path_folder | $glacier_cmd 'upload' $vault --stdin --name ${path_folder#/}.tar.bz2
fi 

if [ "$2" == "zfsbackup" ]; then
    hello=`date --date='now' +%b%g`
    vault="$backup_job$hello" # A unique vault name created from today's date plus job name
    $glacier_cmd 'mkvault' $vault # Create this vault
# Use ZFS send, then upload from stdin
# If using ZFS send, $path_folder must be "pool/filesystem" with no preceding "/"
    pool_filesystem=${path_folder#/}
    /sbin/zfs snapshot "$pool_filesystem@$vault"
    /sbin/zfs send "$pool_filesystem@$vault" | bzip2 | $glacier_cmd 'upload' $vault --stdin --name ${pool_filesystem}.zfs.bz2
    /sbin/zfs destroy "$pool_filesystem@$vault"
fi 

if [ "$2" == "cleanup" ]; then
    goodbye=`date --date='3 months ago' +%b%g`
    vault="$backup_job$goodbye" # The vault from three months ago - may not exist!
    $glacier_cmd 'rmvault' $vault
fi
</code></pre><p>We can set up two <em>cron</em> jobs for the beginning of every month to upload and cleanup a set of ZFS filesystem backups:</p><pre><code>00 02 01 * * /home/matt/scripts/glacier_backup.sh timemachine zfsbackup socrates/TimeMachine
00 01 01 * * /home/matt/scripts/glacier_backup.sh timemachine cleanup
</code></pre><p>That&#8217;s it.</p> ]]></content:encoded> <wfw:commentRss>http://mattshirley.com/automating-apple-time-machine-backups-to-amazon-glacier-using-python-tar-and-zfs/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Retraction of Cell paper from Hopkins autism researcher</title><link>http://mattshirley.com/retraction-of-cell-paper-from-hopkins-autism-researcher/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=retraction-of-cell-paper-from-hopkins-autism-researcher</link> <comments>http://mattshirley.com/retraction-of-cell-paper-from-hopkins-autism-researcher/#comments</comments> <pubDate>Fri, 18 Jan 2013 19:24:19 +0000</pubDate> <dc:creator>matt</dc:creator> <category><![CDATA[news]]></category> <category><![CDATA[retractions]]></category><guid
isPermaLink="false">http://mattshirley.com/?p=449</guid> <description><![CDATA[Last year it was just a rumor, but yesterday Retraction Watch covered an official retraction from a neuroscience lab at Hopkins. The retraction notice: Our paper reported an analysis of a mouse genetic model that deletes the C terminus of Shank3 to mimic human mutations that cause autism spectrum disorder. Figure panels for several polyubiquitination assays [...]]]></description> <content:encoded><![CDATA[<p>Last year it was just a rumor, but yesterday <a
href="http://retractionwatch.wordpress.com/2013/01/17/neuroscientists-retract-cell-autism-model-paper-for-improperly-assembled-figures/">Retraction Watch</a> covered an official retraction from a neuroscience lab at Hopkins. The retraction notice:</p><blockquote><p>Our paper reported an analysis of a mouse genetic model that deletes the C terminus of Shank3 to mimic human mutations that cause autism spectrum disorder. Figure panels for several polyubiquitination assays were improperly assembled, leading to multiple repetitions of bands in western blots of the lysates. These errors did not affect the quantitative analysis of polyubiquitination because this analysis was performed as described and was not dependent on representative western blot images. In light of the figure preparation issues, we feel that the most responsible course of action is to retract the paper. We sincerely apologize to the scientific community for any misunderstanding that these errors may have caused.</p></blockquote><p>Well done for preventing the spread of misinformation. It must hurt to issue a retraction, but it sounds like the conclusions still stand regardless of the &#8220;improper assembly&#8221; of the representative Western blots. When are we going to learn to stop trusting Western blots in papers?</p> ]]></content:encoded> <wfw:commentRss>http://mattshirley.com/retraction-of-cell-paper-from-hopkins-autism-researcher/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Thanks, Hackaday readers.</title><link>http://mattshirley.com/thanks-hackaday-readers/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=thanks-hackaday-readers</link> <comments>http://mattshirley.com/thanks-hackaday-readers/#comments</comments> <pubDate>Wed, 09 Jan 2013 13:49:45 +0000</pubDate> <dc:creator>matt</dc:creator> <category><![CDATA[news]]></category><guid
isPermaLink="false">http://mattshirley.com/?p=429</guid> <description><![CDATA[  I really appreciate all the feedback. You&#8217;ve made my day and my new year!]]></description> <content:encoded><![CDATA[<p><img
src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/Screen-Shot-2013-01-09-at-8.51.26-AM.png" alt="" />   I really appreciate all the feedback. You&#8217;ve made my day and my new year!</p> ]]></content:encoded> <wfw:commentRss>http://mattshirley.com/thanks-hackaday-readers/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Adding Airplay to an external usb audio interface</title><link>http://mattshirley.com/adding-airplay-to-an-external-usb-audio-interface/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=adding-airplay-to-an-external-usb-audio-interface</link> <comments>http://mattshirley.com/adding-airplay-to-an-external-usb-audio-interface/#comments</comments> <pubDate>Tue, 08 Jan 2013 14:03:52 +0000</pubDate> <dc:creator>matt</dc:creator> <category><![CDATA[hacks]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[AirPlay]]></category> <category><![CDATA[audio]]></category> <category><![CDATA[embedded]]></category> <category><![CDATA[raspberry pi]]></category> <category><![CDATA[USB]]></category><guid
isPermaLink="false">http://mattshirley.com/?p=411</guid> <description><![CDATA[The Raspberry Pi is a fairly powerful $25 single-board computer targeted toward the educational market, though just because it&#8217;s for kids doesn&#8217;t mean it&#8217;s not fun for adults. I&#8217;ve been wanting to buy a Pi for a while now, but couldn&#8217;t justify purchasing hardware I have no use for &#8211; that is, until I saw [...]]]></description> <content:encoded><![CDATA[<p>The <a
href="http://raspberrypi.org">Raspberry Pi</a> is a fairly powerful $25 single-board computer targeted toward the educational market, though just because it&#8217;s for kids doesn&#8217;t mean it&#8217;s not fun for adults. I&#8217;ve been wanting to buy a Pi for a while now, but couldn&#8217;t justify purchasing hardware I have no use for &#8211; that is, until I saw this blog post detailing how to use the <a
href="http://jordanburgess.com/post/38986434391/raspberry-pi-airplay">Pi as an Apple Airplay receiver</a>. This is perfect. Let&#8217;s get started turning our little computer into a single-purpose appliance.</p><div
id="attachment_412" class="wp-caption aligncenter" style="width: 310px"><a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0171.jpg"><img
class="size-medium wp-image-412" alt="Here it is, after a few weeks of waiting!" src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0171-300x225.jpg" width="300" height="225" /></a><p
class="wp-caption-text">Here it is, after a few weeks of waiting!</p></div><p><span
id="more-411"></span></p><p>The actual board itself is very small. So small, in fact, that I wondered whether I needed to buy a project box to stuff it in. While looking around online at different expensive plastic boxes to put this in, I realized that I have the perfect enclosure for the Pi already in my audio stack.</p><div
class="wp-caption aligncenter" style="width: 442px"><img
class="  " alt="" src="http://www.musiciansbuy.com/mmMBCOM/Images/EDIROL_UA5.jpg" width="432" height="202" /><p
class="wp-caption-text">The Edirol UA-5 usb audio interface</p></div><p>My USB audio interface is made of thick steel and aluminum, and will be plugged in to the Pi anyway (since the Pi uses onboard pulse-width modulation to approximate an audio signal at low quality). Why not put the Pi <em>inside</em> the UA-5? Let&#8217;s see if there is room for a Pi.</p><div
id="attachment_413" class="wp-caption aligncenter" style="width: 310px"><a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0172.jpg"><img
class="size-medium wp-image-413" alt="Plenty of room inside" src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0172-300x225.jpg" width="300" height="225" /></a><p
class="wp-caption-text">Plenty of room inside</p></div><p>After removing the thick aluminum cover with a few screws, I see that there looks to be room directly over the digital signal processing side of the board. This is good, because I don&#8217;t want to stick a little computer spewing RF noise all over any analogue circuits. Let&#8217;s remove the main board.</p><p><img
class="size-thumbnail wp-image-415 alignleft" alt="IMG_0174" src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0174-150x150.jpg" width="150" height="150" /><a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0173.jpg"><img
class="alignleft size-thumbnail wp-image-414" alt="IMG_0173" src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0173-150x150.jpg" width="150" height="150" /></a><img
class="alignleft size-thumbnail wp-image-421" alt="IMG_0175" src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0175-150x150.jpg" width="150" height="150" /></p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>The board comes right out, and now we&#8217;re left with a thick steel case. Let&#8217;s cut a hole in it! We need a hole to pass the USB ports, power, and WiFi radio through. I have a feeling this case efficiently blocks and RF signals emanating from inside. At this point I should say that I rushed in to cutting the case without proper tools (I used a drill and some snips). I should have had at least a file to smooth out the rough edges, but I can go back and fix this later.</p><div
id="attachment_416" class="wp-caption aligncenter" style="width: 310px"><a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0176.jpg"><img
class="size-medium wp-image-416" alt="IMG_0176" src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0176-300x225.jpg" width="300" height="225" /></a><p
class="wp-caption-text">A very rough looking finish. Oh well.</p></div><p>After cutting a hole in the side of my beautiful equipment, let&#8217;s figure out how to fit the Pi in. I&#8217;ll screw the main board back in and then cut a piece of the packaging cardboard to make a standoff that will insulate the two boards from each other.</p><div
id="attachment_418" class="wp-caption aligncenter" style="width: 310px"><a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0178.jpg"><img
class="size-medium wp-image-418" alt="Reduce, Reuse..." src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0178-300x225.jpg" width="300" height="225" /></a><p
class="wp-caption-text">Reduce, Reuse&#8230;</p></div><p>And secure the Pi to it&#8217;s new home. I&#8217;ve added an 8GB SD card with Raspbian along with an Edimax USB wireless dongle and a microUSB cable for power. This is all secured to the cardboard standoff with zip ties.</p><div
id="attachment_419" class="wp-caption aligncenter" style="width: 310px"><a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0181.jpg"><img
class="size-medium wp-image-419" alt="IMG_0181" src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0181-300x225.jpg" width="300" height="225" /></a><p
class="wp-caption-text">It fits well</p></div><p>Before I screw the lid back on I need to power up the Pi and log in via SSH using the onboard ethernet. After editing my <code>/etc/network/interfaces</code> and adding &#8220;auto wlan0&#8243; I just add the proper <code>wpa_supplicant.conf</code>, grab the wlan0 MAC address, add a static DHCP reservation for the Pi on my router, and reboot. Now let&#8217;s put the lid on.</p><div
id="attachment_420" class="wp-caption aligncenter" style="width: 310px"><a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0182.jpg"><img
class="size-medium wp-image-420" alt="Not bad!" src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0182-300x225.jpg" width="300" height="225" /></a><p
class="wp-caption-text">Not bad!</p></div><p>It looks pretty good! Let&#8217;s log in to our Pi and install <a
href="https://github.com/albertz/shairport">Shairport</a>. It&#8217;s pretty straightforward.</p><pre class="lang:sh decode:true"># Change to our home directory, install all the packages we need.
cd ~
apt-get install build-essential libssl-dev libcrypt-openssl-rsa-perl libao-dev libio-socket-inet6-perl libwww-perl avahi-utils pkg-config git emacs
git clone https://github.com/albertz/shairport.git
cd shairport
make
# Install Net::SDP Perl module
sudo -s
perl -MCPAN -e 'install Net::SDP'
# Demote the onboard soundcard and allow USB soundcards to become default
# Add 'options snd_bcm2835=-2'
# Comment out line 'options snd-usb-audio index=-2'
emacs /etc/modprobe.d/alsa-base.conf 
# Copy the example init script
cp shairport.init.sample /etc/init.d/shairport
# Edit the init script to point to Shairport
# NAME=RecordPlayer
# DAEMON="/home/pi/shairport/shairport.pl"
emacs /etc/init.d/shairport
update-rc.d shairport defaults
reboot</pre><p>That&#8217;s it! Let&#8217;s hook it back in to our amplifier. I&#8217;ve connected the UA-5 to the remaining USB port on the Pi.</p><div
id="attachment_422" class="wp-caption aligncenter" style="width: 310px"><a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0183.jpg"><img
class="size-medium wp-image-422" alt="The Raspberry UA-5 sitting on the phono preamp and stereo amplifier." src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0183-300x225.jpg" width="300" height="225" /></a><p
class="wp-caption-text">The Raspberry UA-5 sitting on the phono preamp and stereo amplifier.</p></div><p>With everything connected and powered on, we can now select &#8220;RecordPlayer&#8221; from our iOS or Mac OS devices and stream music to the nicest speakers in the house.</p><div
id="attachment_423" class="wp-caption aligncenter" style="width: 235px"><a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0184.jpg"><img
class="size-medium wp-image-423" alt="There's a computer in there." src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0184-225x300.jpg" width="225" height="300" /></a><p
class="wp-caption-text">There&#8217;s a computer in there.</p></div><p>The UA-5 is capable of 96KHz 24-bit playback, but because the Pi is not too powerful, and I suspect that Airplay only transmits 16-bit resolution, I have it set up for 48KHz 16-bit playback.</p><p>UPDATE:</p><p>I&#8217;ve recently encountered an issue with the default Pi ALSA configuration. It seems like the Raspberry Pi developers worked in a direct memory access mode for the onboard sound, and this was giving me some issues while using a USB sound card. Sometimes, but not always, the audio would cut out for about a second every five to ten seconds. With some configuration changes I&#8217;ve been able to eliminate this. Also, to be safe I&#8217;m now using 41KHz playback. Here&#8217;s the <code>/etc/asound.conf</code>:</p><pre class="lang:sh decode:true " title="/etc/asound.con">pcm.!default {
    type plug
    slave.pcm anticracking
}

pcm.anticracking {
    type dmix
    ipc_key 1024
    ipc_key_add_uid yes
    slave {
        pcm "hw:0,0"
        period_time 0
        buffer_time 0
        #period_size 1024
        #buffer_size 8192
        rate 44100
    }
}</pre><p>Thanks to [maximeh] for the <a
href="https://github.com/albertz/shairport/issues/25#issuecomment-1142201">suggestion</a>.</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p
style="text-align: center;"><p>&nbsp;</p><p
style="text-align: center;"> ]]></content:encoded> <wfw:commentRss>http://mattshirley.com/adding-airplay-to-an-external-usb-audio-interface/feed/</wfw:commentRss> <slash:comments>18</slash:comments> </item> <item><title>WL v911 helicopter battery charger fix</title><link>http://mattshirley.com/wl911-helicopter-battery-charger-fix/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wl911-helicopter-battery-charger-fix</link> <comments>http://mattshirley.com/wl911-helicopter-battery-charger-fix/#comments</comments> <pubDate>Sun, 06 Jan 2013 17:35:33 +0000</pubDate> <dc:creator>matt</dc:creator> <category><![CDATA[hacks]]></category> <category><![CDATA[charger]]></category> <category><![CDATA[rc]]></category> <category><![CDATA[repair]]></category><guid
isPermaLink="false">http://mattshirley.com/?p=397</guid> <description><![CDATA[I recently bought a really fun mini RC helicopter. It&#8217;s made in China by WL Toys, and it packs lots of technology into a ready to fly kit. Flying it has been a blast, but the manufacturing quality control leaves something to be desired. The remote control has a small piece of something rattling around [...]]]></description> <content:encoded><![CDATA[<p>I recently bought a really fun <a
href="http://www.amazon.com/gp/product/B00762BMOI/ref=oh_details_o00_s00_i00">mini RC helicopter</a>. It&#8217;s made in China by WL Toys, and it packs lots of technology into a ready to fly kit. Flying it has been a blast, but the manufacturing quality control leaves something to be desired. The remote control has a small piece of something rattling around in it, which doesn&#8217;t affect the function at all. The battery charger is supposed to charge two of the Li-polymer batteries simultaneously, but it seems like mine only has one working port:</p><div
id="attachment_398" class="wp-caption aligncenter" style="width: 310px"><a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0161.jpg"><img
class="size-medium wp-image-398 " alt="We need more red LEDs please." src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0161-300x300.jpg" width="300" height="300" /></a><p
class="wp-caption-text">We need more red LEDs please.</p></div><p><span
id="more-397"></span></p><p>Let&#8217;s see what we can do about that. The bottom has four tiny screws and a small vent.</p><div
id="attachment_399" class="wp-caption aligncenter" style="width: 310px"><a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0163.jpg"><img
class="size-medium wp-image-399" alt="Thank god it has screws." src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0163-300x300.jpg" width="300" height="300" /></a><p
class="wp-caption-text">Thank god it has screws.</p></div><p>Inside there is a small, roughly finished board with some SMD components. It looks like a few resistors and maybe voltage regulators.</p><div
id="attachment_404" class="wp-caption aligncenter" style="width: 310px"><a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0167.jpg"><img
class="size-medium wp-image-404 " alt="The top of the board looks fine. Reads &quot;Hong Li&quot;." src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0167-300x300.jpg" width="300" height="300" /></a><p
class="wp-caption-text">The top of the board looks fine. Reads &#8220;Hong Li&#8221;.</p></div><div
id="attachment_400" class="wp-caption alignleft" style="width: 310px"><a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0164.jpg"><img
class="size-medium wp-image-400 " alt="Underneath the lid." src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0164-300x300.jpg" width="300" height="300" /></a><p
class="wp-caption-text">Underneath the lid.</p></div><p>&nbsp;</p><p>Looking at the bottom of the tiny board reveals a potential issue with one of the charging leads. It appears that the leads on the left channel are both soldered, but the right channel only has solder on one lead! Let&#8217;s fix that right up with some lead-free solder.</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><div
id="attachment_401" class="wp-caption alignleft" style="width: 250px"><a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0166.png"><img
class=" wp-image-401 " alt="Something missing" src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0166-300x300.png" width="240" height="240" /></a><p
class="wp-caption-text">Something missing</p></div><p>&nbsp;</p><div
id="attachment_402" class="wp-caption alignright" style="width: 250px"><a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0165.png"><img
class="wp-image-402 " alt="Something added" src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0165-300x300.png" width="240" height="240" /></a><p
class="wp-caption-text">Something added</p></div><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>After adding a blob of solder to the pin and re-assembling the whole thing, it works! I was thinking about asking the seller to replace this part, but the entire fix took under 5 minutes with a small amount of work. My friend has this same helicopter kit, and he also had this issue with the first charger he received. It seems like someone was asleep on the assembly line.</p><div
id="attachment_405" class="wp-caption aligncenter" style="width: 310px"><a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0162.jpg"><img
class="size-medium wp-image-405" alt="It works!" src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2013/01/IMG_0162-300x300.jpg" width="300" height="300" /></a><p
class="wp-caption-text">It works!</p></div> ]]></content:encoded> <wfw:commentRss>http://mattshirley.com/wl911-helicopter-battery-charger-fix/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>&#8220;One Moment Worth Years&#8221; &#8211; RIP Dave Brubeck</title><link>http://mattshirley.com/one-moment-worth-years-rip-dave-brubeck/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=one-moment-worth-years-rip-dave-brubeck</link> <comments>http://mattshirley.com/one-moment-worth-years-rip-dave-brubeck/#comments</comments> <pubDate>Thu, 06 Dec 2012 20:14:20 +0000</pubDate> <dc:creator>matt</dc:creator> <category><![CDATA[music]]></category><guid
isPermaLink="false">http://mattshirley.com/?p=379</guid> <description><![CDATA[Dave Brubeck, the composer and pianist that exposed many decades of young people to jazz, died yesterday at the age of 91. He literally brought jazz to college by integrating classical European composition elements such as alternating time signatures and introspective chord progressions. Some people, including my favorite music professor Michael Budds, hinted that Brubeck couldn&#8217;t [...]]]></description> <content:encoded><![CDATA[<p><audio
controls preload><source
src="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2012/12/08-One-Moment-Worth-Years.mp3" /><embed
type="application/x-shockwave-flash" flashvars="audioUrl=http://mattshirley.com/wp-content/uploads/2012/12/08-One-Moment-Worth-Years.mp3" src="http://mattshirley.com/wp-content/plugins/oembed-html5-audio/3523697345-audio-player.swf" width="400" height="27" quality="best"></embed></audio></p><p>Dave Brubeck, the composer and pianist that exposed many decades of young people to jazz, <a
href="http://www.npr.org/blogs/ablogsupreme/2012/12/05/166591728/dave-brubeck-beyond-take-five">died yesterday</a> at the age of 91. He literally <a
href="http://www.allmusic.com/album/jazz-goes-to-college-mw0000205356">brought jazz to college</a> by integrating classical European composition elements such as alternating time signatures and introspective chord progressions. Some people, including my favorite music professor <a
href="http://music.missouri.edu/faculty/budds.html">Michael Budds</a>, hinted that Brubeck couldn&#8217;t swing like other contemporary jazz innovators. I think he just swung more subtly. He had to, since the styles of music he integrated were viewed as diametrically opposed in nature. Along with other visionary composers such as Duke Ellington, Brubeck left more than the legacy of his songbooks and great recorded performances; he pushed the concept of jazz as art and intellectual stimulus into homes worldwide. Dave Brubeck (along with Paul Desmond, Joe Morello, and Eugene Wright) introduced me to jazz that&#8217;s not &#8220;old-timey&#8221; &#8211; not a caricature of another decade. His death will surely not stop future generations of young people from enjoying this great American art form. Rest in peace.</p><p>PS: This morning (Dec 10) Tom Hall <a
href="http://www.wypr.org/podcast/12-10-12-remembering-dave-brubeck">aired his thoughts</a> about Brubeck as well as a three year old interview between the two.</p> ]]></content:encoded> <wfw:commentRss>http://mattshirley.com/one-moment-worth-years-rip-dave-brubeck/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <enclosure
url="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2012/12/08-One-Moment-Worth-Years.mp3" length="4731714" type="audio/mpeg" /> </item> <item><title>BUGSS: Baltimore Underground Science Space</title><link>http://mattshirley.com/bugss-baltimore-underground-science-space/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=bugss-baltimore-underground-science-space</link> <comments>http://mattshirley.com/bugss-baltimore-underground-science-space/#comments</comments> <pubDate>Fri, 16 Nov 2012 18:02:34 +0000</pubDate> <dc:creator>matt</dc:creator> <category><![CDATA[Baltimore]]></category> <category><![CDATA[synthetic biology]]></category><guid
isPermaLink="false">http://mattshirley.com/?p=363</guid> <description><![CDATA[Tomorrow, Baltimore&#8217;s newest (only?) &#8220;bio-space&#8221; is hosting a hands-on synthetic biology workshop. BUGSS is not a group I&#8217;m associated with, but that may change soon, because it looks like they are having tons of fun. With a bit of lab equipment and some e.coli, these guys are hosting some 18+ and all-ages workshops to expose [...]]]></description> <content:encoded><![CDATA[<p>Tomorrow, Baltimore&#8217;s newest (only?) &#8220;bio-space&#8221; is hosting a hands-on synthetic biology workshop. <a
href="http://www.bugssonline.org">BUGSS</a> is not a group I&#8217;m associated with, but that may change soon, because it looks like they are having tons of fun. With a bit of lab equipment and some e.coli, these guys are hosting some 18+ and all-ages workshops to expose more people to actual molecular biology experiments. I wish this type of thing existed when I was in high-school.</p> ]]></content:encoded> <wfw:commentRss>http://mattshirley.com/bugss-baltimore-underground-science-space/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Using Galaxy in the cloud</title><link>http://mattshirley.com/using-galaxy-in-the-cloud/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-galaxy-in-the-cloud</link> <comments>http://mattshirley.com/using-galaxy-in-the-cloud/#comments</comments> <pubDate>Mon, 12 Nov 2012 18:49:23 +0000</pubDate> <dc:creator>matt</dc:creator> <category><![CDATA[bioinformatics]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[galaxy]]></category> <category><![CDATA[presentation]]></category> <category><![CDATA[talk]]></category> <category><![CDATA[tutorial]]></category><guid
isPermaLink="false">http://mattshirley.com/?p=349</guid> <description><![CDATA[Recently I gave a presentation about Galaxy, and as part of the presentation I walked about 30 people through setting up a Galaxy cluster through Amazon Web Services (AWS). The AWS setup took most of an hour, and moving 30 people through each step was painful. From pain comes prosperity (apparently), because today I stumbled on [...]]]></description> <content:encoded><![CDATA[<p>Recently I gave a presentation about <a
href="http://usegalaxy.org">Galaxy</a>, and as part of the <a
href="http://mattshirley.com.s3.amazonaws.com/wp-content/uploads/2012/11/Galaxy-for-NGS-Analysis-2012-10-09.pdf">presentation</a> I walked about 30 people through setting up a Galaxy cluster through Amazon Web Services (AWS). The AWS setup took most of an hour, and moving 30 people through each step was painful. From pain comes prosperity (apparently), because today I stumbled on a link from the main Galaxy public server that allows a user to <em>automatically <a
href="https://main.g2.bx.psu.edu/cloudlaunch">initialize a Galaxy cluster</a> through AWS! </em>Where were you last month? Anyway, I&#8217;ve updated the presentation with a link to <a
href="https://main.g2.bx.psu.edu/cloudlaunch">the site</a>. I&#8217;ve not tested this method of Cloudman Galaxy initialization, but I&#8217;m assuming it should work really well.</p> ]]></content:encoded> <wfw:commentRss>http://mattshirley.com/using-galaxy-in-the-cloud/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Sequestering the hand the feeds</title><link>http://mattshirley.com/sequestering-the-hand-the-feeds/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sequestering-the-hand-the-feeds</link> <comments>http://mattshirley.com/sequestering-the-hand-the-feeds/#comments</comments> <pubDate>Mon, 17 Sep 2012 14:28:48 +0000</pubDate> <dc:creator>matt</dc:creator> <category><![CDATA[science policy]]></category><guid
isPermaLink="false">http://mattshirley.com/wordpress/?p=291</guid> <description><![CDATA[ASBMB policy blog just posted a concise summary of what impact sequestration could have on NIH and NSF funded research. Today, the administration’s Office of Budget Management (OMB) released its plan, and it paints a pretty grim picture for biomedical research. The NIH and NSF would each sustain an 8.2% cut to their budgets which would [...]]]></description> <content:encoded><![CDATA[<p>ASBMB policy blog just posted a <a
href="http://asbmbpolicy.wordpress.com/2012/09/14/the-impact-of-sequestration-on-research">concise summary</a> of what impact sequestration could have on NIH and NSF funded research.</p><blockquote><p>Today, the administration’s Office of Budget Management (OMB) <a
href="http://www.whitehouse.gov/sites/default/files/omb/assets/legislative_reports/stareport.pdf">released its plan</a>, and it paints a pretty grim picture for biomedical research. The NIH and NSF would each sustain an 8.2% cut to their budgets which would amount to a reduction of roughly $2.5 billion and $460 million, respectively.</p></blockquote><p>An 8.2% budget cut doesn&#8217;t mean that we are &#8220;trimming the fat&#8221;, or keeping expenses under control. I&#8217;m also not sure if it means we&#8217;ll be losing many jobs either. The scientific community is closely knit, and funding has been stagnant for a few years. We&#8217;ll keep doing some research, but not as much, and the size of incoming graduate student cohorts will continue to dwindle as training grants become smaller. I&#8217;m not sure whether this last part is overwhelmingly good or bad.<span
id="more-291"></span></p><p>Since I will soon complete graduate school myself, it&#8217;s easy to view my experience as &#8220;right time, right place&#8221;, and write off the funding contraction as necessary, and look forward to some future time where we again have an inflationary budget, and there will be a shortage of trained scientists of a certain age. The NIH seems aware that we are over-training students for the number of academic positions available, so whether or not sequestration hits at 8.2% or not, we are seem to be moving forward under some selective pressure.</p> ]]></content:encoded> <wfw:commentRss>http://mattshirley.com/sequestering-the-hand-the-feeds/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>