Skip to content

Instantly share code, notes, and snippets.

View BenoitDD-URIOS's full-sized avatar

Benoit Danquechin Dorval BenoitDD-URIOS

View GitHub Profile
@BenoitDD-URIOS
BenoitDD-URIOS / apache-stats.sh
Created August 22, 2018 10:41
Give some memory stats about Apache
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
processesInUse=`ps -eo command,pcpu,pmem,rss | grep apache2 | grep -v "\(root\|grep\) " | awk '{print $4;}' | while read -r; do if [ $REPLY != '0.0' ]; then
echo "val"; fi done | xargs -d"\n" | wc -w`;
systemMem=`free -m | awk '{print $2}' | awk '{print $1}' | xargs -d"\n" | awk '{print $2}'`;
ps -eo command,pcpu,pmem,rss | grep apache2 | grep -v "\(root\|grep\) " | awk '{print $6;}' | awk -v sysMem=${systemMem} -v psUse=${processesInUse} '{count = count + 1}{total = total + $1}END{printf "%-28s%7s\n%-28s%7s\n%-28s%6.0f%1s%6.1f%1s\n%-28s%6.1f%1s\n", "Active Apache Processes:", psUse, "Total Apache Processes:", (count-1), "Apache Memory Usage:", (total/1024), "M", (((total/1024)/sysMem) * 100), "%", "Apache Avg. Process Size:", ((total/1024)/count), "M"}';
echo -e "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";

Keybase proof

I hereby claim:

  • I am benoit-amo on github.
  • I am benoitdd_amosoft (https://keybase.io/benoitdd_amosoft) on keybase.
  • I have a public key whose fingerprint is 31A7 2D9A E5EF AEEF 1329 30A7 8743 75AD 9008 44A5

To claim this, I am signing this object:

@BenoitDD-URIOS
BenoitDD-URIOS / README.md
Last active October 13, 2015 12:08
ZendJobQueue 5+ documentation

Zend Job Queue class skeleton

For NetBeans auto-completion.

Installation

Replace the ZendJobQueue.php file in php/phpstubs/phpruntime directory of the NetBeans installation.

Restart NetBeans.