Skip to content

Instantly share code, notes, and snippets.

##########################################################################
# first require the chef provisioning driver found at:
# https://github.com/chef/chef-provisioning-docker
##########################################################################
require 'chef/provisioning/docker_driver'
with_driver 'docker'
##########################################################################
# this defines the container instance including the role, any attributes,
# the volumes to mount, ports to open, and docker image to use
@jgoulah
jgoulah / gist:cdcd9fc22bfae82b8e96
Last active March 20, 2016 21:22
create chef provisioner node
# install acl gem
chef gem install knife-acl
# only if you need a new node
knife client create -d chefconf-provisioner > ~/.chef/chefconf-provisioner.pem
knife node create -d chefconf-provisioner
# create group
knife group create provisioners
func (cfg *configuration) Load() error {
paths := make([]string, 0)
fdir := filepath.Dir(pathToThisFile())
config := []string{fmt.Sprintf("%s/../config.cfg", fdir)}
paths = findConfig(config, paths)
// we look in multiple places because in production we have the secrets deployed out the the /etc location
// instead of shipping with the app, this allows us to keep production secrets more secure
secrets_config := []string{fmt.Sprintf("%s/../config-secrets.cfg", fdir), "/etc/myapp/config-secrets.cfg"}

Keybase proof

I hereby claim:

  • I am jgoulah on github.
  • I am jgoulah (https://keybase.io/jgoulah) on keybase.
  • I have a public key whose fingerprint is RETU RN T HIS. PGP. GET_ FING ERPR INT( ); }

To claim this, I am signing this object:

#!/bin/bash
function check {
when=$(date --date="$1 15:00" --utc)
echo -n "$when: "
# run design mixer every other monday starting from jan 5 2015
((($(date +%s --date="$when") + 259200) / 86400 % 14)) && echo run || echo skip
# run manager mixer every other monday starting from jan 12 2015
#((($(date +%s --date="$when") + 864000) / 86400 % 14)) && echo run || echo skip
}
@jgoulah
jgoulah / 91redirect-xsession-errors
Created August 17, 2012 14:22
redirect .xsession-errors to /dev/null (put this in /etc/X11/Xsession.d)
#!/bin/sh
# Redirect $HOME/.xsession-errors to /dev/null.
ln -sf /dev/null $HOME/.xsession-errors
#!/bin/bash
cd ~/wdir
for i in MyApp ios_frameworks ; do
echo "tagging $i"
pushd $i
/usr/local/bin/ctags -f ~/.vimtags/$i -R \
--exclude='.git' \
--langmap=objc:.m.h \
--totals=yes \
diff --git a/.gitignore b/.gitignore
index 908d8be..b732476 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,4 @@ run_logs/current*
.bundle/
vendor/bundle
.yardoc
+.DS_Store
diff --git a/templates/generic_single_push.mustache b/templates/generic_single_push.mustache
@jgoulah
jgoulah / gist:729312
Created December 5, 2010 18:16
how to install opencv with python bindings on osx
$ cd /System/Library/Frameworks
$ mv Python.framework Python.framework.system
$ sudo ln -s /opt/local/Library/Frameworks/Python.framework .
$ ls -ald Python.framework*
lrwxr-xr-x 1 root wheel 46 Dec 5 12:49 Python.framework -> /opt/local/Library/Frameworks/Python.framework
drwxr-xr-x 7 root wheel 238 Dec 1 11:24 Python.framework.system
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/opt/local -D PYTHON_INCLUDE_DIR=/opt/local/Library/Frameworks/Python.framework/Headers -D BUILD_PYTHON_SUPPORT=ON -D BUILD_SWIG_PYTHON_SUPPORT=OFF -D CMAKE_CXX_COMPILER=/usr/bin/g++-4.2 -D CMAKE_C_COMPILER=/usr/bin/gcc-4.2 ..
# it will link correctly to /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python