OnCommand
1 min read editmentary command line · terminal · shellDisplays the status of active connections and listening ports.
netstat -a
# alternatively
netstat -an
Find list of files opened/in-use-by a specific process(PID)
lsof -p [PID]
Find the process(PID) that is using a port
lsof -i tcp:[PORT]
# or
netstat -vanp tcp
Rename a file to md5 sum / hash with file extensions.
NOTE: this script will execute on ALL files in a directory. See Stackoverflow for more info.
#MAC
md5 * | sed -e 's/MD5 (\([^.]*\)\(.[^)]*\)) = \(.*\)$/mv -v "\1\2" \3\2/' | sh
#GNU
md5sum * | sed -e 's/\([^ ]*\) \(.*\(\..*\)\)$/mv -v \2 \1\3/e'
#BASH
md5sum * | sed -e 's/\([^ ]*\) \(.*\(\..*\)\)$/mv -v \2 \1\3/' | sh
Convert pfx (or .p12) certificate to pem
See Stackoverflow for more info.
#MAC or LINUX
openssl pkcs12 -in cert.pfx -out cert.pem -nodes
Disagree? Did I miss something? Comment below
.comments powered by Disqus