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 | |
| # Dependency: password-less SSH login | |
| # | |
| # Define server array (easily extensible) | |
| servers=( | |
| "server-1" | |
| "server-2" | |
| "server-3" | |
| ) |
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 | |
| # Dependency: | |
| # 1. rsync: yum/apt install -y rsync | |
| # 2. password-less SSH login | |
| # | |
| # 0. Define server list | |
| servers=("server-1" "server-2" "server-3") | |
| # 1. check param num |
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
| function notifyResult () { | |
| if [ $? -eq 0 ]; then | |
| osascript -e 'display notification "The command finished" with title "Success"' | |
| else | |
| osascript -e 'display notification "The command failed" with title "Failed"' | |
| fi | |
| } |
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 | |
| # ๅธฎๅฉๅฝๆฐ | |
| show_help() { | |
| echo "Usage: $0 [Option] [message]" | |
| echo "Show system notification" | |
| echo | |
| echo "Option:" | |
| echo " -h, --help Show help info" | |
| echo " -t, --title TITLE Set notification title (Default: Notify)" |
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
| // ็ฎๅๅช่ฝๅจnightly็ๆฌไธไฝฟ็จ | |
| #![allow(incomplete_features)] | |
| #![feature(generic_const_exprs)] | |
| fn something<T>(val: T) | |
| where | |
| Assert<{ core::mem::size_of::<T>() < 768 }>: IsTrue, | |
| // ^-----------------------------^ ่ฟ้ๆฏไธไธช const ่กจ่พพๅผ๏ผๆขๆๅ ถๅฎ็ const ่กจ่พพๅผไนๅฏไปฅ | |
| { | |
| // |
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
| # Install K3S | |
| curl -sfL https://get.k3s.io | sh - | |
| # Copy k3s config | |
| mkdir $HOME/.kube | |
| sudo cp /etc/rancher/k3s/k3s.yaml $HOME/.kube/config | |
| sudo chmod 644 $HOME/.kube/config | |
| # Check K3S | |
| kubectl get pods -n kube-system |
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
| # CentOS | |
| history | awk '{CMD[$4]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10 | |
| # Ubuntu | |
| history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10 | |
| # MacOS(zsh) | |
| history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10 |
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
| Java 2 hrs 46 mins โโโโโโโโโโโโโโโโโโโโโ 27.8% | |
| JavaScript 2 hrs 3 mins โโโโโโโโโโโโโโโโโโโโโ 20.6% | |
| YAML 1 hr 13 mins โโโโโโโโโโโโโโโโโโโโโ 12.2% | |
| Vue.js 59 mins โโโโโโโโโโโโโโโโโโโโโ 10.0% | |
| Python 43 mins โโโโโโโโโโโโโโโโโโโโโ 7.3% |