This file contains hidden or 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
| docker system df |
This file contains hidden or 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
| # host to container | |
| docker cp 2020-5-5-11-19.bak unruffled_khayyam:/var/opt/mssql/data/ | |
| # container to host | |
| docker cp awesome_davinci:/var/opt/mssql/data/202048-12-28-43.bak . |
This file contains hidden or 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
| k rollout restart deployment frontend | |
| # k === kubectl |
This file contains hidden or 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
| select now() - xact_start as duration, * from pg_stat_activity WHERE state = 'active'; | |
| SELECT max(now() - xact_start) FROM pg_stat_activity | |
| WHERE state IN ('idle in transaction', 'active'); | |
| --- https://dba.stackexchange.com/questions/44084/troubleshooting-high-cpu-usage-from-postgres-and-postmaster-services |
This file contains hidden or 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
| rsync -avz hzn:/home/khaliq/repos/backend/docker/data/db/demo_data_05_02.sql . |
This file contains hidden or 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
| rsync my_mock.sql -avz hzn:/home/khaliq/repos/backend/docker/data/db -v |
This file contains hidden or 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
| // bash variabes | |
| repo=~/Sites/columbia-repo/ | |
| dropbox=~/Dropbox\ \(Personal\)/KJG/Personal/Education/Classes/Advanced\ Programming/homework | |
| pass=$repo/auth/.pass | |
| clic=clic:/home/kjg2150/cs3157 | |
| hw=~/Sites/columbia-repo/c/3157/hw | |
| -avz = | |
| a = archive | |
| v = verbose |
This file contains hidden or 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
| rsync -v -r --update . [email protected]:/storage/av03089/www/public_html | |
| // test with dry run | |
| rsync -v -r --update . [email protected]:/storage/av03089/www/public_html --dry-run | |
| // had to run sudo -- run from the directory you want to transfer over | |
| sudo rsync -v -r --update . [email protected]:/storage/av03089/www/public_html |
This file contains hidden or 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
| // syncing from my server to my dropbox some data files | |
| rsync -r khaliqgant:/home/kjg/finances/data "/Users/kgant/Dropbox (Personal)/KJG/Personal/Finances/App Data Backup/" |
This file contains hidden or 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
| environment=${1:-develop} | |
| FOO="${VARIABLE:=default}" | |
| https://stackoverflow.com/questions/2013547/assigning-default-values-to-shell-variables-with-a-single-command-in-bash | |
| https://stackoverflow.com/questions/9332802/how-to-write-a-bash-script-that-takes-optional-input-arguments |