Skip to content

Instantly share code, notes, and snippets.

View evokateur's full-sized avatar

Wesley C. Hinkle evokateur

  • Oakland CA
  • 01:32 (UTC -07:00)
View GitHub Profile
@int128
int128 / post.md
Last active August 7, 2021 04:24
How to use Ruby on Cygwin

How to use Ruby on Cygwin

It is strongly recommended to run on Linux or OS X. Maybe many problems will happen.

Prerequisite

  • Cygwin
  • apt-cyg
  • http_proxy is set if needed
@scy
scy / opening-and-closing-an-ssh-tunnel-in-a-shell-script-the-smart-way.md
Last active July 27, 2025 18:17
Opening and closing an SSH tunnel in a shell script the smart way

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