This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Find if you do not have enough processes available for php-fpm | |
Search for php-fpm.log to find following kinds of errors suggesting you need to increase `pm.max_children` value | |
``` | |
WARNING: [pool www] server reached pm.max_children setting (35), consider raising it | |
``` | |
2. Find average memory usage per php process | |
List php fpm process by RSS. RSS (Resident Set Size) is the portion of memory occupied by a process that is held in RAM | |
``` | |
ps -ylC php-fpm --sort:rss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt install mitmproxy | |
mitmweb -p 6666 | |
# Get the ip | |
ip r | |
# Phone advanced options | |
# Setup manual proxy to the ip of laptop and port in advanced options of wifi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## View all disk partition | |
fdisk -l | |
## Displays information about block device | |
blkid | |
## Lists info about all block devices | |
lsblk | |
## Displays amount of disk space available on the file system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias vscode:update="wget https://vscode-update.azurewebsites.net/latest/linux-deb-x64/stable -O /tmp/code_latest_amd64.deb && sudo dpkg -i /tmp/code_latest_amd64.deb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Need to run composer install for a repo does not have docker? Use this | |
docker run --rm -v $(pwd):/app webdevops/php:8.0 bash -c "cd /app && composer install" | |
# Create Network | |
docker network create some-network | |
# Run the PHP Project | |
docker run --rm --name some-app -e 'WEBROOT=/var/www/html/public/' -e 'PHP_CATCHALL=1' -e "PUID=`id -u $USER`" -e "PGID=`id -g $USER`" -v $(pwd):/var/www/html/ -p 8000:80 --net=some-network richarvey/nginx-php-fpm:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect -f | |
# Filename: beanstalk-purge | |
set timeout 1 | |
spawn telnet [lindex $argv 0] [lindex $argv 1] | |
sleep 1 | |
send "use [lindex $argv 2]\n" | |
expect "USING" | |
for {set i 1} {$i < [lindex $argv 3]} { incr i 1 } { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm -rf abc.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Setting The PATH on linux | |
export PATH="$PATH:/path/to/dir" | |
Symlink to Binaries | |
sudo ln -s /path/to/binary /usr/bin/binary-name | |
### Export MYSQL database | |
> mysqldump -u [username] -p [database name] > [database name].sql | |
### Import MYSQL database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install -y curl git zsh vim &&\ | |
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb &&\ | |
sudo dpkg -i google-chrome-stable_current_amd64.deb &&\ | |
rm google-chrome-stable_current_amd64.deb | |
sudo apt-get install terminator &&\ | |
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" &&\ | |
wget https://github.com/powerline/powerline/raw/develop/font/PowerlineSymbols.otf &&\ | |
wget https://github.com/powerline/powerline/raw/develop/font/10-powerline-symbols.conf &&\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for i in $(curl "https://api.github.com/orgs/[ORGANIZATION]/repos?access_token=[TOKEN]&per_page=200" | sed '/[ ]*"ssh_url":/!d;s/[^:]*: "//;s/",$//'); do | |
git clone $i | |
done |
NewerOlder