Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 2023 03 23 #1

Open
wants to merge 81 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
84ac364
Update README.md
invad0r Aug 2, 2019
5b5e2c5
Merge branch 'master' of github.com:invad0r/notable-notes
invad0r Aug 2, 2019
1c25cb7
changed tags
invad0r Aug 2, 2019
0f5ae78
added network and osx notes
invad0r Aug 2, 2019
2820214
added prometheus notes
invad0r Aug 2, 2019
79b5b64
typo
invad0r Aug 2, 2019
081b253
moved stuff around, added bash-builtins
invad0r Aug 18, 2019
b025ff7
Merge branch 'master' of github.com:invad0r/notable-notes
invad0r Aug 18, 2019
e5c3d30
batch of files
invad0r Aug 18, 2019
dd41bea
second batch of files
invad0r Aug 18, 2019
c20d176
added links
invad0r Aug 18, 2019
cc7a0b8
added bash notes and links
invad0r Aug 18, 2019
f2fa706
split datatypes and systemd-ctl's
invad0r Aug 19, 2019
46b8e6c
moved git to seperate note
invad0r Aug 19, 2019
d25126e
rm tags, edited headlines, added links
invad0r Aug 19, 2019
160a2a7
using see-also, moved stuff around
invad0r Aug 25, 2019
f3984b1
big batch: added references and usage
invad0r Nov 29, 2019
056841e
added memtop snipped
invad0r Dec 11, 2019
c1e223c
changes here and there
invad0r Dec 28, 2019
37b17e5
Merge branch 'master' of github.com:invad0r/notable-notes
invad0r Dec 28, 2019
1b1ba91
ruby, python repl and tags
invad0r Jan 2, 2020
2289292
stuff..
invad0r Jan 6, 2020
f6fea14
filesystem-stuff ...xfs..
invad0r Jan 7, 2020
90cfd61
net-tools, python and tagging
invad0r Jan 16, 2020
1cda6fb
capabilities, added usages
invad0r Jan 17, 2020
d257206
bunch of socket stuff
invad0r Jan 21, 2020
72be5cf
ip -br -c a s
invad0r Jan 21, 2020
b1c9287
restructured vim, added to gzip
invad0r Jan 22, 2020
4adb660
Merge branch 'master' of github.com:invad0r/notable-notes
invad0r Jan 22, 2020
8a16d15
moved things together.
invad0r Jan 26, 2020
c8b8cc3
mainly tcpdump
invad0r Jan 30, 2020
1216ca5
go install how to
invad0r Feb 3, 2020
e98f821
firewall-cmd stuff
invad0r Feb 3, 2020
d5c34b2
osx => macos .. keycloack stuff..
invad0r Feb 11, 2020
021116e
added dmidecode
invad0r Feb 12, 2020
34dddcd
Merge branch 'master' of github.com:invad0r/notable-notes
invad0r Feb 12, 2020
487c829
added id and go-channels
invad0r Feb 14, 2020
25164e3
ssh whoami
invad0r Feb 17, 2020
96786f3
stuff .. ulimit, api GET etc
invad0r Feb 19, 2020
628da44
yq, procfs, rust and ocaml
invad0r Feb 28, 2020
9e8a3d7
small changes here and theres, locale, ocaml, openssl
invad0r Mar 12, 2020
cc13f50
consolidate go, added virtual-vm stuff, ..
invad0r Mar 16, 2020
c3b91dd
here and there..
invad0r Mar 24, 2020
9dadfeb
this and that
invad0r Apr 6, 2020
6a1723d
added stuff to ftp
invad0r Apr 14, 2020
4fc1848
batch: bash, c, gnu-utils
invad0r Jun 16, 2020
41e280d
added fossil, gitops, paradigms
invad0r Jul 6, 2020
2314a2f
added column, cp, mv, named, nl, paste, rnd; edits here and there
invad0r Aug 5, 2020
34c8d08
added moreutils, coreutils and wasm
invad0r Sep 2, 2020
074ef96
package stuff net-tools, lua, bash and other stuff
invad0r Sep 12, 2020
f866e41
changed install for brew
0xdnL Oct 2, 2020
2681d41
finding commit message is hard for notes
0xdnL Nov 20, 2020
2eff191
bfg, git cleanup
0xdnL Nov 23, 2020
36e3506
added lambda realted, some formats etc
0xdnL Feb 10, 2021
671364b
calibre, xkcdpass, fx, ..
0xdnL Mar 1, 2021
ac7a006
postgres, k8s and some refactors
0xdnL Mar 22, 2021
dbb8170
aws-vpc, gitflow, signals, z, pdf
0xdnL Apr 26, 2021
cd6e732
shell tags (#1)
0xdnL May 12, 2021
12812d9
added githubworkflow explore actions (#2)
0xdnL May 12, 2021
5364ae6
formatting and stuff
0xdnL Sep 23, 2021
6259c1e
new-notes-1 (#3)
0xdnL Sep 23, 2021
060a8bc
add eksctl, git-cliff, softwareupdate and mostly formatting (#4)
0xdnL Oct 13, 2021
c8d627f
Update 2 (#5)
0xdnL Oct 29, 2021
29a8a92
consolidate git command and retagged a bunch (#6)
0xdnL Oct 29, 2021
667a18e
merged, moved, formatted stuff (#7)
0xdnL Nov 29, 2021
f43312a
update 5: move stuffe around, created stuff, formatted stuff, the usu…
0xdnL Jan 20, 2022
9cf776b
update 6 (#9)
0xdnL Mar 16, 2022
281e37e
typo
0xdnL Mar 16, 2022
de9ca94
update 7 (#10)
0xdnL Apr 27, 2022
de52d0c
add less and jless (#11)
0xdnL Jun 1, 2022
ff273ec
removed api notes (#12)
0xdnL Jun 1, 2022
c44970b
refactor git note (#13)
0xdnL Jun 1, 2022
64b6f12
new and renamed files (#14)
0xdnL Mar 13, 2023
05a2da7
Update 2023 03 13 (#15)
0xdnL Mar 13, 2023
f9df820
Update 2023 03 15 (#16)
0xdnL Mar 20, 2023
8a8bdd5
dns and bind related stuff (#17)
0xdnL Mar 20, 2023
a18b255
tagging, install sectoin to block and add flags
0xdnL Mar 23, 2023
0a5e676
new files
0xdnL Mar 23, 2023
b08ec77
tagging, add, rm, mv..
0xdnL Mar 24, 2023
e0b7cd6
new notes
0xdnL Mar 24, 2023
a4efbb7
cleanup, install sections
0xdnL Mar 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
new and renamed files (#14)
0xdnL authored Mar 13, 2023
commit 64b6f123c56730087feaef9ed2dfbdc4b73d706a
80 changes: 0 additions & 80 deletions notes/bash test [.md

This file was deleted.

99 changes: 99 additions & 0 deletions notes/bash test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
tags: [shell/bash/builtin]
title: bash test
created: '2019-07-30T06:19:49.021Z'
modified: '2022-06-02T12:09:52.169Z'
---

# bash test

> evaluate conditional expression - `[` synonym for `test` where last argument of opening `[` must be a literal `]`

## operators

```sh
-a # and operator inside a test conditional expression
-o # or operator inside a test conditional expression

-z STRING # true if string is empty
-n STRING # true if string is not empty

-o OPTION # true if the shell option OPTION is enabled
-v VAR # true if the shell variable VAR is set
-R VAR # true if the shell variable VAR is set and is a name reference

-a FILE # true if file exists
-e FILE # true if file exists
-b FILE # true if file is block special
-c FILE # true if file is character special
-d FILE # true if file is a directory
-f FILE # true if file exists and is a regular file
-g FILE # true if file is set-group-id
-h FILE # true if file is a symbolic link
-L FILE # true if file is a symbolic link
-k FILE # true if file has its `sticky' bit set
-p FILE # true if file is a named pipe
-r FILE # true if file is readable by you
-s FILE # true if file exists and is not empty
-S FILE # true if file is a socket
-t FD # true if FD is opened on a terminal
-u FILE # true if the file is set-user-id
-w FILE # true if the file is writable by you
-x FILE # true if the file is executable by you
-O FILE # true if the file is effectively owned by you
-G FILE # true if the file is effectively owned by your group
-N FILE # true if the file has been modified since it was last read
```

## usage

```sh
help test
help [


[ CMD ] && CMD || CMD

[ "$(echo 'ok')" ] && { echo 'success'; echo 'success'; } || { echo 'fail'; echo 'fail'; } # notic space between curly-braces

test 3 == "$(kustomize build $OVERLAYS/staging | grep 5276h4th55 | wc -l)"; echo "$?"

if [ CMD ]; then CMD; fi

[ STRING1 = STRING2 ] # STRING1 matches STRING2
[ STRING1 != STRING2 ] # STRING1 does not match STRING2
[ STRING1 < STRING2 ] # STRING1 is less STRING2
[ STRING1 > STRING2 ] # STRING1 is greater than STRING2

[ test -n STRING1 ] # STRING1 is non-zero length (has length greater than 0)
[ test -z STRING1 ] # STR1 is zero-length (has length 0)

[[ STRING1 == "STRING2" ]] # variables don't have to be quoted => Bash performs word splitting and pathname expansion
[[ STRING1 = "STRING2" ]] # variables don't have to be quoted
[ "STRING1" == "STRING2" ] # no word splitting and pathname expansion
[ "STRING1" = "STRING2" ]


[ FILE1 -nt FILE2 ] # FILE1 is newer than FILE2
[ FILE1 -ot FILE2 ] # FILE1 is older than FILE2

# integer - INT1 and INT2 may be positive or negative
[ INT1 -lt INT2 ] # less than
[ INT1 -le INT2 ] # less than or equal
[ INT1 -eq INT2 ] # equal
[ INT1 -ge INT2 ] # greater than or equal
[ INT1 -gt INT2 ] # greater than
[ INT1 -ne INT2 ] # not equal

[ INT1 <= INT2 ] # INT1 is less than or equal to INT2
[ INT1 >= INT2 ] # INT1 is greater than or equal to INT2
```

## see also

- [[bash [ []]
- [[bash built-in vs keyword]]
- [[bash if]]
- [[bash arithmetic]]
- [tldp.org/LDP/abs/html/comparison-ops.html](https://tldp.org/LDP/abs/html/comparison-ops.html)
- [How to check if a variable is set in Bash?](https://stackoverflow.com/questions/3601515/how-to-check-if-a-variable-is-set-in-bash)
55 changes: 55 additions & 0 deletions notes/cdk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: cdk
created: '2022-09-27T06:58:06.755Z'
modified: '2022-11-23T08:36:59.573Z'
---

# cdk

## install

```sh
npm install -g aws-cdk # install latest version
npm install -g aws-cdk@X.YY.Z # install specific version
```

## usage

```sh
cdk list # lists stacks in app
cdk ls

cdk synthesize # synthesizes and prints the cloudformation template for the specified stack(s)
cdk synth

cdk bootstrap # deploys cdk toolkit staging stack

cdk deploy # deploys specified stack(s)

cdk destroy # destroys specified stack(s)

npm run --silent cdk -- destroy --ci STACK

cdk diff # compares specified stack and its dependencies with deployed stack(s) or a local cloudformation template

npm run --silent cdk -- diff --ci -e STACK

cdk metadata # displays metadata about the specified stack

cdk init # creates a new cdk project in the current directory from a specified template

cdk context # manages cached context values

cdk docs (doc) # opens the cdk api reference in your browser

cdk doctor # checks your cdk project for potential problems
```

## see also

- [[aws]]
- [[cfn]]
- [[node]]
- [[npm]]
- [[terraform]]
- [[iac]]
28 changes: 28 additions & 0 deletions notes/cfn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: cfn
created: '2022-09-27T06:56:03.247Z'
modified: '2022-09-27T07:09:26.798Z'
---

# cfn

> `cloudFormation cli` allows you to author your own resource providers, hooks, and modules that can be used by cloudformation

## install

```sh
brew install cloudformation-cli
```

## usage

```sh
cfn
```

## see also

- [docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-cli](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-cli.html)
- [[aws]]
- [[terraform]]
- [[cdk]]
28 changes: 28 additions & 0 deletions notes/ecs-cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: ecs-cli
created: '2022-09-30T07:14:13.775Z'
modified: '2022-11-23T08:35:21.222Z'
---

# ecs-cli

## install

```sh
brew install amazon-ecs-cli
```

## usage

```sh
aws ecs list-clusters --region eu-central-1 | jq -r '.clusterArns[]'

ecs-cli ps --cluster CLUSTER_ARN

ecs-cli ps --cluster CLUSTER_ARN --desired-status RUNNING
```

## see also

- [[aws]]
- [[session-manager-plugin]]
9 changes: 6 additions & 3 deletions notes/infrastructure as code.md → notes/iac.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
tags: [Notebooks]
title: infrastructure as code
title: iac
created: '2019-07-30T06:19:49.081Z'
modified: '2022-04-06T11:34:41.761Z'
modified: '2022-10-17T10:55:16.675Z'
---

# infrastructure as code
# iac

> infrastructure as code

## pets vs cattle

@@ -25,6 +27,7 @@ modified: '2022-04-06T11:34:41.761Z'

## see also

- [[12 factor app]]
- [[gitops]]
- [[terraform]]
- [[aws cloudformation]]
65 changes: 65 additions & 0 deletions notes/kubectl krew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
title: kubectl krew
created: '2022-06-27T06:44:31.241Z'
modified: '2022-11-23T08:33:45.066Z'
---

# kubectl krew

> plugin manager for [[kubectl]]

## install

```sh
(
set -x; cd "$(mktemp -d)" &&
OS="$(uname | tr '[:upper:]' '[:lower:]')" &&
ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" &&
KREW="krew-${OS}_${ARCH}" &&
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" &&
tar zxvf "${KREW}.tar.gz" &&
./"${KREW}" install krew
)
```

## usage

```sh
kubectl krew update

kubectl krew search

kubectl krew install oidc-login # install plugin

kubectl access-matrix # use plugin to see the level of access user has on namespaces
```

```sh
failed to retrieve plugin indexes: failed to list the remote URL for index default
unset GIT_CONFIG
```

## plugins

```sh
# access-matrix v0.5.0
# dds v0.1.0
# example v1.1.0
# krew v0.4.3
# oidc-login v1.25.1
# view-serviceaccount-kubeconfig v2.2.8

kubectl example deployment

access-matrix

dds

view-serviceaccount-kubeconfig
```

## see also

- [[kubectl]]
- [krew.sigs.k8s.io/plugins/](https://krew.sigs.k8s.io/plugins/)
- [krew.sigs.k8s.io/docs/user-guide/setup/install/](https://krew.sigs.k8s.io/docs/user-guide/setup/install/)
26 changes: 26 additions & 0 deletions notes/microdnf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: microdnf
created: '2022-09-30T12:49:43.050Z'
modified: '2022-09-30T13:14:19.747Z'
---

# microdnf

> minimal dnf for containers that uses libdnf and hence doesn't require python
## install

## usage

```sh
microdnf install nc

microdnf update && microdnf install sudo iputils hostname findutils

microdnf clean all
```

## see also

- [[tdnf]]
- [[yum]]
39 changes: 39 additions & 0 deletions notes/redis-cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: redis-cli
created: '2022-10-05T12:58:56.515Z'
modified: '2022-11-23T08:26:33.091Z'
---

# redis-cli

## install

```sh
apt-get install redis-tools
```

## usage

```sh
redis-cli --scan --pattern '*-11*'

redis-cli --latency
```

```
127.0.0.1:6379> SET mykey "Hello\nWorld"
OK
127.0.0.1:6379> GET mykey
Hello
World
```

```sh
nc -v --ssl HOST 6380
```

## see also

- [[nc]]
- [[zookeeper-shell]]
- [redis.io/docs/manual/cli](https://redis.io/docs/manual/cli/)
33 changes: 33 additions & 0 deletions notes/session-manager-plugin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: session-manager-plugin
created: '2022-09-30T07:14:39.638Z'
modified: '2022-11-23T08:31:40.836Z'
---

# session-manager-plugin

## install

```sh
curl -O "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/mac/sessionmanager-bundle.zip"
unzip sessionmanager-bundle.zip
sudo ./sessionmanager-bundle/install -i /usr/local/sessionmanagerplugin -b /usr/local/bin/session-manager-plugin


yum install -y session-manager-plugin.rpm
```

## usage

```sh
session-manager-plugin # verify isntalled correctly

aws ssm start-session --target INSTANCE_ID

session-manager-plugin --version
```

## see also

- [[aws]]
- [[ecs-cli]]
33 changes: 33 additions & 0 deletions notes/tac.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: tac
created: '2022-06-17T09:24:48.712Z'
modified: '2022-06-20T06:37:41.279Z'
---

# tac

> concatenate and print files in reverse
## flags

```sh
-b, --before # attach the separator before instead of after
-r, --regex # interpret the separator as a regular expression
-s, --separator=STRING # use STRING as the separator instead of newline
--help # display this help and exit
--version # output version information and exit
```

## usage

```sh
tac

kubectl get po --sort-by=.metadata.creationTimestamp | tac
```

## see also

- [[cat]]
- [[tig]]
- [[less]]
6 changes: 3 additions & 3 deletions notes/tcp-ip.md → notes/tcp-ip model.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
tags: [network]
title: tcp-ip
title: tcp-ip model
created: '2021-05-28T06:16:51.067Z'
modified: '2022-02-10T12:55:47.494Z'
modified: '2022-11-16T12:36:05.015Z'
---

# tcp-ip
# tcp-ip model

> aka `internet protocol suite`, a conceptual model and set of communications protocols used in internet and networks
> foundational protocols in the suite are the [[tcp]] and [[ipv4]]