(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| Vagrant.configure("2") do |config| | |
| # All Vagrant configuration is done here. The most common configuration | |
| # options are documented and commented below. For a complete reference, | |
| # please see the online documentation at vagrantup.com. | |
| # Every Vagrant virtual environment requires a box to build off of. | |
| config.vm.box = "precise32" |
| # 1) install puppet locally | |
| # - install modules to local modules directory | |
| # puppet module install puppetlabs/postgresql --force -i modules | |
| # puppet module install puppetlabs/stdlib --force -i modules | |
| # puppet module install puppetlabs/firewall --force -i modules | |
| # puppet module install puppetlabs/apt --force -i modules | |
| # puppet module install ripienaar/concat --force -i modules | |
| # OR | |
| # download tar file from https://forge.puppetlabs.com/puppetlabs/postgresql | |
| # and place into modules directory |
| def add_check_digit(upc_str): | |
| """ | |
| Returns a 12 digit upc-a string from an 11-digit upc-a string by adding | |
| a check digit | |
| >>> add_check_digit('02345600007') | |
| '023456000073' | |
| >>> add_check_digit('21234567899') | |
| '212345678992' | |
| >>> add_check_digit('04210000526') |
| #!/bin/sh | |
| # Debian has older Erlang package (R15) in official repositories, Elixir requires newer (R17) | |
| wget http://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb | |
| sudo dpkg -i erlang-solutions_1.0_all.deb | |
| sudo apt-get update | |
| sudo apt-get install -y erlang | |
| rm erlang-solutions_1.0_all.deb | |
| # compile Elixir from source |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| # time ./do-all.sh | |
| + lvcreate -kn -s -n ubunt2 /dev/k2/ubunt | |
| Logical volume "ubunt2" created | |
| + lvresize -L 40G /dev/k2/ubunt2 | |
| Extending logical volume ubunt2 to 40.00 GiB | |
| Logical volume ubunt2 successfully resized | |
| + echo -en 'd\nn\np\n\n\n\n\n\nw\nq\n' | |
| + fdisk /dev/k2/ubunt2 | |
| Command (m for help): Selected partition 1 |
| #!/bin/bash | |
| ### USAGE | |
| ### | |
| ### ./ElasticSearch.sh 1.7 will install Elasticsearch 1.7 | |
| ### ./ElasticSearch.sh will fail because no version was specified (exit code 1) | |
| ### | |
| ### CLI options Contributed by @janpieper | |
| ### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch |
| --- | |
| # packages.yml | |
| - name: Add postgres repository | |
| apt_repository: repo='deb http://apt.postgresql.org/pub/repos/apt/ {{ansible_distribution_release}}-pgdg main' state=present | |
| - name: Add postgres repository key | |
| apt_key: url=http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc state=present | |
| #!/bin/bash | |
| ## Update fail2ban iptables with globally known attackers. | |
| ## Actually, runs 100% independently now, without needing fail2ban installed. | |
| ## | |
| ## /etc/cron.daily/sync-fail2ban | |
| ## | |
| ## Author: Marcos Kobylecki <[email protected]> | |
| ## http://www.reddit.com/r/linux/comments/2nvzur/shared_blacklists_from_fail2ban/ |
| #!/usr/bin/env bash | |
| # -*- mode: sh -*- | |
| old=$(ls -l /usr/local/lib/erlang | awk '{print $11}') | |
| others=$(ls -ld /usr/local/lib/erlang* | awk '{print $9}' | grep -v "^/usr/local/lib/erlang$") | |
| default=${old} | |
| declare -a arry | |
| cat <<EOF |