Skip to content

Instantly share code, notes, and snippets.

Igor Soarez soarez

Block or report user

Report or block soarez

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
@soarez
soarez / ca.md
Last active Aug 16, 2019
How to setup your own CA with OpenSSL
View ca.md

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

View deploy.bash
#!/bin/bash
function deploy {
# Update the rsync target on the server
rsync \
-av \
--delete \
--delete-excluded \
$rsync_ignore_list_param \
$rsync_source/ $target:$rsync_target
@soarez
soarez / gist:3481961
Created Aug 26, 2012
EC2 Amazon Linux AMI port prerouting with NAT iptables
View gist:3481961
# List rules
sudo iptables -t nat -L
# Add rule to forward 80 to 3080
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 3080
# Will delete all rules from nat table
sudo iptables -F -t nat
@soarez
soarez / intro.md
Created Jun 2, 2015
Symmetrical vs asymmetrical crypto
View intro.md

Symmetrical vs asymmetrical crypto


Disclaimer: This content is merely educational. [Don't roll your own crypto][dontDoYourOwnCrypto]. Use TLS and GPG.

These aren't new topics, but if you're reading this maybe you could use a quick

View fg.sh
#!/bin/bash
set -e
#node="/home/vagrant/nodes/iojs-v1.6.2-linux-x64/bin/iojs"
node="/home/vagrant/nodes/node-v0.12.1-linux-x64/bin/node"
node_flags='--perf_basic_prof'
script='/home/vagrant/porf/single.js'
script_log=/dev/null
# load_generator="node test.js"
@soarez
soarez / client.js
Created Jan 31, 2016
Finding how many requests Node tries to handle at the same time for a single connection
View client.js
const net = require('net');
const fs = require('fs');
var req = fs.readFileSync('./req.txt', { encoding: 'utf8' });
var socket = new net.Socket();
socket.connect(7001, '127.0.0.1', function() {
console.log('Connected');
var c = 50000;
while (c --> 0)
@soarez
soarez / linetransform.js
Last active Dec 26, 2015
Line transform
View linetransform.js
var Transform = require('stream').Transform;
var util = require('util');
module.exports = LineTransform;
util.inherits(LineTransform, Transform);
function LineTransform() {
Transform.apply(this, arguments);
this.setEncoding('utf8');
}
@soarez
soarez / .tmux.conf
Last active Dec 20, 2015
My messy tmux conf
View .tmux.conf
# use b as prefix
set-option -g prefix C-b
unbind-key C-a
bind-key C-b send-prefix
# Start numbering at 1
set-option -g base-index 1
# Allows for faster key repetition
set-option -g escape-time 0
@soarez
soarez / pullall.sh
Last active Dec 17, 2015
update and link a folder of git versioned npm modules
View pullall.sh
#!/bin/bash
contents=`ls`
module_names=()
module_folders=()
npm_root=$(npm root -g)
do_pull=1
do_npm_install=1
do_npm_link=1
@soarez
soarez / Makefile
Created Jan 30, 2013
Count stack frames
View Makefile
program: main.c
gcc -Wall -O0 -masm=intel -m32 -g -o program main.c
You can’t perform that action at this time.