Reference Pages

Misc

Data Stuff

Kubernetes

Get Traefik logs

kubectl logs -n kube-system -l app.kubernetes.io/name=traefik

Restart Traefik

kubectl rollout restart deployment traefik -n kube-system

Networking

RFC 1918 Private Addresses

  • 10.0.0.0/8
  • 172.16.0.0/12
  • 192.168.0.0/16

RFC 6598 Shared Address Space

  • 100.64.0.0/10

Regular Expressions

Metacharacters that must be escaped: ^ [ . $ { * ( ) \ + | ? < >

Anchors  
^ start of line
$ end of line
\A start of string
\Z end of string
\b word boundary
\B not word boundary
\< start of word ⚠️
\> end of word ⚠️
Quantifiers  
* 0 or more
*? 0 or more, ungreedy
+ 1 or more
+? 1 or more, ungreedy
? 0 or 1
?? 0 or 1, ungreedy
{#} Exacty # (e.g., {3} = exactly 3)
{#,} # or more (e.g., {3,} = 3 or more)
{#,}? # or more, ungreedy
{#,#} # to # matches, inclusive (e.g., {3,5} = 3, 4, or 5)
{#,#}? # to # matches, inclusive and ungreedy
Ranges  
. any character, typically excluding newline/linefeed
| or (e.g., a | b matches a or b)
() capturing group (e.g., Date: (\d{4}-\d{2}-\d{2}))
(?:) non-capturing/passive group (e.g., (?:this|that))
[] characer range
[^] negative characer range
Character Class  
\c control character (e.g., ASCII 0-31 & 127), same as POSIX [:word:]
\s white space (e.g., [\t\n\f\r ] tab, newline, form feed, carriage returm, space)
\S not white space
\d digit (e.g., [0-9])
\D not digit
\w word (e.g., [A-Za-z0-9_])
\W not word
Escape Sequences  
\\ literal backslash `
\t tab
\n newline/linefeed
\r carriage return
\f form feed
\a alarm/bell
\xhh hexadecimal character hh
\xxx \oxxx \Oxxx octal character xxx
\Q quote (disable pattern metacharacters)
\E end quote (re-enable pattern metacharacters)
POSIX Character Class  
[:upper:] any uppercase character (e.g., [A-Z])
[:lower:] any lowercase character (e.g., [a-z])
[:alpha:] any alphabetical character (e.g., [A-Za-z])
[:alnum:] any alphanumeric character (e.g., [A-Za-z0-9])
[:digit:] any decimal digit (e.g., [0-9])
[:xdigit:] any hexadecimal digit (e.g., [0-9a-fA-F])
[:punct:] any graphical character excluding “word” chartacters (e.g., [-!"#$%&'()*+,./:;<=>?@[\\\]^_`{\|}~])
[:blank:] any horizontal whitespace character (e.g., space or tab \t)
[:space:] any whitespace character, similar to \s\ but also includes vertical tab \X0B / \013
[:cntrl:] any control character (ASCII 0-31 & 127), same as \c
[:graph:] any character that is graphical, that is, visible. This class consists of all alphanumeric characters and all punctuation characters
[:print:] all printable characters, which is the set of all graphical characters plus those whitespace characters which are not also controls.
[:word:] any “word” character (e.g., [A-Za-z0-9_]), same as \w
Backreferences ⚠️  
$n or \n nth capturing group
$` before matched string
$' after matched string
$+ last matched string
$& entire matched string
$_ entire input string
$$ literal dollar sign $

⚠️ Not universally supported

SSL Certificates

Using Certbot with unexposed domains

cloudflare.ini:

# Cloudflare API token used by Certbot
dns_cloudflare_api_token = 0123456789abcdef0123456789abcdef

commands:

apt install certbot python-is-python3 python3-certbot-dns-cloudflare
certbot certonly --dns-cloudflare --dns-cloudflare-credentials /path/to/cloudflare.ini -d domain.name.com -n

Vi/Vim

Change File Format in Vim

  • consider dos2unix
:e ++ff=dos
:set ff=unix
:wq

Time Zones

P M C E
10 11 12 1
11 12 1 2
12 1 2 3
1 2 3 4
2 3 4 5
3 4 5 6
4 5 6 7
5 6 7 8
6 7 8 9
7 8 9 10
8 9 10 11
9 10 11 12