This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def func(val): | |
val**10 | |
import timeit | |
timeit.repeat("for n in range(100): func(n)", | |
"from __main__ import func", | |
number=10000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import libtorrent as lt | |
import time | |
import sys | |
import os | |
ses = lt.session() | |
ses.listen_on(6881, 6891) | |
info_t1 = lt.torrent_info('T1.torrent') | |
info_t2 = lt.torrent_info('T2.torrent') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# torrentmanager.py | |
# | |
# Copyright (C) 2007, 2008 Andrew Resch <[email protected]> | |
# | |
# Deluge is free software. | |
# | |
# You may redistribute it and/or modify it under the terms of the | |
# GNU General Public License, as published by the Free Software | |
# Foundation; either version 3 of the License, or (at your option) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import libtorrent as lt | |
import time | |
session = lt.session(flags=0) | |
print('Session started: ', lt.version) | |
h = session.add_torrent({'ti': lt.torrent_info('../T1.torrent'), 'save_path': './lt_test_data'}) | |
h.auto_managed(False) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Find and replace tracker urls in a Deluge torrents.state | |
# | |
# Need to edit the variables: orig_tracker_url and new_tracker_url | |
import os | |
import sys | |
import platform | |
import cPickle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<!DOCTYPE moduleset SYSTEM "moduleset.dtd"> | |
<?xml-stylesheet type="text/xsl" href="moduleset.xsl"?> | |
<moduleset> | |
<repository type="tarball" name="sourceforge" | |
href="http://downloads.sourceforge.net/sourceforge/"/> | |
<repository type="tarball" name="libtorrent" | |
href="https://github.com/arvidn/libtorrent/archive/"/> | |
<repository type="git" name="git.libtorrent" | |
href="https://github.com/arvidn/"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://wiki.ubuntu.com/PackagingGuide/Python#The%20debhelper%20way | |
http://wiki.vinuxproject.org/index.php?title=Vinux_Packaging_Tutorial#3.4_Creating_New_Source | |
https://help.launchpad.net/Packaging/PPA | |
https://wiki.ubuntu.com/PbuilderHowto | |
http://anonscm.debian.org/gitweb/?p=collab-maint/deluge.git;a=summary | |
export DEBEMAIL="[email protected]" | |
export DEBFULLNAME="Full Name" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd <packaging_dir> | |
wget http://download.deluge-torrent.org/source/deluge-<tarball version>.tar.gz | |
mv deluge-<tarball version>.tar.gz deluge_<tarball version>.orig.tar.gz # Use _ and add '.orig' | |
export DEBEMAIL="[email protected]" DEBFULLNAME="Full Name" | |
cd deluge_deb | |
git co upstream | |
extract tarball to deluge_deb | |
git add . | |
git ci -am "import upstream deluge <tarball version>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deluge.tests.test_log | |
LogTestCase | |
test_twisted_error_log ... 22:01:12.170 [ERROR ][deluge.log:284 ] ('Unhandled error in Deferred:',) | |
22:01:12.171 [ERROR ][deluge.log:284 ] [Failure instance: Traceback (failure with no frames): <class 'deluge.component.ComponentException'>: Trying to start a component ('EventManager') not in stopped state. Current state: 'Paused' | |
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks | |
result = g.send(result) | |
File "/home/ubuntu/deluge.git/deluge/tests/test_log.py", line 48, in call | |
yield component.start(["EventManager"]) | |
File "/home/ubuntu/deluge.git/deluge/component.py", line 298, in start | |
deferreds.append(self.components[name]._component_start()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List mounts | |
systemctl -t mount | |
# Unit starts after mount and unit is stopped when any of the mounts suddenly disappears. | |
After=xyz.mount | |
BindsTo=xyz.mount | |
# Also look at RequiresMountsFor |