Overclock.net banner

Share Your Scripts

292 Views 2 Replies 2 Participants Last post by  Dethredic
Share some of those handy python, perl or bash scripts that help you get through the day.

I will start:

Upload
This script is combined with Tunar's custom actions so I can right click on something and upload it to my server. Useful for sharing images or other files. Most of it came from some site, modified it slightly.

Code:

Code:
#!/usr/bin/env python

import ftplib
import os
import sys

if len(sys.argv) < 2:
    print "Usage: %s file [file2] [file3] ..." % os.path.split(sys.argv[0])[1]
    sys.exit()

# Clear the screen?
#os.system('clear')
print "Files to upload:"
print sys.argv[1:], "\
"
ftp = ftplib.FTP('www.xxxxxx.com')
login  = "xxxx"
passwd = "xxxx"

ftp.login(login, passwd)
ftp.dir()
#Upload DIR
dir = "/public_html/uploads/"
ftp.cwd(dir)

for file in sys.argv[1:]: 
    name = os.path.split(file)[1]
    print "Uploading \\"%s\\" ..." % name,
    f = open(file, "rb")
    ftp.storbinary('STOR ' + name, f)
    f.close()
    print "OK"

print "Quitting..."
ftp.quit()
See less See more
1 - 3 of 3 Posts
I rip my streams with this:

Quote:


#!/bin/bash
streamripper http://scfire-mtc-aa01.stream.aol.com:80/stream/1065 -t -d /home/phil/music/rips

1 - 3 of 3 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top