Category: Linux

Delete files older than another file

Using the find command in *nix is very useful. You can specify that you would like to find files newer than another file, or older or newer than a certain time. You cannot (directly) find files older than another file.…

Port checker

This was useful when we testing a migration between database servers. import socket import sys for i in range(1,5): try: HOST = “foo” + str(i) PORT = 2484 print HOST + ” ” + str(PORT) sock = socket.socket() sock.connect((HOST, int(PORT)))…

Processor architecture

oracle@kcdb01:~> echo “You have $(cat /proc/cpuinfo | grep “physical id” | sort -u | wc -l) $(cat /proc/cpuinfo | grep cores | head -1 | awk ‘{print $4}’) core processors” You have 2 4 core processors oracle@kcdb01:~>