Useful Tools

MySQL

/usr/local/scripts/pt-mysql-summary > /root/pt-mysql-summary-$(date +%FT%T%z).log

System and Security

TLS/SSL

Performance

Capturing System Performance and Status

Source: High Performance MySQL book

perfscript.sh
#!/bin/sh
 
INTERVAL=10
PREFIX=/root/var/$INTERVAL-sec-status
RUNFILE=/root/bin/perfscript.sh.running
#mysql -e 'SHOW GLOBAL VARIABLES' >> mysql-variables
while test -e $RUNFILE; do
        file=$(date +%F_%H)
        sleep=$(date +%s.%N | awk "{print $INTERVAL - (\$1 % $INTERVAL)}")
        sleep $sleep
        ts="$(date +"TS %s.%N %F %T")"
        loadavg="$(uptime)"
        echo "$ts $loadavg" >> $PREFIX-${file}-vmstat
        vmstat >> $PREFIX-${file}-vmstat
        echo "$ts $loadavg" >> $PREFIX-${file}-iostat
        iostat -xd >> $PREFIX-${file}-iostat
        echo "$ts $loadavg" >> $PREFIX-${file}-top
        COLUMNS=512 top -b -n 1 | head -n 35 >> $PREFIX-${file}-top
#       echo "$ts $loadavg" >> $PREFIX-${file}-status
#       mysql -e 'SHOW GLOBAL STATUS' >> $PREFIX-${file}-status &
#       echo "$ts $loadavg" >> $PREFIX-${file}-innodbstatus
#       mysql -e 'SHOW ENGINE INNODB STATUS\G' >> $PREFIX-${file}-innodbstatus &
#        echo "$ts $loadavg" >> $PREFIX-${file}-processlist
#       mysql -e 'SHOW FULL PROCESSLIST\G' >> $PREFIX-${file}-processlist &
        echo $ts
done
echo Exiting because $RUNFILE does not exist.

Misc

    • ping example.com | ts
  • bat
  • glances
  • nnn
  • fd
  • fzf
  • prettyping
  • tldr
  • q
    • q -H -d “;” “SELECT COUNT(*) FROM Downloads/2017-01_sds011.csv where ratioP2 > 77”
  • unix/useful-tools.txt
  • Last modified: 2019-02-11T11:11:07+0100
  • by Wolfgang