Difference between revisions of "Scratch pad"
Line 122: | Line 122: | ||
http://sphinxsearch.com/blog/2020/07/06/sphinx-3-3-1-released/ | http://sphinxsearch.com/blog/2020/07/06/sphinx-3-3-1-released/ | ||
Expert | Expert System search for using bash commands. | ||
http://law-expert.sourceforge.net/ | |||
Xbert program. Has xbt and know file format for guiding search or clicks. | |||
https://www.phpclasses.org/package/10346-PHP-Ask-questions-and-make-decisions-based-on-answers.html | |||
Maybe make option to use online Thesarus with PHP for search | |||
https://words.bighugelabs.com/site/api | |||
Use Synonym in natural speech search to increase page resource finds. | Use Synonym in natural speech search to increase page resource finds. |
Revision as of 02:16, 15 April 2022
This page is to keep items I will organize on the page later or ideas.
Analyse and calculate php-fpm runner settings https://megamorf.gitlab.io/2021/03/08/analyse-and-calculate-php-fpm-runner-settings/
Get average memory of the php-fpm process
ps --no-headers -o "rss,cmd" -C php-fpm | awk '{ sum+=$1 } END { printf ("%d%s\n", sum/NR/1024,"M") }'
Get memory of all php-fpm processes
ps -eo size,pid,user,command --sort -size | awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' | grep php-fpm
How many cores does server have.
echo Cores = $(( $(lscpu | awk '/^Socket/{ print $2 }') * $(lscpu | awk '/^Core/{ print $4 }') ))
php-fpm settings
https://thisinterestsme.com/php-fpm-settings/
Top 10 processes uisng memory
ps auxw|head -1;ps auxw|sort -rn -k4|head -10
Get 20 Highest mem users.
echo [PID] [MEM] [PATH] && ps aux | awk '{print $2, $4, $11}' | sort -k2rn | head -n 20
Get highest cpu users.
ps -eo pcpu,pid,user,args | sort -k 1 -r | head -20
Apache tuning.
https://hostadvice.com/how-to/how-to-tune-and-optimize-performance-of-apache/
Estimate the Thrashing Point
https://www.liquidweb.com/kb/apache-performance-tuning-swap-memory/
ps aux | grep 'httpd' | awk '{print $6/1024;}' | awk '{sum += $1;} END {print sum " MB total mem usage";}'
ps aux | grep 'httpd' | awk '{print $6/1024;}' | awk '{avg += ($1 - avg) / NR;} END {print avg " MB avg mem usage";}'
Useful shell script commands.
https://www.lancaster.ac.uk/staff/tipper/writing/luui/html/unix-intro012.html
https://www.redhat.com/sysadmin/one-line-linux-commands
Make multiple directories in one command.
mkdir -p -v /home/josevnz/tmp/{dir1,anotherdir,similardir}
Make backup via encrypted transfer:
tar --create --directory /home/josevnz/tmp/ --file - *| \
ssh raspberrypi "tar --directory /home/josevnz \
--verbose --list --file -"
Find 10 largest directories.
du -sk /var/log/* | sort -r -n | head -10
Colorize Grep
grep -i --color=auto
https://linuxcommandlibrary.com/basic/oneliners
Remove all files that dont match ext.
rm !(*.foo|*.bar|*.baz)
vi a remote file.
vi scp://username@host//path/to/somefile
Clear line in terminal
CTRL+u
so searching for "data scale" will find any results with data or with scale, "+data +scale" will only find results with both data and scale
and, thank you ignored.
stopword file list to add to ignore list.
If the innodb_ft_user_stopword_table option is set, the stopwords are taken from that table. Else, if the innodb_ft_server_stopword_table option is set, the stopwords are taken from that table. Otherwise, a built-in set of default stopwords is used."
Mediawiki rebuild index stopwords.
Types of Full-Text search IN NATURAL LANGUAGE MODE¶
https://mariadb.com/kb/en/full-text-index-overview/#in-boolean-mode
http://sphinxsearch.com/blog/2020/07/06/sphinx-3-3-1-released/
Expert System search for using bash commands.
http://law-expert.sourceforge.net/
Xbert program. Has xbt and know file format for guiding search or clicks.
https://www.phpclasses.org/package/10346-PHP-Ask-questions-and-make-decisions-based-on-answers.html
Maybe make option to use online Thesarus with PHP for search
https://words.bighugelabs.com/site/api
Use Synonym in natural speech search to increase page resource finds.
composer require hugsbrugs/php-synonym
https://github.com/hugsbrugs/php-synonym
Check to see if site has http2 enabled.
curl --http2 domain.tld
Stack track all of the php-fpm processes.
strace -f $(pgrep php-fpm | paste -s | sed -e 's/\([0-9]\+\)/-p \1/g' -e 's/\t/ /g')
Stack Trace Apache process.
ps h --ppid $(cat /var/run/apache2/httpd.pid) | awk '{print"-p " $1}' | xargs strace
Stack Trace a process and threads
strace -s 80 -fp 46339
Use strace to track process network events.
strace -e trace=%network -f $(pgrep php-fpm | paste -s | sed -e 's/\([0-9]\+\)/-p \1/g' -e 's/\t/ /g')
Use Strace to track all system calls.
strace -e trace=connect -f $(pgrep php-fpm | paste -s | sed -e 's/\([0-9]\+\)/-p \1/g' -e 's/\t/ /g')
Use strace to track all file operations
strace -s 1024 -e trace=%desc -f $(pgrep php-fpm | paste -s | sed -e 's/\([0-9]\+\)/-p \1/g' -e 's/\t/ /g')
Use strace to track all process operations
strace -s 1024 -e trace=%process -f $(pgrep php-fpm | paste -s | sed -e 's/\([0-9]\+\)/-p \1/g' -e 's/\t/ /g')
Use strace to print paths with file descriptors
strace -s 1024 -y -f $(pgrep php-fpm | paste -s | sed -e 's/\([0-9]\+\)/-p \1/g' -e 's/\t/ /g')
Use strace to print socket file descriptors.
strace -s 1024 -yy -e trace=%network -f $(pgrep php-fpm | paste -s | sed -e 's/\([0-9]\+\)/-p \1/g' -e 's/\t/ /g')