As configured in my dotfiles.
start new:
tmux
start new with session name:
| //step1:初始一个counter, with help string | |
| pushCounter = prometheus.NewCounter(prometheus.CounterOpts{ | |
| Name: "repository_pushes", | |
| Help: "Number of pushes to external repository.", | |
| }) | |
| //setp2: 注册容器 | |
| err = prometheus.Register(pushCounter) | |
| if err != nil { | |
| fmt.Println("Push counter couldn't be registered AGAIN, no counting will happen:", err) |
| let regex; | |
| /* matching a specific string */ | |
| regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello" | |
| regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO" | |
| regex = /hello/g; // looks for multiple occurrences of string between the forward slashes... | |
| /* wildcards */ | |
| regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo" | |
| regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo" |
| #!/bin/bash | |
| # | |
| # Ansible role test shim. | |
| # | |
| # Usage: [OPTIONS] ./tests/test.sh | |
| # - distro: a supported Docker distro version (default = "centos7") | |
| # - playbook: a playbook in the tests directory (default = "test.yml") | |
| # - role_dir: the directory where the role exists (default = $PWD) | |
| # - cleanup: whether to remove the Docker container (default = true) | |
| # - container_id: the --name to set for the container (default = timestamp) |
| --- | |
| # This has been tested with ansible 1.3 with these commands: | |
| # ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=false" | |
| # ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=true" | |
| # ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts" | |
| # NB: The type of the variable is crucial! | |
| - name: Ansible Conditionals Examples | |
| hosts: $hosts | |
| vars_files: |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| #!/bin/bash | |
| PROGNAME=${0##*/} | |
| INPUT='' | |
| QUIET='0' | |
| NOSTATS='0' | |
| max_input_size=0 | |
| max_output_size=0 | |
| usage() |