Example JS for populating select
menus with US states and the all the cities in it. The city select
will be updated based on the selected state.
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
# Brew commands | |
brew cleanup | |
rm -rf $(brew --cache) |
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
# Check loaded config | |
php --ini | |
# PHP Info | |
php -i | |
# Restart PHP-FPM | |
systemctl restart php-fpm.service | |
systemctl restart php5-fpm.service # version specific |
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
# Download the SSL certificate from a website | |
echo | openssl s_client -servername NAME -connect HOST:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > FILENAME.cer | |
# copy ssh keys to remote server | |
ssh-copy-id remote_username@server_ip_address | |
# output recent server log | |
# https://explainshell.com/explain?cmd=tail+-f+%2Fpath%2Fto%2Flogs%2Ferror.log+%7C+grep+%27string%27 | |
tail -f /path/to/logs/error.log | grep 'string' | |
cat /path/to/logs/error.log | grep 'string' |
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
# a typical rsync file transfer upload command | |
# https://explainshell.com/explain?cmd=rsync+-uavl+--exclude-from%3D%27exclude-list%27+--delete+.%2F+%24USER%40%24HOST%3A%24UPLOAD_PATH | |
rsync -uavl --exclude-from='exclude-list.txt' --delete ./ user@host:/upload/path | |
# rsync copy folders | |
rsync -avzh --exclude=dir/ /source /destination/ | |
# rsync download remote directory | |
rsync -avzh user@host:/target/path ./destination |
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
# check repo size | |
git count-objects -vH | |
# clone a mirror copy of a repo | |
git clone --mirror <repo-url> | |
# git merge dry run | |
git merge --no-commit --no-ff branch_name | |
# git export as zip |
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
# Start | |
sudo systemctl start nginx | |
sudo service nginx start | |
# Stop | |
sudo systemctl stop nginx | |
sudo service nginx stop | |
# Restart | |
sudo systemctl restart nginx |
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
# Ubuntu | |
sudo service apache2 start | |
sudo service apache2 stop | |
sudo service apache2 restart | |
# CentOS 7.x or newer | |
sudo systemctl start httpd.service | |
sudo systemctl stop httpd.service | |
sudo systemctl restart httpd.service |
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
# check active services | |
# https://explainshell.com/explain?cmd=ps+aux+%7C+grep+%27string%27 | |
ps aux | grep 'service_name' | |
ps -ef | grep service_name | |
# check unix OS | |
cat /etc/os-release | |
hostnamectl | |
lsb_release -a # might not work in every distro |
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
# EditorConfig is awesome: https://EditorConfig.org | |
root = true | |
[*] | |
end_of_line = lf | |
insert_final_newline = true | |
indent_style = tab | |
indent_size = 4 |
NewerOlder