Skip to content

Instantly share code, notes, and snippets.

View vladbabii's full-sized avatar
💭
I may be slow to respond.

Vlad Babii vladbabii

💭
I may be slow to respond.
View GitHub Profile
@vladbabii
vladbabii / pedantically_commented_playbook.yml
Created September 26, 2016 19:46 — forked from marktheunissen/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@vladbabii
vladbabii / build_emqtt.sh
Created October 23, 2016 17:21
Compile EMQTT on Raspberry Pi 3
apt-get update
apt-get install git erlang-base erlang-crypto erlang-eunit erlang-mnesia erlang-runtime-tools erlang-syntax-tools erlang-asn1 erlang-public-key erlang-ssl erlang-inets erlang-snmp erlang-os-mon erlang-webtool erlang-tools erlang-xmerl erlang-dev erlang-edoc erlang-eldap erlang-gs erlang-appmon erlang-wx erlang-et erlang-observer
# then follow instructions from http://emqtt.io/docs/v2/install.html#installing-from-source
git clone https://github.com/emqtt/emqttd-relx.git
cd emqttd-relx
make
# to start cd to bin then run emqttd console
# cd _rel/emqttd/bin/
# ./emqttd console
@vladbabii
vladbabii / install_on_xenial_esl_erlang.sh
Created January 13, 2017 13:38
Install ESL Erlang on Ubuntu Xenial
echo "deb http://binaries.erlang-solutions.com/debian xenial contrib" > /etc/apt/sources.list.d/eslerlang.list
wget -O - http://binaries.erlang-solutions.com/debian/erlang_solutions.asc | sudo apt-key add -
apt-get update
apt-get install esl-erlang
@vladbabii
vladbabii / ubuntu_apt_no_cache.sh
Created January 13, 2017 13:41
Remove apt cached deb files
echo "DPkg::Post-Invoke {\"/bin/rm -f /var/cache/apt/archives/*.deb || true\";};" > /etc/apt/apt.conf.d/clean
@vladbabii
vladbabii / install_on_xenial_rabbitmq.sh
Created January 13, 2017 13:45
Install RabbitMQ on Ubuntu Xenial
# install erang first
# i use https://gist.github.com/vladbabii/704e14dadf6aef671ecb38bf6902a7cc
# then download the deb file from https://www.rabbitmq.com/install-debian.html
apt-get install socat logrotate init-system-helpers
# replace * with the version is you have downloaded multiple files
dpkg -i rabbitmq-server_*.deb
@vladbabii
vladbabii / rabbitmq_create_new_user_with_pass.sh
Created January 13, 2017 14:05
RabbitMQ 3.6.6+ create new admin user
# replace thenewusername thenewpassword ;)
rabbitmqctl add_user thenewusername thenewpassword
rabbitmqctl set_user_tags thenewusername administrator
rabbitmqctl set_permissions -p / thenewusername ".*" ".*" ".*"
@vladbabii
vladbabii / install_on_xenial_repcached.sh
Last active January 14, 2017 15:19
Install repcached on Ubuntu Xenial
wget https://downloads.sourceforge.net/project/repcached/repcached/2.2.1-1.2.8/memcached-1.2.8-repcached-2.2.1.tar.gz?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Frepcached%2Ffiles%2F&ts=1484404423&use_mirror=netix
mv memcached-1.2.8-repcached-2.2.1.tar.gz\?r\=https%3A%2F%2Fsourceforge.net%2Fprojects%2Frepcached%2Ffiles%2F memcached-1.2.8-repcached-2.2.1.tar.gz
tar xvf memcached-1.2.8-repcached-2.2.1.tar.gz
apt-get install libevent-dev g++ makelibevent1-dev
cd memcached-1.2.8-repcached-2.2.1
./configure --enable-replication
make
make install
ln -s /usr/local/bin/memcached /usr/bin/repcached
@vladbabii
vladbabii / keepalived.conf
Created January 14, 2017 21:42
keepalived multi-master (aka equal) with 2 or more services (in this case apache and repcached)
vrrp_script chk_apache2 {
script "/usr/bin/killall -0 apache2"
interval 2
fall 2
rise 2
weight 30
}
vrrp_script chk_repcached {
script "/usr/bin/killall -0 repcached"
@vladbabii
vladbabii / keepalived.conf
Created January 14, 2017 21:43
keepalived multi-master (aka equal) with 1 service or more services without priority
vrrp_script chk_apache2 {
script "/usr/bin/killall -0 apache2"
interval 2
fall 2
rise 2
}
vrrp_script chk_repcached {
script "/usr/bin/killall -0 repcached"
interval 2
@vladbabii
vladbabii / install_on_xenial_composer.sh
Created January 14, 2017 21:50
Install composer on Ubuntu Xenial
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
ln -s /usr/local/bin/composer /usr/bin/composer