all repos — dotfiles @ 0f6e5a30e09a61b7771ae1b5796df24866a23b4c

my *nix dotfiles

scripts/icyup.py (view raw)

 1#!/usr/bin/python
 2
 3import string
 4import sys
 5import os
 6from random import *
 7from subprocess import call
 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 = 'upload/' + rand_st + ext
16
17scp_cmd = 'scp ' + local_file + ' boop:' + remote_file
18os.popen(scp_cmd)
19
20print('https://xix.ph0x.me/' + rand_st + ext)