Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am steve-jansen on github.
  • I am stevejansen (https://keybase.io/stevejansen) on keybase.
  • I have a public key ASA_OhoiYVixB58rBEiRJl_9CcBjl0xT2QsAbM-ponCvsAo

To claim this, I am signing this object:

@steve-jansen
steve-jansen / main.sh
Created February 14, 2017 21:24
Bulk invite Slack users to a channel
for u in $(jq --raw-output ". | .[]" < members.json); do
clear;
echo Inviting user ${u};
curl -i -X GET "https://slack.com/api/channels.invite?token=${API_TOKEN}&channel=${CHANNEL}&user=${u}" | head -n 20;
sleep 1;
done;
@steve-jansen
steve-jansen / demo.sh
Created November 18, 2016 20:13
Parse Terraform state file for AWS security group rules
jq '.modules[].resources | to_entries[] | select(.value.type == "aws_security_group_rule" or .value.type == "aws_security_group")' test.json
@steve-jansen
steve-jansen / WINFILETIME.sh
Created September 28, 2016 15:56
Convert a Windows FILETIME value to a localized date string
# 131194047065676512 is an example FILETIME value
ruby -e 'puts Time.at((Integer(ARGV[0]) - 116444736000000000) / 10000000)' -- 131194047065676512
@steve-jansen
steve-jansen / .vault
Last active June 7, 2024 03:30
HashiCorp Vault Token Helper using the OS X Keychain
token_helper = "/Users/me/.vault-helper"
@steve-jansen
steve-jansen / docker-inspect.sh
Created August 19, 2016 01:55
List labels for a docker container
docker inspect -f '{{ range $k, $v := .ContainerConfig.Labels -}}
{{ $k }}={{ $v }}
{{ end -}}' $cid
@steve-jansen
steve-jansen / bookmarklet.js
Last active August 19, 2016 23:15
Bookmarklet to create a terraform.tfvars file from an Atlas Terraform environment variables page
javascript:var s='';for(i=0;;i++){k=document.forms[0]["runtime_configuration[tf_vars_attributes]["+i+"][key]"];v=document.forms[0]["runtime_configuration[tf_vars_attributes]["+i+"][value]"]; if(k && v){s+=[k.value,'=',v.value,'\n'].join('');}else{break};};window.location="data:text/plain;base64,"+btoa(s);
@steve-jansen
steve-jansen / mirror-docker-registries.sh
Last active February 11, 2021 10:44
Mirror a Docker Trusted Registry (DTR) to another registry
#!/bin/bash
read -p "Registry to clone from: " pull_registry
read -p "Username for $pull_registry: " user
read -s -p "Password for $pull_registry: " password
echo
read -p "Registry to clone onto: " push_registry
echo Querying $pull_registry...
@steve-jansen
steve-jansen / export-zone.sh
Created December 15, 2014 19:11
Export DNS records from Rackspace Cloud DNS to zone files on disk
#!/bin/bash
# exports DNS records from Rackspace Cloud DNS to text files
# Depends on https://github.com/wichert/clouddns/blob/master/src/clouddns.py
set -e
me=export-zone
base_domain=
rackspace_region=
rackspace_rate_limit_delay=3
var express = require('express'),
proxy = require('./lib/proxy');
var app = express();
app.configure(function() {
app.use(express.favicon(false));
app.use(express.logger('dev'));
app.use(proxy.initialize({
proxy: {