This file contains hidden or 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
iex --name sam --cookie secret | |
2018-08-17 12:39:22.425266 | |
args: [] | |
format: "Can't set long node name!\nPlease check your configuration\n" | |
label: {error_logger,info_msg} | |
2018-08-17 12:39:22.425344 crash_report #{label=>{proc_lib,crash},report=>[[{initial_call,{net_kernel,init,['Argument__1']}},{pid,<0.59.0>},{registered_name,[]},{error_info,{exit,{error,badarg},[{gen_server,init_it,6,[{file,"gen_server.erl"},{line,358}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,249}]}]}},{ancestors,[net_sup,kernel_sup,<0.45.0>]},{message_queue_len,0},{messages,[]},{links,[<0.56.0>]},{dictionary,[{longnames,true}]},{trap_exit,true},{status,running},{heap_size,610},{stack_size,27},{reductions,833}],[]]} | |
2018-08-17 12:39:22.425812 supervisor_report #{label=>{supervisor,start_error},report=>[{supervisor,{local,net_sup}},{errorContext,start_error},{reason,{'EXIT',nodistribution}},{offender,[{pid,undefined},{id,net_kernel},{mfargs,{net_kernel,start_link,[[sam,longnames],true]}},{restart_type,per |
This file contains hidden or 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 Math do | |
def fib(n) when n == 1, do: [0] | |
def fib(n) when n > 1, do: fib([0], n-1) | |
def fib([0], n), do: fib([1|[0]], n-1) | |
def fib(l,0), do: Enum.reverse(l) | |
def fib(l,n) do | |
[h1|[h2 | _]] = l | |
fib([h1+h2 | l], n-1) | |
end | |
end |
This file contains hidden or 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 -x | |
pushd /tmp | |
wget https://github.com/sribalakumar/bootchart/archive/master.zip | |
unzip master.zip | |
pushd bootchart-master | |
sh install.sh | |
sed -i 's/default=1/default=0/g' /boot/grub/menu.lst | |
popd |
This file contains hidden or 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 | |
/etc/init.d/monit stop | |
/etc/init.d/opsworks-agent stop | |
rm -rf /etc/aws/opsworks/ /opt/aws/opsworks/ /var/log/aws/opsworks/ /var/lib/aws/opsworks/ /etc/monit.d/opsworks-agent.monitrc /etc/monit/conf.d/opsworks-agent.monitrc /var/lib/cloud/ /etc/chef | |
rpm -e opsworks-agent-ruby | |
# rpm -e chef | |
# /etc/init.d/nginx stop |
This file contains hidden or 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 | |
/etc/init.d/monit stop | |
/etc/init.d/opsworks-agent stop | |
rm -rf /etc/aws/opsworks/ /opt/aws/opsworks/ /var/log/aws/opsworks/ /var/lib/aws/opsworks/ /etc/monit.d/opsworks-agent.monitrc /etc/monit/conf.d/opsworks-agent.monitrc /var/lib/cloud/ /etc/chef | |
rpm -e opsworks-agent-ruby | |
rpm -e chef | |
/etc/init.d/nginx stop |
This file contains hidden or 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 | |
function install_haproxy () { | |
echo "Install dependencies..." | |
sudo yum install wget git gcc pcre-static pcre-devel -y | |
echo "Download haproxy..." | |
pushd /tmp | |
wget http://www.haproxy.org/download/1.6/src/haproxy-1.6.3.tar.gz |
This file contains hidden or 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
port 26379 | |
sentinel monitor mymaster 172.31.20.201 6379 1 | |
sentinel down-after-milliseconds mymaster 10000 | |
sentinel failover-timeout mymaster 20000 | |
sentinel parallel-syncs mymaster 1 | |
bind 0.0.0.0 | |
dir "/tmp" | |
loglevel notice | |
logfile "/var/log/redis-sentinel.log" | |
daemonize yes |
This file contains hidden or 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/sh | |
# From - http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/ | |
# | |
# redis - this script starts and stops the redis-server daemon | |
# Originally from - https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server | |
# | |
# chkconfig: - 85 15 | |
# description: Redis is a persistent key-value database | |
# processname: redis-server | |
# config: /etc/redis/redis.conf |
This file contains hidden or 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
[Unit] | |
Description=Redis In-Memory Data Store | |
After=network.target | |
[Service] | |
User=redis | |
Group=redis | |
ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf | |
ExecStop=/usr/local/bin/redis-cli shutdown | |
Restart=always |
This file contains hidden or 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
from optparse import OptionParser | |
from time import sleep | |
import requests | |
def main(): | |
parser = OptionParser(usage="usage %prog [options]", version="%prog 1.0") | |
parser.add_option("-d", "--domain", | |
action = "store", |