We optimize for three goals:
- Clean Code
- Testability
- Fail Fast
We use a pragmatic, adapted form of hexagonal architecture: take the strengths (clear seams for change and testing) and avoid dogma (no needless layers, no over-abstraction).
| [alias] | |
| # status | |
| s = status -sb | |
| st = status | |
| # branch / checkout | |
| br = branch | |
| co = checkout | |
| sw = switch |
| @import url(http://fonts.googleapis.com/css?family=Merriweather:300italic,300); | |
| body { | |
| font-family: 'Merriweather', Georgia, serif; | |
| line-height: 1.6; | |
| color: #333; | |
| max-width: 860px; | |
| margin: 0 auto; | |
| padding: 2rem; | |
| background-color: #f9f9f9; |
| services: | |
| setup: | |
| image: docker.elastic.co/elasticsearch/elasticsearch:8.13.0 | |
| user: "0" | |
| command: > | |
| bash -c ' | |
| if [ x${ELASTIC_PASSWORD} == x ]; then | |
| echo "Set the ELASTIC_PASSWORD environment variable in the .env file"; | |
| exit 1; | |
| elif [ x${KIBANA_PASSWORD} == x ]; then |
| # 基础订阅 | |
| subscribers: | |
| nzl: &nzl !include https://path/to/your/subscription.yaml | |
| mewu: &mewu !include https://path/to/your/another/subscription.yaml | |
| proxies: &proxies !flatten | |
| - !jq { object: *nzl, filter: '[.proxies[] | (.name += "-nzl")]' } | |
| - !jq { object: *mewu, filter: '[.proxies[] | (.name += "-mewu")]' } | |
| proxy-names: &all !jq { object: *proxies, filter: '[.[].name]' } | |
| hk-proxy-names: &hk !jq { object: *all, filter: '[.[] | select(contains("香港"))]' } | |
| tw-proxy-names: &tw !jq { object: *all, filter: '[.[] | select(contains("台湾"))]' } |
I think most of us realize that macOS isn't a Linux OS, but what that also means is that instead of shipping with the GNU flavor of command line tools, it ships with the FreeBSD flavor. As such, writing shell scripts which can work across both platforms can sometimes be challenging.
Homebrew can be used to install the GNU versions of tools onto your Mac, but they are all prefixed with "g" by default.
All commands have been installed with the prefix "g". If you need to use these commands with their normal names, you can add a "gnubin" directory to your PATH from your bashrc.
| # 0. SYSTEM INFO & CLUSTER ARCH | |
| # CentOS 7 | |
| # | |
| # +------------+ +-----------+ | |
| # | k8s-master |>192.168.99.20 -- 192.168.99.21<| k8s-node1 | | |
| # +------------+ +-----------+ | |
| # v v | |
| # internet internet | |
| # | |
| # /etc/hosts |
| # see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/ | |
| # core | |
| brew install coreutils | |
| # key commands | |
| brew install binutils | |
| brew install diffutils | |
| brew install ed --default-names | |
| brew install findutils --with-default-names |
| asn1crypto==0.23.0 | |
| bleach==1.5.0 | |
| cachetools==2.0.1 | |
| certifi==2017.11.5 | |
| cffi==1.11.2 | |
| chardet==3.0.4 | |
| click==6.7 | |
| conda==4.3.31 | |
| cryptography==2.1.4 | |
| decorator==4.2.1 |