Skip to content

Instantly share code, notes, and snippets.

View qingshan's full-sized avatar

Qingshan qingshan

View GitHub Profile
@drmalex07
drmalex07 / README-setup-tunnel-as-systemd-service.md
Last active March 15, 2024 15:56
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

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 January 7, 2012 02:43
autosshd is the autossh daemon.
#!/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
#
# 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