Skip to content

Instantly share code, notes, and snippets.

@acacio
acacio / golang-tls.md
Created January 23, 2018 23:36 — forked from 6174/golang-tls.md
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048
    
# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
openssl ecparam -genkey -name secp384r1 -out server.key
@acacio
acacio / README.md
Created September 21, 2017 21:29 — forked from magnetikonline/README.md
Bash string manipulation cheatsheet.

Bash string manipulation cheatsheet

Removal
Delete shortest match of needle from front of haystack ${haystack#needle}
@acacio
acacio / GEN_PROTO.sh
Last active September 10, 2017 16:39
Wiki proto definition
#!/bin/sh
#protoc --go_out=plugins=grpc,import_path=.:. *.proto
protoc --go_out=. -owiki.desc *.proto
protoc --js_out=. *.proto
@acacio
acacio / osx_automount_nfs.md
Created December 30, 2015 02:58 — forked from L422Y/osx_automount_nfs.md
Automounting NFS share in OS X into /Volumes

I have spent quite a bit of time figuring out automounts of NFS shares in OS X...

Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:

/etc/auto_master (see last line):

#
# Automounter master map
#

+auto_master # Use directory service

@acacio
acacio / upnp.js
Created January 12, 2012 21:17
UPNP Port Forwarding for node.js
/* node UPNP port forwarding PoC
This is a simple way to forward ports on NAT routers with UPNP.
This is a not-for-production hack that I found useful when testing apps
on my home network behind ny NAT router.
-satori
usage:
@acacio
acacio / anchor.js
Created January 9, 2012 21:53 — forked from draeton/anchor.js
Anchor - A URL parsing utility
/**
* Anchor - A URL parsing utility
*
* Copyright 2012, Matthew Cobbs
* MIT licensed
*
* Methods:
*
* getSearchVars - returns a key-value object with the parameters in the URL search
* setSearchVars(o) - sets parameters using a key-value object in the URL search
var secure = __dirname + "/secure/";
var handler = require('stack')(
require('creationix/log')(),
require('creationix/auth')(/^\/secure\//, require(secure + "users.js")),
require('creationix/static')("/", __dirname, "index.html")
);
var read = require('fs').readFileSync;
var options = {
@acacio
acacio / telnet.js
Created December 16, 2010 21:42 — forked from ry/telnet.js
#!/usr/bin/env node
// requires node v0.3
// telnet.js 80 google.com
net = require('net');
a = process.argv.slice(2);
if (!a.length) {
console.error("telnet.js port [ host=localhost ]");
process.exit(1);
}
s = require('net').Stream();