Skip to content

Instantly share code, notes, and snippets.

View Quantium's full-sized avatar
:octocat:

Andrés González Aragón Quantium

:octocat:
View GitHub Profile
UPDATE ps_specific_price SET reduction = 1-((1-reduction)*(1-0.1))...
@Quantium
Quantium / APC Centos Install
Created January 24, 2013 19:06
APC (Alternative PHP Cache) Installation on Centos
sudo yum install php-pear
sudo yum install httpd-devel
sudo yum install pcre-devel
sudo pecl install apc
#Add tophp.ini:
extension=apc.so
@Quantium
Quantium / SSH VirtualBox VM Cloning
Created January 24, 2013 19:08
Debian VirtualBox Virtual Machine Cloning with ssh
vboxmanage createvm --name skydev --ostype Debian --basefolder VirtualBox\ VMs/skydev --register
vboxmanage storagectl skydev --name LsiLogic --add scsi --controller LsiLogic
VBoxManage storageattach "skydev" --storagectl LsiLogic --port 0 --device 0 --type hdd --medium sky.vdi
vboxmanage startvm skydev --type headless
vboxmanage controlvm skydev poweroff
@Quantium
Quantium / gist:5543602
Last active December 17, 2015 03:29
What distro you are using.
echo 'To know what linux distro you are using.'
lsb_release -a
echo 'or'
cat /etc/issue
@Quantium
Quantium / gitstats_automata
Last active December 21, 2015 07:49
This is a little shell script for update, join and run gitstats on several repositories in order to see only one gitstats project
#!/bin/sh
echo --------
allrepos='';
c=0;
for D in ~/repos/*;do
if [ -d "${D}" ];
then
cd "${D}";
pwd;
#Can't exist a repository with the name 'www'"

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@Quantium
Quantium / github_account_regex
Created May 14, 2014 01:15
Github account Regex
var githubAccount = /^(?:https?:\/\/)?(?:www\.)?(?:github\.com\/(\w+))\/?$/
@Quantium
Quantium / gist:e6a493dbe2d89c16830b
Created July 7, 2014 20:08
Find raspberry machines IPs on local network
sudo nmap -sP 192.168.1.0/24 | awk '/^Nmap/{ip=$NF}/B8:27:EB/{print ip}'
@Quantium
Quantium / fuzz.js
Created April 22, 2015 23:10
Fuzzy logic timelapse simulation
var fuzzylogic = require('fuzzylogic'),
colors = require('colors');
function simulate(ttl){
var timelapse = ttl*1000;
var half = timelapse /2;
var qrt = half/2;
//Cuando se guardó el caché
@Quantium
Quantium / AWS CodeDeployPolicy
Last active May 17, 2017 06:02
CodeDeploy necesary IAM Roles
CodeDeploy Trust Role
This Role is attached to CD Deployment Group or to the CD App when is created.
In the Inline Policies of the Role must be added a Policy called CodeDeployPolicy as follows:
{
"Statement": [
{
"Resource": [