Skip to content

Instantly share code, notes, and snippets.

View nir0s's full-sized avatar
💭
Multiplying forces

nir0s nir0s

💭
Multiplying forces
  • Rewind
View GitHub Profile
@scy
scy / opening-and-closing-an-ssh-tunnel-in-a-shell-script-the-smart-way.md
Last active December 25, 2025 17:26
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

@audreyfeldroy
audreyfeldroy / pypi-release-checklist.md
Last active May 20, 2025 07:59
My PyPI Release Checklist
  • Update HISTORY.md
  • Commit the changes:
git add HISTORY.md
git commit -m "Changelog for upcoming release 0.1.1."
  • Update version number (can also be minor or major)
bumpversion patch
@sfreiberg
sfreiberg / gist:4515042
Created January 11, 2013 23:57
Install fpm on centos 6.x with shepherd
// install fpm on centos 6.x
yum("ruby rubygems ruby-devel")
// yum groupinstall "Development Tools"
command("gem install fpm")
@obohrer
obohrer / gist:1351906
Created November 9, 2011 16:05
Enable JMX remote
Server side :
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=1099 -Djava.rmi.server.hostname=127.0.0.1 -Djava.rmi.server.useLocalHostname=true
Client side :
Forward port 1099 ==> ssh -L 1099:localhost:1099 username@serverip
Download this logging properties file : http://blogs.oracle.com/jmxetc/resource/logging.properties
start jconsole using the downloaded properties file :
$ jconsole -debug -J"-Djava.util.logging.config.file=logging.properties" localhost:1099
@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active November 9, 2025 00:12
How to publish packages to NPM

Getting Started with NPM (as a developer)

As easy as 1, 2, 3!

Updated:

  • Aug, 08, 2022 update config docs for npm 8+
  • Jul 27, 2021 add private scopes
  • Jul 22, 2021 add dist tags
  • Jun 20, 2021 update for --access=public
  • Sep 07, 2020 update docs for npm version