Skip to content

Instantly share code, notes, and snippets.

View pid's full-sized avatar

Sascha pid

  • Baden-Württemberg, Germany
View GitHub Profile

Opening and closing an SSH tunnel in a shell script the smart way

I recently had the following problem:

  • From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
  • That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.

We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like

ssh -L 3306:localhost:3306 remotehost


For feedback or suggestions, please send a tweet (@dideler). Gist comments don't notify me. Pull requests aren't possible with gists (yet), so I don't recommend forking because then I can't easily get the change.

Starring this gist will give me an idea of how many people consider this list useful.

  • OpenStrategy - kinda like this list, but much nicer presentation
module KellyColors exposing (..)
import Color exposing (..)
import Maybe exposing (..)
import List.Extra as List exposing (..)
type alias KellyDef =
{ isccNbsNr : Int, hexString : String, r : Int, g : Int, b : Int }
pid /
Last active October 13, 2016 06:16 — forked from rauchg/
Minimum Viable Async with Node 6

Minimum Viable Async with Node 6

With the release of Node 6.0.0, the surface of code that needs transpilation to use ES6 features has been reduced very dramatically.

This is what my current workflow looks like to set up a minimalistic and fast microservice using micro and async + await.

The promise

pid / a.js
Created September 23, 2016 10:37 — forked from isaacs/a.js
var Module = require('module')
Module.prototype.require = function (orig) { return function (id) {
console.trace(this, id)
return orig.apply(this, arguments)
pid /
Created April 19, 2016 11:26 — forked from victorporof/
# Fish 2.0 config
# Enviroment setup
set -x NODE_PATH /usr/local/lib/node_modules
set -x PATH /usr/local/bin /usr/bin /bin /usr/local/sbin /usr/sbin /sbin /usr/local/share/npm/bin $NODE_PATH
set -e fish_greeting
pid /
Created March 22, 2016 12:47 — forked from staltz/
The introduction to Reactive Programming you've been missing
pid / info.plist
Created January 8, 2016 12:50 — forked from mlynch/info.plist
Disable App Transport Security in iOS 9
This disables app transport security and allows non-HTTPS requests.
Note: it is not recommended to use non-HTTPS requests for sensitive data. A better
approach is to fix the non-secure resources. However, this patch will work in a pinch.
To apply the fix in your Ionic/Cordova app, edit the file located here:
And add this XML right before the end of the file inside of the last </dict> entry:
pid / Makefile
Last active August 29, 2015 14:18 — forked from isaacs/Makefile
# Hello, and welcome to makefile basics.
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
# Once you're done here, go to
# to learn SOOOO much more.
// Y Combinator
// makes the recursion
(function(improver) {
return (function(gen) { return gen(gen) })(
function(gen) {
return improver(function(v) {
return gen(gen)(v)