Skip to content

Instantly share code, notes, and snippets.

View braxtone's full-sized avatar

Braxton braxtone

View GitHub Profile
@braxtone
braxtone / gzsync.sh
Last active August 29, 2015 14:17 — forked from woodb/gzsync.sh
Bash script to compress and upload the current directory to an S3 bucket with the ability to exclude files with certain extensions.
#!/bin/bash
BUCKET=$1
TMP_DIR=`mktemp -d -t gzsync`
# Get a list of comma-delimited excluded filetypes
OIFS=$IFS;
IFS=",";
EXCLUDED_FILETYPES=($2)
IFS=$OIFS;
@braxtone
braxtone / iam_policy.json
Created April 1, 2015 05:42
AWS S3 Bucket Policy to Allow Another Account to Upload to your S3 Bucket
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "UploadPermissions",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::AWS_ID:root"
},
"Action": [
@braxtone
braxtone / list_ssl_ciphers.sh
Created August 6, 2015 23:37
List out all the supported SSL Ciphers for a given hostname
#!/usr/bin/env bash
# OpenSSL requires the port number.
SERVER=$1:443
DELAY=1
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')
echo Obtaining cipher list from $(openssl version).
for cipher in ${ciphers[@]}
#!/usr/bin/ruby
# Parses the XML format that iOS' HealthKit export feature creates, extracting step counts and dumping out a CSV
require 'nokogiri'
require 'date'
filename = ARGV[0]
def process_date(date)
DateTime.parse(date).strftime('%Y-%m-%d %H:%M:%S')
end
@braxtone
braxtone / bit_flipper.py
Created May 13, 2018 06:11
Calculate bit flips for random integers, an adventure in Python's bitwise operators
#!/usr/bin/env python3
import sys
if len(sys.argv) != 2:
print("Usage: %s <number>" % sys.argv[0])
sys.exit(1)
def flip_bit(number, n):
mask = (0b1 << (n-1))
result = number ^ mask
/***************************************************
Script will send an email notification to you or other email addresses
when a file in a given Google folder has been added, or modified.
To create a copy, use https://docs.google.com/spreadsheets/d/13z6ExSxdhrAfjppSIrGw6yLvByRjTIA3iWWpi97dgsQ/edit?usp=sharing
***************************************************/
function checkForChangedFiles() {
var config = loadConfiguration();
var folderSearch = '"' + config["folderID"] + '" ' + 'in parents';

Keybase proof

I hereby claim:

  • I am braxtone on github.
  • I am braxtone (https://keybase.io/braxtone) on keybase.
  • I have a public key ASCGOapNGRE3Mbz5M2s35_dbFBw4PoutBS0_55f7iQq2lQo

To claim this, I am signing this object: