Skip to content

Instantly share code, notes, and snippets.

@mexisme
mexisme / spew-logs.go
Last active September 4, 2015 03:13
Golang Log Testing (Loggly)
package main
import (
log "github.com/Sirupsen/logrus"
"github.com/rifflock/lfshook"
//"github.com/sebest/logrusly"
"os"
"time"
)
@mexisme
mexisme / walk-dir.py
Created January 26, 2016 11:18
Walk directory, print symlinks and non-symlinks
#!/usr/bin/env python2
# Given a list of paths, walk the directory hierarchy of each path, taking
# the files within each and return a list of those items that are symlinks,
# and those that aren't
#
# Example:
# % ./walk-dir.py .
# Symlinks:
# './test.test'

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

#!/bin/bash
PROGNAME=$(basename $0)
PROGDIR=$(dirname $0)
: ${MyTemp:=$(mktemp -d "${TMPDIR:-/tmp/}${PROGNAME}.XXXXXXXXXXXX")}
## TODO: Allow me to set this up via $AWS_PROFILE (i.e. read the credentials file)
: ${ROLE_ARN:=arn:aws:iam::XXXX:role/XXXX}
: ${ROLE_SESSION:=${USER}-assume-admin}
@mexisme
mexisme / s3cp.go
Created April 10, 2017 10:57 — forked from howeyc/s3cp.go
Golang - copy files to / from s3
// From https://github.com/kr/s3/tree/master/s3cp
// Added public read for uploaded files
// Command s3cp copies a file to or from Amazon S3.
//
// Usage:
//
// s3cp file url
// s3cp url file
//
// The file does not need to be seekable or stat-able. You can use s3cp to
# Note: Updated from https://github.com/mexisme/spigot-docker/blob/master/lib/myshell.rb
# If your prefer the 'logging' gem:
# LOG = Logging.logger(STDOUT)
LOG = Logger.new(STDOUT)
require 'benchmark'
require 'timeout'
class MyShell
@mexisme
mexisme / vendored-pipenv.makefile
Last active January 7, 2018 22:43
Vendorising Python pips via Pipfile
# Makefile-friendly version of:
#
# pipenv run -- pip install -r <(pipenv lock -r) --target $PWD/vendored --no-deps
# You will need to add something like the following to your Main .py file:
#
# import os
# import sys
# parent_dir = os.path.abspath(os.path.dirname(__file__))
# # (Might need to adjust the path, e.g. adding '..' if appropriate)
@mexisme
mexisme / A Protobuf Python Experiment
Last active January 9, 2018 01:30
Protobuf Python Experiment
*
@mexisme
mexisme / screen-stuff.md
Created August 4, 2016 21:50 — forked from gesellix/screen-stuff.md
screen and Docker for Mac
screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty



screen -AmdS docker ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
screen -r docker
# enter, then disconnect with Ctrl-a d
screen -S docker -p 0 -X stuff $(printf root\\r\\n)
screen -r docker
@mexisme
mexisme / install-profile.mk
Last active January 22, 2018 21:48
Install config and scripts to $HOME
#!/usr/bin/make -f
colon := :
$(colon) := :
BINS = e ediff emacs-xauth emacs.my emacs-agenda \
lpc xterm.my \
local-apt \
nx-session nx-menu chrome