How to find your external IP

Today I needed to know external IP of the server where I was login to (through the jumphost). And I found pretty easy way to do that in a command line:


[user@host ~]$ curl ifconfig.me
11.22.33.44

How to find your external IP

Today I needed to know external IP of the server where I was login to (through the jumphost). And I found pretty easy way to do that in a command line:


[user@host ~]$ curl ifconfig.me
11.22.33.44

Script for ssh port forwarding

Day to day I need to use ssh port forwarding and connect securely to my work servers. So I decided to create some simple bash script which will allow me to forward port via ssh and to kill previous tunnel if it freezed.

Script source:


#!/bin/bash
# irc.sh
kill -9 `ps -aef | grep -i 'ssh -f -N -L 1234:127.0.0.1:1234 user@hostname.com' | grep -v grep | awk '{print $2}'`
ssh -f -N -L 1234:127.0.0.1:1234 user@hostname.com

Continue reading