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 images --format "{{.Repository}}:{{.Tag}}" | grep ':latest' | xargs -L1 docker pull; |
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
| # Fix dylib for MySQL image not load | |
| # Library not loaded: /usr/local/opt/mysql/lib/libssl.1.1.dylib | |
| # Library not loaded: /usr/local/opt/mysql/lib/libcrypto.1.1.dylib | |
| # image not load | |
| ln -s /usr/local/opt/openssl/lib/libssl.1.1.dylib /usr/local/opt/mysql/lib/libssl.1.1.dylib | |
| ln -s /usr/local/opt/openssl/lib/libcrypto.1.1.dylib /usr/local/opt/mysql/lib/libcrypto.1.1.dylib |
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
| Shortcut Action | |
| Navigation | |
| Ctrl + a Go to the beginning of the line. | |
| Ctrl + e Go to the end of the line. | |
| Alt + f Move the cursor forward one word. | |
| Alt + b Move the cursor back one word. | |
| Ctrl + f Move the cursor forward one character. | |
| Ctrl + b Move the cursor back one character. | |
| Ctrl + x, x Toggle between the current cursor position and the beginning of the line. | |
| Editing |
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
| // source : https://stackoverflow.com/a/58406183/1606462 | |
| CommandLineFu had this one liner to run an SMTP server on port 25: | |
| sudo python -m smtpd -n -c DebuggingServer localhost:25 | |
| This will run a fake smtp server on your local machine. It won't send anything, but will dump it to the console. |
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
| #!/bin/bash | |
| yy=2018 | |
| for m in `seq 1 12`; do | |
| mm=$(printf %02.0f $m) | |
| max_date=$(cal $(date +"${mm} ${yy}") | awk 'NF {DAYS = $NF}; END {print DAYS}') | |
| for d in `seq 1 $max_date`; do | |
| dd=$(printf %02.0f $d) | |
| echo "paht/to/script.sh $yy $mm $dd" | |
| # sleep 1 |
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
| # method 1 use `find` | |
| find '/path/to/somewhere/' -name '*.txt' -exec grep -e 'pattern' {} \; -print | |
| # method 2 use `grep` | |
| grep -rnw '/path/to/somewhere/' -e "pattern" |
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 procpid, current_query, waiting, waiting_reason, query_start FROM pg_stat_activity WHERE (now() - pg_stat_activity.query_start) > interval '5 minutes' AND current_query != '<IDLE>' ORDER BY query_start DESC LIMIT 100; |
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
| ps aux | grep "airflow run" | grep -v grep | awk '{print $2}' | xargs kill -9 |
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
| #!/bin/bash | |
| # source : https://stackoverflow.com/a/44757040/1606462 | |
| (echo "COMM PID SWAP"; for file in /proc/*/status ; do awk '/^Pid|VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | grep kB | grep -wv "0 kB" | sort -k 3 -n -r) | column -t |
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
| find /opt/hadoop/tmp -mmin +360 -exec rm {} \; |