This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant ssh -c 'sudo yum -y update kernel' ; vagrant reload ; vagrant provision ; vagrant ssh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
id_in_output(){ | |
id="$(grep -Po '(?:UUID: ).+' "$1")" | |
if [ -z "$id" ]; then | |
echo 'Cannot find id' | |
exit 1 | |
fi |