Skip to content

Instantly share code, notes, and snippets.

@sportebois
sportebois / fmtnomad.sh
Last active November 21, 2018 15:40
Nomad job formatter (chmox+x and symlink it in your $PATH)
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
#/ Description:
#/ Run Terraform fmt on nomad file to format HCL, and update the file in place.
#/
#/ Arguments:
#/ $1 the nomad flie
#/ --diff if set, then do not write the changes, but show the diff between current and cacnonical format
@sportebois
sportebois / vernemq_prometheus_metrics_sorted.txt
Created October 10, 2018 11:52
VerneMQ Prometheuse metrics
# ---- BYTES
# HELP bytes_received The total number of bytes received.
# TYPE bytes_received counter
bytes_received{node="nodeName"} 8504294780
# HELP bytes_sent The total number of bytes sent.
# TYPE bytes_sent counter
bytes_sent{node="nodeName"} 7981953590
# ---- CLIENT
@sportebois
sportebois / NGINX-conf-snippet-dns-resolvers.conf
Created July 12, 2018 14:55
NGINX config snippets with various common DNS resolvers
# Potential resolvers:
# AWS VPC (should be the default): 169.254.169.253
# AWS EC2 classic (goes out of VPC): 172.16.0.23
# Google global DNS: 8.8.8.8
# Quad9 DNS: 9.9.9.9
# Cloudflare's 1⁴ : 1.1.1.1 / 1.0.0.1
resolver 169.254.169.253;
@sportebois
sportebois / Makefile
Created April 13, 2018 01:13
Terraform Makefile
.PHONY: all info init refresh plan apply destroy fmt
# use `make plan` to do a dry-run. And same pattern for all other commands
ifndef stack
stack=terraform
endif
# Forcing AWS default region
export AWS_DEFAULT_REGION=us-east-1
@sportebois
sportebois / ecr-add-tag.sh
Created March 29, 2018 18:55
Add tag to a docker image in ECR via AWS CLI
#!/usr/bin/env bash
function ecr-add-tag() {
if (( $# < 3 )); then
echo "Wrong number of arguments. Usage: ecr-add-tag ECR_REPO_NAME TAG_TO_FIND TAG_TO_ADD [AWS_PROFILE]"
return
fi
local repo_name=$1
local existing_tag=$2
local new_tag=$3
@sportebois
sportebois / firacode_in_manning_livebook.css
Created February 18, 2018 20:56
Firacode in Manning livebook (Stylish rule)
/* Manning's livebooks */
@import url(https://cdn.rawgit.com/tonsky/FiraCode/1.204/distr/fira_code.css);
code {
font-family: 'Fira Code';
}
/* applies to URLs on the domain livebook.manning.com */
@sportebois
sportebois / firacode_in_medium.css
Created February 18, 2018 20:54
Firacode in Medium posts (Stylish rule)
/* Medium */
@import url(https://cdn.rawgit.com/tonsky/FiraCode/1.204/distr/fira_code.css);
.graf--pre, .markup--blockquote-code, .markup--li-code, .markup--p-code {
font-family: 'Fira Code';
}
/* Applies to url matching the regexp .*\bmedium\b\.?[^/]*\/*.* This matches many medium subdomains. For custom domains, you have to expand this rule */
@sportebois
sportebois / firacode_in_stackoverflow.css
Created February 18, 2018 20:51
Firacode in Stackoverflow (Stylish config)
/* Stackoverflow */
@import url(https://cdn.rawgit.com/tonsky/FiraCode/1.204/distr/fira_code.css);
code {
font-family: 'Fira Code';
}
/* applies to URLs on the domain stackoverflow.com */
@sportebois
sportebois / firacode_in_bitbucket.css
Created February 18, 2018 20:48
FiraCode in Bitbucket (stylish rule)
/* Bitbucket */
@import url(https://cdn.rawgit.com/tonsky/FiraCode/1.204/distr/fira_code.css);
/* Bitbucket code and diffs */
.refract-content-container .line-numbers,
.refract-content-container .source,
body.adg3 .wiki-content pre,
body.adg3 ak-editor-bitbucket .ProseMirror pre,
body.adg3 ak-editor-bitbucket .code,
@sportebois
sportebois / firacode_in_gitlab.css
Last active February 18, 2018 20:52
FiraCode in Gitlab (Stylish rule)
/* Gitlab */
@import url(https://cdn.rawgit.com/tonsky/FiraCode/1.204/distr/fira_code.css);
.file-content.code pre code,
.wiki code,
.diff-file .diff-content table {
font-family: 'Fira Code';
}