Skip to content

Instantly share code, notes, and snippets.


João Silva Xplouder

View GitHub Profile
nstielau /
Created May 11, 2011
Send a metric to StatsD from bash
# Send a metric to statsd from bash
# Useful for:
# deploy scripts (
# init scripts
# sending metrics via crontab one-liners
# sprinkling in existing bash scripts.
# netcat options:
# -w timeout If a connection and stdin are idle for more than timeout seconds, then the connection is silently closed.
theDisco / Vagrantfile
Created Sep 17, 2012
Vagrant setup for phalcon projects
View Vagrantfile do |config| = "squeeze32" :hostonly, ""
config.vm.forward_port 80, 8080
fideloper / app.js
Last active Oct 17, 2016
Using Event Emitter in your node modules
View app.js
var Fancy = require('FancyModule');
var mod = new Fancy();
mod.on('success', function(data) {
console.log(data); // { this_is_fancy:'indubitably' }
ck-on / ocp.php
Last active Dec 8, 2021
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)#ocp #php #opcache #opcode #cache #zend #optimizerplus #optimizer+
View ocp.php
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.7
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.7 2015-09-01 regex fix for PHP7 phpinfo
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
stephenhardy / git-clearHistory
Created Apr 26, 2013
Steps to clear out the history of a git/github repository
View git-clearHistory
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin<YOUR ACCOUNT>/<YOUR REPOS>.git
baojie /
Created Jul 21, 2013
Python multiprocessing hello world. Split a list and process sublists in different jobs
import multiprocessing
# split a list into evenly sized chunks
def chunks(l, n):
return [l[i:i+n] for i in range(0, len(l), n)]
def do_job(job_id, data_slice):
for item in data_slice:
print "job", job_id, item
denji /
Last active Jan 24, 2022
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
denji /
Last active Jan 20, 2022
NGINX tuning for best performance

Moved to git repository:

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

voxxit /
Last active Apr 19, 2021
Consul + Vault + MySQL = <3
git clone vault
cd vault
docker-compose up -d
export VAULT_ADDR=

Initializing a vault:

vault init
ChuckJHardy /
Last active Apr 5, 2021
Gource Recording for Git

Install Gource

brew install gource

Convert Quicktime Movie to Animated Gif

ffmpeg -i -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif

Record Gource