tar extracting to a target directory

By default untaring will put the contents into the current directory.
Sometimes it is not desirable to change directory to the target (such as in a scrip).

tar -xvvf /source/tarfile.tar -C /target

This will extract(x), very verbosly(vv) the file(f) /source/tarfile.tar to the directory(-C) /target (it will change the output folder to /target (so make sure it exists).

What program is using port x?

netstat can be used to figure out what program is using a port.

$ netstat -nlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1096/sshd
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1733/apache2
tcp6       0      0 :::22                   :::*                    LISTEN      1096/sshd
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node   PID/Program name    Path
unix  2      [ ACC ]     STREAM     LISTENING     6338     1071/gdm-simple-sla @/tmp/gdm-greeter-LvjLQPzT
unix  2      [ ACC ]     STREAM     LISTENING     5165     1072/X              /tmp/.X11-unix/X0

If you have a lot open then grep can be used to only find what you are looking for

netstat -nlp|grep :22
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1096/sshd
tcp6       0      0 :::22                   :::*                    LISTEN      1096/sshd

For windows, simply start with

netstat -n

Showing (and/or) Clearing the arp cache

The arp cache should (normally) be cleared within 20 minutes (or less, this depends on what platform is used).

If you don’t know what ARP is and what is is good for, then perhaps you should take a moment and read the man page:

DESCRIPTION
Arp manipulates or displays the kernels IPv4 network neighbor cache. It can add entries to the table, delete one or display the current content.
 
ARP stands for Address Resolution Protocol, which is used to find the media access control address of a network neighbor for a given IPv4 Address.

On a windows platform to show the arp cache

C:\> arp -a
Interface: 192.168.1.49 --- 0xb
  Internet Address      Physical Address      Type
  192.168.1.29          00-1d-92-08-49-25     dynamic
  192.168.1.34          00-24-81-85-ab-b6     dynamic

To clear the cache

C:\>netsh interface ip delete arpcache
Ok.

To show the arp cache on a nix machine:

$  arp -vn; cat /proc/net/arp
Address                  HWtype  HWaddress           Flags Mask            Iface
192.168.1.254            ether   00:08:ae:09:20:a0   C                     eth0
IP address       HW type     Flags       HW address            Mask     Device
192.168.1.254    0x1         0x2         00:08:ae:09:20:a0     *        eth0

To clear the apr cache on a nix machine.

$  ip neigh flush all

unqualified host name ([something]) unknow; sleeping for retry

sendmail expects to the machine to have a FQDN (fully qualified domain name).

If it does not have that (type “hostname” to check what name the machine has) sendmail will complain about this and take a loot of extra time trying to find it.

To use a FQDN edit “/etc/hosts” and change [something] to [something.yourdomain.com] and this will go away. Updating “/etc/hostname” at the same time might be a good idea; don’t forget to run “/bin/hostname -F /etc/hostname” after updating /etc/hostname.