Skip to content

Instantly share code, notes, and snippets.

View rosskarchner's full-sized avatar
🤘
ROLLBACK_COMPLETE

Ross M Karchner rosskarchner

🤘
ROLLBACK_COMPLETE
View GitHub Profile
$ sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install g++-4.8
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package g++-4.8
E: Couldn't find any package by regex 'g++-4.8'
01 09:31 10:15 11:22 12:40 13:51 14:43 14:50 14:09 13:00 11:46 10:32 09:39
02 09:31 10:17 11:24 12:43 13:53 14:44 14:49 14:07 12:58 11:43 10:29 09:38
03 09:32 10:19 11:27 12:45 13:55 14:45 14:48 14:05 12:55 11:41 10:27 09:37
04 09:33 10:21 11:29 12:48 13:57 14:46 14:48 14:03 12:53 11:38 10:25 09:36
05 09:34 10:23 11:32 12:50 13:59 14:47 14:47 14:01 12:50 11:36 10:23 09:35
06 09:34 10:25 11:34 12:52 14:01 14:47 14:46 13:59 12:48 11:33 10:21 09:34
07 09:35 10:27 11:37 12:55 14:03 14:48 14:45 13:57 12:45 11:31 10:19 09:33
08 09:36 10:30 11:39 12:57 14:05 14:49 14:44 13:55 12:43 11:28 10:17 09:32
09 09:38 10:32 11:42 13:00 14:07 14:49 14:43 13:53 12:40 11:26 10:15 09:31
10
class FilterDateField(forms.DateField):
def clean(self, value):
from sheerlike.templates import get_date_obj
if value:
try:
value = get_date_obj(value)
except Exception as e:
pass
return value
@rosskarchner
rosskarchner / random_sv.py
Created December 14, 2016 18:26
I wrote this a few years ago when I was playing around with color math-- I'm not sure I could explain it all at this point, but I made some tweaks that let it work with the latest version of colormath.
import svgwrite
import random
from colormath.color_objects import sRGBColor, HSVColor
from colormath.color_conversions import convert_color
from collections import deque
from copy import copy
BOARD_WIDTH = "24in"
BOARD_HEIGHT = "12in"
@rosskarchner
rosskarchner / random_sv.py
Last active December 14, 2016 18:31
I wrote this a few years ago when I was playing around with color math-- I'm not sure I could explain it all at this point, but today I made some tweaks that let it work with the latest version of colormath. Each row represents a specific hue, and the blocks on that row are that hue, with a random saturation and value.
import svgwrite
import random
from colormath.color_objects import sRGBColor, HSVColor
from colormath.color_conversions import convert_color
from collections import deque
from copy import copy
BOARD_WIDTH = "24in"
BOARD_HEIGHT = "12in"
import os
from setuptools import setup, find_packages
def read_file(filename):
"""Read a file into a string"""
path = os.path.abspath(os.path.dirname(__file__))
filepath = os.path.join(path, filename)
try:
return open(filepath).read()
AWS Budgets
AWS Certificate Manager
AWS CloudFormation
AWS CloudHSM
AWS CloudTrail
AWS CodeCommit
AWS CodeDeploy
AWS CodePipeline
AWS Competency Program
AWS Config
SELECT DISTINCT `wagtailcore_page`.`id`,
`wagtailcore_page`.`path`,
`wagtailcore_page`.`depth`,
`wagtailcore_page`.`numchild`,
`wagtailcore_page`.`title`,
`wagtailcore_page`.`slug`,
`wagtailcore_page`.`content_type_id`,
`wagtailcore_page`.`live`,
`wagtailcore_page`.`has_unpublished_changes`,
`wagtailcore_page`.`url_path`,
docker-machine create default --driver virtualbox\
--virtualbox-cpu-count "2"\
--virtualbox-memory "3072"\
--virtualbox-hostonly-cidr "10.10.10.1/24"
@rosskarchner
rosskarchner / export.py
Last active October 4, 2018 14:41
export a simple report of Jenkins credential usage
import csv
import requests
auth = ('username', 'password')
API_URL = 'http://jenkins.host/credentials/store/system/api/json?depth=3&pretty=1'
response = requests.get(API_URL, auth=auth)
data = response.json()