This file contains hidden or 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/python | |
| import argparse | |
| from getpass import getuser | |
| import json | |
| import os | |
| import readline # not to be confused with the builtin | |
| import sys | |
| import time | |
| import sqlite3 |
This file contains hidden or 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 json import loads as json_loads | |
| import requests | |
| import time | |
| class Windfinder(object): | |
| def __init__(self): | |
| self.cache = {} | |
| self.threshold = 3 * 60 | |
| def get_uncached(self, location): |
This file contains hidden or 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/python | |
| import datetime | |
| from math import sin, pi, cos, atan2, asin, tan, acos | |
| import requests | |
| # https://www.timeanddate.com/sun/@z-us-02118 | |
| def get_julian_day(dtobj, longitude): | |
| Y, M, D = [float(x) for x in (dtobj.year, dtobj.month, dtobj.day)] |
This file contains hidden or 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/python | |
| # my pid and instance uniquely identify myself | |
| import os | |
| import random | |
| import sys | |
| import threading | |
| import time | |
| import boto3 | |
| from botocore.errorfactory import ClientError |
This file contains hidden or 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/python | |
| from gi.repository import Gio, GLib | |
| class Color(object): | |
| def __init__(self, red, green, blue): | |
| self.red = red | |
| self.green = green | |
| self.blue = blue |
This file contains hidden or 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/python | |
| """Get the set of instance id's (exclude spot instances)!""" | |
| import boto3 | |
| import datetime | |
| import json | |
| import redis | |
| import sys | |
| import base64 | |
| VERSION = 0.2 |
This file contains hidden or 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/python | |
| """ | |
| Something that's kind of sort of like a multiprocessing pool, but is designed for heterogenously sized tasks | |
| """ | |
| import math | |
| import multiprocessing | |
| import random | |
| import sys | |
| import time | |
| import Queue |
This file contains hidden or 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
| export workdir=$(mktemp -d) | |
| ( | |
| cd $workdir | |
| wget http://ftpmirror.gnu.org/parallel/parallel-latest.tar.bz2 | |
| tar -xf parallel-latest.tar.bz2 | |
| cd $(find . -maxdepth 1 -mindepth 1 -type d) | |
| ./configure | |
| make -j $(grep -c processor /proc/cpuinfo) | |
| sudo --non-interactive make install | |
| ) |
This file contains hidden or 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/python | |
| import argparse | |
| import hashlib | |
| import json | |
| import multiprocessing | |
| import os | |
| import re | |
| import resource | |
| import subprocess | |
| import urllib |
This file contains hidden or 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
| class DateRange(object): | |
| start_of_time = datetime.date.min | |
| end_of_time = datetime.date.max | |
| def __init__(self, start=start_of_time, end=end_of_time): | |
| if type(start) != type(DateRange.start_of_time): | |
| self.start = datetime.datetime.strptime(start, '%Y-%m-%d').date() | |
| else: | |
| self.start = start | |
| if type(end) != type(DateRange.end_of_time): | |
| self.end = datetime.datetime.strptime(end, '%Y-%m-%d').date() |