Skip to content

Instantly share code, notes, and snippets.

View nrvale0's full-sized avatar

Nathan Valentine nrvale0

View GitHub Profile
@nrvale0
nrvale0 / runit.sh
Last active October 17, 2016 21:12
docker-machine provisioning script
#!/bin/sh
set -e
touch /tmp/ran_the_script
#
# This script is meant for quick & easy install via:
# 'curl -sSL https://get.docker.com/ | sh'
# or:
# 'wget -qO- https://get.docker.com/ | sh'
@nrvale0
nrvale0 / sh
Created October 1, 2016 14:39
Make GNOME3 Alt-Tab have current workspace scope
$ dconf write /org/gnome/shell/app-switcher/current-workspace-only 'true'
@nrvale0
nrvale0 / emacs
Last active October 7, 2016 18:45
create new emacs ansi-term when in ansi-term window
C-c M-x ansi-term
@nrvale0
nrvale0 / loggingtest.sh
Created September 28, 2016 21:16
more focused logging with Python logging library
#!/usr/bin/env python3
import logging
from invoke import run, Failure
log = logging.getLogger(__name__)
log.setLevel(logging.INFO)
stream = logging.StreamHandler()
stream.setFormatter(logging.Formatter('%(asctime)s - %(levelname)s - %(filename)s:%(lineno)s - %(funcName)s - %(message)s'))
log.addHandler(stream)
@nrvale0
nrvale0 / sh
Last active September 21, 2016 01:07
Get public IP address from AWS metadata service
export PUBLIC_IP=$(wget -q -O - http://169.254.169.254/latest/meta-data/public-ipv4)
@nrvale0
nrvale0 / README.md
Last active September 8, 2016 18:00
rancher-compose in Rancher < 1.2.0 :: variable interpolation of boolean as String results in 'json: cannot unmarshal bool into Go value of type string'

In this case, the rancher-compose variable jenkins_init_debug is the culprit.

@nrvale0
nrvale0 / quick.md
Last active June 17, 2016 01:26
Rancher quick tips
  • install Rancher server: $ sudo docker run -d --restart=always -p 8080:8080 rancher/server

  • list orphaned Docker volumes: docker volume ls -qf dangling=true

  • remove orphaned Docker volumes: docker volume rm $(docker volume ls -qf dangling=true)

@nrvale0
nrvale0 / datadog.conf
Created March 4, 2016 18:34
Example Datadog agent config file
[Main]
dd_url: https://app.datadoghq.com
# If you need a proxy to connect to the Internet, provide the settings here
# proxy_host: my-proxy.com
# proxy_port: 3128
# proxy_user: user
# proxy_password: password
# To be used with some proxys that return a 302 which make curl switch from POST to GET
@nrvale0
nrvale0 / start.sh
Last active December 10, 2015 20:20
Adjust the amount of memory and / filesystem for Docker Toolbox docker template
--- start.sh 2015-12-10 12:17:19.000000000 -0800
+++ start.sh.orig 2015-12-10 12:16:55.000000000 -0800
@@ -25,7 +25,7 @@
echo "Creating Machine $VM..."
$DOCKER_MACHINE rm -f $VM &> /dev/null
rm -rf ~/.docker/machine/machines/$VM
- $DOCKER_MACHINE create -d virtualbox --virtualbox-memory 4096 --virtualbox-disk-size 409600 $VM
+ $DOCKER_MACHINE create -d virtualbox --virtualbox-memory 2048 --virtualbox-disk-size 204800 $VM
else
echo "Machine $VM already exists in VirtualBox."
@nrvale0
nrvale0 / rsc doc blurb
Created October 30, 2015 23:41
typo in rsc docs
/rll/tss/hostname
Function: Manipulate the hostname associated with TSS
Actions: get_hostname, put_hostname
Parameters: hostname=<hostname_value>
Example:
rsc rl10 put_hostname /rll/tss/hostname hostname=tss3.rightscale.com