Bash Script參考:有用BASH腳本的集合

git clone https://github.com/alexanderepstein/Bash-Snippets

cd Bash-Snippets/

檢視所有命令,進入相關目錄,便可執行命令

ls
CODE_OF_CONDUCT.md  bash-snippets         cloudup         geo         newton       skeleton       todo
CONTRIBUTING.md     bash-snippets.1       crypt           install.sh  pwned        skeleton.bats  transfer
LICENSE             bash-snippets.1.ronn  cryptocurrency  lyrics      qrify        stocks         uninstall.sh
README.md           changelog.md          currency        meme        short        taste          weather
bak2dvd             cheat                 extras          movies      siteciphers  tests          ytview
sudo ./install.sh all

一個簡易的應用例子 wheather 台南市

 weather 台南市
天氣預報: 台南市

               薄雾
  _ - _ - _ -  21 °C          
   _ - _ - _    7 km/h       
  _ - _ - _ -  5 km           
               0.0 mm         
                                                       ┌─────────────┐                                                       
┌──────────────────────────────┬───────────────────────┤  一 16 12月 ├───────────────────────┬──────────────────────────────┐
             早上                          中午      └──────┬──────┘       晚間                                        
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
    \  /       局部多云           \  /       局部多云            \   /     晴朗                \   /     晴朗           
│  _ /"".-.     23..25 °C      │  _ /"".-.     26..27 °C      │      .-.      24..26 °C      │      .-.      20 °C          │
│    \_(   ).   ↖ 6-7 km/h     │    \_(   ).   ↘ 10-12 km/h   │   ― (   ) ―   ↗ 13-17 km/h   │   ― (   ) ―   ↓ 7-8 km/h     │
│    /(___(__)  10 km          │    /(___(__)  10 km          │      `-’      10 km          │      `-’      10 km          │
│               0.0 mm | 0%    │               0.0 mm | 0%    │     /   \     0.0 mm | 0%    │     /   \     0.0 mm | 0%    │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
                                                       ┌─────────────┐                                                       
┌──────────────────────────────┬───────────────────────┤  二 17 12月 ├───────────────────────┬──────────────────────────────┐
             早上                          中午      └──────┬──────┘       晚間                                        
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
     \   /     晴天                \   /     晴天                \   /     晴朗                \   /     晴朗           
│      .-.      24..26 °C      │      .-.      27 °C          │      .-.      26..27 °C      │      .-.      25..26 °C      │
│   ― (   ) ―   ↖ 8-10 km/h    │   ― (   ) ―   ↘ 13-15 km/h   │   ― (   ) ―   ↗ 18-26 km/h   │   ― (   ) ―   ↓ 15-22 km/h   │
│      `-’      10 km          │      `-’      10 km          │      `-’      10 km          │      `-’      10 km          │
│     /   \     0.0 mm | 0%    │     /   \     0.0 mm | 0%    │     /   \     0.0 mm | 0%    │     /   \     0.0 mm | 0%    │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
                                                       ┌─────────────┐                                                       
┌──────────────────────────────┬───────────────────────┤  三 18 12月 ├───────────────────────┬──────────────────────────────┐
             早上                          中午      └──────┬──────┘       晚間                                        
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
    \  /       局部多云            \   /     晴天               \  /       局部多云           \  /       局部多云       
│  _ /"".-.     24..26 °C      │      .-.      26..27 °C      │  _ /"".-.     24..26 °C      │  _ /"".-.     23..25 °C      │
│    \_(   ).   ↖ 8-9 km/h     │   ― (   ) ―   ↘ 12-14 km/h   │    \_(   ).   ↗ 21-27 km/h   │    \_(   ).   ↓ 16-21 km/h   │
│    /(___(__)  10 km          │      `-’      10 km          │    /(___(__)  10 km          │    /(___(__)  10 km          │
│               0.0 mm | 0%    │     /   \     0.0 mm | 0%    │               0.0 mm | 0%    │               0.0 mm | 0%    │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
地点: 臺南市, Taiwan [22.9912348,120.184982]

geo 取得IP資訊

geo -wlrdgm wlp4s0
120.115.4.29 192.168.43.63
172.17.0.1
192.168.43.1
127.0.0.53
Taiwan

Fenjihu

TANET
120.115.4.29
ac:fd:ce:f7:7a:1a

顯示Linux命令速查表 cheat curl

cheat curl
# Download a single file
curl http://path.to.the/file

# Download a file and specify a new filename
curl http://example.com/file.zip -o new_file.zip

# Download multiple files
curl -O URLOfFirstFile -O URLOfSecondFile

# Download all sequentially numbered files (1-24)
curl http://example.com/pic[1-24].jpg

# Download a file and follow redirects
curl -L http://example.com/file

# Download a file and pass HTTP Authentication
curl -u username:password URL 

# Download a file with a Proxy
curl -x proxysever.server.com:PORT http://addressiwantto.access

# Download a file from FTP
curl -u username:password -O ftp://example.com/pub/file.zip

# Get an FTP directory listing
curl ftp://username:password@example.com

# Resume a previously failed download
curl -C - -o partial_file.zip http://example.com/file.zip

# Fetch only the HTTP headers from a response
curl -I http://example.com

# Fetch your external IP and network info as JSON
curl http://ifconfig.me/all/json

# Limit the rate of a download
curl --limit-rate 1000B -O http://path.to.the/file

# POST to a form
curl -F "name=user" -F "password=test" http://example.com

# POST JSON Data
curl -H "Content-Type: application/json" -X POST -d '{"user":"bob","pass":"123"}' http://example.com

# POST data from the standard in / share data on sprunge.us
curl -F 'sprunge=<-' sprunge.us

看youtube:ytview -s bashscript

產生 QRcode : qrify

qrify
Qrify
Description: Converts strings or URLs into a QR code.
Usage: qrify [stringtoturnintoqrcode]
    -u  Update Bash-Snippet Tools
    -m  Enable multiline support (feature not working yet)
    -h  Show the help
    -v  Get the tool version
    -f  Store the QR code as a PNG file
    -d  Decode the QR code from a PNG/GIF/JP(E)G file
Examples:
    qrify this is a test string
    qrify -m two\\nlines
    qrify github.com (no http:// or https://)
    qrify -f fileoutputName google.com
    qrify -d fileName.png

qrify 你好,卓國興
█████████████████████████████████
█████████████████████████████████
████ ▄▄▄▄▄    █▄▀ ▀██ ▄▄▄▄▄ ████
████      ▀▄ ███▄      ████
████ █▄▄▄█ █▀██▀▀█ ▀██ █▄▄▄█ ████
████▄▄▄▄▄▄▄█▄▀▄█ █▄▀ █▄▄▄▄▄▄▄████
████  █▀  ▄▀█▀▀▄▀▄  ▀██▄█▄▄▄▄████
████▀▄▀▀▀█▄ ██▀  ▄█▀██▀▀▄▄▄▄████
████▀█ ▀▄▄▄ ▄▀▄█▄ ▀▄██▀ ▄▀▄ █████
███████ ▀▄▄▀▀█ █▀█▀▀▄█▄▀▀▀▄ ▄████
████▄▄██▄█▄▄ ▀█▄▀▄▄  ▄▄▄ ▀▄▄▄████
████ ▄▄▄▄▄ █▀▄     █▄█ ▀▄█ ████
████     █▄▀▄█▄  ▄▄▄▄▄   ████
████ █▄▄▄█ █▀▄▀█▀█▀▀▄▀█▀ █▄ █████
████▄▄▄▄▄▄▄█▄▄█▄█▄▄▄▄▄████▄▄▄████
█████████████████████████████████
█████████████████████████████████

網站加密格式資源 :siteciphers google.com

siteciphers google.com

TLS_AES_256_GCM_SHA384 - YES
TLS_CHACHA20_POLY1305_SHA256 - YES
TLS_AES_128_GCM_SHA256 - YES
ECDHE-ECDSA-AES256-GCM-SHA384 - YES
ECDHE-RSA-AES256-GCM-SHA384 - YES
DHE-DSS-AES256-GCM-SHA384 - YES
DHE-RSA-AES256-GCM-SHA384 - YES
ECDHE-ECDSA-CHACHA20-POLY1305 - YES
ECDHE-RSA-CHACHA20-POLY1305 - YES
DHE-RSA-CHACHA20-POLY1305 - YES
ECDHE-ECDSA-AES256-CCM8 - YES
ECDHE-ECDSA-AES256-CCM - YES
DHE-RSA-AES256-CCM8 - YES
DHE-RSA-AES256-CCM - YES

Last updated