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
| Text 1 hr 28 mins โโโโโโโโโโโโโโโโโโโโโ 47.7% | |
| Other 1 hr 3 mins โโโโโโโโโโโโโโโโโโโโโ 34.4% | |
| Markdown 21 mins โโโโโโโโโโโโโโโโโโโโโ 11.8% | |
| TOML 5 mins โโโโโโโโโโโโโโโโโโโโโ 3.0% | |
| Python 4 mins โโโโโโโโโโโโโโโโโโโโโ 2.5% |