<?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>tail -f /dev/null &#187; bittorrent</title>
	<atom:link href="http://tfdn.radiofreeomaha.net/tag/bittorrent/feed/" rel="self" type="application/rss+xml" />
	<link>http://tfdn.radiofreeomaha.net</link>
	<description>Tips, notes, HOWTOs</description>
	<lastBuildDate>Fri, 20 Aug 2010 04:13:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Pause Torrent Downloads When Screensaver Is Inactive</title>
		<link>http://tfdn.radiofreeomaha.net/2008/12/pause-torrent-downloads-when-screensaver-is-inactive/</link>
		<comments>http://tfdn.radiofreeomaha.net/2008/12/pause-torrent-downloads-when-screensaver-is-inactive/#comments</comments>
		<pubDate>Sat, 06 Dec 2008 05:39:41 +0000</pubDate>
		<dc:creator>Uncle Jubba</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[bittorrent]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[rpc]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://tfdn.radiofreeomaha.net/?p=10</guid>
		<description><![CDATA[If you use Transmission this little python script will start all of your downloads when your screensaver kicks on and pause them when it turns off, i.e. you are at your terminal. #!/usr/bin/env python import dbus, urllib from dbus.mainloop.glib import DBusGMainLoop START_TORRENTS = &#34;http://localhost:9091/transmission/rpc?method=torrent-start&#34; STOP_TORRENTS = &#34;http://localhost:9091/transmission/rpc?method=torrent-stop&#34; DBusGMainLoop(set_as_default=True) sess=dbus.SessionBus() def sig(screensaverActive): if screensaverActive: data = [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>If you use <a href="http://www.transmissionbt.com/" target="_blank">Transmission</a> this little python script will start all of your downloads when your screensaver kicks on and pause them when it turns off, i.e. you are at your terminal.</p>
<pre>
<pre class="brush: python">#!/usr/bin/env python
import dbus, urllib
from dbus.mainloop.glib import DBusGMainLoop

START_TORRENTS = &quot;http://localhost:9091/transmission/rpc?method=torrent-start&quot;
STOP_TORRENTS = &quot;http://localhost:9091/transmission/rpc?method=torrent-stop&quot;

DBusGMainLoop(set_as_default=True)
sess=dbus.SessionBus()
def sig(screensaverActive):
  if screensaverActive:
    data = urllib.urlopen(START_TORRENTS).read()
  else:
    data = urllib.urlopen(STOP_TORRENTS).read()

sess.add_signal_receiver(sig, &#039;ActiveChanged&#039;,&#039;org.gnome.ScreenSaver&#039;)
import gobject
loop = gobject.MainLoop()
loop.run()</pre>
<p>via <span style="color: #ff0000;">I can&#8217;t find it at the moment but I will update once I get the link.  <img src='http://tfdn.radiofreeomaha.net/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </span></p>
<p>UPDATE:</p>
<p>I found my source <a href="http://www.kryogenix.org/days/2008/11/15/pause-torrents-while-im-using-the-computer" target="_blank">here</a>.  The comments also include a patch for throttling the app rather than outright pausing everything.</p>
<p><strong><span style="text-decoration: underline;"><span style="color: #ff0000;">SECURITY</span></span></strong>: I should point out, as mentioned in <a href="http://www.kryogenix.org/days/2008/11/15/pause-torrents-while-im-using-the-computer#comment-122886" target="_blank">this</a> comment, the RPC for Transmission will allow a nefarious person to control your application with a web page that includes elements like:</p>
<pre>
<pre class="brush: html">&lt;img src=&quot;http://localhost:9091/transmission/rpc?method=torrent-stop&quot;&gt;</pre>
<p>It is assumed that most (all?) other RPC calls for the web interface of Transmission could be called the same way.  This is a fairly large security hole and I would suggest using a password on the Transmission web interface if you enable it.  Though if you do that would render this tip pretty much useless.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://tfdn.radiofreeomaha.net/2008/12/pause-torrent-downloads-when-screensaver-is-inactive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

