Skip to content

Instantly share code, notes, and snippets.

View carlessanagustin's full-sized avatar

carles san agustin carlessanagustin

View GitHub Profile
@carlessanagustin
carlessanagustin / build2scheduler.py
Last active August 29, 2015 14:08
(Python) Re-order dictionary for Buildbot CI Framework - Applied here: https://github.com/carlessanagustin/buildbot-bootstrap/blob/master/config/schedulers.py
build_names = []
build_names.append(dict(name='build_id', branch='master', slaves=['bbslave'],
scheduler=['single', 'force', 'periodic', 'nightly']))
build_names.append(dict(name='branch_id', branch='branch_id', slaves=['bbslave'],
scheduler=['single', 'periodic']))
build_names.append(dict(name='branch_idm', branch='master', slaves=['bbslave'],
scheduler=['single', 'force','periodic']))
print ''
print 'original: ', build_names
@carlessanagustin
carlessanagustin / static-network.ps1
Last active August 29, 2015 14:14
(PowerShell) Request static IP configuration and place it into a text file
## An A-Z Index of Windows PowerShell 2.0 commands: http://ss64.com/ps/
do {
$ip = Read-Host "Enter IP address"
$mask = Read-Host "Enter mask"
$gw = Read-Host "Enter default gateway"
Write-Host 'Is this information correct? IP $ip MASK $mask GW $gw'
$confirm = Read-Host "yes/no"
}while ($confirm -notlike "yes")
@carlessanagustin
carlessanagustin / nginx.conf
Last active August 29, 2015 14:16
Nginx app frontend / Load balancer / Static assets caching (not tested)
# Number of worker processes. Set it to the number of available CPU cores as a good start value or use 'auto' to autodetect it
worker_processes 4;
# User and group used by worker processes
user www-data www-data;
# Skip superfluous info in the main error log file
error_log /var/log/nginx/error_log error;
# Limit number of files a worker process can open
@carlessanagustin
carlessanagustin / nginx-min.conf
Last active August 29, 2015 14:16
Nginx simplified
server {
listen 80;
charset utf-8;
server_name your-site.com www.your-site.com;
#index index.html index.htm;
# myApp at port 8010
location /myApp {
return 301 http://$host:8010$request_uri;
@carlessanagustin
carlessanagustin / hyper-v-snapshots.ps1
Last active August 29, 2015 14:17
Working with Hyper-V & Snapshots/Checkpoints via PowerShell
# --- VM ---
## get hyper-v info
Get-VMHost -ComputerName computer_name | format-list *
#3 get VMs info
Get-VM -ComputerName computer_name
## get VM info
Get-VM -ComputerName computer_name -name vm_name
@carlessanagustin
carlessanagustin / nginx-reverse-proxy.conf
Last active August 29, 2015 14:21
Nginx simple reverse proxy
upstream app_server {
server 172.17.0.1:8080 fail_timeout=0;
}
server {
listen 80;
location / {
proxy_pass http://app_server;
}
@carlessanagustin
carlessanagustin / launch_an_instance.cf
Created October 3, 2015 08:38
AWS CloudFormation mini-demo
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "launch an instance.",
"Resources": {
"Ec2Instance": {
"Type": "AWS::EC2::Instance",
"Properties": {
"ImageId": "ami-d05e75b8",
"InstanceType": "t2.micro"
}
@carlessanagustin
carlessanagustin / terraform.tf.json
Last active October 14, 2015 15:28
HashiCorp Terraform AWS and DOCKER up-n-running
############ AWS ############
provider "aws" {
access_key = "${var.access_key}"
secret_key = "${var.secret_key}"
# access_key = "lalalalalalalalalala"
# secret_key = "lalalalalalalalalala"
region = "us-east-1"
}
@carlessanagustin
carlessanagustin / My_first_20_hours.md
Last active October 24, 2015 15:57
How to learn ANYTHING - My first 20 hours

full video

step title comments
1 deconstruct the skill break it down into smaller parts
2 learn enough to self correct get better by practise, don't overstimulate you with 20 books
3 remove practise barriers tv, internet, whatsapp, telegram...off!
4 practise for at least 20 hours remove the frustration barrier after the first 5 minutes, then 20 hours

learning curve

@carlessanagustin
carlessanagustin / csv2gcalendar.md
Last active November 18, 2015 16:47
Como crear archivos CSV antes de importarlos a Google Calendar
Subject Start Date Start Time End Date End Time All Day Event Description Location Private
El nombre del evento (dato obligatorio). El primer día del evento (dato obligatorio). La hora a la que empieza el evento. El último día del evento. La hora a la que termina el evento. Aquí se indica si el evento dura todo el día. Si dura todo el día indica True. Si no indicaFalse. Descripción o notas del evento. La ubicación del evento. Si quieres marcar el evento como privado o no. Si es un evento privado indica True. Si no lo es indica False.
Ejemplo: Examen final Ejemplo: 05/30/2020 Ejemplo: 10:00 AM Ejemplo: 05/30/2020 Ejemplo: 1:00 PM Ejemplo: False Ejemplo: 50 preguntas tipo test y 2 preguntas para desarrollar Ejemplo: Universidad Complutense de Madrid Ejemplo: True