From be5ac939c446b32ad7ff83c7b7628e4a7c4fa775 Mon Sep 17 00:00:00 2001 From: nojhan Date: Tue, 5 Jul 2022 09:47:27 +0200 Subject: [PATCH] fix: use python 3.8+ interface --- README.md | 17 +++++++++++++++-- tunnelmon.py | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 93f3929..6d31da1 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,9 @@ It can print the current state of your tunnels or display them in an interactive `tunnelmon` targets Linux operating systems, and depends on: * `openssh-client` -* `python3` +* `python` version 3.8 at least. -You may want to install the recommend pacages also: +You may also want to install the recommend packages: * `autossh` @@ -62,3 +62,16 @@ Keyboard commands: * `N`: Show the network connections related to each tunnel instances. * `Q`: Quit tunnelmon. + +## SSH Tunnels in a nutshell + +To open a tunnel to port 1234 of `server` through a `host` reached on port 4567: +```sh +ssh -N host -L4567:server:1234 +``` +You may add `-f` to run ssh in the background. + +Autossh can restart tunnels for you, in case they crash: +̏``` +autossh -f host -L4567:server:1234 +``` diff --git a/tunnelmon.py b/tunnelmon.py index b50aafd..ff178dd 100755 --- a/tunnelmon.py +++ b/tunnelmon.py @@ -376,7 +376,7 @@ class CursesMonitor: self.display() # first update counter - self.last_update = time.clock() + self.last_update = time.perf_counter() self.last_state = None self.log_ticks = ""