Posts

Showing posts from 2013

CVS: Changing from extssh to ext

Linux:
find . -name Root -exec sed -i 's/extssh/ext/' {} \;

OSX:
find . -name 'Root' | xargs perl -pi -e 's/extssh/ext/g'

Reverse SSH - Poor man site-to-site communication

Taken from http://toic.org/blog/2009/01/18/reverse-ssh-port-forwarding/

Real life example
I will assume that home PC is connected via dynamically assigned IP address. First thing you will need to make sure you have ssh server installed on your home PC and it should be accessible from Internet. If you have some NAT routers, be sure to forward port 22 to your home PC. Secondly you will need to setup a dyndns account so you can connect to your home PC regardless of IP address changes. Now the goal will be to connect to ssh server on our office PC. so the port in question will be 22 if you wish to forward another port change it in your configuration accordingly. For the purpose of this example i will name my home PC: bhome.dyndns.com office computer name will be bwork.office.com bwork computer uses private IP range of 192.168.0.0/24 with address 192.168.0.100 So if the firewall is preventing outside connections to our bwork computer we must initiate connection from it. We can do this with s…

HOW-TO: Virtual Serial ports in Linux

The below instructions are targeted toward CentOS but should work on other Linux Distributions.
This HOW-TO shows how to create 2 virtual serial ports that are linked together as if they were 2 physical serial ports linked together using a NULL-modem cable.
1. Install socat yum install socat
2. Run socat in a screen instance screen socat -d -d pty,raw,echo=0 pty,raw,echo=0
You will see something like this on your screen 2012/11/15 15:52:43 socat[24000] N PTY is /dev/pts/2 2012/11/15 15:52:43 socat[24000] N PTY is /dev/pts/3 2012/11/15 15:52:43 socat[24000] N starting data transfer loop with FDs [3,3] and [5,5]
Your first serial port is /dev/pts2 and your 2nd serial port is /dev/pts/3 (those port path can be different from this example). Those will remain linked as long as the socat program is running. Press CTRL-A d in order to detach from this scree instance
3. Configure and run your first application using /dev/pts/2
4. Configure and run your second application using /dev/pts/3
Voila your 2 appli…