Skip to content

Instantly share code, notes, and snippets.

@jjtroberts
jjtroberts / average_php.sh
Created August 9, 2021 20:19 — forked from MiPnamic/average_php.sh
Check average Memory usage of PHP-FPM processes
#!/bin/bash
echo "Average php-fpm process memory usage:"
PHPFPM="php-fpm" # it could be just php-fpm or php-fpm-X.X (eg. php-fpm-7.1) depending on configuration
AVG=$(ps --no-headers -o "rss,cmd" -C $PHPFPM | awk '{ sum+=$1 } END { printf ("%d%s\n", sum/NR/1024,"M") }')
QTY=$(ps -ylC $PHPFPM --sort:rss | tail -n +2 | wc -l)
echo "$AVG on $QTY processes"
exit 0
@jjtroberts
jjtroberts / Response.php
Created October 17, 2020 21:05 — forked from jeffochoa/Response.php
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@jjtroberts
jjtroberts / ansible-summary.md
Created May 11, 2018 02:57 — forked from andreicristianpetcu/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of