Skip to content

Instantly share code, notes, and snippets.

View joshuaquek's full-sized avatar
🏠
Working from home

Joshua Ben-Tzion Quek ( יְהוֹשֻׁעַ בֶּן-צִיּוֹן ) joshuaquek

🏠
Working from home
View GitHub Profile
@eculver
eculver / Reverse SSH tunnelling
Created April 18, 2011 16:18
Reverse SSH tunnelling
Via: http://www.rustyrazorblade.com/2010/03/ssh-reverse-tunnel-to-access-box-behind-firewall/
On host behind NAT/firewall:
ssh -R 5000:localhost:22 eculver@imatool.no-ip.org
On host (imatool.no-ip.org) connecting from outside:
ssh localhost -p 5000

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@benbuckman
benbuckman / intercept-stdout.js
Created May 20, 2012 15:42 — forked from pguillory/gist:729616
Hooking into Node.js stdout, pipe stdout to telnet
var _ = require('underscore'),
util = require('util');
// intercept stdout, passes thru callback
// also pass console.error thru stdout so it goes to callback too
// (stdout.write and stderr.write are both refs to the same stream.write function)
// returns an unhook() function, call when done intercepting
module.exports = function interceptStdout(callback) {
var old_stdout_write = process.stdout.write,
old_console_error = console.error;
@aurbano
aurbano / removeKeys.js
Last active November 29, 2022 21:57
Remove a property from a nested object, recursively
/**
* Remove all specified keys from an object, no matter how deep they are.
* The removal is done in place, so run it on a copy if you don't want to modify the original object.
* This function has no limit so circular objects will probably crash the browser
*
* @param obj The object from where you want to remove the keys
* @param keys An array of property names (strings) to remove
*/
function removeKeys(obj, keys){
var index;
@msubel
msubel / uuid_v4_excel_formula.txt
Created July 14, 2015 12:37
An Excel Fromula to generate a UUID v4
=LOWER(CONCATENATE(DEC2HEX(RANDBETWEEN(0;POWER(16;8));8);"-";DEC2HEX(RANDBETWEEN(0;POWER(16;4));4);"-";"4";DEC2HEX(RANDBETWEEN(0;POWER(16;3));3);"-";DEC2HEX(RANDBETWEEN(8;11));DEC2HEX(RANDBETWEEN(0;POWER(16;3));3);"-";DEC2HEX(RANDBETWEEN(0;POWER(16;8));8);DEC2HEX(RANDBETWEEN(0;POWER(16;4));4)))
@tushar-borole
tushar-borole / traverse.js
Last active May 16, 2023 17:37 — forked from steinfletcher/traverse.js
Object tree traversal in javascript (with lodash)
var data = {
"name": "root",
"contents": [
{
"name": "A",
"contents": [
{
"name": "fileA1",
"contents": []
}
@mkubenka
mkubenka / install.sh
Created April 23, 2016 19:28
OpenVPN Access Server Letsencrypt
#!/bin/sh
apt-get -y install git bc
git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
mkdir /etc/letsencrypt
@hunje
hunje / private.xml
Created July 19, 2016 06:55
Topre Realforce 87U for OSX
<?xml version="1.0"?>
<root>
<name>Topre Realforce87UB</name>
<devicevendordef>
<vendorname>TOPRE</vendorname>
<vendorid>0x0853</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>Realforce87</productname>
<productid>0x0111</productid>
@up1
up1 / try.txt
Created October 12, 2016 12:31
Elasticsearch :: Simple Thai Analyzer
DELETE /twitter
PUT /twitter
{
"mappings": {
"tweet": {
"properties": {
"message": {
"type": "string",
"analyzer": "thai",
@JonathanMH
JonathanMH / index.js
Created October 22, 2016 15:07
JSON Web Token Tutorial: Express
// file: index.js
var _ = require("lodash");
var express = require("express");
var bodyParser = require("body-parser");
var jwt = require('jsonwebtoken');
var passport = require("passport");
var passportJWT = require("passport-jwt");