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 / auto-refresh-checkbox.js
Last active Aug 27, 2018
(Javascript) Auto refresh checkbox
View auto-refresh-checkbox.js
<!-- add Javascript in html head -->
<script>
var reloading;
var refresh_time = 30000;
function checkReloading() {
if (window.location.hash=="#autoreload") {
reloading=setTimeout("window.location.reload();", refresh_time);
document.getElementById("reloadCB").checked=true;
}
@carlessanagustin
carlessanagustin / purge2.sh
Last active May 15, 2019
Script to reduce VM size before packaging for Vagrant v.2
View purge2.sh
#!/bin/sh
# Credits to:
# - http://vstone.eu/reducing-vagrant-box-size/
# - https://github.com/mitchellh/vagrant/issues/343
# - https://gist.github.com/adrienbrault/3775253
## for vagrant related tasks, uncomment vagrant comments
# vagrant: Unmount project
@carlessanagustin
carlessanagustin / duf.sh
Last active Aug 16, 2017
Getting folder sizes through command line
View duf.sh
# 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 /
duf
# more info at http://www.carlessanagustin.com/2010/09/22/shell-como-obtener-el-tamano-de-carpeta-via-linea-de-comandos/
@carlessanagustin
carlessanagustin / VAGRANT-Cheat-Sheet.md
Last active Jun 9, 2019
This is a VAGRANT cheat sheet
View VAGRANT-Cheat-Sheet.md

Vagrant Cheat Sheet

add image

local

$ vagrant box add {title} {url}
$ vagrant init {title}
$ vagrant up
@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 / detele-smarty-cache.sh
Created Feb 18, 2015
Clear Prestashop - Smarty cache
View detele-smarty-cache.sh
#!/bin/sh
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: http://www.templatemonster.com/help/prestashop-1-6-x-how-to-clear-smarty-cache.html
@carlessanagustin
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|
config.vm.box = "ubuntu/trusty64"
config.vm.boot_timeout = 60
config.vm.provider "virtualbox" do |vb|
vb.memory = 512
vb.cpus = 1
vb.gui = false
@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;
You can’t perform that action at this time.