- Creación de un Keypair
- Configuración de Security Groups
- Crear una nueva instancia con Ubuntu
- Conectarnos a la instancia e instalar software (apache2)
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 | |
FILE="chef-server_11.0.8-1.ubuntu.12.04_amd64.deb" | |
wget https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/$FILE | |
dpkg -i $FILE ; sudo chef-server-ctl reconfigure |
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/sh | |
# Require: | |
# * VirtualBox already installed | |
# * Internet connection :) | |
# | |
# This script will: | |
# * Download the latest live ISO image of SmartOS | |
# * Create a VirtualBox VM, or update an existing VM with the latest ISO | |
# * Configure the VM with a zones disk, and boot it! | |
# |
Para esto, los ingredientes son:
- Vagrant
- Docker desde http://docs.docker.io/en/latest/installation/vagrant/
Crear una imagen base (notar el cambio en el prompt.
vagrant@precise64:~$ docker run -i -t base /bin/bash
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'net/ssh' | |
Net::SSH.start('server.fqdn', 'foo') do |ssh| | |
output = ssh.exec("uname -a ; whoami") | |
puts output | |
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
frontend front-in | |
bind 0.0.0.0:80 | |
acl custom_uri path_beg /something | |
use_backend super_server if custom_uri | |
default_backend all_servers | |
backend all_servers | |
balance roundrobin | |
option httpclose | |
option forwardfor |
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
/* select contact .. from TALBE where user="user" and CONDITION into outfile 'path';*/ | |
select concat('KILL ',id,';') from information_schema.processlist where user='root' and Info like "%fail%" outfile '/tmp/kill.txt'; | |
source /tmp/kill.txt; |
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
# HAProxy | |
description "HAProxy" | |
start on runlevel [2345] | |
stop on runlevel [016] | |
respawn | |
respawn limit 2 5 |
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
God.watch do |w| | |
w.name = "mysql" | |
w.interval = 30.seconds | |
w.start = "/etc/init.d/mysql start" | |
w.stop = "/etc/init.d/mysql stop" | |
w.restart = "/etc/init.d/mysql restart" | |
w.start_grace = 20.seconds | |
w.restart_grace = 20.seconds | |
w.pid_file = "/var/run/mysqld/mysqld.pid" | |
w.behavior(:clean_pid_file) |
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
{ | |
"name": "data_bag_item_users_boris", | |
"json_class": "Chef::DataBagItem", | |
"chef_type": "data_bag_item", | |
"data_bag": "users", | |
"raw_data": { | |
"id": "USER", | |
"username": "user", | |
"groups": "group", | |
"shell": "/bin/bash", |