This file contains 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
from requests.adapters import HTTPAdapter, Retry | |
from requests import Session | |
retries = Retry( | |
total=5, backoff_factor=1, status_forcelist=[502, 503, 504] | |
) | |
session = Session() # reuse tcp connection | |
session.mount("http://", HTTPAdapter(max_retries=retries)) | |
session.mount("https://", HTTPAdapter(max_retries=retries)) |
This file contains 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
networksetup -setwebproxy Wi-Fi 127.0.0.1 1234 | |
networksetup -setsecurewebproxy Wi-Fi 127.0.0.1 231 | |
networksetup -setsocksfirewallproxy Wi-Fi 127.0.0.1 1232 | |
networksetup -setproxybypassdomains Wi-Fi 192.168.0.0/16 10.0.0.0/8 172.16.0.0/12 127.0.0.1 localhost *.local timestamp.apple.com sequoia.apple.com seed-sequoia.siri.apple.com | |
// proxy off | |
networksetup -setwebproxystate Wi-Fi off | |
networksetup -setsecurewebproxystate Wi-Fi off | |
networksetup -setsocksfirewallproxystate Wi-Fi off |
This file contains 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 | |
Help=$(cat <<-"HELP" | |
my-script — does one thing well | |
Usage: | |
my-script <input> <output> | |
Options: |
This file contains 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
./kafka-topics.sh \ | |
--zookeeper 192.168.96.15:2181 \ | |
--topic boxState\ | |
--describe |
This file contains 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
./kafka-consumer-groups.sh \ | |
--bootstrap-server localhost:9092 \ | |
--group managerApp \ | |
--describe |
This file contains 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
./kafka-consumer-groups.sh \ | |
--bootstrap-server 127.0.0.1:9092 \ | |
--group 0 \ | |
--reset-offsets |
This file contains 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
./kafka-consumer-groups.sh \ | |
--bootstrap-server 127.0.0.1:9092 \ | |
--group 0 \ | |
--describe |
This file contains 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 run -d \ | |
--name=manager-redis \ | |
-h manager-redis \ | |
-p 6381:6379 \ | |
daocloud.io/library/redis:3.2.9 |
This file contains 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 run -d \ | |
--name=wjmongodb \ | |
-h wjmongodb \ | |
-p 27017:27017 \ | |
-v /Users/fanwu/Workspace/Docker/manager_app/wjmongodb/data:/data/db \ | |
daocloud.io/library/mongo:3.5 |
This file contains 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 run \ | |
--name manager_app \ | |
-v /Users/fanwu/Workspace/Docker/manager_app/jar:/opt \ | |
--link wjdbmgrapp:wjdbmgrapp \ | |
--link manager-redis:manager-redis \ | |
--link wjmongodb:wjmongodb \ | |
-p 3039:3039 \ | |
manager_app:v01 |
NewerOlder