This file contains 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
import subprocess | |
import time | |
import re | |
import sys | |
while True: | |
out = subprocess.check_output('nvidia-smi') | |
usage = int(re.search(b'\d*MiB /', out).group(0).split(b'M')[0]) | |
if usage < 1000: | |
subprocess.Popen(sys.argv[1:]) |
This file contains 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 python3 | |
import sys | |
import sexpdata | |
def walk_bmarks(bmarks, level): | |
output = '' | |
wroteTitle = False | |
for j in bmarks: |
This file contains 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
import asyncio | |
import socket | |
from string import ascii_letters | |
import random | |
class BroadcastProtocol: | |
def __init__(self, loop): | |
self.loop = loop |
This file contains 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
import requests | |
from bs4 import BeautifulSoup | |
# Fill in your account here | |
EMAIL = "" | |
PASSWD = "" | |
session = requests.Session() | |
main_url = "http://ne2x.com/" | |
main = session.get(main_url) |
This file contains 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
# From http://www.robberphex.com/2013/05/141 | |
# -*- coding: utf-8 -*- | |
import os | |
import sys | |
import zipfile | |
from optparse import OptionParser | |
def listZip(zipf): | |
print "Archive: %s" %zipf |