Piping Tar over SSH
Oct 25

I recently had the issue where I wanted to Tar/Gzip up a large directory but didn’t have the available space on the server, but I need to get it transfered over to another server.  So I came up with two options.  First, Tar/Gzip it and pipe it over SSH and create the tgz file on the remote host, or just pipe and extract it directly on the other host.

The first option, creating the tgz on the remote host can be accomplished by doing this

cd /my/path
tar czf – . | ssh remoteserver “cat > /new/path/file.tar.gz”

The second option, creating the tgz but extracting the contents directly on the remote host can be accomplished by doing this.

cd /my/path
tar czf – . | ssh remoteserver “cd /remote/path; tar xzf -”

Another thing you can do is if you want a path on a remote server but you want to pull it to the local server and extract it you can run the following

cd /my/path
ssh remote “cd /my/path; tar czf – .” | tar xfz -

Configuring Cisco ASA 5505 with primary & backup ISP
Mar 23

Here’s an example config for configuring an Cisco ASA5505 with primary and backup ISP’s.

ASA5505(config)# interface ethernet 0/0
ASA5505(config-if)# switchport access vlan 2
ASA5505(config-if)# no shutdown

ASA5505(config)# interface ethernet 0/1
ASA5505(config-if)# switchport access vlan 1
ASA5505(config-if)# no shutdown

ASA5505(config)# interface ethernet 0/2
ASA5505(config-if)# switchport access vlan 3
ASA5505(config-if)# no shutdown

ASA5505(config)# interface vlan 1
ASA5505(config-if)# nameif inside
ASA5505(config-if)# security-level 100
ASA5505(config-if)# ip address 192.168.1.1 255.255.255.0
ASA5505(config-if)# no shutdown

ASA5505(config)# interface vlan 2
ASA5505(config-if)# nameif primary-isp
ASA5505(config-if)# security-level 0
ASA5505(config-if)# ip address 100.100.100.1 255.255.255.0
ASA5505(config-if)# backup interface vlan 3
ASA5505(config-if)# no shutdown

ASA5505(config)# interface vlan 3
ASA5505(config-if)# nameif backup-isp
ASA5505(config-if)# security-level 1
ASA5505(config-if)# ip address 200.200.200.1 255.255.255.0
ASA5505(config-if)# no shutdown

ASA5505(config)# route primary-isp 0.0.0.0 0.0.0.0 100.100.100.2 1
ASA5505(config)# route backup-isp 0.0.0.0 0.0.0.0 200.200.200.2 2


Switch to our mobile site