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
import csv
def format_name(response):
email_address = response['Email Address']
name = email_address.split('@')[0].replace('.', ' ').title()
return "%s (%s)" % (name, response['What is your role?'])
def response_id(field_index, response):
@rosskarchner
rosskarchner / EMPLOYMENT OFFER 2019.eml
Created January 22, 2019 20:45
Shell oil hiring scam
Return-Path: <careers.us@shell.com>
Received: from shell.com ([37.120.146.95]) by
inbound-smtp.us-east-1.amazonaws.com with SMTP id
d8j5m6dfae652tfcrm9gpnmhp8lnv79c5re4ss01 for ross@karchner.com; Sun, 20 Jan
2019 22:55:43 +0000
Received-SPF: fail (spfCheck: domain of shell.com does not designate
37.120.146.95 as permitted sender) client-ip=37.120.146.95;
envelope-from=careers.us@shell.com; helo=37.120.146.95;
Subject: EMPLOYMENT OFFER 2019
From: =?windows-1252?Q?JAMIE_WILLIAMS_-_=28HR_Dept-_SHELL_OIL_COMPANY=29?=
@rosskarchner
rosskarchner / after.yaml
Created October 30, 2018 15:47
SAM hello world, before and after processing into plain Cloudformation
AWSTemplateFormatVersion: 2010-09-09
Outputs:
HelloWorldApi:
Description: API Gateway endpoint URL for Prod stage for Hello World function
Value: !Sub >-
https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/hello/
HelloWorldFunctionIamRole:
Description: Implicit IAM Role created for Hello World function
Value: !GetAtt
- HelloWorldFunctionRole
@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()
docker-machine create default --driver virtualbox\
--virtualbox-cpu-count "2"\
--virtualbox-memory "3072"\
--virtualbox-hostonly-cidr "10.10.10.1/24"
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`,
AWS Budgets
AWS Certificate Manager
AWS CloudFormation
AWS CloudHSM
AWS CloudTrail
AWS CodeCommit
AWS CodeDeploy
AWS CodePipeline
AWS Competency Program
AWS Config
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()
@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"
@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"