Skip to content

Instantly share code, notes, and snippets.

View boris's full-sized avatar
🇨🇱
Building from home

Boris Quiroz boris

🇨🇱
Building from home
View GitHub Profile
@boris
boris / lab_unasur.md
Last active December 24, 2015 17:19
Puntos que tratamos en la presentación a los alumnos de informatica de la UNASUR.

IaaS - OpenStack

  • Creación de un Keypair
  • Configuración de Security Groups
  • Crear una nueva instancia con Ubuntu
  • Conectarnos a la instancia e instalar software (apache2)

PaaS - Heroku

@boris
boris / install-chef.sh
Created October 16, 2013 14:27
Install chef server on Ubuntu 12.04 LTS
#! /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
@boris
boris / smartos.sh
Created October 17, 2013 13:34
Installs SmartOS on VirtualBox
#!/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!
#
@boris
boris / docker.md
Last active December 27, 2015 08:29
Intro a docker
#!/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
@boris
boris / haproxy_uri.conf
Created January 7, 2014 14:21
haproxy balance by uri. if the uri is www.something.com/something, traffic will be forwarded to front-3
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
@boris
boris / kill.sql
Created January 14, 2014 13:05
Massive kill mysql processes.
/* 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;
@boris
boris / haproxy.conf
Created January 22, 2014 23:52
upstart file for haproxy
# HAProxy
description "HAProxy"
start on runlevel [2345]
stop on runlevel [016]
respawn
respawn limit 2 5
@boris
boris / mysql.god
Created March 3, 2014 15:48
mysql godrb (http://godrb.com/) config file
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)
@boris
boris / user.json
Created March 13, 2014 14:54
User's config using chef data bag
{
"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",