Skip to content

Instantly share code, notes, and snippets.

carles san agustin carlessanagustin

Block or report user

Report or block carlessanagustin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View build2scheduler.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 Aug 29, 2015
(PowerShell) Request static IP configuration and place it into a text file
View static-network.ps1
## 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 Aug 29, 2015
Nginx app frontend / Load balancer / Static assets caching (not tested)
View nginx.conf
# 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
View nginx-min.conf
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 Aug 29, 2015
Working with Hyper-V & Snapshots/Checkpoints via PowerShell
View hyper-v-snapshots.ps1
# --- 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 Aug 29, 2015
Nginx simple reverse proxy
View nginx-reverse-proxy.conf
upstream app_server {
server 172.17.0.1:8080 fail_timeout=0;
}
server {
listen 80;
location / {
proxy_pass http://app_server;
}
@carlessanagustin
carlessanagustin / Debconf.md
Last active Aug 29, 2015
For unattended installations in Debian Linux environments
View Debconf.md
@carlessanagustin
carlessanagustin / launch_an_instance.cf
Created Oct 3, 2015
AWS CloudFormation mini-demo
View launch_an_instance.cf
{
"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 Oct 14, 2015
HashiCorp Terraform AWS and DOCKER up-n-running
View terraform.tf.json
############ 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 / AdminProductsController.php
Last active Oct 24, 2015
Adding a new column to Prestashop 1.6 admin product list. Changes are indicated with "START: carlessanagustin.com" and "END: carlessanagustin.com". 2 files included in this Gist.
View AdminProductsController.php
<?php
/*
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
You can’t perform that action at this time.