Skip to content

Instantly share code, notes, and snippets.

View martin-langhoff's full-sized avatar
Adjusting Code & Trimming Sails

Martin Langhoff martin-langhoff

Adjusting Code & Trimming Sails
  • Tech DNA - Due Diligence
  • Miami, FL
View GitHub Profile
#!/bin/bash
set -e
id_in_output(){
id="$(grep -Po '(?:UUID: ).+' "$1")"
if [ -z "$id" ]; then
echo 'Cannot find id'
exit 1
fi
@martin-langhoff
martin-langhoff / gist:c28670a1469e76c85a3877605847be8b
Created December 1, 2016 19:51
Update vagrant kernel, restart, reprovision
vagrant ssh -c 'sudo yum -y update kernel' ; vagrant reload ; vagrant provision ; vagrant ssh
defmodule Common.MixTools do
# WE
def get_version do
try do
:ets.new(:version_cache, [:named_table, :set, :public])
rescue
[ArgumentError] -> nil
end
case :ets.lookup(:version_cache, 'version') do
@martin-langhoff
martin-langhoff / gist:5d16a2e08bdb7ef950526cce83bc9e27
Created August 23, 2016 22:04
Read in sys.config in an Elixir Release under 'console_clean'
# Read sys.config as in a normal start
{ :ok, [ conf ] } = :file.consult('/path/to/running-config/sys.config')
Enum.each(conf, fn({k, v}) ->
Enum.each(v, fn({sk, sv}) ->
Application.put_env(k, sk, sv)
end)
end)