Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Fabfile to:
  2. #    - update the remote system(s)
  3. #    - download and install an application
  4.  
  5. # Import Fabric's API module
  6. import os
  7. from fabric.api import *
  8.  
  9. env.hosts = [
  10.     'ec2-54-93-42-94.eu-central-1.compute.amazonaws.com',
  11.   # 'ip.add.rr.ess
  12.   # 'server2.domain.tld',
  13. ]
  14. # Set the username
  15. env.user = "ubuntu"
  16. env.key_filename = ["mikaelubuntu.pem",]
  17.  
  18. # Set the password [NOT RECOMMENDED]
  19. # env.password = "passwd"
  20.  
  21. def setup():
  22.     """
  23.        Update the default OS installation's
  24.        basic default tools.
  25.                                            """
  26.     run("cd ~/")
  27.     sudo("apt-get update")
  28.     sudo("apt-get install -y git")
  29.     run("rm -r -f rworker")
  30.     run("git clone -b fortesting https://github.com/DurandA/rworker.git")
  31.     run("cd rworker")
  32.  
  33. def run_rworker():
  34.     with cd('/home/ubuntu/rworker'):
  35.         run("java -Djava.library.path=dist -jar drttor.jar -o testing zero_1M_64.worker")
  36.  
  37. def kill_rworker():
  38.     run("pkill -f 'java -jar'")
  39.  
  40. def send_torrent(torrent_path):
  41.     put(torrent_path, "/home/ubuntu/rworker/%s" % os.path.basename(torrent_path))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement