Skip to content

Instantly share code, notes, and snippets.

View balupton's full-sized avatar
🏍️
Travelling for next 2 weeks

Benjamin Lupton balupton

🏍️
Travelling for next 2 weeks
View GitHub Profile
@andypiper
andypiper / basic-recipes.md
Last active September 5, 2022 14:53
Twitter API recipes for twurl +jq, and other useful Twitter code snippets and tools
module.exports = {
plugins: [
// es2015 - based off of v6.3.13
// https://github.com/babel/babel/blob/master/packages/babel-preset-es2015/index.js
[require('babel-plugin-transform-es2015-template-literals'), { loose: true }],
require('babel-plugin-transform-es2015-literals'),
require('babel-plugin-transform-es2015-function-name'),
require('babel-plugin-transform-es2015-arrow-functions'),
require('babel-plugin-transform-es2015-block-scoped-functions'),
[require('babel-plugin-transform-es2015-classes'), { loose: true }],
@alanwill
alanwill / s3-bucket-move
Created December 5, 2015 20:27
Move an S3 bucket to a different region
aws s3 sync s3://oldbucket s3://newbucket --source-region us-west-1 --region us-west-2
@fcoury
fcoury / id_rsa_encryption.md
Created December 5, 2015 19:20
Encrypt/Decrypt a File using your SSH Public/Private Key on Mac OS X

A Guide to Encrypting Files with Mac OS X

This guide will demonstrate the steps required to encrypt and decrypt files using OpenSSL on Mac OS X. The working assumption is that by demonstrating how to encrypt a file with your own public key, you'll also be able to encrypt a file you plan to send to somebody else using their private key, though you may wish to use this approach to keep archived data safe from prying eyes.

Too Long, Didn't Read

Assuming you've already done the setup described later in this document, that id_rsa.pub.pcks8 is the public key you want to use, that id_rsa is the private key the recipient will use, and secret.txt is the data you want to transmit…

Encrypting

$ openssl rand 192 -out key

$ openssl aes-256-cbc -in secret.txt -out secret.txt.enc -pass file:key

@balupton
balupton / README.md
Last active January 22, 2016 16:50
DocPad Continuous Deployment
@jodiecunningham
jodiecunningham / idle.sh
Created August 9, 2015 15:13
Shut down idle AWS plex instance
#!/bin/bash
#set -x
#DEBUG=echo
# Runs via cron to shut down the instance if it's not in use for 5 minutes
# Starts checks after it's been up more than 500secs
# Won't kick you out if you're ssh'ed in and it's idle.
# crontab -l|grep idle
# */6 * * * * /root/bin/idle.sh >/dev/null 2>&1
until $(awk '$1>500{exit 1}' /proc/uptime)
@jodiecunningham
jodiecunningham / awscheck.sh
Created August 9, 2015 15:04
AWS Startup on-demand script
#!/bin/sh
# Install the AWS CLI, set up an IAM user for the instance(s) you want to control.
# Pull the AWS keys for the IAM user and run aws configure to add them.
# I run this on Sophos UTM and have Sophos run a reverse proxy from the \
# $ROUTERIP:32400 to $PLEXHOST:32400
# set -x
# started with screen -Sdm a '/root/bin/awscheck.sh'een -Sdm a '/root/bin/awscheck.sh'screen -Sdm a '/root/bin/awscheck.sh'screen -Sdm a '/root/bin/awscheck.sh'n -Sdm a '/root/bin/awscheck.sh'
PLEXHOST=dokie.duckdns.org
WANIF=eth2
@balupton
balupton / README.md
Last active January 14, 2017 03:36
Thoughts on a new CMS

Some thoughts on a new CMS, in different progressions.

@getify
getify / gist:2b53198906d320abe650
Created March 23, 2015 17:02
ES6 highlight reel
function foo(x) { x = (typeof x != "undefined") ? x : 10; .. }
function foo(x = 10) { .. }
function foo(x,y,z) { .. }; foo.apply(null,[1,2,3]);
function foo(x,y,z) { .. }; foo(...[1,2,3]);
function foo() { var args = [].slice.call(arguments); .. }
function foo(...args) { .. }
var o = { x: 2, y: 3 }, x = o.x, y = o.y, z = (typeof o.z != "undefined") ? o.z : 10;
@balupton
balupton / README.md
Last active January 14, 2017 03:40
Problems

This gist is used to contain list of issues I've encountered with entities. Luckily, all have been resolved.