graph TD
A[Me] -->|Testing mermaid on| B(Github)
View mermaid-test.md
View test.md
Test mermaid
graph TD
A[Cortex GW] -->|GET| B(Querier)
B --> |Key Config| C(GCS)
C --> |Config| B
B -->|Config| A
View download-private-release.sh
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 | |
# shellcheck disable=SC2086 | |
set -eou pipefail | |
_git_token="${GIT_TOKEN:-}" | |
repo_owner="${1:-}" | |
repo_name="${2:-}" | |
git_tag="${3:-}" | |
asset_filename="${4:-}" |
View resolve_dns_with_backoff.sh
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 | |
# vim: ai:ts=8:sw=8:noet | |
# set -eufo pipefail | |
export SHELLOPTS # propagate set to children by default | |
IFS=$'\t\n' | |
# Performs a DNS resolution and waits until the answer has a non-empty response | |
function resolve_dns_with_backoff { | |
local timeout=${DNS_RESOLUTION_TIMEOUT-5} | |
local domain=${1} |
View pipes.go
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
package main | |
import ( | |
"io/ioutil" | |
"os" | |
"github.com/sirupsen/logrus" | |
) | |
func main() { |
View postgres-cheatsheet.md
PSQL
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the\
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
View go-tools.sh
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
# Tools for developing using go | |
go get golang.org/x/tools/cmd/gotype | |
go get github.com/securego/gosec/cmd/gosec | |
go get github.com/mdempsky/maligned |
View migrate_to_go_mod.sh
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
# Quick list of steps to initialize go mod in your go project. | |
# Make sure to do this out of the GOPATH or play around with GO111MODULE env var | |
# Initialize project | |
go mod init github.com/<repository_path>/<project_name> | |
go build -o /tmp/main main.go | |
rm /tmp/main | |
# Remove traces of dep | |
rm -rf vendor | |
rm Gopkg.* | |
# Verify dependencies are there |
View prometheus_cheatsheet.md
- Metric cardinality
count by(__name__) ({__name__=~".*"})
View .ideavimrc
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
set hlsearch | |
set scrolloff=3 | |
set ignorecase smartcase | |
set showmode | |
set history=1000 | |
"" easy system clipboard copy/paste | |
"noremap <space>y "*y | |
"noremap <space>Y "*Y | |
"noremap <space>p "*p |
NewerOlder