Skip to content

Instantly share code, notes, and snippets.

View cwells's full-sized avatar

Cliff Wells cwells

  • Portland, Oregon USA
  • 22:43 (UTC -07:00)
View GitHub Profile
@cwells
cwells / main.jl
Last active August 22, 2018 19:13
include("./strings.jl")
filename, stride, highest = ARGS
@time main(filename, parse(Int64, stride), parse(Int64, highest))
#!/bin/env python3
#
# Create ~/.aws/aws-mfa.yaml with the following content:
#
# ---
# default:
# account: 1234567890
# username: phil@veridiandynamics.com
# aws_profile: production
def dig(d, keys, *args):
"""Locate a value in a nested dictionary.
Args:
d (dict): the dictionary
keys (list): list of keys to index the dictionary with
default (value|callable): value or callable to return in case of missing key
Returns:
Value at `d[k0][k1][...]` if all keys are present
#!/usr/bin/env python3
import sys
import os
import getpass
import socket
import select
import threading
import logging
import yaml
#!/usr/bin/python3
import os
import re
import logging
import boto3
from queue import Queue
from threading import Thread
from datetime import datetime, timedelta, timezone
@cwells
cwells / github.css
Last active December 16, 2017 08:12
Grey theme for FF 57+ / matching Stylish theme for slack.com, github.com
body {
background-color: #eeeeee;
}
a {
color: #333333;
text-decoration: none;
}
.server-stats {
@cwells
cwells / correlate.py
Created October 26, 2017 22:01
Create new CSV file by combining results of directory traversal + original CSV file
#!/usr/bin/python
import csv
import os
from datetime import datetime
skipped = open('no-target.csv', 'w')
targets = {}
with open('file_mapping.csv') as csvfile:
@cwells
cwells / auth.py
Created October 26, 2017 03:59
Gets username from YAML file, password from keyring, otherwise prompt user via click
try:
config = yaml.load(open(CONFIGFILE).read())
except:
config = None
if not config: config = {}
username = config.get('username', None)
password = keyring.get_password(PROGRAM, username) if username else None
#!/usr/bin/env python
from OpenSSL import crypto
import click
def validate_country(ctx, param, value):
try:
assert len(value) == 2
except AssertionError:
raise click.BadParameter('{} must be two letters'.format(param.name))
#define _CRT_SECURE_NO_WARNINGS // turn off SAFE COMMANDS
// ############################
// Written By: Cristian Colocho
// Date Written: March, 14, 2015
// Purpose: Loop Menu and Switch
// ############################
#include <stdio.h>
#include <stdlib.h>
int enter(int n) {