netstat pid mac
having trouble identifying the pid using netstat on a mac? Try this instead: # sudo lsof -i -P This will list all open files and the current socket they are using and the actual port (using an integer).
having trouble identifying the pid using netstat on a mac? Try this instead: # sudo lsof -i -P This will list all open files and the current socket they are using and the actual port (using an integer).
Here’s a bash kill liferay script! This should kill any running liferay or liferay social office on a linux system. Open up your favorite editor and paste this in #!/bin/bash # #Script name: kill_liferay.sh # #Purpose: To kill any running…
To Gzip files older than one day place this in a cronjob: TODAY=`date +”%Y-%m-%d”` for logfile in ; do # grab the %Y-%m-%d out of the name DTS=${logfile:(-14):10} if [ $DTS != $TODAY ]; then # compress in place gzip…
To install 7zip on a 64 bit Redhat Server: # rpm -ivh # rpm -ivh
To modify ip-tables directly in ubuntu First save off your current config: $ sudo -s $ iptables-save > $ iptables-save > .to.modify At this point you can modify the file. Once your are satisfied restore it # iptables-restore <…
to kill orphaned httpd processes create a script called killhttpd.sh with the following code #!/bin/bash for pid in `ps -C httpd|sed -e ‘s/^\ \+//g’ | grep httpd|awk ‘{print $1}’` do kill $pid done
Configure postfix with Gmail via Webmin This assumes the user has webmin installed and understands how to log in and use it. (Usually bring it up in a browser at https://localhost:10000 ) Make sure that postfix is installed. In Webmin this…
Someone recently passed me this link and it looks great! You can generate crontab scripts via a website. Here’s the link:
this script will reset a user’s password and email it to them. It accepts two parameters (username) (email address) Example Usage: . someuser [email protected] #!/usr/local/bin/bash if [ $# -ne 2 ]; then echo “Please provide a username and email address”;…