<?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>1000umbrellas.com &#187; server</title>
	<atom:link href="http://1000umbrellas.com/tag/server/feed" rel="self" type="application/rss+xml" />
	<link>http://1000umbrellas.com</link>
	<description>Michael Descy&#039;s Personal Website</description>
	<lastBuildDate>Fri, 15 Jul 2011 02:06:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<atom:link rel='hub' href='http://1000umbrellas.com/?pushpress=hub'/>
		<item>
		<title>My Favorite Ubuntu Linux Music Server</title>
		<link>http://1000umbrellas.com/2011/01/08/my-favorite-ubuntu-linux-music-server</link>
		<comments>http://1000umbrellas.com/2011/01/08/my-favorite-ubuntu-linux-music-server#comments</comments>
		<pubDate>Sun, 09 Jan 2011 03:57:12 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[things I like]]></category>
		<category><![CDATA[web interface]]></category>
		<category><![CDATA[windows phone 7]]></category>

		<guid isPermaLink="false">http://1000umbrellas.com/?p=1164</guid>
		<description><![CDATA[The Problem
After about a year of enjoying how well my Ubuntu Linux home server downloads, organizes, and serves video files to my TV, I started to think harder about serving up music to devices around the house, and to my phone and/or PC while I&#8217;m at work. In the past, I&#8217;ve made my music library [...]]]></description>
			<content:encoded><![CDATA[<h2>The Problem</h2>
<p>After about a year of enjoying how well my Ubuntu Linux home server <a href="http://1000umbrellas.com/2010/10/08/updated-flexget-installationconfiguration-on-ubuntu-10-04-server-lucid-lynx" target="_self">downloads</a>, <a href="http://1000umbrellas.com/2010/10/10/using-tvnamer-to-move-completed-tv-torrent-downloads" target="_self">organizes</a>, and serves video files to my <a href="http://1000umbrellas.com/2010/11/13/boxee-box-review-on-amazon-com" target="_self">TV</a>, I started to think harder about serving up music to devices around the house, and to my phone and/or PC while I&#8217;m at work. In the past, I&#8217;ve made my music library available on my home network via MediaTomb, minidlna, and Samba, but I never made use of it. Instead, I always used iTunes, which is good software, but very limiting.</p>
<p>In December, I realized two things:</p>
<ol>
<li>I almost never sync my iPods to my computer anymore, because they charge in my car or in my home stereo&#8217;s dock.</li>
<li>I also never use my Android phone to listen to music, even though it is perfectly capable, because I never wanted to bother to get the USB cable out for my phone, and I haven&#8217;t found any software that I like to sync with.</li>
</ol>
<p>My problem: syncing. I hate it. It is passé and worthless when everything is network connected and your music collection is vastly larger than what a reasonably-priced amount of flash memory will hold.</p>
<p>Around the same time, I received a Cr-48 from Google. It runs Chrome OS, which can play audio via the browser (Flash or HTML 5), but that&#8217;s it. I thought it would be an interesting challenge to find a good way to play my music library on it. I also wanted to store my library on my power-efficient Ubuntu Linux server, so I wouldn&#8217;t have to leave my power-hungry desktop on all day.</p>
<h2>Searching for a Solution</h2>
<p>I found two highly respected options that would allow me to stream music to a browser or other device: Ampache and Subsonic. <a href="http://ampache.org/" target="_blank">Ampache</a> is built on top of the LAMP stack, so it requires Apache, MySQL, and PHP, which a ton of Linux servers have installed on them. It has a good number of features, too, including an Android client and front-end support in Amarok and WinAmp. I ended up not liking it, however, for two main reasons: The system requirements are rather high, mostly because it depends on MySQL as a data store. Also, indexing my 80 GB music library was very slow.</p>
<p>What I ended up preferring, and falling in love with, was <a href="http://www.subsonic.org/" target="_blank">Subsonic</a>. Subsonic is a Java app, which you can install either as a standalone Debian package in Ubuntu, or as a WAR file that you can run under TomCat or another Java Server. It runs on any host OS that supports Java, so Windows and Mac users can run it too. Subsonic scanned my music library surprisingly quickly, looks great, and worked right away. I have it installed under TomCat, and configured to use SSL (for security and to disguise my music downloading/streaming from network administrators).</p>
<h2>Subsonic</h2>
<div id="attachment_1168" class="wp-caption aligncenter" style="width: 310px"><a href="http://1000umbrellas.com/blog/wp-content/uploads/2011/01/screenshot-20110108-215936.png" rel="lightbox[1164]"><img class="size-medium wp-image-1168" title="Subsonic" src="http://1000umbrellas.com/blog/wp-content/uploads/2011/01/screenshot-20110108-215936-300x187.png" alt="Subsonic" width="300" height="187" /></a><p class="wp-caption-text">Subsonic</p></div>
<p>Subsonic offers a somewhat complex, but attractive and skinnable, web interface. It offers playlist support (though not smart playlists as in iTunes), random playlists, search, and support for album art and metadata (including a tag editor). It is far more album-oriented than song oriented, which took some getting used to moving from iTunes. For example, albums can be rated, but not individual songs. Also, the home page on the interface defaults to random albums, which looks nice and pretty, but differs greatly from how I use iTunes. I really like the feature, though, because it allows me to rediscover music that has long been buried by my iTunes smart playlists.</p>
<p>Playback in the browser is done via an open-source Flash plugin, which works fine. Album art must be embedded in the files, or at least stored at the folder level, which was initially a challenge for me due to the way iTues handles album art in its library. I used <a href="http://www.mediamonkey.com/" target="_self">MediaMonkey</a> to help get my album art into shape. The server can be set up to transcode music in formats such as Flac to MP3 or AAC to support the client player&#8217;s capabilities and to limit bandwidth.</p>
<p>Subsonic doesn&#8217;t really stream your music; it downloads and caches it. The browser client caches the song you are playing, while the iOS, Android, and Windows Phone 7 clients will cache a number of songs ahead of the current one. Caching is way better than streaming, because you don&#8217;t need a constant connection to the server. It works really well. The server has a &#8220;Status&#8221; window in which you can review all the connected clients and the bandwidth they are using, which is pretty cool.</p>
<p>Subsonic is free and open source software, though it does have a somewhat controversial donation requirement if you wish to use it via a phone app. You can connect to it via a web browser indefinitely, but if you use the Android app, as I do, it will tell you that you must donate to the project/developer after 30 days, or it will refuse to access the server. After seeing how well the Android app worked, I donated right away. Remember, even in the open source world, it is a good idea to support good developers.</p>
<p>By creating multiple user accounts, you can also use Subsonic to share music with friends and family. If you configure the server with SSL, you can do so securely and privately as well. Users can be given access to download and upload music, so it could become a music sharing platform for you and your close friends that flies under the radar.</p>
<p>All in all, I love Subsonic and recommend it to anyone who has a large music library that they wish to bring with them and share with close friends.</p>
]]></content:encoded>
			<wfw:commentRss>http://1000umbrellas.com/2011/01/08/my-favorite-ubuntu-linux-music-server/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Manage Linux File Permissions and Ownership</title>
		<link>http://1000umbrellas.com/2010/12/01/how-to-manage-linux-file-permissions-and-ownership</link>
		<comments>http://1000umbrellas.com/2010/12/01/how-to-manage-linux-file-permissions-and-ownership#comments</comments>
		<pubDate>Wed, 01 Dec 2010 16:23:58 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[file ownership]]></category>
		<category><![CDATA[file permissions]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://1000umbrellas.com/?p=1136</guid>
		<description><![CDATA[IBM just published a great article that describes how to manage Linux file permissions and ownership. That&#8217;s a very important topic for managing any server, and is very important in my Transmission-Daemon setup tutorial. This article is one of the most complete and well-written I have come across. Its command line examples are based on Fedora, but [...]]]></description>
			<content:encoded><![CDATA[<p>IBM just published <a href="http://www.ibm.com/developerworks/linux/library/l-lpic1-v3-104-5/" target="_blank">a great article</a> that describes how to manage Linux file permissions and ownership. That&#8217;s a very important topic for managing any server, and is very important in my <a href="http://1000umbrellas.com/2010/10/04/updated-transmission-installationconfiguration-on-ubuntu-server">Transmission-Daemon setup tutorial</a>. This article is one of the most complete and well-written I have come across. Its command line examples are based on Fedora, but will work just fine in Ubuntu, too.</p>
<p><a href="http://www.ibm.com/developerworks/linux/library/l-lpic1-v3-104-5/" target="_blank">Learn Linux, 101: Manage file permissions and ownership</a> [IBM]</p>
]]></content:encoded>
			<wfw:commentRss>http://1000umbrellas.com/2010/12/01/how-to-manage-linux-file-permissions-and-ownership/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Monitor Services on Ubuntu Lucid Lynx Using Monit</title>
		<link>http://1000umbrellas.com/2010/10/27/how-to-monitor-services-on-ubuntu-lucid-lynx-using-monit</link>
		<comments>http://1000umbrellas.com/2010/10/27/how-to-monitor-services-on-ubuntu-lucid-lynx-using-monit#comments</comments>
		<pubDate>Wed, 27 Oct 2010 12:00:52 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[automatic]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[lucid lynx]]></category>
		<category><![CDATA[mediatomb]]></category>
		<category><![CDATA[monit]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[pid file]]></category>
		<category><![CDATA[restart]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[sshd]]></category>
		<category><![CDATA[transmission-daemon]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://1000umbrellas.com/?p=1109</guid>
		<description><![CDATA[Even though my Ubuntu Lucid Lynx media server runs pretty solidly, I like to monitor it periodically using SSH and command line tools. Some of my favorites are w, htop, ps, bwm-ng, and nmap. After rebuilding my server, I decided to install some lightweight system monitoring tools that exposed themselves via a web interface, so [...]]]></description>
			<content:encoded><![CDATA[<p>Even though my Ubuntu Lucid Lynx media server runs pretty solidly, I like to monitor it periodically using SSH and command line tools. Some of my favorites are <a href="http://en.wikipedia.org/wiki/W_(Unix)" target="_blank">w</a>, <a href="http://htop.sourceforge.net/" target="_blank">htop</a>, <a href="http://en.wikipedia.org/wiki/Ps_(Unix)" target="_blank">ps</a>, <a href="http://sourceforge.net/projects/bwmng/" target="_blank">bwm-ng</a>, and <a href="http://www.nmap.org/" target="_blank">nmap</a>. After rebuilding my server, I decided to install some lightweight system monitoring tools that exposed themselves via a web interface, so I could check up on my server more quickly. The FLOSS utility <a href="http://mmonit.com/monit/" target="_blank">Monit</a> fit the bill for point-in-time monitoring.</p>
<p>Monit is a utility that you can set up to monitor your server’s processes and files, alert you to problems, restart stopped services, and present a web interface to display the server’s current status. I suspect most administrators would configure it to email them when services are down, drives are nearly full, load is too high, and so on. I don&#8217;t bother with email alerts, but I really like Monit&#8217;s web front-end and service restarting capabilities.</p>
<div id="attachment_1113" class="wp-caption aligncenter" style="width: 302px"><a href="http://1000umbrellas.com/blog/wp-content/uploads/2010/10/monit.png" rel="lightbox[1109]"><img class="size-medium wp-image-1113" title="monit" src="http://1000umbrellas.com/blog/wp-content/uploads/2010/10/monit-292x300.png" alt="" width="292" height="300" /></a><p class="wp-caption-text">Monit system monitoring (yes, my server is redlining!)</p></div>
<h2>Install Monit</h2>
<p>Installing Monit on an Ubuntu server is accomplished in the usual way.</p>
<p>$ sudo apt-get install monit</p>
<h2>Configure Monit</h2>
<p>You have to edit a configuration file to start monit on your server.</p>
<p><code>$ sudo nano /etc/defaults/monit</code></p>
<p>Default configuration file</p>
<pre># Defaults for monit initscript
# sourced by /etc/init.d/monit
# installed at /etc/default/monit by maintainer scripts
# Stefan Alfredsson

# You must set this variable to for monit to start
startup=0

# To change the intervals which monit should run,
# edit the configuration file /etc/monit/monitrc
# It can no longer be configured here.</pre>
<p>You have to change &#8220;startup=0&#8243; to &#8220;startup=1&#8243;.</p>
<h2>Edit the Control File</h2>
<p>Monit&#8217;s control file is the place to set up system, service, and file monitoring. The default control file is all commented out. When I set mine up, I uncommented various lines and inserted sections for each service at the bottom of the file.</p>
<p><code>$ sudo nano /etc/monit/monitrc</code></p>
<p>Edit the file (uncomment lines), to enable the following options, which set up a monitoring daemon and enables the web interface (http://localhost:2812).</p>
<pre>set daemon  120

set logfile syslog facility log_daemon

set httpd port 2812
allow localhost
allow 192.168.1.0/255.255.255.0

check system localhost

if loadavg (1min) &gt; 4 then alert
if loadavg (5min) &gt; 2 then alert
if memory usage &gt; 75% then alert
if cpu usage (user) &gt; 70% then alert
if cpu usage (system) &gt; 30% then alert
if cpu usage (wait) &gt; 20% then alert

check filesystem root with path /</blockquote>

Add the following sections to the bottom of the file to monitor cron, <a href="http://1000umbrellas.com/2010/09/25/how-to-install-openssh-on-ubuntu-server">sshd</a>, <a href="http://1000umbrellas.com/2010/10/01/how-to-set-up-samba-on-ubuntu-server">samba</a>, <a href="http://1000umbrellas.com/2010/10/03/how-to-install-and-configure-mediatomb-upnp-server-on-ubuntu-server">mediatomb</a>, lighttpd, and MySQL (which I am running to sync XMBC across multiple PCs). Services that run with a pid file are simple to monitor. MySQL does not run with a pidfile, but can easily be configured to by adding the line <code>"pid-file = /var/run/mysqld/mysqld.pid</code>" to the [mysqlid] section of <code>/etc/mysql/my.cnf</code>.
<blockquote>
# cron
check process cron with pidfile /var/run/crond.pid
group system
start program = "/etc/init.d/cron start"
stop  program = "/etc/init.d/cron stop"
if 5 restarts within 5 cycles then timeout
depends on cron_rc

check file cron_rc with path /etc/init.d/cron
group system
if failed checksum then unmonitor
if failed permission 755 then unmonitor
if failed uid root then unmonitor
if failed gid root then unmonitor

# sshd
check process sshd with pidfile /var/run/sshd.pid
start program  "/etc/init.d/ssh start"
stop program  "/etc/init.d/ssh stop"
if failed port 22 protocol ssh then restart
if 5 restarts within 5 cycles then timeout

#  samba
check process smbd with pidfile /var/run/samba/smbd.pid
group samba
start program = "/etc/init.d/smbd start"
stop  program = "/etc/init.d/smbd stop"
if failed host 192.168.1.3 port 139 type TCP  then restart
if 5 restarts within 5 cycles then timeout

# mediatomb
check process mediatomb with pidfile /var/run/mediatomb.pid
group mediatomb
start program = "/etc/init.d/mediatomb start"
stop  program = "/etc/init.d/mediatomb stop"
if 5 restarts within 5 cycles then timeout

# lighttpd
check process lighttpd with pidfile /var/run/lighttpd.pid
group lighttpd
start program = "/etc/init.d/lighttpd start"
stop program = "/etc/init.d/lighttpd stop"
if failed host 127.0.0.1 port 80
protocol http then restart
if 5 restarts within 5 cycles then timeout

# mysql
# note: requires mysql to run with a pid.
check process mysql with pidfile /var/run/mysqld/mysqld.pid
group database
start program = "/etc/init.d/mysql start"
stop program = "/etc/init.d/mysql stop"
if failed host 127.0.0.1 port 3306 then restart
if 5 restarts within 5 cycles then timeout</pre>
<p>Unfortunately, monit can&#8217;t monitor the <a href="http://1000umbrellas.com/2010/10/04/updated-transmission-installationconfiguration-on-ubuntu-server">transmission-daemon</a> service, because transmission-daemon does not run with a pid file, and forks itself sometimes. There is a warning in the transmission-daemon launch script, <code>/etc/init.d/transmission-daemon</code>, which says that pid file support will not work, because the daemon forks. Hopefully this will be resolved in the future.</p>
<h2>Using Monit</h2>
<p>After editing your configuration file, restart monit.</p>
<p><code>$ sudo service monit restart</code></p>
<p>Now you can check the health of your server by pointing a web browser to your server&#8217;s IP address, port 2812 (http://server:2812/).</p>
]]></content:encoded>
			<wfw:commentRss>http://1000umbrellas.com/2010/10/27/how-to-monitor-services-on-ubuntu-lucid-lynx-using-monit/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to Cache Everything on the WD TV LIVE Due to a Slow Network</title>
		<link>http://1000umbrellas.com/2010/10/26/how-to-cache-everything-on-the-wd-tv-live-due-to-a-slow-network</link>
		<comments>http://1000umbrellas.com/2010/10/26/how-to-cache-everything-on-the-wd-tv-live-due-to-a-slow-network#comments</comments>
		<pubDate>Tue, 26 Oct 2010 17:23:57 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[HTPC]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[tv]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[wd tv live]]></category>

		<guid isPermaLink="false">http://1000umbrellas.com/?p=1102</guid>
		<description><![CDATA[This is a simple script I wrote to perform one-way sync to mirror my server&#8217;s media folder on my WD TV LIVE&#8216;s external hard drive. I have to run such a script because the wifi-N signal in my TV cabinet is not sufficient to stream HD video, and the WD TV LIVE doesn&#8217;t appear to [...]]]></description>
			<content:encoded><![CDATA[<p>This is a simple script I wrote to perform one-way sync to mirror my server&#8217;s media folder on my <a href="http://www.wdtvlive.com/" target="_blank">WD TV LIVE</a>&#8216;s external hard drive. I have to run such a script because the wifi-N signal in my TV cabinet is not sufficient to stream HD video, and the WD TV LIVE doesn&#8217;t appear to buffer enough of the video to ensure smooth playback. (I even ran into problems running Boxee on my PC, when it was in the cabinet. And yes, no hardwired solution is possible in that room; even powerline networking wasn&#8217;t up to snuff.) Therefore, instead of relying on software to cache video streams, I put an old, external hard drive into use to cache <em>everything </em>on my media server. This is not an elegant solution, but it is an effective one.</p>
<p>The WD TV LIVE&#8217;s external hard drive is NTFS-formatted, and is<a href="http://1000umbrellas.com/2010/10/02/how-to-mount-windowssamba-shares-to-the-ubuntu-file-system"> mounted to my media server&#8217;s filesystem via smbmount</a>.</p>
<h2>The &#8220;syncmedia&#8221; Script</h2>
<p>This is my script, which I store in <code>/home/mjdescy/bin/syncmedia</code>.</p>
<pre>#!/bin/sh
# mirror media folder to server

SOURCE_DIR=/home/mjdescy/media/
DEST_DIR=/home/mjdescy/wdtvlive/

# perform simple, one-way sync using rsync; use setlock to prevent simultaneous instances from being run
/usr/bin/setlock -n /tmp/.mediasync.lock /usr/bin/rsync --size-only --verbose --recursive --stats --delete --exclude=".*" --modify-window=1 --times --bwlimit=1000 $SOURCE_DIR $DEST_DIR</pre>
<h3>Execute Permissions</h3>
<p>Make sure to set execute permissions on the script before you try to run it.</p>
<p><code>$ chmod u+x /home/mjdescy/bin/syncmedia</code></p>
<h3>Notes on &#8220;setlock&#8221;</h3>
<p>Note the use of &#8220;setlock&#8221; (which is part of the &#8220;daemontools&#8221; package) to prevent the rsync command from being run if it is already running. This is necessary if the time it takes to copy the files can exceed the interval at which the script is executed via cron.</p>
<p>Install daemontools in Ubuntu via:</p>
<p><code>$ sudo apt-get install daemontools</code></p>
<h3>Rsync Options</h3>
<p>Using rsync to copy the files to a Samba share, mounted with <a href="http://samba.org/samba/smbfs/" target="_blank">smbfs</a>, presented some challenges. Because the server and the share are on two different file systems, copying permissions would either not work or produce unexpected results. Therefore, I couldn&#8217;t use the rsync &#8220;archive&#8221; option, as I typically do. Therefore, I selected the options &#8220;modifiy-windows&#8221; and &#8220;times&#8221; to help prevent the same files from being copied again when there wasn&#8217;t really a change.</p>
<p>I used the &#8220;size-only&#8221; option because my media files aren&#8217;t edited and updated like office documents; they are either downloaded or created once via Handbrake.</p>
<p>I used the &#8220;exclude&#8221; option to avoid deleting the &#8220;.wd_tv&#8221; folder that the WD TV LIVE uses to store its library information on the external hard drive.</p>
<p>The &#8220;delete&#8221; option will ensure that deletions on my media server (the master) are replicated on the WD TV LIVE (the slave).</p>
<p>I used the &#8220;bwlimit&#8221; option to avoid taking all the upload bandwidth away from my server for the sync. This is entirely optional. After the initial data move, this process should run primarily during the day, when we are not watching the TV, so slow uploads are not a big problem.</p>
<h2>Sheduling</h2>
<p>I use my account&#8217;s crontab to kick off this script every hour.</p>
<p><code>$ crontab -e</code></p>
<p>Add the following line and save the crontab.</p>
<blockquote><p>@hourly /home/mjdescy/bin/syncmedia &gt; /dev/null 2&gt;&amp;1</p></blockquote>
<p>Now the process will be kicked off at the top of every hour. Rsync will not move files if there have been no changes to the source folder, and will move only new/changed files to the destination folder. If an instance of this process is already running, another one will not be created.</p>
]]></content:encoded>
			<wfw:commentRss>http://1000umbrellas.com/2010/10/26/how-to-cache-everything-on-the-wd-tv-live-due-to-a-slow-network/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using TVNamer to Move Completed TV Torrent Downloads</title>
		<link>http://1000umbrellas.com/2010/10/10/using-tvnamer-to-move-completed-tv-torrent-downloads</link>
		<comments>http://1000umbrellas.com/2010/10/10/using-tvnamer-to-move-completed-tv-torrent-downloads#comments</comments>
		<pubDate>Mon, 11 Oct 2010 03:34:54 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[configure]]></category>
		<category><![CDATA[HTPC]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lucid lynx]]></category>
		<category><![CDATA[metadata]]></category>
		<category><![CDATA[move files]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[season number]]></category>
		<category><![CDATA[series name]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[tv]]></category>
		<category><![CDATA[tv series]]></category>
		<category><![CDATA[tvnamer]]></category>

		<guid isPermaLink="false">http://1000umbrellas.com/?p=1090</guid>
		<description><![CDATA[I have previously written a post explaining how to install and configure TVNamer to automatically rename downloaded TV episode files into nice, human-readable formats. I found that if you create a configuration file for TVNamer, however, it can do even more than that. I will outline how to use TVNamer to move TV episodes to a folder [...]]]></description>
			<content:encoded><![CDATA[<p>I have previously written a post explaining <a href="http://1000umbrellas.com/2010/04/27/tvnamer-installationconfiguration">how to install and configure TVNamer</a> to automatically rename downloaded TV episode files into nice, human-readable formats. I found that if you create a configuration file for <a href="http://github.com/dbr/tvnamer/" target="_blank">TVNamer</a>, however, it can do even more than that. I will outline how to use TVNamer to move TV episodes to a folder tree, based on metadata such as the series name and season number. This organizes your media perfectly for a HTPC front-end.</p>
<p>Example of the TV folder tree:</p>
<blockquote>
<ul>
<li>tv
<ul>
<li>series name 1
<ul>
<li>Season 01</li>
</ul>
</li>
<li>series name 2
<ul>
<li>Season 01</li>
<li>Season 02</li>
</ul>
</li>
<li>series name 3
<ul>
<li>Season 05</li>
</ul>
</li>
</ul>
</li>
</ul>
</blockquote>
<h2>Install TVNamer</h2>
<p>First, install TVNamer using the instructions found in <a href="http://1000umbrellas.com/2010/04/27/tvnamer-installationconfiguration">my prior post on the subject</a>.</p>
<h2>Generate and Customize the TVNamer Configuration File</h2>
<p>Running TVNamer without a configuration file renames files in place, without too many options as to how it is done. Running TVNamer with a configuration file, on the other hand, unlocks more powerful functionality. I will show you how to configure TVNAmer to move your TV episodes into a well-organized folder tree, using the series name, season number, and other metadata to create the folder- and file names. (A word of caution: While TVNamer works superbly on episodic content, it does not currently work shows broadcast daily, such as &#8220;The Daily Show&#8221; and &#8220;The Colbert Report&#8221;, due to how the files are named.)</p>
<p>To begin using a TVNamer configuration file, you must create one. Luckily, it is easy to tell TVNamer to create a default configuration file for you. Run TVNamer, as follows, to create a configuration file in your home folder.</p>
<p><code>$ tvnamer --save=~/.tvnamerconfig.json</code></p>
<p>Now, edit that configuration file. The file is in JSON (JavaScript Object Notation) format, which means that you must be sure your syntax is consistent, and all quotation marks and braces are closed.</p>
<p><code>$ nano ~/.tvnamerconfig.json</code></p>
<p>Your configuration file will look similar to my file, which is reproduced below. Any lines that I changed from the default are in boldface. <span style="font-family: Arial;">I recommend setting “batch” and “recursive” to true. To move renamed files to a new folder, edit the following attributes: “move_files_confirmation”, “move_files_destination” and “move_files”.</span></p>
<p>You can pick metadata keywords out of the various &#8220;filename_*&#8221; attributes. The most useful ones will likely be &#8221;seriesname&#8221;, &#8220;seasonno&#8221;, &#8221;episodename&#8221;, and &#8220;episode&#8221;. These can be used not only in file names, but also in the folder path for the &#8220;move_files_destination&#8221; attribute. Note the syntax used to insert the metadata values into the attribute value: %(keyword)s. When inserting these metadata strings into the attributes you edit, you must keep the control characters&#8211;the &#8220;%(&#8221; that precedes the keyword, and the )s that follows it&#8211;intact. Numbers are treated a little differently in terms of the suffix: 02dx instead of s. This follows Python string formatting syntax, and is explained in the <a href="http://github.com/dbr/tvnamer" target="_blank">&#8220;Custom Output Filenames&#8221; section</a> of TVNamer&#8217;s web site.</p>
<p>The configuration file below sets up TVNamer to run in batch mode, recursively process any folders passed to it on the command line, process only files with video file extensions, and to move any renamed files to a specific folder tree (~/media/tv/(series name)/Season (season number)),  I don&#8217;t change how files are named, but you could easily do so by editing the attributes that start with “filename_”. I highly recommend limiting TVNamer&#8217;s activities to video files using the &#8220;valid_extensions&#8221; attribute, because I&#8217;ve had non-video files confuse the script. (I never believed that would happen, but it did, and the fix is simple.)</p>
<blockquote><p>{<br />
&#8220;always_rename&#8221;: false,<br />
<strong> &#8220;batch&#8221;: true, </strong><br />
&#8220;episode_separator&#8221;: &#8220;-&#8221;,<br />
&#8220;episode_single&#8221;: &#8220;%02d&#8221;,<br />
&#8220;filename_patterns&#8221;: [<br />
"^\\[.+?\\][ ]? # group name\n        (?P&lt;seriesname&gt;.*?)[ ]?[-_][ ]?          # show name, padding, spaces?\n        (?P&lt;episodenumberstart&gt;\\d+)              # first episode number\n        ([-_]\\d+)*                               # optional repeating episodes\n        [-_](?P&lt;episodenumberend&gt;\\d+)            # last episode number\n        [^\\/]*$&#8221;,<br />
&#8220;^\\[.+?\\][ ]? # group name\n        (?P&lt;seriesname&gt;.*) # show name\n        [ ]?[-_][ ]?(?P&lt;episodenumber&gt;\\d+)\n        [^\\/]*$&#8221;,</p>
<p>&#8220;\n        ^((?P&lt;seriesname&gt;.+?)[ \\._\\-])?          # show name\n        [Ss](?P&lt;seasonnumber&gt;[0-9]+)             # s01\n        [\\.\\- ]?                                 # separator\n        [Ee](?P&lt;episodenumberstart&gt;[0-9]+)       # first e23\n        ([\\.\\- ]+                                # separator\n        [Ss](?P=seasonnumber)                    # s01\n        [\\.\\- ]?                                 # separator\n        [Ee][0-9]+)*                             # e24 etc (middle groups)\n        ([\\.\\- ]+                                # separator\n        [Ss](?P=seasonnumber)                    # last s01\n        [\\.\\- ]?                                 # separator\n        [Ee](?P&lt;episodenumberend&gt;[0-9]+))        # final episode number\n        [^\\/]*$&#8221;,</p>
<p>&#8220;\n        ^((?P&lt;seriesname&gt;.+?)[ \\._\\-])?          # show name\n        [Ss](?P&lt;seasonnumber&gt;[0-9]+)             # s01\n        [\\.\\- ]?                                 # separator\n        [Ee](?P&lt;episodenumberstart&gt;[0-9]+)       # first e23\n        ([\\.\\- ]?                                # separator\n        [Ee][0-9]+)*                             # e24e25 etc\n        [\\.\\- ]?[Ee](?P&lt;episodenumberend&gt;[0-9]+) # final episode num\n        [^\\/]*$&#8221;,</p>
<p>&#8220;\n        ^((?P&lt;seriesname&gt;.+?)[ \\._\\-])?          # show name\n        (?P&lt;seasonnumber&gt;[0-9]+)                 # first season number (1)\n        [xX](?P&lt;episodenumberstart&gt;[0-9]+)       # first episode (x23)\n        ([ \\._\\-]+                               # separator\n        (?P=seasonnumber)                        # more season numbers (1)\n        [xX][0-9]+)*                             # more episode numbers (x24)\n        ([ \\._\\-]+                               # separator\n        (?P=seasonnumber)                        # last season number (1)\n        [xX](?P&lt;episodenumberend&gt;[0-9]+))        # last episode number (x25)\n        [^\\/]*$&#8221;,</p>
<p>&#8220;\n        ^((?P&lt;seriesname&gt;.+?)[ \\._\\-])?          # show name\n        (?P&lt;seasonnumber&gt;[0-9]+)                 # 1\n        [xX](?P&lt;episodenumberstart&gt;[0-9]+)       # first x23\n        ([xX][0-9]+)*                            # x24x25 etc\n        [xX](?P&lt;episodenumberend&gt;[0-9]+)         # final episode num\n        [^\\/]*$&#8221;,</p>
<p>&#8220;\n        ^((?P&lt;seriesname&gt;.+?)[ \\._\\-])?          # show name\n        [Ss](?P&lt;seasonnumber&gt;[0-9]+)             # s01\n        [\\.\\- ]?                                 # separator\n        [Ee](?P&lt;episodenumberstart&gt;[0-9]+)       # first e23\n        (                                        # -24 etc\n             [\\-]\n             [Ee]?[0-9]+\n        )*\n             [\\-]                                # separator\n             (?P&lt;episodenumberend&gt;[0-9]+)        # final episode num\n        [\\.\\- ]                                  # must have a separator (prevents s01e01-720p from being 720 episodes)\n        [^\\/]*$&#8221;,</p>
<p>&#8220;\n        ^((?P&lt;seriesname&gt;.+?)[ \\._\\-])?          # show name\n        (?P&lt;seasonnumber&gt;[0-9]+)                 # 1\n        [xX](?P&lt;episodenumberstart&gt;[0-9]+)       # first x23\n        (                                        # -24 etc\n             [\\-][0-9]+\n        )*\n             [\\-]                                # separator\n             (?P&lt;episodenumberend&gt;[0-9]+)        # final episode num\n        ([\\.\\- ].*                               # must have a separator (prevents 1&#215;01-720p from being 720 episodes)\n        |\n        $)&#8221;,</p>
<p>&#8220;^(?P&lt;seriesname&gt;.+?)[ \\._\\-]          # show name and padding\n        \\[                                       # [\n            ?(?P&lt;seasonnumber&gt;[0-9]+)            # season\n        [xX]                                     # x\n            (?P&lt;episodenumberstart&gt;[0-9]+)       # episode\n            (- [0-9]+)*\n        -                                        # -\n            (?P&lt;episodenumberend&gt;[0-9]+)         # episode\n        \\]                                       # \\]\n        [^\\/]*$&#8221;,</p>
<p>&#8220;^(?P&lt;seriesname&gt;.+?)[ \\._\\-]\n        [Ss](?P&lt;seasonnumber&gt;[0-9]{2})\n        [\\.\\- ]?\n        (?P&lt;episodenumber&gt;[0-9]{2})\n        [^0-9]*$&#8221;,</p>
<p>&#8220;^((?P&lt;seriesname&gt;.+?)[ \\._\\-])?       # show name and padding\n        \\[?                                      # [ optional\n        (?P&lt;seasonnumber&gt;[0-9]+)                 # season\n        [xX]                                     # x\n        (?P&lt;episodenumber&gt;[0-9]+)                # episode\n        \\]?                                      # ] optional\n        [^\\/]*$&#8221;,</p>
<p>&#8220;^((?P&lt;seriesname&gt;.+?)[ \\._\\-])?\n        [Ss](?P&lt;seasonnumber&gt;[0-9]+)[\\.\\- ]?\n        [Ee]?(?P&lt;episodenumber&gt;[0-9]+)\n        [^\\/]*$&#8221;,</p>
<p>&#8220;\n        ^((?P&lt;seriesname&gt;.+?)[ \\._\\-])?         # show name\n        (?P&lt;year&gt;\\d{4})                          # year\n        [ \\._\\-]                                 # separator\n        (?P&lt;month&gt;\\d{2})                         # month\n        [ \\._\\-]                                 # separator\n        (?P&lt;day&gt;\\d{2})                           # day\n        [^\\/]*$&#8221;,</p>
<p>&#8220;^(?P&lt;seriesname&gt;.+?)[ ]?[ \\._\\-][ ]?\n        [Ss](?P&lt;seasonnumber&gt;[0-9]+)[\\.\\- ]?\n        [Ee]?[ ]?(?P&lt;episodenumber&gt;[0-9]+)\n        [^\\/]*$&#8221;,</p>
<p>&#8220;\n        (?P&lt;seriesname&gt;.+)                       # Showname\n        [ ]-[ ]                                  # -\n        [Ee]pisode[ ]\\d+                         # Episode 1234 (ignored)\n        [ ]\n        \\[                                       # [\n        [sS][ ]?(?P&lt;seasonnumber&gt;\\d+)            # s 12\n        ([ ]|[ ]-[ ]|-)                          # space, or -\n        ([eE]|[eE]p)[ ]?(?P&lt;episodenumber&gt;\\d+)   # e or ep 12\n        \\]                                       # ]\n        .*$                                      # rest of file\n        &#8220;,</p>
<p>&#8220;^(?P&lt;seriesname&gt;.+)[ \\._\\-]\n        (?P&lt;seasonnumber&gt;[0-9]{1})\n        (?P&lt;episodenumber&gt;[0-9]{2})\n        [\\._ -][^\\/]*$&#8221;,</p>
<p>&#8220;^(?P&lt;seriesname&gt;.+)[ \\._\\-]\n        (?P&lt;seasonnumber&gt;[0-9]{2})\n        (?P&lt;episodenumber&gt;[0-9]{2,3})\n        [\\._ -][^\\/]*$&#8221;,</p>
<p>&#8220;^(?P&lt;seriesname&gt;.+?)                  # Show name\n        [ \\._\\-]                                 # Padding\n        [Ee](?P&lt;episodenumber&gt;[0-9]+)            # E123\n        [\\._ -][^\\/]*$                          # More padding, then anything\n        &#8221;</p>
<p>],</p>
<p>&#8220;filename_with_episode&#8221;: &#8220;%(seriesname)s &#8211; [%(seasonno)02dx%(episode)s] &#8211; %(episodename)s%(ext)s&#8221;,<br />
&#8220;filename_with_episode_no_season&#8221;: &#8220;%(seriesname)s &#8211; [%(episode)s] &#8211; %(episodename)s%(ext)s&#8221;,<br />
&#8220;filename_without_episode&#8221;: &#8220;%(seriesname)s &#8211; [%(seasonno)02dx%(episode)s]%(ext)s&#8221;,<br />
&#8220;filename_without_episode_no_season&#8221;: &#8220;%(seriesname)s &#8211; [%(episode)s]%(ext)s&#8221;,<br />
&#8220;input_filename_replacements&#8221;: [],<br />
&#8220;language&#8221;: &#8220;en&#8221;,<br />
<strong> &#8220;move_files_confirmation&#8221;: false, </strong><br />
<strong> &#8220;move_files_destination&#8221;: &#8220;/home/mjdescy/media/tv/%(seriesname)s/Season %(seasonnumber)02d&#8221;, </strong><br />
<strong> &#8220;move_files_enable&#8221;: true, </strong><br />
&#8220;move_files_fullpath_replacements&#8221;: [],<br />
&#8220;multiep_join_name_with&#8221;: &#8220;, &#8220;,<br />
&#8220;normalize_unicode_filenames&#8221;: false,<br />
&#8220;output_filename_replacements&#8221;: [],<br />
<strong> &#8220;recursive&#8221;: true, </strong><br />
&#8220;replace_invalid_characters_with&#8221;: &#8220;_&#8221;,<br />
&#8220;search_all_languages&#8221;: true,<br />
&#8220;select_first&#8221;: false,<br />
&#8220;skip_file_on_error&#8221;: true,<br />
<strong> &#8220;valid_extensions&#8221;: ["avi","mp4","m4v","wmv","mkv","mov"], </strong><br />
&#8220;verbose&#8221;: false,<br />
<strong> &#8220;windows_safe_filenames&#8221;: true</strong><br />
}</p></blockquote>
<h2>Scheduling/Putting it All Together</h2>
<p>I run TVNamer on my &#8220;completed torrents&#8221; folder every 15 minutes, via my personal account’s crontab. This process automatically sweeps any TV episodes out of <a href="http://1000umbrellas.com/2010/10/04/updated-transmission-installationconfiguration-on-ubuntu-server">Transmission</a>&#8216;s <a href="http://1000umbrellas.com/2010/10/05/updated-how-to-automatically-move-and-remove-transmission-daemon-downloads">completed downloads folder</a> and files them into my TV folder, which is shared via <a href="http://1000umbrellas.com/2010/10/02/how-to-mount-windowssamba-shares-to-the-ubuntu-file-system">Samba </a>and <a href="http://1000umbrellas.com/2010/10/03/how-to-install-and-configure-mediatomb-upnp-server-on-ubuntu-server">MediaTomb </a>for use by my HTPC front-ends. This set-up is perfect for my WD TV LIVE front-end, XBMC, or for any HTPC front-end setup. For any TV shows that I rip from DVD and encode to MP4 files myself, TVNamer will rename and file them automatically, as long as I name the original files with a S01E01 (series number, episode number) syntax and drop them into the completed downloads folder.</p>
<p><code>$ crontab -e</code></p>
<p>Add the following line, being sure to modify the config file and TV folder paths, and save the crontab file.</p>
<blockquote><p>*/15 * * * * /usr/local/bin/tvnamer -c /home/mjdescy/.tvnamerconfig.json /home/mjdescy/dl/complete &gt;/dev/null 2&gt;&amp;1</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://1000umbrellas.com/2010/10/10/using-tvnamer-to-move-completed-tv-torrent-downloads/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Updated: FlexGet Installation/Configuration on Ubuntu 10.04 Server (Lucid Lynx)</title>
		<link>http://1000umbrellas.com/2010/10/08/updated-flexget-installationconfiguration-on-ubuntu-10-04-server-lucid-lynx</link>
		<comments>http://1000umbrellas.com/2010/10/08/updated-flexget-installationconfiguration-on-ubuntu-10-04-server-lucid-lynx#comments</comments>
		<pubDate>Fri, 08 Oct 2010 14:00:45 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[automatic]]></category>
		<category><![CDATA[bittorrent]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[flexget]]></category>
		<category><![CDATA[lucid lynx]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[torrents]]></category>
		<category><![CDATA[tv]]></category>
		<category><![CDATA[tv series]]></category>
		<category><![CDATA[tv shows]]></category>

		<guid isPermaLink="false">http://1000umbrellas.com/?p=1081</guid>
		<description><![CDATA[Note: These instructions are an update of a previous post. I updated my instructions to include the download of the transmissionrpc plugin, and to include the cron job definition I use. These instructions apply to FlexGet 1.0r1377.
When I read posts on LifeHacker and Gizmodo sometimes, I figure that everybody else in the world is downloading [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Note</strong>: <em>These instructions are an update of a previous post. I updated my instructions to include the download of the transmissionrpc plugin, and to include the cron job definition I use. These instructions apply to FlexGet 1.0r1377.</em></p>
<p>When I read posts on LifeHacker and Gizmodo sometimes, I figure that everybody else in the world is downloading TV episodes via BitTorrent, and doing it using RSS feeds and an automated process. That can’t possibly be true, but I figured that if other people do this, I should be able to figure out how, too. It is pretty easy to find RSS feeds for various TV shows. Therfore, I thought it would be relatively simple to write a script to download episodes from each one. I figured that I would have to figure out how to sort out duplicate episodes and different quality types (720p, 1080p, etc.) somehow, too. It didn’t take me too long to find out that an excellent Python program called FlexGet already does all this. Plus, it runs from the command line, which is perfect for a headless server, like my Ubuntu Lucid Lynx box.</p>
<p>I don’t actually endorse doing this, by the way, but I was really curious to learn how it was done. I wanted to share what I learned, in case anyone was struggling with the configuration.</p>
<h2>Installation</h2>
<p>FlexGet’s web site has an excellent walkthrough that describes how to install it on various operating systems. My instructions in this section are not meant to improve on that guide, but merely to summarize it for an Ubuntu Server install.</p>
<p>FlexGet requires Python 2.6. If you don’t already have that installed on your server, try:</p>
<p><code>$ sudo apt-get install python2.6 python-setuptools</code></p>
<p>You have to download FlexGet from their web site. Choose the version for Python 2.6. I prefer to copy the URL and download the file via wget.</p>
<p><code>$  wget http://download.flexget.com/unstable/FlexGet-1.0r1377-py2.6.egg</code></p>
<p>After you download FlexGet, install it via Python’s easy_install script. You’ll have to specify the name of the FlexGet file you downloaded.</p>
<p><code>$ sudo easy_install &lt;downloaded egg&gt;</code></p>
<p>That’s it! Flexget is now installed in the /usr/local/bin directory.</p>
<p>If you run Transmission like I do, you should also install the the TransmisionRPC plugin.</p>
<p><code>$ sudo easy_install transmissionrpc</code></p>
<h2>Configuration</h2>
<p>Configuring FlexGet is deceptively simple. The configuration file is written in a format I had heard of, but never encountered before: YAML. YAML is simple and powerful, which means that it can be deceptively complex. You can write a config file that does the same thing in a million different ways. FlexGet’s Cookbook shows you a few examples to get you started. It took me a lot of experimentation to find a config file format that I liked. Here is what I ended up with. It’s probably more complex than it needs to be, but I like the idea of using presets to customize different types of downloads. Note that, in YAML, each level of indentation is two spaces (no tabs are allowed).</p>
<p><code>$ nano ~/.flexget/config.yml</code></p>
<blockquote><p>presets:<br />
tv:<br />
series:<br />
settings:<br />
720p:<br />
timeframe: 8 hours<br />
720p:<br />
- series title 1<br />
- series title 2<br />
- series title 3</p>
<p>transmissionrpc:<br />
host: localhost<br />
port: 9091<br />
netrc: /home/mjdescy/.netrc<br />
removewhendone: true<br />
addpaused: no<br />
ratio: 1.00</p>
<p>feeds:<br />
TvTorrent1:<br />
rss: http://tv.rss.url/<br />
preset: tv</p>
<p>TvTorrent2:<br />
rss: http://tv.rss.url/<br />
preset: tv</p></blockquote>
<p>This configuration file sets up a preset called “tv” which tells FlexGet to wait 8 hours before selecting episodes of any of the series listed under the 720p heading. 720p is the default quality setting for FlexGet, and is perfectly adequate for my needs. If FlexGet finds an episode of that quality, it will download it; if it finds episodes above that quality level, at 1080p for example, it will ignore them. If no 720p version exists after the “timeframe” of 8 hours is over, FlexGet will select the entry with the highest quality available. FlexGet won’t download the same episode more than once, unless there is a “proper” or “repack” version—a corrected version of a previously released episode—is available.</p>
<p>At the end of the “tv” preset, the “tranmissionrpc” heading instructs FlexGet to use the transmissionrpc plugin to directly send torrent URLs to transmission-daemon for download. This obviates the need to set a watch directory in transmission-daemon. Note that the “netrc” setting refers to a special username/password file that contains the user name and password required to log into transmission daemon. That file should be in the following format, hidden, in your home directory. Make sure you grant only your account access to read that file (i.e., chmod 600 ~/.netrc).</p>
<blockquote><p>machine localhost<br />
login username<br />
password password123456789</p></blockquote>
<p>If you do not run transmission-daemon, you could replace the “transmissionrpc” section with a “download” section, or use another plugin. Check out the flexget Cookbook for more information.</p>
<p>The “feeds” section lists all the TV torrent feeds to look in. I have each feed set to use the “tv” preset that I defined above.</p>
<p>Each RSS feed you list can contain a number of TV series (which is the easiest way to set it up), or just one series (you’ll have to find or build custom feeds for this). Flexget will search all the feeds you list for the series titles listed in the “tv” preset.</p>
<p>This configuration file works very well for me. I hope that it helps you get up and running.</p>
<h2>Scheduling</h2>
<p>FlexGet can be run manually for debugging purposes (<code>flexget -v</code>), but it should be scheduled to run periodically via cron. Note that there is no need to run FlexGet as root. I run it under my own user account. If you want to operate under the principle of least privilege, you could create a “flexget” account, edit its crontab, and grant that account the permissions it needs to get the job done. For my needs, that isn’t necessary. Therefore, to schedule FlexGet to run every hour, I simply edit my own crontab.</p>
<p><code>$ crontab -e</code></p>
<p>Add the following line to the crontab file, and save it.</p>
<blockquote><p>0,30 * * * * /usr/local/bin/flexget &#8211;cron -c /home/mjdescy/.flexget/config.yml  &gt; /dev/null 2&gt;&amp;1</p></blockquote>
<p>This cron job will run FlexGet at the top of every hour and half past the hour. FlexGet will read its options from the configuration file I specified (/home/mjdescy/.flexget/config.yml). I redirect output to /dev/null to prevent cron from sending me emails regarding the command’s output.</p>
]]></content:encoded>
			<wfw:commentRss>http://1000umbrellas.com/2010/10/08/updated-flexget-installationconfiguration-on-ubuntu-10-04-server-lucid-lynx/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Updated: How to Automatically Move and Remove Transmission-Daemon Downloads</title>
		<link>http://1000umbrellas.com/2010/10/05/updated-how-to-automatically-move-and-remove-transmission-daemon-downloads</link>
		<comments>http://1000umbrellas.com/2010/10/05/updated-how-to-automatically-move-and-remove-transmission-daemon-downloads#comments</comments>
		<pubDate>Tue, 05 Oct 2010 16:00:25 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[lucid lynx]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Transmission]]></category>
		<category><![CDATA[transmission-daemon]]></category>
		<category><![CDATA[transmission-remote]]></category>

		<guid isPermaLink="false">http://1000umbrellas.com/?p=1069</guid>
		<description><![CDATA[Using the configuration file shown in my Transmission-Daemon setup post, Transmission will download files into the “downloading” folder until the download hits 100%. At that point, the downloaded files will be moved to the “seeding” folder. The torrent will remain active, seeding to other users, until it hits the seeding ratio, or until you pause [...]]]></description>
			<content:encoded><![CDATA[<p>Using the configuration file shown in <a href="http://1000umbrellas.com/2010/10/04/updated-transmission-installationconfiguration-on-ubuntu-server">my Transmission-Daemon setup post</a>, Transmission will download files into the “downloading” folder until the download hits 100%. At that point, the downloaded files will be moved to the “seeding” folder. The torrent will remain active, seeding to other users, until it hits the seeding ratio, or until you pause or remove the torrent. </p>
<p>Left alone, these completed torrents will not be removed from the server, and will accumulate as you download more torrents over time. There is no automated way to remove these torrents. Also, there is no automated way to move files to a new folder after seeding is complete, only after downloading is complete.</p>
<p>My ultimate goals are to complete seeding up until my seeding ratio is hit, to move torrents out of the seeding folder once seeding is complete, and to use the TVNamer Python script to automatically move any TV episodes I have downloaded to my media server&#8217;s TV folder.</p>
<p>Because I want to use <a href="http://1000umbrellas.com/2010/04/27/tvnamer-installationconfiguration">TVNamer</a> to move and rename most of my downloads automatically, but I want them to be seeded up to the ratio I set, I cannot use TVNamer on my “seeding” folder. If I did so, there’s a big chance that files would be removed from my “seeding” folder before seeding was complete. To solve that, I decided to move all completed torrent downloads to another folder, “complete”, and set TVNamer to run on that folder. To move completed torrents, I created a Transmission queue management script, which performs the following actions every 15 minutes:</p>
<ol>
<li>Check for completed downloads that have either been paused manually or have seeded until the seeding ratio.</li>
<li>Move the downloaded files to another folder (“complete”).</li>
<li>Remove the torrent from the Transmission server.</li>
</ol>
<h2>Removing Completed Torrents Using a Script</h2>
<p>Here is the script, which is based on <a href="http://1000umbrellas.com/2010/04/28/how-to-automatically-move-and-remove-transmission-daemon-downloads">my previous version</a>. Compared to my last script, this one’s largest difference is the elimination of the netrc argument in the transmission-remote calls. I noticed that I did not need to send credentials to the Transmission daemon, presumably because my user account has all the privileges it needs to run transmission-remote.</p>
<p>A commenter on my previous post of this script informed me that Transmission 2.x uses “Finished” instead of “Stopped” to indicate completed torrents. I incorporated that change into the script, so that it will work with the old or the new verbiage.</p>
<p>Be sure to change the value of the MOVEDIR to the path you wish to move the downloads to. If you set it to “%1”, you can specify the path as a command-line argument.</p>
<p>Script file: <code>/home/mjdescy/bin/removecompletedtorrents</code></p>
<blockquote><p>#!/bin/sh</p>
<p># script to check for complete torrents in transmission folder, then stop and move them</p>
<p># either hard-code the MOVEDIR variable here&#8230;<br />
MOVEDIR=/home/mjdescy/media # the folder to move completed downloads to<br />
# &#8230;or set MOVEDIR using the first command-line argument<br />
# MOVEDIR=%1</p>
<p># use transmission-remote to get torrent list from transmission-remote list<br />
# use sed to delete first / last line of output, and remove leading spaces<br />
# use cut to get first field from each line<br />
TORRENTLIST=`transmission-remote &#8211;list | sed -e &#8217;1d;$d;s/^ *//&#8217; | cut &#8211;only-delimited &#8211;delimiter= &#8221; &#8221; &#8211;fields=1`</p>
<p># for each torrent in the list<br />
for TORRENTID in $TORRENTLIST<br />
do<br />
  echo &#8220;* * * * * Operations on torrent ID $TORRENTID starting. * * * * *&#8221;</p>
<p>  # check if torrent download is completed<br />
  DL_COMPLETED=`transmission-remote &#8211;torrent $TORRENTID &#8211;info | grep &#8220;Percent Done: 100%&#8221;`</p>
<p>  # check torrent&#8217;s current state is &#8220;Stopped&#8221;, &#8220;Finished&#8221;, or &#8220;Idle&#8221;<br />
  STATE_STOPPED=`transmission-remote &#8211;torrent $TORRENTID &#8211;info | grep &#8220;State: Stopped\|Finished\|Idle&#8221;`</p>
<p>  # if the torrent is &#8220;Stopped&#8221;, &#8220;Finished&#8221;, or &#8220;Idle&#8221; after downloading 100%&#8230;<br />
  if [ "$DL_COMPLETED" != "" ] &#038;&#038; [ "$STATE_STOPPED" != "" ]; then<br />
    # move the files and remove the torrent from Transmission<br />
    echo &#8220;Torrent #$TORRENTID is completed.&#8221;<br />
    echo &#8220;Moving downloaded file(s) to $MOVEDIR.&#8221;<br />
    transmission-remote &#8211;torrent $TORRENTID &#8211;move $MOVEDIR<br />
    echo &#8220;Removing torrent from list.&#8221;<br />
    transmission-remote &#8211;torrent $TORRENTID &#8211;remove<br />
  else<br />
    echo &#8220;Torrent #$TORRENTID is not completed. Ignoring.&#8221;<br />
  fi</p>
<p>  echo &#8220;* * * * * Operations on torrent ID $TORRENTID completed. * * * * *&#8221;</p>
<p>done
</p></blockquote>
<p>After creating the script file, be sure to make it executable.</p>
<p><code>$ sudo chmod u+x /home/mjdescy/bin/removecompletedtorrents</code></p>
<h2>Scheduling the Script</h2>
<p>Schedule execution of the script using cron. </p>
<p><code>$ crontab -e</code></p>
<p>I run the script every 10 minutes, with a 1-minute offset from the top of the hour. I redirect output to /dev/null so cron will not send me emails regarding the script’s output.</p>
<blockquote><p>1,11,21,31,41,51 * * * * /home/mjdescy/bin/removecompletedtorrents > /dev/null 2>&#038;1</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://1000umbrellas.com/2010/10/05/updated-how-to-automatically-move-and-remove-transmission-daemon-downloads/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Updated: Transmission Installation/Configuration on Ubuntu Server</title>
		<link>http://1000umbrellas.com/2010/10/04/updated-transmission-installationconfiguration-on-ubuntu-server</link>
		<comments>http://1000umbrellas.com/2010/10/04/updated-transmission-installationconfiguration-on-ubuntu-server#comments</comments>
		<pubDate>Mon, 04 Oct 2010 15:00:49 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[configure]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lucid lynx]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Transmission]]></category>
		<category><![CDATA[transmission-daemon]]></category>

		<guid isPermaLink="false">http://1000umbrellas.com/?p=1054</guid>
		<description><![CDATA[Note: This article is an update to the Transmission daemon install instructions which reflects what I did when I rebuilt my media server. I now show the location of the configuration file in the “normal” place, /etc/transmission-daemon/, which did not work for me originally, but worked for me after a fresh install. I also improved [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Note</strong>: <em>This article is an update to the <a href="http://1000umbrellas.com/2010/04/21/transmission-install-on-ubuntu-10-04-server-lucid">Transmission daemon install instructions</a> which reflects what I did when I rebuilt my media server. I now show the location of the configuration file in the “normal” place, /etc/transmission-daemon/, which did not work for me originally, but worked for me after a fresh install. I also improved the organization of torrents by setting up separate download, watch, and incomplete download folders. I hope these new instructions are more comprehensive, and better written, than the old ones.</em></p>
<p>This article explains how to install, configure, and run the Transmission daemon on a headless Ubuntu Lucid Lynx (10.04) server. <a href="http://www.transmissionbt.com/" target="_blank">Transmission</a>, specifically <a href="http://linux.die.net/man/1/transmission-daemon" target="_blank">transmission-daemon</a>, is a BitTorrent client that can be accessed via a web browser and other front-ends, including a desktop app called <a href="http://code.google.com/p/transmisson-remote-gui/" target="_blank">trasmission-remote-gui</a> and Android apps, including <a href="http://www.transdroid.org/" target="_blank">Transdroid</a> (my favorite) and <a href="http://torrent-fu.com/" target="_blank">Torrent-Fu</a>.</p>
<h2>Installation</h2>
<p>First, install the Transmission daemon using apt-get.</p>
<p><code>$ sudo apt-get install transmission-daemon</code></p>
<p>This installs the app and starts the daemon. The daemon runs under the user “debian-transmission”, which belongs to a group of the same name.</p>
<h2>Preparation of File System and Group Permissions</h2>
<p>I wanted all torrent files to be stored somewhere within my home folder (/home/mjdescy), which debian-transmission does not, by default, have access to. That means that I had to create folders for Transmission to use, and then grant debian-transmission read/write/execute access to them (execute is necessary to create folders), while ensuring that my user account (mjdescy) still had full control of the folders and their contents as well.</p>
<p>To do so, first create the folders for downloading and seeding torrents, completed torrents (i.e., seeding complete), and a watch folder to put new torrent files into. These three folders will be used by Transmission directly.<br />
<code>$ mkdir -p ~/dl/downloading # incomplete downloads<br />
$ mkdir ~/dl/seeding # completed downloads/seeding torrents<br />
$ mkdir ~/dl/watch<br />
</code><br />
I also create a folder to move downloaded files to after seeding is complete. Transmission does not use this folder directly; I manipulate it via a cron job.<br />
<code>$ mkdir ~/dl/complete<br />
</code><br />
Then, add your user account to the group debian-transmission. (I’m using my account name, mjdescy, in this example.) Now your user account and the debian-transmission user account are in the same group.</p>
<p><code>$ sudo usermod -a -G debian-transmission mjdescy</code></p>
<p>Next, change the group ownership of the folders Transmission will use to debian-transmission (the group, not the user).</p>
<p><code>$ chgrp debian-transmission ~/dl/downloading<br />
$ chgrp debian-transmission ~/dl/seeding<br />
$ chgrp debian-transmission ~/dl/watch</code></p>
<p>Finally, modify the permissions on each folder to allow full access (read, write, and execute) for both user (me) and group (debian-transmission, in this case).</p>
<p><code>$ chmod 770 ~/dl/downloading<br />
$ chmod 770 ~/dl/seeding<br />
$ chmod 770 ~/dl/watch</code></p>
<p>Doing so grants the debian-transmission group read/write access to that folder, preserves read/write/execute access for your user account, and prevents access to all others.</p>
<p>These changes also require me to “umask” setting in Transmission’s configuration file from the default of 18 to 2. That means transmission-daemon will create files with read/write permissions set at both the user and group level. Not changing the umask will make Transmission create files that your user account cannot delete or access completely.</p>
<h2>Configuring Transmission</h2>
<p>Configuring Transmission is a little unusual, compared to other daemons such as Samba, due to the daemon’s method of saving (overwriting) its configuration file on exit. Restarting the daemon, if it is already running, will result in it saving the configuration file, and overwriting any changes you might have made to it. Instead of restarting the service after editing the configuration file, you should reload the service. The following code sends a SIGHUP signal to transmission-daemon, which causes it to reload its configuration file. Importantly, it does not stop the the daemon, which would cause it to write over the configuration file.</p>
<p><code>$ sudo service transmission-daemon reload</code></p>
<p>After Transmission is installed, the daemon will be started automatically. Without changing the configuration, however, Transmission will not be accessible from other machines, which would pose a problem on a headless server. You must edit the configuration file using the command below, set the proper configuration options, then reload the daemon, to get Transmission going the way you want it to.</p>
<p><code>$ sudo nano /etc/transmission-daemon/settings.json</code></p>
<p>Here is my settings.json file, which I recommend that you use as a starting point. It configures Transmission to be available to clients other than localhost, to use separate folders for incomplete and complete (seeding) downloads and for the watch folder.</p>
<p>You have to edit the rpc-whitelist setting to connect to the server from anything other than the local host (and that’s nearly useless on a headless server). You should also edit the paths (download-dir, watch-dir, incomplete-dir) and peer ports as you see fit. Be sure to set the rpc-password, too!</p>
<pre>{
"alt-speed-down": 500,
"alt-speed-enabled": true,
"alt-speed-time-begin": 480,
"alt-speed-time-day": 127,
"alt-speed-time-enabled": true,
"alt-speed-time-end": 0,
"alt-speed-up": 10,
"bind-address-ipv4": "0.0.0.0",
"bind-address-ipv6": "::",
"blocklist-enabled": false,
"dht-enabled": true,
"download-dir": "/home/mjdescy/dl/seeding",
"download-limit": 100,
"download-limit-enabled": 0,
"encryption": 2,
"incomplete-dir": "/home/mjdescy/dl/downloading",
"incomplete-dir-enabled": true,
"lazy-bitfield-enabled": true,
"max-peers-global": 200,
"message-level": 2,
"open-file-limit": 32,
"peer-limit-global": 240,
"peer-limit-per-torrent": 60,
"peer-port": 20500,
"peer-port-random-high": 20599,
"peer-port-random-low": 20500,
"peer-port-random-on-start": true,
"peer-socket-tos": 0,
"pex-enabled": true,
"port-forwarding-enabled": false,
"preallocation": 1,
"proxy": "",
"proxy-auth-enabled": false,
"proxy-auth-password": "",
"proxy-auth-username": "",
"proxy-enabled": false,
"proxy-port": 80,
"proxy-type": 0,
"ratio-limit": 0.2500,
"ratio-limit-enabled": true,
"rename-partial-files": true,
"rpc-authentication-required": true,
"rpc-bind-address": "0.0.0.0",
"rpc-enabled": true,
"rpc-password": “password”,
"rpc-port": 9091,
"rpc-username": "transmission",
"rpc-whitelist": "127.0.0.1,*.*.*.*",
"rpc-whitelist-enabled": true,
"speed-limit-down": 1500,
"speed-limit-down-enabled": true,
"speed-limit-up": 50,
"speed-limit-up-enabled": true,
"umask": 2,
"upload-limit": 100,
"upload-limit-enabled": 0,
"upload-slots-per-torrent": 4,
"watch-dir": "/home/mjdescy/dl/watch",
"watch-dir-enabled": true
}</pre>
<p>After saving any changes, tell the daemon to reload its configuration file, which applies all the changes you have made.</p>
<p><code>$ sudo service transmission-daemon reload</code></p>
<p>Note that if you change the rpc-password to a plaintext value (which is the easiest way to do it), the password will remain unencrypted until transmission-daemon closes and it rewrites its settings file. To ensure that happens, and that the password is encrypted, restart (instead of reload) the service after you have reloaded it to apply the configuration changes. Once transmission-daemon saves its configuration file, the password will be converted from plaintext to a SHA1 encrypted format. You should only have to do this when you are changing the password.</p>
<p><code>$ sudo service transmission-daemon restart</code></p>
<p>That finishes configuration. Note that you will likely have to set up port forwarding on your router to access the web app from outside your network, and to seed properly.</p>
<h2>Port Forwarding</h2>
<p>Be sure to set up port forwarding on your router to expose the Transmission daemon to the outside world. You will have to forward the peer port range in order to upload properly. You can also forward the 9091 port (or whatever you set the RPC port to be) to your server. This is especially handy if you also run a dynamic DNS service, because then you can access your server from anywhere using a URL and a port number. I use Transdroid on my Android phone to check up on my torrents, or add them via an excellent search interface.</p>
<h2>Web Access</h2>
<p>To access the server, point your web browser to http://your.server.ip.address:9091. (9091 is the default port, which can be changed, under “rpc-port”, in the settings file.) The web interface is pretty simple. Note that you can adjust some settings, such as transfer speed and download directory, by clicking the gear on the lower right of the page. The open dialog supports URLs to torrent files, magnet links, and uploading a torrent file from your computer.</p>
<h2>The Watch Folder</h2>
<p>Simply move torrent files to the watch folder to start a download. If your watch folder is accessible via Samba share, SFTP, WebDAV, or what have you, you can add torrents to it while on the go, without a browser.</p>
]]></content:encoded>
			<wfw:commentRss>http://1000umbrellas.com/2010/10/04/updated-transmission-installationconfiguration-on-ubuntu-server/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>How to Install and Configure MediaTomb uPNP Server on Ubuntu Server</title>
		<link>http://1000umbrellas.com/2010/10/03/how-to-install-and-configure-mediatomb-upnp-server-on-ubuntu-server</link>
		<comments>http://1000umbrellas.com/2010/10/03/how-to-install-and-configure-mediatomb-upnp-server-on-ubuntu-server#comments</comments>
		<pubDate>Sun, 03 Oct 2010 12:00:39 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[dlna]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[mediatomb]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[upnp]]></category>

		<guid isPermaLink="false">http://1000umbrellas.com/?p=1062</guid>
		<description><![CDATA[I prefer to use Samba shares to serve my media files to my front-end player, the WD TV Live. That said, not all front-ends work with Samba shares; my TV and my iPod Touch come to mind as products that work with media servers, not with file shares. There are several media servers on the [...]]]></description>
			<content:encoded><![CDATA[<p>I prefer to use Samba shares to serve my media files to my front-end player, the WD TV Live. That said, not all front-ends work with Samba shares; my TV and my iPod Touch come to mind as products that work with media servers, not with file shares. There are several media servers on the market that work well with TVs and PlayStation 3’s. I prefer <a href="http://mediatomb.cc/" target="_blank">MediaTomb</a>, a <a href="http://www.upnp.org/" target="_blank">uPnP</a>-compliant server, because it is simple to install and configure. MediaTomb works flawlessly with my WD TV Live, and allows me to stream video (mostly AVI files), audio (mostly AAC files with .m4a extensions), and photos from my server to my TV.</p>
<h2>Install MediaTomb</h2>
<p>MediaTomb is simple to install on Ubuntu Server because a Debian package for it is in the repositories. To install MediaTomb, simply install the mediatomb package.</p>
<p><code>$ sudo apt-get install mediatomb</code></p>
<p>The MediaTomb daemon will start automatically after installation.</p>
<h2>Configure Port Number</h2>
<p>By default, MediaTomb will pick the first available port starting with 49152. When restarting the server, it may pick a different port, such as 49153. I prefer to lock MediaTomb down to a certain point, so my bookmarks for the web interface are always correct, and so I can set firewall and networking rules consistently.</p>
<p>To lock MediaTomb to a single port, simply edit the XML configuration file.</p>
<p><code>$ sudo nano /etc/mediatomb/config.xml</code></p>
<p>Find the  &lt;name&gt; element in the configuration file. (You can rename its contents if you wish to. Personally, I don’t like the word “tomb” displayed on my TV, so I rename the service “MediaServer”.) Underneath the  element, insert a<br />
element, as follows:</p>
<blockquote><p>&lt;port&gt;49152&lt;/port&gt;</p></blockquote>
<p>Save the configuration file, and restart the service.</p>
<p><code>$ sudo service mediatomb restart</code></p>
<p>Now MediaTomb will be locked down to port 49152. You can now set up your firewall to allow traffic on that port.</p>
<h2>Add Media Files to MediaTomb’s Library</h2>
<p>MediaTomb needs to be told where your media files reside in order to serve them. For simplicity, I prefer to keep all my media files in one folder tree, with high-level subfolders corresponding to media type. My media folder tree is within my home directory; your media may be spread out over your hard drive. MediaTomb doesn’t really care; you simply need to add each folder your media is in to the media library.</p>
<ul>
<li>media
<ul>
<li>movies</li>
<li>music</li>
<li>photos</li>
<li>tv</li>
</ul>
</li>
</ul>
<h2>Add Media to MediaTomb</h2>
<p>To add my media folder to MediaTomb, I use MediaTomb’s web interface. I point my browser to my server’s IP address, plus the port it is running on, as follows: http://serverip:49152.</p>
<p>MediaTomb’s sparse web user interface will appear. You will want to click on the Filesystem link, then browse the file system tree to find your media folder. Click on the media folder you wish to add, then click the icon that looks like a plus sign with two sync arrows, as in (+). This button calls up a form that allows you to add that folder to the media library, and set up automatic updating.</p>
<p>Set the scan mode to Inotify, the initial scan to Full, and check the Recursive checkbox. Then click Set, and you have added the folder. MediaTomb will scan the folder for media files to serve. Because we selected the Inotify scan mode, MediaTomb will monitor this folder tree for file changes, and update the media library accordingly. This allows you to add and remove media using Samba or the command line.</p>
<p>Repeat this process for each media folder on your server. Note that Inotify will not work with media served from remote file shares; you will need to set scanning to a timed interval.</p>
<p>Note: It is possible to add media via the command line, but it does not work well for the packaged Ubuntu install.</p>
<h2>Connect to your Server</h2>
<p>After setting up the server and adding media to it, you are essentially done. Your front-end device should automatically discover MediaTomb on the network.</p>
]]></content:encoded>
			<wfw:commentRss>http://1000umbrellas.com/2010/10/03/how-to-install-and-configure-mediatomb-upnp-server-on-ubuntu-server/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Mount Windows/Samba Shares to the Ubuntu File System</title>
		<link>http://1000umbrellas.com/2010/10/02/how-to-mount-windowssamba-shares-to-the-ubuntu-file-system</link>
		<comments>http://1000umbrellas.com/2010/10/02/how-to-mount-windowssamba-shares-to-the-ubuntu-file-system#comments</comments>
		<pubDate>Sun, 03 Oct 2010 00:00:53 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[cifs]]></category>
		<category><![CDATA[file share]]></category>
		<category><![CDATA[lucid lynx]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://1000umbrellas.com/?p=1058</guid>
		<description><![CDATA[I use the WD TV LIVE as a HTPC front-end. Because of latency problems with my wireless network, I attached a USB stick to the WD TV LIVE to use for video storage. The player allows me to expose that USB stick to the network via “Windows” (Samba) file sharing. I would push video to [...]]]></description>
			<content:encoded><![CDATA[<p>I use the WD TV LIVE as a HTPC front-end. Because of latency problems with my wireless network, I attached a USB stick to the WD TV LIVE to use for video storage. The player allows me to expose that USB stick to the network via “Windows” (Samba) file sharing. I would push video to it from my media server after hours, so it would be ready to watch the following day. I tended to move the files via shell scripts kicked off by cron jobs (or other triggers), or via SSH. </p>
<p>Now I have a new wifi network (802.11n), and I can stream almost all content to the WD TV LIVE directly from the media server. Bandwidth and latency are a problem, however, with very large files, such as 1080p video and Blu-Ray rips. To handle this content, I still have to transfer it to local storage on the WD TV LIVE front-end.</p>
<h2>Install Samba File System</h2>
<p>The most transparent way to connect to a samba share it to mount it to a mount point on your filesystem. To do so, you need to install the Samba File System (smbfs).</p>
<p><code>$ sudo apt-get install smbfs</code></p>
<h2>Mount the Samba Share</h2>
<p>You mount the samba share like any other hard drive. First, create the mount point, which is simply a folder. </p>
<p>$ mkdir ~/wdtvlive</p>
<p>Next, mount the share to the mount point. Note that I’m using the host name, instead of the IP address. You can use the IP address, or configure your server to allow the use of host names. Note the use of options following the -o argument. Your security needs may differ.</p>
<p><code>$ sudo smbmount //WDTVLIVE/32GB_STICK ~/wdtvlive -o guest,rw</code></p>
<p>Now you can use the folder ~/wdtvlive to browse the fire share. The file share is now part of the file system, so utilities such as rsync will work with it as it it was a local folder.</p>
<p>You can unmount the share via the following command:</p>
<p><code>$ sudo smbumount ~/wdtvlive</code></p>
<h2>Optional: Permanently Mount the Samba Share</h2>
<p>To mount a Samba share permanently, you have to add a line to the server’s file system table. First, edit the FSTAB:</p>
<p><code>$ sudo nano /etc/fstab</code></p>
<p>Next, add a line, as follows. Note that the file system type is “cifs”, for “Common Internet File System”. The other options essentially set security wide open on the drive, which is acceptable for my use case, but certainly not for every one.</p>
<blockquote><p>//WDTVLIVE/32GB_STICK    /home/mjdescy/wdtvlive	cifs guest,rw,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0
</p></blockquote>
<p>Then, save and close the file. Finally, remount all drives.</p>
<p><code>$ sudo mount -a</code></p>
<p>Now your file share will be mounted in the file system, and it will be persistent between server reboots.</p>
]]></content:encoded>
			<wfw:commentRss>http://1000umbrellas.com/2010/10/02/how-to-mount-windowssamba-shares-to-the-ubuntu-file-system/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

