Skip to content

Instantly share code, notes, and snippets.

View smo921's full-sized avatar

Stephen Oberther smo921

View GitHub Profile
@smo921
smo921 / consul_lock.go
Last active August 23, 2023 08:08
Go consul lock example
package mrha
import (
"log"
consulapi "github.com/hashicorp/consul/api"
)
// Lock stores data for a consul lock
type Lock struct {
Links to things I wanted to follow up on from Gophercon 2016
[Pachyderm](https://github.com/pachyderm/pachyderm) - Containerized Data Analytics http://pachyderm.io
[Go-Guru](https://godoc.org/golang.org/x/tools/cmd/guru)
[Atom go-guru plugin](https://atom.io/packages/go-oracle)
[GoNum](https://github.com/gonum)
[GoBots](https://gobot.io/)
@smo921
smo921 / gist:028de14be4b0f227cb07f28fb06fa446
Created June 27, 2016 15:44
Alpine file not found fix
RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
@smo921
smo921 / setup-mh.sh
Created November 12, 2015 15:28
Docker Multi Host redis example
#!/usr/bin/env bash
docker-machine create -d virtualbox mh-keystore
docker $(docker-machine config mh-keystore) run \
-d -p "8500:8500" -h "consul" \
progrium/consul -server -bootstrap
docker-machine create -d virtualbox --swarm \
--swarm-image="swarm" --swarm-master \
### Keybase proof
I hereby claim:
* I am smo921 on github.
* I am smo921 (https://keybase.io/smo921) on keybase.
* I have a public key whose fingerprint is C805 B86E 332D F854 7D8A A58C FC01 9DE1 8BD5 40DB
To claim this, I am signing this object:
@smo921
smo921 / gist:da18237705cbc86ee1b3
Last active August 29, 2015 14:13
consul + registrator

  • Start consul
docker run -ti --rm -p 8400:8400 -p 8500:8500 -p 8600:53/udp -h node1 --name consul progrium/consul -server -bootstrap -ui-dir /ui

  • Start registrator
docker run --rm -ti -v /var/run/docker.sock:/tmp/docker.sock -h 192.168.1.13 --link consul:consulserver progrium/registrator consul://consulserver:8500

@smo921
smo921 / .git-prompt-colors.sh
Created January 4, 2015 20:13
bash-git-prompt customization
# This is the custom theme template for gitprompt.sh
# These are the defaults from the "Default" theme
# You just need to override what you want to have changed
override_git_prompt_colors() {
GIT_PROMPT_THEME_NAME="Custom"
# Time12a="\$(date +%H:%M)"
# PathShort="\w";
@smo921
smo921 / gist:e133d6312d94627910f3
Last active August 29, 2015 14:06
logstash.conf example
input {
file {
type => "syslog"
path =>
[ "/data/redis-server.log",
"/usr/local/nginx/logs/access.log"]
}
}
output {
stdout { codec => rubydebug }
@smo921
smo921 / gist:9056370
Created February 17, 2014 18:37
Vagrant Ansible output
vagrant up
Bringing machine 'sandbox' up with 'virtualbox' provider...
[sandbox] Importing base box 'precise64'...
[sandbox] Matching MAC address for NAT networking...
[sandbox] Setting the name of the VM...
[sandbox] Clearing any previously set forwarded ports...
[sandbox] Fixed port collision for 22 => 2222. Now on port 2200.
[sandbox] Clearing any previously set network interfaces...
[sandbox] Preparing network interfaces based on configuration...
[sandbox] Forwarding ports...