Skip to content

Instantly share code, notes, and snippets.

View reedobrien's full-sized avatar

Reed O'Brien reedobrien

View GitHub Profile

Keybase proof

I hereby claim:

  • I am reedobrien on github.
  • I am reedobrien (https://keybase.io/reedobrien) on keybase.
  • I have a public key whose fingerprint is AD1F 6FBD 3802 DDB0 3F73 252D F8E3 4744 2BB6 36FE

To claim this, I am signing this object:

@reedobrien
reedobrien / dev-clouds.yaml
Created October 14, 2016 19:16
juju clouds configured for quicker more convenient development and validation.
clouds:
awstest:
type: ec2
regions:
us-west-1:
endpoint: https://ec2.us-west-1.amazonaws.com
us-east-1:
endpoint: https://ec2.us-east-1.amazonaws.com
us-west-2:
endpoint: https://ec2.us-west-2.amazonaws.com
@reedobrien
reedobrien / mongo.sh
Created July 13, 2016 03:10 — forked from niedbalski/mongo.sh
Connect to Juju Mongodb
$ juju ssh 0
machine-0# sudo apt-get install mongodb-clients
machine-0# mongo --ssl -u admin -p $(grep oldpassword /var/lib/juju/agents/machine-0/agent.conf | awk -e '{print $2}') localhost:37017/admin
MongoDB shell version: 2.4.9
connecting to: localhost:37017/admin
juju:PRIMARY> db = db.getSiblingDB("juju")
juju
mgo.SetDebug(true)
var aLogger *log.Logger
aLogger = log.New(os.Stderr, "", log.LstdFlags)
mgo.SetLogger(aLogger)
@reedobrien
reedobrien / notepad.html
Created June 6, 2016 18:37 — forked from jdkanani/notepad.html
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
<!--
For other language: Instead of `ace/mode/ruby`, Use
Markdown -> `ace/mode/markdown`
Python -> `ace/mode/python`
C/C++ -> `ace/mode/c_cpp`
Javscript -> `ace/mode/javascript`
Java -> `ace/mode/java`
Scala- -> `ace/mode/scala`
@reedobrien
reedobrien / timecapsule-handler
Created December 15, 2015 22:23 — forked from dgraziotin/timecapsule-handler
Script to automatically look for Apple TimeCapsule devices and mount/umount them under GNU/Linux. See http://task3.cc/418/how-to-automatically-mount-and-umount-apple-time-capsule-on-linu for info and explanations.
#!/bin/bash
#
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COPYING for more details.
#
# Version 3, enhanced for Ubuntu 13.X+, Fedora 19+, and similar distros.
@reedobrien
reedobrien / random_pass.go
Created September 9, 2015 17:40
Generate a random password from words list
// Create a random passowrd from words file
package main
import (
"bufio"
"fmt"
"log"
"math/rand"
"os"
@reedobrien
reedobrien / shuffle.go
Created September 9, 2015 17:38
given a slice of 52 slots shuffle so that the result has a uniform distribution probability
package main
import (
"fmt"
"math/rand"
"time"
)
// given array of 52 slots shuffle so that the result has a uniform distribution probability
@reedobrien
reedobrien / sample_cplusj.json
Last active August 29, 2015 14:26
sample search response
{
"collection": {
"version": "1.0",
"href": "/search?q=sometxt",
"items": [{
"href": "image/201405140003HQ/collection.json",
"data": [
{
"date_created": "2014-01-05T16:38:57Z",
"description":
# Upload asset
curl -X POST -F 'flowTotalChunks=1' -F file=@~/tmp/201405140003HQ.tif localhost:6543/asset/
{"jobId": "453cc053-5efe-420a-be2c-c805a3026814"}% # Use this job id below
curl -X POST -F 'flowTotalChunks=1' -F file=@/home/robrien/tmp/201405140003HQ.tif localhost:6543/metadata-extract > ~/tmp/201405140003HQ.json
# upload metadata.json with above job id
curl -X POST -F 'flowTotalChunks=1' --form filename=metadata.json --form jobId=453cc053-5efe-420a-be2c-c805a3026814 -F file=@/home/robrien/tmp/201405140003HQ.json localhost:6543/metadata/