all repos — dotfiles @ 16b6ecca894c494bf693fc826996f2f84f8278f8

my *nix dotfiles

scripts/icyup.py (view raw)

 1#!/usr/bin/python
 2
 3import string
 4import sys
 5import os
 6from random import *
 7import subprocess
 8
 9# generate random string 
10st = string.ascii_letters + string.digits
11rand_st = ''.join(choice(st) for x in range(6))
12
13local_file = sys.argv[1]
14ext = os.path.splitext(local_file)[1]
15remote_file = '/home/icy/upload/' + rand_st + ext
16
17#scp_cmd = 'scp ' + local_file + ' boop:' + remote_file
18p = subprocess.Popen(['scp', '-r', local_file, '%s' % ('boop: ') , remote_file], bufsize=2048)
19p.wait()
20
21print('https://xix.ph0x.me/' + rand_st + ext)