Skip to content

Instantly share code, notes, and snippets.

View MiPnamic's full-sized avatar
Fast-forward

Marco Orlandin MiPnamic

Fast-forward
View GitHub Profile
@MiPnamic
MiPnamic / test_chipers.sh
Created February 9, 2022 14:42
Test a given URL with all available Cipher using OpenSSL
#!/usr/bin/env bash
# Test all ciphers against given URL
# Script by Indiv https://superuser.com/users/21867/indiv - https://superuser.com/a/224263
# OpenSSL requires the port number.
SERVER=$1
DELAY=1
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')
@MiPnamic
MiPnamic / structured-mysql-dump.sh
Last active April 12, 2022 10:09
Mysqldump a whole server with a single folder for every database and a single sql file for every table
#!/bin/bash
# this file
# a) gets all databases from mysql
# b) gets all tables from all databases in a)
# c) creates subfolders for every database in a)
# d) dumps every table from b) in a single file
# this is a mixture of scripts from Trutane (http://stackoverflow.com/q/3669121/138325)
# and Elias Torres Arroyo (https://stackoverflow.com/a/14711298/8398149)
@MiPnamic
MiPnamic / average_php.sh
Last active February 23, 2023 01:43
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
@MiPnamic
MiPnamic / keybase.md
Last active May 7, 2020 08:08
keybase.md

Keybase proof

I hereby claim:

  • I am mipnamic on github.
  • I am mipnamic (https://keybase.io/mipnamic) on keybase.
  • I have a public key whose fingerprint is 2F7B D02E 0F18 C655 8EC6 B14A FA10 F567 041B 7629

To claim this, I am signing this object: