Skip to content

Instantly share code, notes, and snippets.

Avatar

Qingshan qingshan

View GitHub Profile
@drmalex07
drmalex07 / README-setup-tunnel-as-systemd-service.md
Last active Apr 17, 2021
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward
View README-setup-tunnel-as-systemd-service.md

README

Create a template service file at /etc/systemd/system/secure-tunnel@.service. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target
@qingshan
qingshan / autosshd
Created Jan 7, 2012
autosshd is the autossh daemon.
View autosshd
#!/bin/bash
#
# autosshd This script starts and stops the autossh daemon
#
# chkconfig: 2345 95 15
# processname: autosshd
# description: autosshd is the autossh daemon.
# Source function library.
. /etc/rc.d/init.d/functions
View Ruby Anonymous Class Possibilities
#
# After a discussion about the cool groovy syntax for
# declaring anonymous classes. Jim Weirich and I came up
# with the following solutions in Ruby.
#
# Requires: Ruby 1.9
#
def run(x)
x.foo
end