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
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 / auto-refresh-checkbox.js
Last active Aug 27, 2018
(Javascript) Auto refresh checkbox
View auto-refresh-checkbox.js
<!-- add Javascript in html head -->
var reloading;
var refresh_time = 30000;
function checkReloading() {
if (window.location.hash=="#autoreload") {
reloading=setTimeout("window.location.reload();", refresh_time);
carlessanagustin /
Last active May 15, 2019
Script to reduce VM size before packaging for Vagrant v.2
# Credits to:
# -
# -
# -
## for vagrant related tasks, uncomment vagrant comments
# vagrant: Unmount project
carlessanagustin /
Last active Aug 16, 2017
Getting folder sizes through command line
# add next command to the command line
alias duf='du -sk * | sort -n | while read size fname; do for unit in k M G T P E Z Y; do if [ $size -lt 1024 ]; then echo -e "${size}${unit} - ${fname}"; break; fi; size=$((size/1024)); done; done'
# run next commands and see output
cd /
# more info at
carlessanagustin /
Last active Jun 9, 2019
This is a VAGRANT cheat sheet

Vagrant Cheat Sheet

add image


$ vagrant box add {title} {url}
$ vagrant init {title}
$ vagrant up
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:
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 /
Created Feb 18, 2015
Clear Prestashop - Smarty cache
sudo find $1/cache/smarty/cache -type f ! -regex ".*/\(index.php\)" -delete
sudo find $1/cache/smarty/compile -type f ! -regex ".*/\(index.php\)" -delete
sudo find $1/img/ tmp -type f ! -regex ".*/\(index.php\)" -delete
# continue reading:
carlessanagustin / Vagrantfile-2xInstances.rb
Last active Jan 13, 2017
Vagrantfile for multi-machine configuration
View Vagrantfile-2xInstances.rb
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config| = "ubuntu/trusty64"
config.vm.boot_timeout = 60
config.vm.provider "virtualbox" do |vb|
vb.memory = 512
vb.cpus = 1
vb.gui = false
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;
#index index.html index.htm;
# myApp at port 8010
location /myApp {
return 301 http://$host:8010$request_uri;
You can’t perform that action at this time.