toml .bldr.toml

.bldr.toml
[nodejs_demo]
plan_path = "nodejs_demo/habitat"

toml haproxy_update.toml

haproxy_update.toml
[status]
enabled = true

toml nodjs_update.toml

nodjs_update.toml
[css]
background_color = 'green'

toml default.toml

default.toml
mongodb_database = "demo"

[server]
port = "8080"
shutdown-port = "8005"
redirect-port = "8443"

toml traefik.toml

traefik.toml
defaultEntryPoints = ["http", "https"]
[web]
address = ":8080"
  [web.auth.basic]
  users = ["admin:$apr1$JIigA50X$09nzP0.bdFoh6vv/vLM040"]
[entryPoints]
  [entryPoints.http]
  address = ":80"
    [entryPoints.http.redirect]
    entryPoint = "https"
  [entryPoints.https]
  address = ":443"
    [entryPoints.https.tls]
[acme]
email = "malabya@specbee.com"
storage = "acme.json"
entryPoint = "https"
onHostRule = true
onDemand = false

toml Traefik

docker-compose.yml
version: '3'

services:

  traefik:
    image: traefik:1.7
    labels:
      - traefik.enable=true
      - traefik.docker.network=proxy
      - traefik.frontend.rule=Host:traefik.178.128.83.195.xip.io
      - traefik.port=8080
    ports:
      - 80:80
      - 443:443
    restart: always
    networks:
      - proxy
    volumes:
      - ./traefik.toml:/etc/traefik/traefik.toml
      - /var/run/docker.sock:/var/run/docker.sock
      - ./acme.json:/acme.json

networks:
  proxy:
    external: true
traefik.toml
debug = false

logLevel = "ERROR"
defaultEntryPoints = ["https","http"]

[entryPoints]
  [entryPoints.http]
    address = ":80"
  [entryPoints.http.redirect]
    entryPoint = "https"
  [entryPoints.https]
    address = ":443"
  [entryPoints.https.tls]

[retry]

[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "178.128.83.195.xip.io"
watch = true
exposedByDefault = false

[acme]
email = "dmitry.a@buzzwoo.de"
storage = "acme.json"
entryPoint = "https"
onHostRule = true

[acme.httpChallenge]
entryPoint = "http"

[entryPoints.traefik]
address = ":8080"
[entryPoints.traefik.auth.basic]
users = ["admin:$apr1$EkWsXgFM$hIRvu3XQK4ni.saAbd7qp/"]

[api]
entryPoint = "traefik"

toml .toml

.toml
[tool.poetry]
name = "lqd-server"
version = "0.1.1"
description = ""
authors = ["Gennadiy Popov <gennadiy.popov.87@yandex.ru>"]

[tool.poetry.dependencies]
python = "^2.7"
django = "^2.1"

[tool.poetry.dev-dependencies]

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"

toml 描述

描述

pet-snippet.toml
[[snippets]]
  description = "Openssl client connect"
  command = "echo  | openssl s_client -connect <domain>:443"
  tag = ["openssl"]
  output = ""

[[snippets]]
  description = "Openssl quick benchmark for new and tls reuse handshakes"
  command = "openssl s_time -connect <domain>:443  -time 1"
  tag = ["openssl"]
  output = ""

[[snippets]]
  description = "Github update executable flag for already commited file."
  command = "git update-index --chmod=+x <filename>"
  tag = ["git"]
  output = ""

[[snippets]]
  description = "Grep IP addresses"
  command = "grep -o '[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}' <filename>"
  tag = ["grep", "regex"]
  output = ""

[[snippets]]
  description = "Install docker on linux"
  command = "curl -fsSL get.docker.com | sh -x"
  tag = ["docker", "install"]
  output = ""

[[snippets]]
  description = "rvm install"
  command = "gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB && \\curl -sSL https://get.rvm.io | bash -s stable"
  tag = ["ruby", "install"]
  output = ""

[[snippets]]
  description = "Date formatting in shell"
  command = "DATE=`date '+%Y-%m-%d %H:%M:%S'`"
  tag = ["date"]
  output = ""

[[snippets]]
  description = "Time formatting with Ruby"
  command = "ruby -e 'puts Time.now.strftime(\"%Y%M%d%H%M%S\")'"
  tag = ["date", "ruby"]
  output = ""

[[snippets]]
  description = "Average with awk"
  command = "seq 5 | awk '{ sum+=$1} END { printf \"%0.3f\\n\",sum/$NF }'"
  tag = ["awk", "shell", "average"]
  output = ""

[[snippets]]
  description = "Run command 5 times"
  command = "seq 5 | xargs -I@ -n1 echo \"-- @ --\""
  tag = ["shell"]
  output = ""

[[snippets]]
  description = "Extract RPM"
  command = "rpm2cpio <rpm_file> | cpio -idmv"
  tag = ["rpm"]
  output = ""

[[snippets]]
  description = "Check keepalive for site"
  command = "curl -Iv <site>  2>&1 | grep -i 'connection #0'"
  tag = ["curl", "shell", "keepalive"]
  output = ""

[[snippets]]
  description = "cat filename with hidden characters"
  command = "cat -vet <filename>"
  tag = ["cat", "shell"]
  output = ""

[[snippets]]
  description = "Docker steal container clean up"
  command = "docker ps -a | awk '{print $1}' | grep -v CON | xargs  -I@ docker rm @  && docker images | grep none | awk '{print $3}' | xargs -I@ docker rmi @"
  tag = ["docker", "shell"]
  output = ""

[[snippets]]
  description = "sar ethernet interface traffic"
  command = "sar -n DEV"
  tag = ["sar", "network"]
  output = ""

[[snippets]]
  description = "strace to provide system call stats"
  command = "sudo strace -T -c -f  -p <pid>"
  tag = ["strace", "shell", "systemcall"]
  output = ""

[[snippets]]
  description = "date epoc back and forth conversion"
  command = "date '+%s'  && date -d @<epoc>"
  tag = ["date", "shell"]
  output = ""

[[snippets]]
  description = "always stumble with these cops urls"
  command = "https://<cops_service>.stg.vidops.internal.justin.tv/health"
  tag = ["cops"]
  output = ""

[[snippets]]
  description = "docker build no chache"
  command = "docker build --no-cache -t <name> ."
  output = ""

[[snippets]]
  description = "aws cloudwatch log fetch"
  command = "aws logs get-log-events --log-group-name <group_name>  --log-stream-name <stream_name>"
  output = ""

[[snippets]]
  description = "aws cloudwatch get log streams and other information"
  command = "aws logs describe-log-streams --log-group-name <group_name>"
  output = ""

[[snippets]]
  description = "aws cloudwatch delete logs"
  command = "aws logs delete-log-stream --log-group-name <group_name>  --log-stream-name <stream_name>"
  output = ""

[[snippets]]
  description = "Find out file belongs to which debian package"
  command = "dpkg -S <filename>"
  tag = ["dpkg"]
  output = ""

[[snippets]]
  description = "find out column number for further awk parsing"
  command = "head -1 <file>  | tr \" \" \"\\n\" | nl"
  tag = ["awk", "bash", "nl"]
  output = ""

[[snippets]]
  description = "Provides socke opt flags"
  command = "sudo ss  -l -p  --extended --memory  --info"
  tag = ["ss", "network"]
  output = ""

[[snippets]]
  description = "git rebase interactive to rewrite history"
  command = "git rebase -i HEAD~<commit_number>"
  tag = ["git"]
  output = ""

[[snippets]]
  description = "git checkout and track remote branch locall"
  command = "git checkout --track origin/<name_of_remote_branch>"
  tag = ["git"]
  output = ""

[[snippets]]
  description = "swap entrypoint"
  command = "docker run -t -i  --entrypoint \"bash\" <container_image>"
  tag = ["docker"]
  output = ""

[[snippets]]
  description = "setup process in real time prioiry"
  command = "sudo chrt -r -p <prio_range_1_to_99> <PID>"
  tag = ["chrt", "scheduling"]
  output = ""

[[snippets]]
  description = "sed inline replacement"
  command = "sed -i '' 's/<str>/<replace_str>/g'  <filename>"
  tag = ["sed", "shell"]
  output = ""

[[snippets]]
  description = "capture TLS handshake packets only"
  command = "tcpdump -ni eth0 \"tcp port 443 and (tcp[((tcp[12] & 0xf0) >> 2)] = 0x16)\""
  tag = ["tcpdump"]
  output = ""

[[snippets]]
  description = "setup all CPU cores in performance mode"
  command = "echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor"
  tag = ["shell", "performance"]
  output = ""

[[snippets]]
  description = "get power draw for server"
  command = "sudo ipmi-dcmi --get-system-power-statistics"
  tag = ["ipmi"]
  output = ""

[[snippets]]
  description = "varnish param modification during runtime"
  command = "sudo varnishadm -n /dev/shm/varnish/ param.set timeout_idle 60"
  tag = ["varnish"]
  output = ""

[[snippets]]
  description = "setup golang env"
  command = "export GOROOT=<go_path> && mkdir $HOME/goworkspace && export GOPATH=$HOME/goworkspace && export PATH=$PATH:$GOROOT/bin:$GOPATH/bin"
  tag = ["golang"]
  output = ""

[[snippets]]
  description = "pass command line options for script which piped to bash shell"
  command = "script.sh | sudo bash -s --  --cmd_option for_script.sh"
  tag = ["bash", "shell"]
  output = ""

[[snippets]]
  description = "Install gem from private repo"
  command = "gem install <GEM> --no-rdoc --no-ri  --source https://gem.internal.justin.tv/"
  tag = ["gem", "ruby"]
  output = ""

[[snippets]]
  description = "no wrap of text"
  command = "less -S"
  tag = ["less", "shell"]
  output = ""

[[snippets]]
  description = "ruby named capture ,  m[:area] # => \"555\""
  command = "m = \"555-333-7777\".match(/(?<area>\\d{3})-(?<city>\\d{3})-(?<number>\\d{4})/)"
  tag = ["ruby"]
  output = ""

[[snippets]]
  description = "watch pkt flow on interface"
  command = "watch -n 1 -d \"ethtool -S <iface> | egrep rx.*pack\""
  tag = ["ethtool"]
  output = ""

[[snippets]]
  description = "run filebeat with BATCH priority and attach task to 8th core"
  command = "/usr/bin/taskset 0x00000007 /usr/bin/chrt -b 0  /usr/bin/filebeat -c /etc/filebeat/filebeat.yml"
  tag = ["taskset", "chrt", "affinity"]
  output = ""

[[snippets]]
  description = "tmux to run script and exit , useful with long running command to start over ssh"
  command = "tmux new -d 'script.sh |& tee tmux.log'"
  tag = ["ssh", "tmux", "remote_exec"]
  output = ""

[[snippets]]
  description = "Intel quicksync P580 existance"
  command = "lspci -nn -s 0:02.0"
  tag = ["intel", "quicksync"]
  output = ""

[[snippets]]
  description = "checkout given tag"
  command = "git checkout tags/<TAG_NAME>"
  tag = ["git", "tag"]
  output = ""

[[snippets]]
  description = "start synflood with hping procs equivalent to CPU cores"
  command = "for i in `seq 1 \\`lscpu  | grep -e '^CPU(s):' | awk -F: '{print $2}'\\``; do sudo hping3 -S --flood --rand-source -p 1234 10.23.32.182 & done"
  tag = ["hping", "synflood", "ddos"]
  output = ""

toml 描述

描述

pet-snippet.toml
[[snippets]]
  description = "Openssl client connect"
  command = "echo  | openssl s_client -connect <domain>:443"
  tag = ["openssl"]
  output = ""

[[snippets]]
  description = "Openssl quick benchmark for new and tls reuse handshakes"
  command = "openssl s_time -connect <domain>:443  -time 1"
  tag = ["openssl"]
  output = ""

[[snippets]]
  description = "Github update executable flag for already commited file."
  command = "git update-index --chmod=+x <filename>"
  tag = ["git"]
  output = ""

[[snippets]]
  description = "Grep IP addresses"
  command = "grep -o '[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}' <filename>"
  tag = ["grep", "regex"]
  output = ""

[[snippets]]
  description = "Install docker on linux"
  command = "curl -fsSL get.docker.com | sh -x"
  tag = ["docker", "install"]
  output = ""

[[snippets]]
  description = "rvm install"
  command = "gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB && \\curl -sSL https://get.rvm.io | bash -s stable"
  tag = ["ruby", "install"]
  output = ""

[[snippets]]
  description = "Date formatting in shell"
  command = "DATE=`date '+%Y-%m-%d %H:%M:%S'`"
  tag = ["date"]
  output = ""

[[snippets]]
  description = "Time formatting with Ruby"
  command = "ruby -e 'puts Time.now.strftime(\"%Y%M%d%H%M%S\")'"
  tag = ["date", "ruby"]
  output = ""

[[snippets]]
  description = "Average with awk"
  command = "seq 5 | awk '{ sum+=$1} END { printf \"%0.3f\\n\",sum/$NF }'"
  tag = ["awk", "shell", "average"]
  output = ""

[[snippets]]
  description = "Run command 5 times"
  command = "seq 5 | xargs -I@ -n1 echo \"-- @ --\""
  tag = ["shell"]
  output = ""

[[snippets]]
  description = "Extract RPM"
  command = "rpm2cpio <rpm_file> | cpio -idmv"
  tag = ["rpm"]
  output = ""

[[snippets]]
  description = "Check keepalive for site"
  command = "curl -Iv <site>  2>&1 | grep -i 'connection #0'"
  tag = ["curl", "shell", "keepalive"]
  output = ""

[[snippets]]
  description = "cat filename with hidden characters"
  command = "cat -vet <filename>"
  tag = ["cat", "shell"]
  output = ""

[[snippets]]
  description = "Docker steal container clean up"
  command = "docker ps -a | awk '{print $1}' | grep -v CON | xargs  -I@ docker rm @  && docker images | grep none | awk '{print $3}' | xargs -I@ docker rmi @"
  tag = ["docker", "shell"]
  output = ""

[[snippets]]
  description = "sar ethernet interface traffic"
  command = "sar -n DEV"
  tag = ["sar", "network"]
  output = ""

[[snippets]]
  description = "strace to provide system call stats"
  command = "sudo strace -T -c -f  -p <pid>"
  tag = ["strace", "shell", "systemcall"]
  output = ""

[[snippets]]
  description = "date epoc back and forth conversion"
  command = "date '+%s'  && date -d @<epoc>"
  tag = ["date", "shell"]
  output = ""

[[snippets]]
  description = "always stumble with these cops urls"
  command = "https://<cops_service>.stg.vidops.internal.justin.tv/health"
  tag = ["cops"]
  output = ""

[[snippets]]
  description = "docker build no chache"
  command = "docker build --no-cache -t <name> ."
  output = ""

[[snippets]]
  description = "aws cloudwatch log fetch"
  command = "aws logs get-log-events --log-group-name <group_name>  --log-stream-name <stream_name>"
  output = ""

[[snippets]]
  description = "aws cloudwatch get log streams and other information"
  command = "aws logs describe-log-streams --log-group-name <group_name>"
  output = ""

[[snippets]]
  description = "aws cloudwatch delete logs"
  command = "aws logs delete-log-stream --log-group-name <group_name>  --log-stream-name <stream_name>"
  output = ""

[[snippets]]
  description = "Find out file belongs to which debian package"
  command = "dpkg -S <filename>"
  tag = ["dpkg"]
  output = ""

[[snippets]]
  description = "find out column number for further awk parsing"
  command = "head -1 <file>  | tr \" \" \"\\n\" | nl"
  tag = ["awk", "bash", "nl"]
  output = ""

[[snippets]]
  description = "Provides socke opt flags"
  command = "sudo ss  -l -p  --extended --memory  --info"
  tag = ["ss", "network"]
  output = ""

[[snippets]]
  description = "git rebase interactive to rewrite history"
  command = "git rebase -i HEAD~<commit_number>"
  tag = ["git"]
  output = ""

[[snippets]]
  description = "git checkout and track remote branch locall"
  command = "git checkout --track origin/<name_of_remote_branch>"
  tag = ["git"]
  output = ""

[[snippets]]
  description = "swap entrypoint"
  command = "docker run -t -i  --entrypoint \"bash\" <container_image>"
  tag = ["docker"]
  output = ""

[[snippets]]
  description = "setup process in real time prioiry"
  command = "sudo chrt -r -p <prio_range_1_to_99> <PID>"
  tag = ["chrt", "scheduling"]
  output = ""

[[snippets]]
  description = "sed inline replacement"
  command = "sed -i '' 's/<str>/<replace_str>/g'  <filename>"
  tag = ["sed", "shell"]
  output = ""

[[snippets]]
  description = "capture TLS handshake packets only"
  command = "tcpdump -ni eth0 \"tcp port 443 and (tcp[((tcp[12] & 0xf0) >> 2)] = 0x16)\""
  tag = ["tcpdump"]
  output = ""

[[snippets]]
  description = "setup all CPU cores in performance mode"
  command = "echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor"
  tag = ["shell", "performance"]
  output = ""

[[snippets]]
  description = "get power draw for server"
  command = "sudo ipmi-dcmi --get-system-power-statistics"
  tag = ["ipmi"]
  output = ""

[[snippets]]
  description = "varnish param modification during runtime"
  command = "sudo varnishadm -n /dev/shm/varnish/ param.set timeout_idle 60"
  tag = ["varnish"]
  output = ""

[[snippets]]
  description = "setup golang env"
  command = "export GOROOT=<go_path> && mkdir $HOME/goworkspace && export GOPATH=$HOME/goworkspace && export PATH=$PATH:$GOROOT/bin:$GOPATH/bin"
  tag = ["golang"]
  output = ""

[[snippets]]
  description = "pass command line options for script which piped to bash shell"
  command = "script.sh | sudo bash -s --  --cmd_option for_script.sh"
  tag = ["bash", "shell"]
  output = ""

[[snippets]]
  description = "Install gem from private repo"
  command = "gem install <GEM> --no-rdoc --no-ri  --source https://gem.internal.justin.tv/"
  tag = ["gem", "ruby"]
  output = ""

[[snippets]]
  description = "no wrap of text"
  command = "less -S"
  tag = ["less", "shell"]
  output = ""

[[snippets]]
  description = "ruby named capture ,  m[:area] # => \"555\""
  command = "m = \"555-333-7777\".match(/(?<area>\\d{3})-(?<city>\\d{3})-(?<number>\\d{4})/)"
  tag = ["ruby"]
  output = ""

[[snippets]]
  description = "watch pkt flow on interface"
  command = "watch -n 1 -d \"ethtool -S <iface> | egrep rx.*pack\""
  tag = ["ethtool"]
  output = ""

[[snippets]]
  description = "run filebeat with BATCH priority and attach task to 8th core"
  command = "/usr/bin/taskset 0x00000007 /usr/bin/chrt -b 0  /usr/bin/filebeat -c /etc/filebeat/filebeat.yml"
  tag = ["taskset", "chrt", "affinity"]
  output = ""

[[snippets]]
  description = "tmux to run script and exit , useful with long running command to start over ssh"
  command = "tmux new -d 'script.sh |& tee tmux.log'"
  tag = ["ssh", "tmux", "remote_exec"]
  output = ""

toml 描述

描述

pet-snippet.toml
[[snippets]]
  description = "Openssl client connect"
  command = "echo  | openssl s_client -connect <domain>:443"
  tag = ["openssl"]
  output = ""

[[snippets]]
  description = "Openssl quick benchmark for new and tls reuse handshakes"
  command = "openssl s_time -connect <domain>:443  -time 1"
  tag = ["openssl"]
  output = ""

[[snippets]]
  description = "Github update executable flag for already commited file."
  command = "git update-index --chmod=+x <filename>"
  tag = ["git"]
  output = ""

[[snippets]]
  description = "Grep IP addresses"
  command = "grep -o '[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}' <filename>"
  tag = ["grep", "regex"]
  output = ""

[[snippets]]
  description = "Install docker on linux"
  command = "curl -fsSL get.docker.com | sh -x"
  tag = ["docker", "install"]
  output = ""

[[snippets]]
  description = "rvm install"
  command = "gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB && \\curl -sSL https://get.rvm.io | bash -s stable"
  tag = ["ruby", "install"]
  output = ""

[[snippets]]
  description = "Date formatting in shell"
  command = "DATE=`date '+%Y-%m-%d %H:%M:%S'`"
  tag = ["date"]
  output = ""

[[snippets]]
  description = "Time formatting with Ruby"
  command = "ruby -e 'puts Time.now.strftime(\"%Y%M%d%H%M%S\")'"
  tag = ["date", "ruby"]
  output = ""

[[snippets]]
  description = "Average with awk"
  command = "seq 5 | awk '{ sum+=$1} END { printf \"%0.3f\\n\",sum/$NF }'"
  tag = ["awk", "shell", "average"]
  output = ""

[[snippets]]
  description = "Run command 5 times"
  command = "seq 5 | xargs -I@ -n1 echo \"-- @ --\""
  tag = ["shell"]
  output = ""

[[snippets]]
  description = "Extract RPM"
  command = "rpm2cpio <rpm_file> | cpio -idmv"
  tag = ["rpm"]
  output = ""

[[snippets]]
  description = "Check keepalive for site"
  command = "curl -Iv <site>  2>&1 | grep -i 'connection #0'"
  tag = ["curl", "shell", "keepalive"]
  output = ""

[[snippets]]
  description = "cat filename with hidden characters"
  command = "cat -vet <filename>"
  tag = ["cat", "shell"]
  output = ""

[[snippets]]
  description = "Docker steal container clean up"
  command = "docker ps -a | awk '{print $1}' | grep -v CON | xargs  -I@ docker rm @  && docker images | grep none | awk '{print $3}' | xargs -I@ docker rmi @"
  tag = ["docker", "shell"]
  output = ""

[[snippets]]
  description = "sar ethernet interface traffic"
  command = "sar -n DEV"
  tag = ["sar", "network"]
  output = ""

[[snippets]]
  description = "strace to provide system call stats"
  command = "sudo strace -T -c -f  -p <pid>"
  tag = ["strace", "shell", "systemcall"]
  output = ""

[[snippets]]
  description = "date epoc back and forth conversion"
  command = "date '+%s'  && date -d @<epoc>"
  tag = ["date", "shell"]
  output = ""

[[snippets]]
  description = "always stumble with these cops urls"
  command = "https://<cops_service>.stg.vidops.internal.justin.tv/health"
  tag = ["cops"]
  output = ""

[[snippets]]
  description = "docker build no chache"
  command = "docker build --no-cache -t <name> ."
  output = ""

[[snippets]]
  description = "aws cloudwatch log fetch"
  command = "aws logs get-log-events --log-group-name <group_name>  --log-stream-name <stream_name>"
  output = ""

[[snippets]]
  description = "aws cloudwatch get log streams and other information"
  command = "aws logs describe-log-streams --log-group-name <group_name>"
  output = ""

[[snippets]]
  description = "aws cloudwatch delete logs"
  command = "aws logs delete-log-stream --log-group-name <group_name>  --log-stream-name <stream_name>"
  output = ""

[[snippets]]
  description = "Find out file belongs to which debian package"
  command = "dpkg -S <filename>"
  tag = ["dpkg"]
  output = ""

[[snippets]]
  description = "find out column number for further awk parsing"
  command = "head -1 <file>  | tr \" \" \"\\n\" | nl"
  tag = ["awk", "bash", "nl"]
  output = ""

[[snippets]]
  description = "Provides socke opt flags"
  command = "sudo ss  -l -p  --extended --memory  --info"
  tag = ["ss", "network"]
  output = ""

[[snippets]]
  description = "git rebase interactive to rewrite history"
  command = "git rebase -i HEAD~<commit_number>"
  tag = ["git"]
  output = ""

[[snippets]]
  description = "git checkout and track remote branch locall"
  command = "git checkout --track origin/<name_of_remote_branch>"
  tag = ["git"]
  output = ""

[[snippets]]
  description = "swap entrypoint"
  command = "docker run -t -i  --entrypoint \"bash\" <container_image>"
  tag = ["docker"]
  output = ""

[[snippets]]
  description = "setup process in real time prioiry"
  command = "sudo chrt -r -p <prio_range_1_to_99> <PID>"
  tag = ["chrt", "scheduling"]
  output = ""

[[snippets]]
  description = "sed inline replacement"
  command = "sed -i '' 's/<str>/<replace_str>/g'  <filename>"
  tag = ["sed", "shell"]
  output = ""

[[snippets]]
  description = "capture TLS handshake packets only"
  command = "tcpdump -ni eth0 \"tcp port 443 and (tcp[((tcp[12] & 0xf0) >> 2)] = 0x16)\""
  tag = ["tcpdump"]
  output = ""

[[snippets]]
  description = "setup all CPU cores in performance mode"
  command = "echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor"
  tag = ["shell", "performance"]
  output = ""

[[snippets]]
  description = "get power draw for server"
  command = "sudo ipmi-dcmi --get-system-power-statistics"
  tag = ["ipmi"]
  output = ""

[[snippets]]
  description = "varnish param modification during runtime"
  command = "sudo varnishadm -n /dev/shm/varnish/ param.set timeout_idle 60"
  tag = ["varnish"]
  output = ""

[[snippets]]
  description = "setup golang env"
  command = "export GOROOT=<go_path> && mkdir $HOME/goworkspace && export GOPATH=$HOME/goworkspace && export PATH=$PATH:$GOROOT/bin:$GOPATH/bin"
  tag = ["golang"]
  output = ""

[[snippets]]
  description = "pass command line options for script which piped to bash shell"
  command = "script.sh | sudo bash -s --  --cmd_option for_script.sh"
  tag = ["bash", "shell"]
  output = ""

[[snippets]]
  description = "Install gem from private repo"
  command = "gem install <GEM> --no-rdoc --no-ri  --source https://gem.internal.justin.tv/"
  tag = ["gem", "ruby"]
  output = ""

[[snippets]]
  description = "no wrap of text"
  command = "less -S"
  tag = ["less", "shell"]
  output = ""

[[snippets]]
  description = "ruby named capture ,  m[:area] # => \"555\""
  command = "m = \"555-333-7777\".match(/(?<area>\\d{3})-(?<city>\\d{3})-(?<number>\\d{4})/)"
  tag = ["ruby"]
  output = ""

[[snippets]]
  description = "watch pkt flow on interface"
  command = "watch -n 1 -d \"ethtool -S <iface> | egrep rx.*pack\""
  tag = ["ethtool"]
  output = ""

[[snippets]]
  description = "run filebeat with BATCH priority and attach task to 8th core"
  command = "/usr/bin/taskset 0x00000007 /usr/bin/chrt -b 0  /usr/bin/filebeat -c /etc/filebeat/filebeat.yml"
  tag = ["taskset", "chrt", "affinity"]
  output = ""