diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml
new file mode 100644
index 00000000..09c778fa
--- /dev/null
+++ b/.github/workflows/github-actions-demo.yml
@@ -0,0 +1,17 @@
+# name: GitHub Actions Demo
+# on: [push]
+# jobs:
+# Explore-GitHub-Actions:
+# runs-on: ubuntu-latest
+# steps:
+# - run: echo "๐ The job was automatically triggered by a ${{ github.event_name }} event."
+# - run: echo "๐ง This job is now running on a ${{ runner.os }} server hosted by GitHub!"
+# - run: echo "๐ The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
+# - name: Check out repository code
+# uses: actions/checkout@v2
+# - run: echo "๐ก The ${{ github.repository }} repository has been cloned to the runner."
+# - run: echo "๐ฅ๏ธ The workflow is now ready to test your code on the runner."
+# - name: List files in the repository
+# run: |
+# ls ${{ github.workspace }}
+# - run: echo "๐ This job's status is ${{ job.status }}."
diff --git a/.github/workflows/markdown-lint.yml b/.github/workflows/markdown-lint.yml
new file mode 100644
index 00000000..01f70ae8
--- /dev/null
+++ b/.github/workflows/markdown-lint.yml
@@ -0,0 +1,25 @@
+name: GitHub Actions Demo
+
+on: [push]
+
+jobs:
+
+# node-docker:
+# runs-on: ubuntu-latest
+# container:
+# image: node:14.15.0-alpine3.12
+# steps:
+# - name: Log the node version
+# run: |
+# node -v
+# cat /etc/os-release
+
+ lint-markdown:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v1
+ - name: debug output
+ uses: docker://ghcr.io/igorshubovych/markdownlint-cli:latest
+ with:
+ args: ./notes/t*.md --disable MD013 MD025 MD010
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..234a059d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+.DS_Store
+.obsidian/
diff --git a/README.md b/README.md
index f630ab60..f85db27c 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,18 @@
# notable - notes
-my notes managed with [notable/notable](https://github.com/notable/notable)
+> collection of markdown notes about tools used on the cli
+
+It's a bit of a combination of [command-not-found.com](https://command-not-found.com) and [tldr.sh](https://tldr.sh/) for me.
+Most notes describe a cli program, a short description, how to install, a usage section and references to other tools.
+
+## prerequesites
+
+- [github.com/notable/notable](https://github.com/notable/notable)
+
+## usage
+
+- clone repo
+- open repo dir using `notable`
+- start taking notes
+
+Have fun !
diff --git a/attachments/docker-compose.terraform-run.yml b/attachments/docker-compose.terraform-run.yml
new file mode 100644
index 00000000..e3bd96d7
--- /dev/null
+++ b/attachments/docker-compose.terraform-run.yml
@@ -0,0 +1,18 @@
+version: '2.4'
+
+services:
+ terraform:
+ build:
+ context: .
+ args:
+ TAG: 0.12.6
+ image: docker-registry/terraform:0.12.6
+ tty: true
+ stdin_open: true
+ environment:
+ TF_VAR_vsphere_server: ${vsphere_server}
+ TF_VAR_vsphere_user: ${vsphere_user}
+ TF_VAR_vsphere_password: ${vsphere_password}
+ volumes:
+ - ./:/opt/terraform/
+ - /var/run/docker.sock:/var/run/docker.sock
diff --git a/attachments/icon.png b/attachments/icon.png
deleted file mode 100644
index 88599a52..00000000
Binary files a/attachments/icon.png and /dev/null differ
diff --git a/attachments/icon_small.png b/attachments/icon_small.png
deleted file mode 100644
index 71322820..00000000
Binary files a/attachments/icon_small.png and /dev/null differ
diff --git a/notes/12 factor app.md b/notes/12 factor app.md
new file mode 100644
index 00000000..a71a72c1
--- /dev/null
+++ b/notes/12 factor app.md
@@ -0,0 +1,111 @@
+---
+tags: [Notebooks]
+title: 12 factor app
+created: '2022-02-15T10:15:31.700Z'
+modified: '2023-04-25T08:26:28.980Z'
+---
+
+# 12 factor app
+
+> methodology for building software-as-a-service apps
+
+## 12 factors
+
+- was developed by heroku
+- is as set of best practices aswell as a mindset
+
+## I. Codebase
+
+> one codebase tracked in a vcs, many deploy
+
+- multiple developers push to single source base via git
+- services that comprise one app should each have a seperate codebase
+
+## II. Dependencies
+
+> explicitly declare and isolate dependencies
+
+- a twelve factor app never relies on implicit existence of system wite packages
+- declare dependecies explicitly e.g. `flask==2.0.0` in `requirements.txt`
+- isolate environment using virtual environments like [[virtualenv]] or [[docker]]
+
+## III. Config
+
+> store config in the environment
+
+- store config values in environment variables
+- seperate set of environment variable per stage
+
+## IV. Backing Services
+
+> treat backing services as attached resources
+
+- attached resoruce meaning it should be no problem switching to a differen redis instance
+
+## V. Build, Release, Run
+
+> strictly seperate build and run stages
+
+- strict seperation between `build`, `release`and `run` stages
+1. build: generate executable -> e.g `docker build`
+2. release: executable + config = `release object`, should have release id, tag
+3. run:
+
+## VI. Processes
+
+> execute app as one or more stateless processes
+
+- processes are stateless and share-nothing
+- sticky sessions are a violation of twelve-factor and should never be used or relied upon if data is stored locally on the process (data loss!)
+- use `IV. Backing Services` like redis or a db to share data between processes
+
+## VII. Port Binding
+
+> export services via port binding
+
+- twelve-factor app is completely self-contained and does not rely on specific server to function
+- [[osi model]] [[tcp-ip model]]
+
+## VIII. Concurrency
+
+> scale out via process model
+
+- to use horizontal scaling the app must be independant and stateless
+- processes are first class citizen -> app should scale horizontally not vertically -> `VI. Processes`
+
+## IV. Disposability
+
+> maximize robustness with fast startup and graceful shutdown
+
+- app's processes are disposable and should be started or stopped at a moments notice
+- app's processes should shutdown gracefully when receiving a `SIGTERM` [[signal]] from process manager, avoiding unexpected dataloss
+
+## X. Dev/prod parity
+
+> keep development, staging and production as similar as possible
+
+- designed for Continous Deployment by keepking gap between dev and prod small
+- developer resists the urge to use different backing services betweetn dev and prod
+
+## XI. Logs
+
+> treat logs as event streams
+
+- twelve factor app never concerns itself with routing or storage of it output stream
+- store logs in centralized location in structured format
+- don't store logs in local fs -> `IV. Disposability`
+- ouput logs to `STDOUT` which can be transported by agent (fluentd) to centralized logging system (ELK-Stack, Splunk)
+
+## XII. Admin Processes
+
+> rund admin/management tasks as one-off processes
+
+- administrative tasks should be kept seperate from app process
+- database migration or restart should be run as seperate process e.g. start coontainer in parallel to run migration
+
+## see also
+
+- [[devops]]
+- [[unix socket]]
+- [12factor.net](https://12factor.net/)
+- [[iac]]
diff --git a/notes/7z.md b/notes/7z.md
new file mode 100644
index 00000000..e4661fb2
--- /dev/null
+++ b/notes/7z.md
@@ -0,0 +1,25 @@
+---
+tags: [linux, macos]
+title: 7z
+created: '2023-01-27T09:15:35.429Z'
+modified: '2023-03-25T12:25:14.303Z'
+---
+
+# 7z
+
+## install
+
+```sh
+brew install p7zip
+```
+
+## usage
+
+```sh
+7z x FILE.rar
+```
+
+## see also
+
+- [[rar]]
+- [[zip]]
diff --git a/notes/BIND.md b/notes/BIND.md
new file mode 100644
index 00000000..87db8bf4
--- /dev/null
+++ b/notes/BIND.md
@@ -0,0 +1,40 @@
+---
+tags: [dns]
+title: BIND
+created: '2019-07-30T06:19:49.027Z'
+modified: '2023-03-20T08:58:45.389Z'
+---
+
+# BIND
+
+> `berkeley internet name domain` - implements the DNS protocols and a software distribution which contains all of the software necessary for `asking` and `answering` name service questions
+
+### The BIND software distribution has three parts
+
+1. domain name resolver
+ resolver is a program that resolves questions about names by sending those questions to appropriate servers and responding appropriately to the servers
+ stub resolver library
+2. domain name authority server - authoritative DNS server answers requests from resolvers
+3. tools - diagnostic and operational tools such as the `dig`
+
+## install
+
+```sh
+yum install bind bind-utils
+```
+
+## usage
+
+`BIND`โs process is known as [[named]]
+
+```sh
+/var/lib/named/slave/domain.net.zone
+```
+
+## see also
+
+- [[dig]]
+- [[named]]
+- [[dnsmasq]]
+- [[rndc]]
+- [Domain name resolution - ArchWiki](https://wiki.archlinux.org/index.php/resolv.conf)
diff --git a/notes/acid crud.md b/notes/acid crud.md
new file mode 100644
index 00000000..b3814395
--- /dev/null
+++ b/notes/acid crud.md
@@ -0,0 +1,68 @@
+---
+tags: [Notebooks]
+title: acid crud
+created: '2019-08-18T16:14:42.254Z'
+modified: '2022-02-02T08:49:37.072Z'
+---
+
+# acid crud
+
+## acid
+
+> set of properties that guarante reliable database transactions
+
+```
+A C I D
+| | | โโ Durability
+| | โโโโ Isolation
+| โโโโโโ Consistency
+โโโโโโโโ Atomaticity
+```
+
+#### atomicity
+
+> Transactions are composed of multiple statements. Atomicity guarantees that each transaction is treated as a single "unit", which either succeeds completely, or fails completely: if any of the statements constituting a transaction fails to complete, the entire transaction fails and the database is left unchanged.
+
+#### consistency
+
+> ensures that a transaction can only bring the database from one valid state to another - any data written to the database must be valid according to all defined rules, including constraints, cascades, triggers, and any combination thereof. This prevents database corruption by an illegal transaction, but does not guarantee that a transaction is correct.
+
+#### isolation
+
+> Transactions are often executed concurrently (e.g., multiple transactions reading and writing to a table at the same time). Isolation ensures that concurrent execution of transactions leaves the database in the same state that would have been obtained if the transactions were executed sequentially.
+
+#### durability
+
+> guarantees that once a transaction has been committed, it will remain committed even in the case of a system failure (power outage or crash). This usually means that completed transactions are recorded in non-volatile memory
+
+> ensure that the data is actually written on disk physically, preventing any loss of data in case of a sudden power outage
+
+On POSIX systems, durability is achieved through `sync` operations: `fsync`, `fdatasync`, `aio_fsync`
+`fsync` is intended to force a physical write of data from the buffer cache, and to assure that after a system crash/failure that all data up to the time of the `fsync` call is recorded on the disk.
+`fdatasync()` does not necessarily update the meta-data associated with a file โ such as the `last modified` date โ but only the file data
+
+## crud
+
+> 4 basic functions of persistent storage
+
+```
+C R U D
+| | | โโ Delete
+| | โโโโ Update
+| โโโโโโ Read
+โโโโโโโโ Ceate
+```
+
+
+| CRUD-Operation | SQL-92 | HTTP/REST |
+|-- |-- |-- |
+| Create | `INSERT` | `PUT` or `POST` |
+| Read (Retrieve) | `SELECT` | `GET` |
+| Update | `UPDATE` | `PATCH` or `PUT` |
+| Delete (Destroy) | `DELETE` | `DELETE` |
+
+## see also
+
+- [[rest api design]]
+- [blog.httrack.com/../everything-you-always-wanted-to-know-about-fsync](http://blog.httrack.com/blog/2013/11/15/everything-you-always-wanted-to-know-about-fsync/)
+- [lwn.net/postgresqls-fsync-surprise](https://lwn.net/Articles/752063/)
diff --git a/notes/add-apt-repository.md b/notes/add-apt-repository.md
new file mode 100644
index 00000000..20b099db
--- /dev/null
+++ b/notes/add-apt-repository.md
@@ -0,0 +1,39 @@
+---
+tags: [linux]
+title: add-apt-repository
+created: '2022-02-02T09:05:29.982Z'
+modified: '2023-03-23T10:17:46.175Z'
+---
+
+# add-apt-repository
+
+> script which adds an external [[apt]] repository to either `/etc/apt/sources.list`
+> or a file in `/etc/apt/sources.list.d/`
+> or removes an already existing repository
+
+## option
+
+```sh
+-h, --help # show help message and exit
+-m, --massive-debug # print a lot of debug information to the command line
+-r, --remove # remove the specified repository
+-y, --yes # assume yes to all queries
+-k, --keyserver # use custom keyserver instead of the default
+-s, --enable-source # allow downloading of the source packages from the repository
+```
+
+## usage
+
+```sh
+add-apt-repository "deb https://download.srcclr.com/ubuntu stable/"
+add-apt-repository "ppa:ian-berke/ppa-drawers" # ppa
+
+add-apt-repository -r "deb https://download.srcclr.com/ubuntu stable/"
+add-apt-repository -r "ppa:ian-berke/ppa-drawers"
+```
+
+## see also
+
+- [[apt-key]]
+- [[apt]]
+- [[apt-get]]
diff --git a/notes/adduser.md b/notes/adduser.md
new file mode 100644
index 00000000..4cb2cd8b
--- /dev/null
+++ b/notes/adduser.md
@@ -0,0 +1,23 @@
+---
+tags: [linux]
+title: adduser
+created: '2020-03-23T12:12:51.817Z'
+modified: '2022-02-02T08:49:45.771Z'
+---
+
+# adduser
+
+> uses `useradd` as backend and adds user with full profile and info (pass, quota, permission, etc.)
+
+## usage
+
+```sh
+adduser USER
+
+adduser --home USER_HOME --system --group USER
+```
+
+## see also
+
+- [[useradd]]
+- [[usermod]]
diff --git a/notes/airport.md b/notes/airport.md
new file mode 100644
index 00000000..12f12cc3
--- /dev/null
+++ b/notes/airport.md
@@ -0,0 +1,28 @@
+---
+tags: [macos, network]
+title: airport
+created: '2019-07-30T06:19:49.196Z'
+modified: '2022-02-02T08:49:57.619Z'
+---
+
+# airport
+
+> get information for 802.11 interface
+
+## usage
+
+```sh
+ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/local/bin/airport
+
+airport -s # Scan for Wi-Fi networks
+
+airport -c CHANNEL # Change channel
+
+airport -z # Disconnect
+
+airport -I # Get current connection info
+```
+
+## see also
+
+- [[networksetup]]
diff --git a/notes/alacritty.md b/notes/alacritty.md
new file mode 100644
index 00000000..ffb950f2
--- /dev/null
+++ b/notes/alacritty.md
@@ -0,0 +1,55 @@
+---
+tags: [linux, macos, rust]
+title: alacritty
+created: '2023-03-07T07:58:26.959Z'
+modified: '2023-05-10T14:13:42.703Z'
+---
+
+# alacritty
+
+> terminal emulator, sensible defaults, extensive configuration
+
+## install
+
+```sh
+brew install alacritty
+
+cargo install alacritty
+```
+
+## option
+
+```sh
+ --class INSTANCE # Defines window class/app_id on X11/Wayland [default: Alacritty]
+ --config-file FILE # alternative configuration file [default: $HOME/.config/alacritty/alacritty.yml]
+-e, --command CMD... # command and args to execute (must be last argument)
+ --embed EMBED # X11 window ID to embed Alacritty within (decimal or hexadecimal with "0x" prefix)
+-h, --help # Print help information
+ --hold # Remain open after child process exit
+-o, --option OPT... # override configuration file options [example: cursor.style=Beam]
+ --print-events # print all events to stdout
+-q # reduces the level of verbosity (min level is -qq)
+ --ref-test # generates ref test
+ --socket SOCKET # path for IPC socket creation
+-t, --title TITLE # defines the window title [default: Alacritty]
+-v # increases the level of verbosity (the max level is -vvv)
+-V, --version # print version information
+ --working-directory DIR # start shell in specified working directory
+```
+
+## usage
+
+```sh
+alacrity -v # start session verbose
+
+alacrity help # print help
+alacrity msg # send message to the Alacritty socket
+```
+
+## see also
+
+- [[brew]]
+- [[cargo]]
+- [[tmux]]
+- [[bash]]
+- [[nerdfonts]]
diff --git a/notes/amazon-linux-extras.md b/notes/amazon-linux-extras.md
new file mode 100644
index 00000000..b0a61955
--- /dev/null
+++ b/notes/amazon-linux-extras.md
@@ -0,0 +1,32 @@
+---
+tags: [linux]
+title: amazon-linux-extras
+created: '2022-01-24T10:53:34.798Z'
+modified: '2023-03-22T10:21:07.164Z'
+---
+
+# amazon-linux-extras
+
+> manage specific fresh software
+
+## install
+
+```sh
+yum install -y amazon-linux-extras
+```
+
+## usage
+
+```sh
+amazon-linux-extras # list
+
+amazon-linux-extras enable php7.2 # enable desired topic
+
+amazon-linux-extras install -y postgresql12 #
+```
+
+## see also
+
+- [[aws]]
+- [[psql]]
+- [[yum]]
diff --git a/notes/ansible-playbook.md b/notes/ansible-playbook.md
new file mode 100644
index 00000000..62cbc89f
--- /dev/null
+++ b/notes/ansible-playbook.md
@@ -0,0 +1,26 @@
+---
+tags: [iac]
+title: ansible-playbook
+created: '2019-11-28T11:53:47.807Z'
+modified: '2022-02-02T08:50:15.733Z'
+---
+
+# ansible-playbook
+
+> runs ansible playbooks, executing the defined tasks on the targeted hosts.
+
+## usage
+
+```sh
+ansible-playbook --syntax-check playbook.yml
+
+ansible-playbook --list-hosts playbook.yml
+
+ansible-playbook --list-tasks playbook.yml
+
+ansible-playbook -i hosts ansible-bootstrap-ubuntu-16.04.yml # bootstraps machine with python2
+```
+
+## see also
+
+- [[ansible]]
diff --git a/notes/ansible.md b/notes/ansible.md
index 0fb7e051..6bee2227 100644
--- a/notes/ansible.md
+++ b/notes/ansible.md
@@ -2,29 +2,24 @@
tags: [iac]
title: ansible
created: '2019-07-30T06:19:27.514Z'
-modified: '2019-07-30T09:06:44.963Z'
+modified: '2022-02-02T08:50:08.080Z'
---
# ansible
-## ansible adhoc
+> software provisioning, configuration management, and application-deployment tool enabling infrastructure as code
+
+## usage
```sh
-ansible all -m ping -s
+ansible all -m ping -s # adhoc command
-ansible -i hosts all -m ping # uses local hosts file
+ansible all -m shell -a 'cat /etc/*release' # adhoc command using shell string
-ansibele all -m shell -a 'cat /etc/*release'
+ansible -i hosts all -m ping # uses local hosts file
```
-## ansible-playbook
-
-```sh
-ansible-playbook --syntax-check playbook.yml
-
-ansible-playbook --list-hosts playbook.yml
+## see also
-ansible-playbook --list-tasks playbook.yml
-
-ansible-playbook -i hosts ansible-bootstrap-ubuntu-16.04.yml # bootstraps machine with python2
-```
+- [[ansible-playbook]]
+- [[ssh]]
diff --git a/notes/ant.md b/notes/ant.md
new file mode 100644
index 00000000..61f068a2
--- /dev/null
+++ b/notes/ant.md
@@ -0,0 +1,38 @@
+---
+tags: [buildsystem, java]
+title: ant
+created: '2019-08-20T07:46:08.815Z'
+modified: '2022-02-02T08:50:25.068Z'
+---
+
+# ant
+
+> completely written in java - `ant` uses `xml` as build script
+
+## usage
+
+```sh
+ant -version
+
+ant compile
+
+ant package
+
+ant hello # run target: hello
+```
+
+## target
+
+```xml
+
+
+
+ Hello, World!
+
+
+```
+
+## see also
+
+- [[mvn]]
+- [[java]]
diff --git a/notes/apache httpd.md b/notes/apache httpd.md
deleted file mode 100644
index d4bf0d1b..00000000
--- a/notes/apache httpd.md
+++ /dev/null
@@ -1,46 +0,0 @@
----
-tags: [cli, linux]
-title: apache httpd
-created: '2019-07-30T06:19:48.985Z'
-modified: '2019-07-30T09:05:39.597Z'
----
-
-# apache httpd
-
-> `A Patchy Server`
-
-```sh
-# prerequesite
-source /etc/apache2/envvars \
-apache2 -S # Show settings as parsed from the config file
-```
-
-```sh
-a2enmode ssl # enable-modules
-
-# /server-status
-a2enmod info.load
-a2enmod info.conf # vim /etc/apach2/mods-available/info.conf => comment Require to access outside localhost
-service apache2 restart
-
-a2ensite vhosts_nam.com.conf # enable site
-```
-
-## apachectl
-
-### test config
-```sh
-apachectl configtest
-
-/usr/local/apache/bin/apachectl configtest
-```
-### list modules
-```sh
-apache2ctl -M # list loaded modules
-
-apachectl -t -D DUMP_MODULES # list loaded modules
-
-ls /etc/apache2/mods-enabled/ # list enabled modules
-ls /etc/apache2/mods-available/ # list available modules
-```
-[Generate Mozilla Security Recommended Web Server Configuration Files](https://mozilla.github.io/server-side-tls/ssl-config-generator/)
diff --git a/notes/apache2.md b/notes/apache2.md
new file mode 100644
index 00000000..c622f0bf
--- /dev/null
+++ b/notes/apache2.md
@@ -0,0 +1,76 @@
+---
+tags: [linux]
+title: apache2
+created: '2019-07-30T06:19:48.985Z'
+modified: '2023-04-11T15:53:46.578Z'
+---
+
+# apache2
+
+> `A Patchy Server` and package
+
+## install
+
+```sh
+apt-get install apache2
+```
+
+## usage
+
+```sh
+# prerequesite
+source /etc/apache2/envvars \
+apache2 -S # Show settings as parsed from the config file
+apache2 -v
+
+service apache2 restart
+```
+
+## apachectl
+
+```sh
+
+apachectl configtest # test config
+
+/usr/local/apache/bin/apachectl configtest
+
+
+apache2ctl -M # list loaded modules
+
+apachectl -t -D DUMP_MODULES # list loaded modules
+
+ls /etc/apache2/mods-enabled/ # list enabled modules
+ls /etc/apache2/mods-available/ # list available modules
+```
+
+## a2enmode
+
+```sh
+a2enmode ssl # enable-modules
+
+a2enmod info.load # /server-status
+
+a2enmod info.conf
+# vim /etc/apach2/mods-available/info.conf => comment Require to access outside localhost
+```
+
+## a2ensite
+
+```sh
+a2ensite vhosts_nam.com.conf # enable site / virtual host
+```
+
+```sh
+-q, --quiet # don't show informative messages.
+-m, --maintmode # enables the maintainer mode
+-p, --purge # purge all traces of the module in the internal state data base
+```
+
+```sh
+a2dissite 000-default
+```
+
+## see also
+
+- [Generate Mozilla Security Recommended Web Server Configuration Files](https://mozilla.github.io/server-side-tls/ssl-config-generator/)
+- [manpages.debian.org/jessie/apache2/a2ensite.8.en.html](https://manpages.debian.org/jessie/apache2/a2ensite.8.en.html)
diff --git a/notes/api consul.md b/notes/api consul.md
new file mode 100644
index 00000000..facc43bf
--- /dev/null
+++ b/notes/api consul.md
@@ -0,0 +1,53 @@
+---
+tags: [iac]
+title: api consul
+created: '2019-07-30T06:19:49.077Z'
+modified: '2023-03-22T09:58:30.041Z'
+---
+
+# api consul
+
+> api can perform basic CRUD operations on nodes, services, checks, configuration etc.
+
+## usage
+
+```sh
+GET /v1/status/leader
+
+# /agent endpoint used to interact with local consul-agent !
+GET /v1/agent/members
+
+PUT /v1/agent/service/register # add new service to local agent
+
+# /catalog endpoint register/deregister nodes, services, and checks in Consul
+GET /v1/catalog/services
+
+GET /v1/catalog/services | jq -r 'to_entries[].key' # get only service names
+
+GET /v1/catalog/service/SERVICE_NAME | jq -r '.[] | "\(.Node) \(.ServicePort) \(.ServiceID)"'
+
+GET /v1/catalog/service/SERVICENAME | jq '.[].ServiceID' # get service id
+
+GET /v1/catalog/register
+
+PUT /v1/catalog/register
+{
+ "Datacenter": "dc1",
+ "Node": "NODE",
+ "Address": "1.2.3.4",
+ "ServiceName": "SERVICE_NAME"
+}
+
+PUT /v1/catalog/deregister
+{
+ "Datacenter": "dc1",
+ "Node": "NODE",
+ "ServiceID": "NODE-vip-svc:k4dv467p..qw07xh:HOST:PORT"
+}
+```
+
+## see also
+
+- [[consul]]
+- [[vault]]
+- [[curl]]
diff --git a/notes/api design rest.md b/notes/api design rest.md
new file mode 100644
index 00000000..240cdd42
--- /dev/null
+++ b/notes/api design rest.md
@@ -0,0 +1,276 @@
+---
+tags: [Notebooks]
+title: api design rest
+created: '2019-07-30T06:19:49.224Z'
+modified: '2023-03-25T12:32:33.176Z'
+---
+
+# api design rest
+
+> from `RESTful API Design โ OCTO Quick Reference Card`
+
+## general concepts
+
+## KISS
+
+Anyone should be able to use your API without having to refer to the documentation.
+- Use standard, concrete and shared terms, not your specific business terms or acronyms.
+- Never allow application developers to do things more than one way.
+- Design your API for your clients
+
+(Application developers), not for your data.
+- Target major uses cases first, deal with exceptions later
+
+```sh
+GET /orders
+GET /users
+GET /products
+
+curl โXPOST -H "Accept: application/json" \
+ -H "Authorization: Bearer at-80003004-19a8-46a2-908e-33d4057128e7" \
+ -d '{"state":"running"}' \
+ https://api.fakecompany.com/v1/users/007/orders?client_id=API_KEY_003
+```
+
+### Medium grained resources
+
+You should use medium grained, not fine nor coarse. Resources shouldnโt be nested more than two level deep e.g.
+
+```json
+GET /users/007
+{
+ "id":"007",
+ "firstname":"James",
+ "name":"Bond",
+ "address":{
+ "street":"H.Ferry Rd.",
+ "country": { "name":"London" }
+ }
+}
+```
+
+consider the following five subdomains
+Production `https://api.fakecompany.com`
+Tests `https://api.sandbox.fakecompany.com`
+Developer portal `https://developers.fakecompany.com`
+Production `https://oauth2.fakecompany.com`
+Tests `https://oauth2.sandbox.fakecompany.com`
+
+---
+
+## URLs
+
+### Nouns
+
+You should use `nouns`, not `verbs` (vs SOAP-RPC). `GET /orders` not `/getAllOrders`
+
+### Plurals
+
+use plural nouns not singular nouns to manage two different types of resources :
+- CollecTon resource : `/users `
+- Instance resource : `/users/007`
+
+You should remain consistent. `GET /users/007` not `GET /user/007`
+
+### Consistent case
+
+choose between `snake_case` or `camelCase` for attributes and parameters, but remain consistent
+- `GET /orders?id_user=007` or `GET /orders?idUser=007`
+- `POST/orders {"id_user":"007"}` or `POST/orders {"idUser":"007"}`
+
+if you have to use more than one word in URL, you should use spinal-case (some servers ignore case). `POST /specific-orders`
+
+### Versioning
+
+make versioning mandatory in the URL at the highest scope (major versions). You may support at most two versions at the same time
+`GET /v1/orders`
+
+### Hierarchical structure
+
+leverage the hierarchical nature of the URL to imply structure (aggregatoon or composition)
+e.g.: an order contains products.
+`GET /orders/1234/products/1`
+
+## CRUD-like operations
+
+Use HTTP verbs for CRUD operations `Create/Read/Update/Delete`
+
+```sh
+Verb Collection: /orders Instance: /orders/{id}
+
+GET Read a list orders. 200 OK Read detail of single order. 200 OK
+POST Create a new order. 201 Created -
+PUT - Full Update : 200 OK / Create a specific order: 201 Created
+PATCH - Partial Update. 200 OK
+DELETE - Delete order. 204 OK
+```
+
+
+```sh
+# POST is used to Create an instance of a collection.
+# The ID isnโt provided, and the new resource location is returned in the `Location` Header.
+POST /orders {"state":"running", "id_user":"007"}
+201 Created
+Location: https://api.fakecompany.com/orders/1234
+
+# But remember that, if the ID is specified by the client,
+
+# `PUT` is used for Create.
+PUT /orders/1234
+201 Created
+
+#`PUT` is used for Update to perform a full replacement.
+PUT /orders/1234 {"state":"paid", "id_user":"007"}
+200 Ok
+
+
+#`PATCH` is commonly used for partial Update.
+PATCH /orders/1234 {"state":"paid"}
+200 Ok
+
+#`GET` is used to Read a collection.
+GET /orders
+200 Ok
+[
+ {"id":"1234", "state":"paid"}
+ {"id":"5678", "state":"running"}
+]
+
+
+# GET is used to Read an instance.
+GET /orders/1234
+200 Ok
+{"id":"1234", "state":"paid"}
+```
+
+---
+
+## Query strings
+
+### Search
+
+You may use the โGoogle wayโ to perform a global search on multiple resources.
+`GET /search?q=running+paid`
+
+### Filters
+
+You should use `?` to filter resources
+`GET /orders?state=payed&id_user=007`
+or (multiple URIs may refer to the same resource)
+`GET /users/007/orders?state=paied`
+
+### Pagination
+
+You may use a range query parameter. Pagination is mandatory : a default pagination has to be defined, for example: range=0-25.
+The response should contain the following headers: `Link`, `Content-Range`, `Accept-Range`.
+Note that pagination may cause some unexpected behavior if many resources are added.
+
+```sh
+/orders?range=48-55
+206 Partial Content
+Content-Range: 48-55/971
+Accept-Range: order 10
+Link : ; rel="first",
+; rel="prev",
+; rel="next",
+; rel="last"
+```
+
+### Partial responses
+
+You should use partial responses so developers can select informaTon needed and optimize bandwidth (mobile development).
+
+```sh
+GET /users/007?fields=firstname,name,address(street)
+
+200 OK
+
+{
+ "id":"007",
+ "firstname":"James",
+ "name":"Bond",
+ "address": {
+ "street":"Horsen Ferry Road"
+ }
+}
+```
+
+### Sort
+
+Use `?sort =atribute1,atributeN` to sort resources. By default resources are sorted in ascending order.
+Use `?desc=atribute1,atributeN` to sort resources in descending order
+`GET /restaurants?sort=rating,reviews,name;desc=rate,reviews`
+
+```sh
+# URL reserved words : first, last, count
+# Use `/first` to get the 1st element
+GET /orders/first
+200 OK
+{"id":"1234", "state":"paid"}
+
+
+# Use `/last` to retrieve the latest resource of a collection
+GET /orders/last
+200 OK
+{"id":"5678", "state":"running"} !
+
+# Use `/count` to get the current size of a collection
+GET /orders/count !!
+200 OK !
+{"2"}
+```
+
+---
+
+## Other concepts
+
+### Content negotiation
+
+Content negotiation is managed only in a pure RESTful way. The client asks for the requierd content, in the Accept Header, in order of preference. Default format is JSON. Accept: application/json, text/plain not /orders.json!
+
+### I18N
+
+Use ISO 8601 standard for Date/Time/Timestamp: `1978-05-10T06:06:06+00:00` or `1978-05-10`
+Add support for different Languages. Accept-Language: `fr-ca, fr-fr` not `?language=fr`
+
+### Cross-origin requests
+
+Use `CORS` standard to support REST API requests from browsers (js SPAโฆ).
+But if you plane to support Internet Explorer 7/8 or 9, you shall consider specifics endpoints to add a `jsonp` support.
+- All requests will be sent with a GET method!
+- Content negoTation cannot be handled with Accept Header in Jsonp.
+- Payload cannot be used to send data. !
+
+`POST /orders` and `/orders.jsonp?method=POST&callback=foo`
+`GET /orders` and `/orders.jsonp?callback=foo`
+`GET /orders/1234` and `/orders/1234.jsonp?callback=foo`
+`PUT /orders/1234` and `/orders/1234.jsonp?method=PUT&callback=foo`
+
+Warning: a web crawler could easily damage your application with a method parameter. Make sure that an OAuth2 `access_token` is required, and an OAuth2 `client_id` as well.
+
+### HATEOAS
+
+Your API should propose Hypermedia links in order to be completely discoverable. But keep in mind that a majority of users wont probably use those hyperlinks, and will read the API documentation and copy/paste call examples. So, each call to the API should return in the Link Header every possible state of the application from the current state, plus self. You may use `RFC5988` Link notation to implement HATEOAS:
+
+```sh
+GET /users/007
+< 200 Ok
+< { "id":"007", "firstname":"James",...}
+< Link : ; rel="self"; method:"GET",
+; rel="addresses"; method:"GET",
+; rel="orders"; method:"GET"
+```
+
+### "Non-Resources" scenarios
+
+In a few use cases we have to consider operations or services rather than resources.
+You may use a `POST` request with a verb at the end of the URI
+`POST /emails/42/send`
+`POST /calculator/sum [1,2,3,5,8,13,21]`
+`POST /convert?from=EUR&to=USD&amount=42`
+
+## see also
+
+- [[curl]]
+- [[acid crud]]
+
diff --git a/notes/api docker registry.md b/notes/api docker registry.md
new file mode 100644
index 00000000..c0b265cf
--- /dev/null
+++ b/notes/api docker registry.md
@@ -0,0 +1,27 @@
+---
+tags: [container]
+title: api docker registry
+created: '2019-07-30T06:19:49.043Z'
+modified: '2023-03-22T10:23:02.551Z'
+---
+
+# api docker registry
+
+## usage
+
+```sh
+HEAD /v2//blobs/
+
+GET /v2/path/manifests/0.0.2-SNAPSHOT
+
+GET /v2/path/manifests/latest
+
+curl --head -k -H "Accept: application/vnd.docker.distribution.manifest.v2+json" \
+ -u user:pass "https://foo.bar.baz/v2/path/manifests/0.0.2-SNAPSHOT"
+```
+
+## see also
+
+- [[docker]]
+- [[nexus api]]
+
diff --git a/notes/api docker.md b/notes/api docker.md
new file mode 100644
index 00000000..5fe7f238
--- /dev/null
+++ b/notes/api docker.md
@@ -0,0 +1,64 @@
+---
+tags: [container]
+title: api docker
+created: '2019-08-20T09:42:39.909Z'
+modified: '2023-03-22T10:23:02.539Z'
+---
+
+# api docker
+
+## usage
+
+```sh
+-H "unix:///var/run/docker.sock" # docker-daemon listen unix socket
+
+curl --unix-socket /var/run/docker.sock \
+ "http://./debug/pprof/goroutine?debug=2" # dump stacktrace
+
+curl --unix-socket /var/run/docker.sock \
+ "http://containers/json" # start container
+
+curl -XPOST --unix-socket /var/run/docker.sock \
+ -H 'Content-Type: application/json' \
+ -d '{"Image":"nginx"}' \
+ "http://localhost/containers/create"
+# { "Id": "fcb65c6147efcb6...7d65", "Warnings":null }
+
+curl -XPOST --unix-socket /var/run/docker.sock \
+ http://localhost/containers/fcb6...7d65/start
+
+# get events from inside container
+docker run -ti \ # run in interactive-mode
+ -v /var/run/docker.sock:/var/run/docker.sock \ # (1) bind mounts the docker.sock
+ alpine sh
+curl --unix-socket /var/run/docker.sock \ # (2) get events
+ "http://localhost/events"
+
+curl -XGET --unix-socket /run/docker/plugins/nfs.sock/Plugin.Activate \
+ "http://%2Frun%2Fdocker%2Fplugins%2Fnfs.sock/Plugin.Activate"
+
+curl -XGET --unix-socket /run/docker/plugins/nfs.sock \
+ "http://%2Frun%2Fdocker%2Fplugins%2Fnfs.sock/Plugin.Activate"
+
+curl -XGET --unix-socket /run/docker/plugins/nfs.sock \
+ "http://%2Frun%2Fdocker%2Fplugins%2Fnfs.sock/VolumeDriver.List"
+
+curl -XGET --unix-socket /run/docker/plugins/nfs.sock \
+ "http://%2Frun%2Fdocker%2Fplugins%2Fnfs.sock/VolumeDriver.Path"
+
+curl -XGET --unix-socket /run/docker/plugins/nfs.sock \
+ "http://%2Frun%2Fdocker%2Fplugins%2Fnfs.sock/VolumeDriver.Capabilities"
+
+curl -XGET --unix-socket /run/docker/plugins/nfs.sock \
+ "http://%2Frun%2Fdocker%2Fplugins%2Fnfs.sock/VolumeDriver.Get"
+
+/Plugin.Activate
+```
+
+## see also
+
+- [[curl]]
+- [[unix socket]]
+- [[api kubernetes]]
+- [docs.docker.com/engine/api](https://docs.docker.com/engine/api/v1.24/)
+- [github.com/docker/go-plugins-helpers/](https://github.com/docker/go-plugins-helpers/)
diff --git a/notes/api elasticsearch.md b/notes/api elasticsearch.md
new file mode 100644
index 00000000..77f5dc2b
--- /dev/null
+++ b/notes/api elasticsearch.md
@@ -0,0 +1,66 @@
+---
+tags: [elasticsearch]
+title: api elasticsearch
+created: '2019-09-03T09:09:54.970Z'
+modified: '2023-03-22T10:23:02.560Z'
+---
+
+# api elasticsearch
+
+## usage
+
+```sh
+GET /_cat/nodes?h=h,diskAvail
+
+GET /_cat/indices?v # show all indices open and close !
+
+GET /_cat/indices/some-index_392?v
+
+GET /_cat/allocation?v
+
+GET /_cat/allocation?v&pretty&h=node,disk.indices,disk.used,disk.avail,disk.total,disk.percent
+
+GET /_cat/shards?v
+
+GET /_cat/shards?v&h=index,shard,docs,store,node
+
+?help
+?bytes=b
+# `b` Bytes
+# `kb` Kilobytes
+# `mb` Megabytes
+# `gb` Gigabytes
+# `tb` Terabytes
+# `pb` Petabytes
+?s=order:desc,index_patterns
+
+
+GET /_nodes/process?pretty # e.g. find out mlockall: true
+
+GET /_nodes/_all/settings?flat_settings
+
+
+GET /_cluster/health?pretty # status
+
+GET /_cluster/state/metadata
+
+GET /_cluster/state/blocks
+
+
+GET /_cluster/settings
+
+PUT /_cluster/settings '{ "transient": { "cluster.routing.allocation.disk.watermark.low": "90%", "cluster.routing.allocation.disk.watermark.high": "90%" } }'
+# disk-based shard allocation
+# cluster.routing.allocation.disk.watermark.low # (85%) will not allocate shards to nodes that have more than 85% disk used.
+# cluster.routing.allocation.disk.watermark.high # (90%) attempt to relocate shards away from a node whose disk usage is above 90%.
+# cluster.routing.allocation.disk.watermark.flood_stage # (95%) enforces a read-only index block (`index.blocks.read_only_allow_delete`) on every index that has one or more shards allocated on the node that has at least one disk exceeding the flood stage. This is a last resort to prevent nodes from running out of disk space. The index block must be released manually once there is enough disk space available to allow indexing operations to continue.
+
+PUT /_cluster/settings '{ "transient" :{ "cluster.routing.allocation.exclude._ip" : "10.20.30.40" } }' # remove node from cluster
+```
+
+## see also
+
+- [[curator]]
+- [[ulimit]]
+- [reference/current/cat.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/cat.html)
+
diff --git a/notes/api github.md b/notes/api github.md
new file mode 100644
index 00000000..078fc50f
--- /dev/null
+++ b/notes/api github.md
@@ -0,0 +1,34 @@
+---
+tags: [cloud]
+title: api github
+created: '2020-11-20T23:42:32.328Z'
+modified: '2023-05-24T08:45:01.604Z'
+---
+
+# api github
+
+>
+
+## usage
+
+```sh
+api.github.com
+
+GET /users/ORG/orgs
+
+GET /orgs/ORG/repos
+
+GET /users/USER/repos?type=owner | jq -r '.[] | select(.fork == false)|.ssh_url'
+
+
+curl --user "TOKEN:x-oauth-basic" "https://api.github.com/user"
+
+curl --user "TOKEN:x-oauth-basic" "https://api.github.com/orgs/ORG/repos" | jq -r '.[].ssh_url'
+```
+
+## see also
+
+- [developer.github.com/v3](https://developer.github.com/v3/)
+- [[api gitlab]]
+- [[jq]]
+- [[gh]]
diff --git a/notes/api gitlab.md b/notes/api gitlab.md
new file mode 100644
index 00000000..23cbe4bf
--- /dev/null
+++ b/notes/api gitlab.md
@@ -0,0 +1,29 @@
+---
+tags: [cloud]
+title: api gitlab
+created: '2023-03-11T10:08:17.544Z'
+modified: '2023-05-24T08:44:54.814Z'
+---
+
+# api gitlab
+
+## usage
+
+```sh
+curl "https://gitlab.example.com/api/v4/projects"
+
+curl --header "Authorization: Bearer OAUTH-TOKEN" "https://gitlab.example.com/api/v4/projects"
+curl --header "PRIVATE-TOKEN: " "https://gitlab.example.com/api/v4/projects"
+curl --header "Authorization: Bearer " "https://gitlab.example.com/api/v4/projects"
+
+
+GET "/api/v4/namespaces?per_page=50"
+
+GET "/api/v4/projects?pagination=keyset&per_page=100&order_by=id&sort=asc"
+```
+
+## see also
+
+- [[api github]]
+- [[curl]]
+- [[glab]]
diff --git a/notes/apk.md b/notes/apk.md
index d9e429e8..526fea86 100644
--- a/notes/apk.md
+++ b/notes/apk.md
@@ -1,38 +1,35 @@
---
-tags: [container/docker, linux/packagemanager]
+tags: [container, linux, packagemanager, shell]
title: apk
created: '2019-07-30T20:26:52.476Z'
-modified: '2019-07-30T20:37:01.456Z'
+modified: '2023-03-27T05:51:34.613Z'
---
# apk
-> Software packages for `Alpine Linux` are digitally signed `tar.gz` archives containing programs, configuration files, and dependency metadata. They have the extension `.apk`, and are often called `"a-packs"`
+> packages for `Alpine Linux` are digitally signed `tar.gz` archives containing programs, configuration files, and dependency metadata. They have the extension `.apk`, and are often called `"a-packs"`
-[wiki.alpinelinux.org](https://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management)
+## usage
-## list installed
```sh
-apk info
-```
+apk info # list installed
-## install package
-```sh
-apk add --no-cache package
-```
+apk add --no-cache package # install package
-### unsatisfiable constraints
-if package is only available in edge alpine repo, not in a stable one
-```sh
-echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
-```
-[docker - ERROR: unsatisfiable constraints using apk in dockerfile - Stack Overflow](https://stackoverflow.com/a/48893148)
+apk add --update py-pip
+apk del pkg
----
+# unsatisfiable constraints
+# if package is only available in edge alpine repo, not in a stable one
+echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
+```
+## see also
-[docker-alpine :: viewdocs.io](http://gliderlabs.viewdocs.io/docker-alpine/)
-[BusyBox - The Swiss Army Knife of Embedded Linux](https://busybox.net/downloads/BusyBox.html)
+- [wiki.alpinelinux.org](https://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management)
+- [docker-alpine :: viewdocs.io](http://gliderlabs.viewdocs.io/docker-alpine/)
+- [BusyBox - The Swiss Army Knife of Embedded Linux](https://busybox.net/downloads/BusyBox.html)
+- [ERROR: unsatisfiable constraints using apk in dockerfile - Stack Overflow](https://stackoverflow.com/a/48893148)
diff --git a/notes/apropos.md b/notes/apropos.md
new file mode 100644
index 00000000..592bf07d
--- /dev/null
+++ b/notes/apropos.md
@@ -0,0 +1,26 @@
+---
+tags: [linux, macos]
+title: apropos
+created: '2019-09-23T05:22:20.385Z'
+modified: '2023-05-19T11:12:34.655Z'
+---
+
+# apropos
+
+> search the whatis database for strings
+
+## usage
+
+```sh
+apropos namespace # searches for man pages with namespaces
+
+apropos -e fork # limit exact word
+apropos "^fork$"
+```
+
+## see also
+
+- [[man]], [[whatis]]
+- [[which]]
+- [[type]]
+- [[command-not-found]]
diff --git a/notes/apt-cache.md b/notes/apt-cache.md
new file mode 100644
index 00000000..8214afae
--- /dev/null
+++ b/notes/apt-cache.md
@@ -0,0 +1,32 @@
+---
+tags: [linux]
+title: apt-cache
+created: '2019-11-28T11:57:30.886Z'
+modified: '2020-04-21T08:30:28.253Z'
+---
+
+# apt-cache
+
+> performs a variety of operations on apt's package cache - does not manipulate the state of the system, but provides operations to search and generate interesting output from the package metadata
+
+## usage
+
+```sh
+apt-cache search REGEX # full text search on available package lists; searches package names and descriptions
+ # --full output identical to show is produced for each matched package
+ # --names-only long description is not searched, only the package name
+
+apt-cache search lint
+
+apt-cache search $i | grep -E "^$i\s"
+
+apt-cache madison rabbitmq-server
+
+apt-cache showpkg
+
+apt-cache policy
+```
+
+## see also
+
+- [[apt]]
diff --git a/notes/apt-file.md b/notes/apt-file.md
new file mode 100644
index 00000000..f39bc116
--- /dev/null
+++ b/notes/apt-file.md
@@ -0,0 +1,27 @@
+---
+tags: [linux]
+title: apt-file
+created: '2020-01-16T07:31:31.148Z'
+modified: '2022-04-06T11:35:45.799Z'
+---
+
+# apt-file
+
+> search for file/binary in packages
+
+## install
+
+`apt install apt-file`
+
+## usage
+
+```sh
+apt-file update
+
+apt-file search mkpasswd
+```
+
+## see also
+
+- [[apt]]
+- [[apt-get]]
diff --git a/notes/apt-get.md b/notes/apt-get.md
new file mode 100644
index 00000000..2b58eafe
--- /dev/null
+++ b/notes/apt-get.md
@@ -0,0 +1,28 @@
+---
+tags: [linux, packagemanager]
+title: apt-get
+created: '2021-10-29T12:42:44.200Z'
+modified: '2022-02-02T09:04:53.032Z'
+---
+
+# apt-get
+
+> apt package handling utility
+
+## usage
+
+```sh
+apt-get update
+
+apt-get upgrade
+
+apt-get install PACKAGE
+```
+
+## see also
+
+- [[apt]]
+- [[apt-key]]
+- [[brew]]
+- [[yum]]
+- [[zypper]]
diff --git a/notes/apt-key.md b/notes/apt-key.md
new file mode 100644
index 00000000..ca3a4f9d
--- /dev/null
+++ b/notes/apt-key.md
@@ -0,0 +1,47 @@
+---
+tags: [linux]
+title: apt-key
+created: '2022-02-02T08:54:23.749Z'
+modified: '2023-07-19T11:17:06.469Z'
+---
+
+# apt-key
+
+> manage list of keys used by apt to authenticate packages
+
+`apt-key` supports only the binary `openPGP` format (`"GPG key public ring"`) in files with the [[gpg]] extension
+
+## option
+
+```sh
+-v, --version # get version
+-h, --help # get help
+ --keyring FILE #
+```
+
+## usage
+
+```sh
+apt-key add FILE # add a new key to the list of trusted keys
+
+apt-key del KEY_ID # Remove a key from the list of trusted keys
+
+apt-key export KEY_ID # output the key keyid to standard output
+
+apt-key exportall # output all trusted keys to standard output
+
+apt-key list, finger # list trusted keys with fingerprints
+
+apt-key adv # pass advanced options to gpg, with adv
+
+apt-key adv \
+ --keyserver keyserver.ubuntu.com \
+ --recv-keys KEY_ID # --recv-key: download key from keyservers directly into the trusted set of keys
+```
+
+## see also
+
+- [[gpg]]
+- [[apt]]
+- [[apt-get]]
+- [[add-apt-repository]]
diff --git a/notes/apt.md b/notes/apt.md
index e1c5505a..ff03c87b 100644
--- a/notes/apt.md
+++ b/notes/apt.md
@@ -1,55 +1,33 @@
---
-tags: [linux/packagemanager]
+tags: [linux, packagemanager, python]
title: apt
created: '2019-07-30T20:20:43.614Z'
-modified: '2019-07-30T20:35:53.347Z'
+modified: '2023-06-28T08:24:27.222Z'
---
# apt
-### used packages
-```sh
-apt install net-tools # ifconfig, nslookup
-apt install dnsutils # dig
-apt install iputils-ping # ping
-apt install iproute2 # ip
-```
+> high-level commandline interface for the package management system, frontend to [[apt-get]]
-### repository commands
-```sh
-apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DF7DD7A50B746DD4
+## usage
-add-apt-repository "deb https://download.srcclr.com/ubuntu stable/"
-add-apt-repository ppa:ian-berke/ppa-drawers # ppa
+```sh
+apt update
-apt-get update
-apt-get install pkg
+apt install PKG
-add-apt-repository -r "deb https://download.srcclr.com/ubuntu stable/"
+apt remove PKG
-apt remove drawers
apt autoremove # remove former dependencies
-add-apt-repository -r ppa:ian-berke/ppa-drawers
-
-# apt-cache
-apt-cache madison rabbitmq-server
-apt-cache showpkg
-
-apt-cache policy
+apt list --installed
```
-### search for packages ?!
-```sh
-#!/bin/bash
-
-# declare -a arrayName=(...)
-package=('cmake' 'valac' 'libgtk-3-dev' 'librest-dev' 'libjson-glib-dev' 'libnotify-dev' 'libcanberra-dev' 'libx11-dev' 'libwebkitgtk-3.0-dev' 'libsqlite3-dev' 'libxtst-dev' 'libpurple-dev' 'libgee-dev' 'libdbusmenu-gtk-dev' 'libgtksourceview-3.0-dev')
+## see also
-echo 'array Size:' ${#package[@]}
-
-for i in "${package[@]}" do
- :
- echo $(apt-cache search $i | grep -E "^$i\s")
-done
-```
+- [[apt-get]]
+- [[apt-key]]
+- [[apt-file]]
+- [[apt-cache]]
+- [[brew]]
+- [[nix]]
diff --git a/notes/architectural pattern.md b/notes/architectural pattern.md
new file mode 100644
index 00000000..a2896b2e
--- /dev/null
+++ b/notes/architectural pattern.md
@@ -0,0 +1,15 @@
+---
+tags: [Notebooks]
+title: architectural pattern
+created: '2020-03-12T09:08:11.760Z'
+modified: '2022-04-06T11:36:03.247Z'
+---
+
+# architectural pattern
+
+> Even though an architectural pattern conveys an image of a system, it is not an architecture. An architectural pattern is a concept that solves and delineates some essential cohesive elements of a software architecture. Countless different architectures may implement the same pattern and share the related characteristics. Patterns are often defined as "strictly described and commonly available"
+
+## see also
+
+- [[hexagonal architecture]]
+- [[software design pattern]]
diff --git a/notes/argocd.md b/notes/argocd.md
new file mode 100644
index 00000000..181ae7fe
--- /dev/null
+++ b/notes/argocd.md
@@ -0,0 +1,40 @@
+---
+tags: [container]
+title: argocd
+created: '2020-10-26T12:29:59.372Z'
+modified: '2022-03-16T07:10:31.142Z'
+---
+
+# argocd
+
+> declarative, gitops continuous delivery tool for k8s
+
+## install
+
+```sh
+brew install argocd # install cli
+
+kubectl create namespace argocd # install argocd on cluster
+kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/core-install.yaml
+```
+
+## usage
+
+```sh
+argocd login HOST
+
+argocd app create guestbook \
+ --repo https://github.com/argoproj/argocd-example-apps.git \
+ --path guestbook \
+ --dest-server https://kubernetes.default.svc \
+ --dest-namespace default
+
+argocd app list
+```
+
+## see also
+
+- [[flux]]
+- [[gitops]]
+- [[kubectl]]
+- [[minikube]]
diff --git a/notes/arp.md b/notes/arp.md
new file mode 100644
index 00000000..33249a3a
--- /dev/null
+++ b/notes/arp.md
@@ -0,0 +1,45 @@
+---
+tags: [linux, net-tools, network]
+title: arp
+created: '2019-09-03T11:30:41.018Z'
+modified: '2023-03-22T08:28:25.338Z'
+---
+
+# arp
+
+> manipulates or displays the kernel's ipv4 network neighbour cache. It can add entries to the table, delete one, or display the current content.
+
+## install
+
+```sh
+apt install net-tools
+```
+
+## usage
+
+```sh
+arp -a # display (all) hosts in alternative (BSD) style
+
+arp -a | awk '{ ahost=$1; aip=$2; gsub("()","",aip); print aip }'
+
+arp -a | awk '{ gsub(/[()]/,""); print $1 " " $2}'
+
+
+arp -e # display (all) hosts in default (Linux) style
+
+arp -a 159.254.171.22
+
+arp -i ens192 # display for interface
+
+
+cat /proc/net/arp
+```
+
+## see also
+
+- [[arping]]
+- [[procfs]]
+- [[ip]]
+- [[net-tools vs iproute]]
+- [omputerhope.com/unix/arp](https://www.computerhope.com/unix/arp.htm)
+- [superuser.com/questions/1272010/where-is-the-arp-cache-on-linux](https://superuser.com/questions/1272010/where-is-the-arp-cache-on-linux)
diff --git a/notes/arping.md b/notes/arping.md
new file mode 100644
index 00000000..1c39e84c
--- /dev/null
+++ b/notes/arping.md
@@ -0,0 +1,32 @@
+---
+tags: [linux]
+title: arping
+created: '2019-12-26T19:30:34.765Z'
+modified: '2023-03-25T12:45:27.436Z'
+---
+
+# arping
+
+> send arp requests to a neighbour host
+
+## install
+
+```sh
+apt install arping
+yum install arping
+```
+
+## usage
+
+```sh
+arping # send arp request to a neighbour host
+
+arping -I eth0 192.168.1.1 # send arp request to 192.168.1.1 via interface eth0
+
+arping -D -I eth0 192.168.1.1 # check for duplicate MAC addresses at 192.168.1.1 on eth0
+```
+
+## see also
+
+- [[arp]]
+- [[ping]]
diff --git a/notes/as.md b/notes/as.md
new file mode 100644
index 00000000..95a9b893
--- /dev/null
+++ b/notes/as.md
@@ -0,0 +1,27 @@
+---
+tags: [macos]
+title: as
+created: '2023-05-09T06:57:12.701Z'
+modified: '2023-05-09T06:58:58.845Z'
+---
+
+# as
+
+> macos X Mach-O GNU-based assemblers - translates assembly code in the named files to object code
+
+## option
+
+```sh
+-o name # name the output file name instead of a.out
+```
+
+## usage
+
+```sh
+as -o FILE.o FILE.as
+```
+
+## see also
+
+- [[ld]]
+- [[make]]
diff --git a/notes/ascii.md b/notes/ascii.md
index 4c79cf41..d9949b08 100644
--- a/notes/ascii.md
+++ b/notes/ascii.md
@@ -1,91 +1,85 @@
---
-tags: [encoding/ascii]
+tags: [linux, macos, Notebooks]
title: ascii
created: '2019-07-30T06:19:48.987Z'
-modified: '2019-07-30T09:06:14.044Z'
+modified: '2023-05-19T11:04:19.568Z'
---
# ascii
-> `ASCII - American Standard Code for Infromation Interchange` is a character `encoding`standard for electronic communication
+> `american standard code for infromation interchange` - character `encoding` standard
+`codepoint` - numeric value that maps to a character
+`codespace` - set of all codepoints
-## ascii character set
+ascii is comprised of 128 `codepoints` from `0x00` to `0x7F`
-```sh
-man ascii
-```
+## install
-### print all avail. characters
```sh
-for ((i=32;i<127;i++)) do
- printf "\\$(printf %03o "$i")";
-done
-printf "\n"
+brew install ascii
```
-
-| char | oct | hex |dec |
-| :-- | :-- | :-- |:-- |
-| `"` | 042 | 22 | 34 |
-| `J` | 112 | 4a | 74 |
+## option
```sh
-printf '\112' # or
-echo $'\112' # octal
-
-printf '\x4a' # hex
-
-printf "\\$(printf %o 74)" # or
-xxd -r <<<'0 4a' # decimal
+-t # one-line output
+-a # vertical format
+-d # Decimal table
+-o # octal table
+-x # hex table
+-b # binary table
+-h # This help screen
+-v # version information
```
+## usage
-## get decimal-set
```sh
-echo '"' | tr -d "\n" | od -An -t uC
-# | โโโโโโโโโโโโโโโโโ Use od (octal dump) to print:
-# | -An means Address none
-# remove "newline" char -t select a type
-# u type is unsigned decimal.
-# C of size (one) char
-
+ascii -x # get table in hex
+man 7 ascii # table hexadecimal
```
-## hexdump file
-```sh
-xxd docker-compose.yml # hexdump of file
```
-[Jafrog's dev blog](http://jafrog.com/2013/11/23/colors-in-terminal.html)
-
-
-## table hexadecimal
-
+char | oct | hex | dec
+" | 042 | 22 | 34
+J | 112 | 4a | 74
```
-# _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F
-
-# 0_ NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO SI
-# 0 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
-# 1_ DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US
-# 16 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
+## hex
-# 2_ SP ! " # $ % & ' ( ) * + , - . /
-# 32 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
-
-# 3_ 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
-# 48 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
-
-# 4_ @ A B C D E F G H I J K L M N O
-# 64 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
-
-# 5_ P Q R S T U V W X Y Z [ \ ] ^ _
-# 80 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
-
-# 6_ ` a b c d e f g h i j k l m n o
-# 96 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
-
-# 7_ p q r s t u v w x y z { | } ~ DEL
-# 112 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
```
+00 nul 01 soh 02 stx 03 etx 04 eot 05 enq 06 ack 07 bel
+08 bs 09 ht 0a nl 0b vt 0c np 0d cr 0e so 0f si
+10 dle 11 dc1 12 dc2 13 dc3 14 dc4 15 nak 16 syn 17 etb
+18 can 19 em 1a sub 1b esc 1c fs 1d gs 1e rs 1f us
+20 sp 21 ! 22 " 23 # 24 $ 25 % 26 & 27 '
+28 ( 29 ) 2a * 2b + 2c , 2d - 2e . 2f /
+30 0 31 1 32 2 33 3 34 4 35 5 36 6 37 7
+38 8 39 9 3a : 3b ; 3c < 3d = 3e > 3f ?
+40 @ 41 A 42 B 43 C 44 D 45 E 46 F 47 G
+48 H 49 I 4a J 4b K 4c L 4d M 4e N 4f O
+50 P 51 Q 52 R 53 S 54 T 55 U 56 V 57 W
+58 X 59 Y 5a Z 5b [ 5c \ย 5d ] 5e ^ 5f _
+60 ` 61 a 62 b 63 c 64 d 65 e 66 f 67 g
+68 h 69 i 6a j 6b k 6c l 6d m 6e n 6f o
+70 p 71 q 72 r 73 s 74 t 75 u 76 v 77 w
+78 x 79 y 7a z 7b { 7c | 7d } 7e ~ 7f del
+```
+
+## see also
+
+- [[bash printf]]
+- [[bash echo]]
+- [[man]]
+- [[od]]
+- [[xxd]]
+- [[iconv]]
+- [[baudot]]
+- [[markdown]]
+- [[url encoding]]
+- [[hyper text transfer protocol]]
+- [asciimoji.com](http://asciimoji.com/)
+- [asciiflow.com](https://asciiflow.com/#/)
+- [jafrog.com/2013/11/23/colors-in-terminal](http://jafrog.com/2013/11/23/colors-in-terminal.html)
diff --git a/notes/asdf.md b/notes/asdf.md
new file mode 100644
index 00000000..0c5aa2ab
--- /dev/null
+++ b/notes/asdf.md
@@ -0,0 +1,37 @@
+---
+tags: [shell]
+title: asdf
+created: '2021-03-29T06:54:55.237Z'
+modified: '2023-03-23T07:42:12.313Z'
+---
+
+# asdf
+
+> manage multiple language runtime versions on a per-project basis - like [[gvm]], [[nvm]], [[rbenv]],[[pyenv]], .. all in one! Simply install your language's plugin!
+
+## install
+
+```sh
+brew install asdf
+```
+
+## usage
+
+```sh
+asdf
+
+asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
+
+asdf list all nodejs
+
+asdf list all nodejs 14
+
+asdf install nodejs latest
+```
+
+
+## see also
+
+- [github.com/asdf-vm/asdf](https://github.com/asdf-vm/asdf)
+- [[sdk]]
+- [[nvm]]
diff --git a/notes/ash.md b/notes/ash.md
new file mode 100644
index 00000000..67008e6c
--- /dev/null
+++ b/notes/ash.md
@@ -0,0 +1,22 @@
+---
+tags: [shell]
+title: ash
+created: '2021-05-12T08:58:17.934Z'
+modified: '2023-03-22T09:24:17.335Z'
+---
+
+# ash
+
+> almquist shell
+
+## usage
+
+```sh
+zsh
+```
+
+## see also
+
+- [[busybox]]
+- [[bash]], [[dash]]
+- [rosettacode.org/wiki/Almquist_Shell](https://rosettacode.org/wiki/Almquist_Shell)
diff --git a/notes/asm assmbler.md b/notes/asm assmbler.md
deleted file mode 100644
index 28554962..00000000
--- a/notes/asm assmbler.md
+++ /dev/null
@@ -1,36 +0,0 @@
----
-tags: [lang/asm]
-title: asm assmbler
-created: '2019-07-30T06:19:48.988Z'
-modified: '2019-07-30T09:06:01.981Z'
----
-
-# asm assmbler
-
-
-```
-EAX,EBX,ECX,EDX - "general purpose", more or less interchangeable
-
-lea rbx, qword [..]
-
-```
-
-```c
-unsigned long a1, r;
-void junk( void )
-{
- asm(
- "pushl %eax \n"
- "pushl %ebx \n"
- "movl $100,%eax \n"
- "movl a1,%ebx \n"
- "int $69 \n"
- "movl %eax,r \n"
- "popl %ebx \n"
- "popl %eax \n"
- );
-}
-
-```
-
-
diff --git a/notes/asm.md b/notes/asm.md
new file mode 100644
index 00000000..a4ad9799
--- /dev/null
+++ b/notes/asm.md
@@ -0,0 +1,67 @@
+---
+tags: [c]
+title: asm
+created: '2019-07-30T06:19:48.988Z'
+modified: '2022-04-06T11:36:41.806Z'
+---
+
+# asm
+
+> assembly language - closely tied to processor architecture
+
+- `CISC` Complex Instruction-Set Computer
+- `RISC` Reduced Instruction-Set Computer
+- `DSP` Digital Signal Processor
+- `VLIW` Very Long Instruction Word
+
+## usage
+
+```asm
+; opcode operands
+add R1, R2, 3
+
+; opcodes: arithmetic/logical
+add
+sub
+mult
+Cmp
+
+; opcodes: memory load/store
+ld
+st
+
+; opcodes: control transfer
+jmp
+bne
+
+; opcodes: complex
+movs
+
+
+EAX,EBX,ECX,EDX - "general purpose", more or less interchangeable
+
+lea rbx, qword [..]
+
+```
+
+```c
+unsigned long a1, r;
+
+void junk( void ) {
+ asm( "pushl %eax \n"
+ "pushl %ebx \n"
+ "movl $100,%eax \n"
+ "movl a1,%ebx \n"
+ "int $69 \n"
+ "movl %eax,r \n"
+ "popl %ebx \n"
+ "popl %eax \n" );
+}
+```
+
+## see also
+
+- [[wasm]]
+- [[c]]
+- [[rust]]
+
diff --git a/notes/atlantis.md b/notes/atlantis.md
new file mode 100644
index 00000000..aff5e889
--- /dev/null
+++ b/notes/atlantis.md
@@ -0,0 +1,26 @@
+---
+tags: [iac]
+title: atlantis
+created: '2022-04-19T08:16:22.864Z'
+modified: '2023-03-22T10:33:37.859Z'
+---
+
+# atlantis
+
+> terraform pull request automation
+
+## usage
+
+```sh
+atlantis server \
+ --atlantis-url="$URL" \
+ --gh-user="$USERNAME" \
+ --gh-token="$TOKEN" \
+ --gh-webhook-secret="$SECRET" \
+ --repo-allowlist="$REPO_ALLOWLIST"
+```
+
+## see also
+
+- [[terraform]]
+- [github.com/runatlantis/atlantis](https://github.com/runatlantis/atlantis)
diff --git a/notes/atom.md b/notes/atom.md
index 321c0172..c0dabeb1 100644
--- a/notes/atom.md
+++ b/notes/atom.md
@@ -2,30 +2,38 @@
tags: [editor]
title: atom
created: '2019-07-30T06:19:48.989Z'
-modified: '2019-07-30T20:37:25.171Z'
+modified: '2022-03-04T07:42:47.142Z'
---
# atom
-cmd + shift + p # command palette will pop up
+> editor based on electron
-cmd + ; # open setting view
+## usage
-cmd + o # open project
-
-
-## atom package manager
```sh
-apm install project-manager
-
-apm install language-terraform
-
-apm install remember-session
+cmd + shift + p # command palette will pop up
+cmd + ; # open setting view
+cmd + o # open project
+ctl + shift + p `Window:Reload` # command palette
```
-## test
+## atom package manager
+```sh
+apm list # list installed packages
+
+apm install \
+ project-manager remember-session atom-beautify \
+ docker \
+ linter \
+ language-docker \
+ language-terraform terraform-fmt linter-terraform-syntax \
+```
-ctl + shift + p
-Window:Reload
+## see also
+- [[vim]]
+- [[code]]
+- [[idea]]
+- [[npm]]
diff --git a/notes/autoconf.md b/notes/autoconf.md
new file mode 100644
index 00000000..1eec58ef
--- /dev/null
+++ b/notes/autoconf.md
@@ -0,0 +1,43 @@
+---
+tags: [buildsystem, c]
+title: autoconf
+created: '2022-02-02T13:35:55.731Z'
+modified: '2023-03-22T10:40:07.333Z'
+---
+
+# autoconf
+
+> generate configuration scripts
+
+## option
+
+```sh
+# operation modes
+-h, --help # print this help, then exit
+-V, --version # print version number, then exit
+-v, --verbose # verbosely report processing
+-d, --debug # don't remove temporary files
+-f, --force # consider all files obsolete
+-o, --output=FILE # save output in FILE (stdout is the default)
+-W, --warnings=CATEGORY # report the warnings falling in CATEGORY
+
+# library directories
+-B, --prepend-include=DIR # prepend directory DIR to search path
+-I, --include=DIR # append directory DIR to search path
+
+# tracing
+-t, --trace=MACRO[:FORMAT] # report the list of calls to MACRO
+-i, --initialization # also trace autoconf's initialization process
+```
+
+## usage
+
+```sh
+autoreconf -fi # generate config script
+```
+
+## see also
+
+- [[make]]
+- [[automake]]
+- [[curl]]
diff --git a/notes/automake.md b/notes/automake.md
new file mode 100644
index 00000000..80f28603
--- /dev/null
+++ b/notes/automake.md
@@ -0,0 +1,27 @@
+---
+tags: [buildsystem, c]
+title: automake
+created: '2019-08-21T14:37:43.236Z'
+modified: '2023-05-01T13:14:21.485Z'
+---
+
+# automake
+
+> generates `Makefile.in` for configure from `Makefile.am`
+
+> `Makefile.am` is a programmer-defined file and is used by `automake` to generate the `Makefile.in` file
+
+- `.am` stands for `automake`
+- `.in` input for `configure` think of template
+
+## usage
+
+```sh
+automake
+```
+
+## see also
+
+- [[make]]
+- [[autoconf]]
+- [Using Autotools](https://developer.gnome.org/anjuta-build-tutorial/stable/create-autotools.html.en)
diff --git a/notes/awk snippets.md b/notes/awk snippets.md
deleted file mode 100644
index 6d14f4f2..00000000
--- a/notes/awk snippets.md
+++ /dev/null
@@ -1,48 +0,0 @@
----
-tags: [lang/awk]
-title: awk snippets
-created: '2019-08-02T07:17:02.123Z'
-modified: '2019-08-02T07:17:50.148Z'
----
-
-# awk snippets
-
-```sh
-awk '{if (NR!=1) {print} }' # skip first line
-
-awk '{print $NF}' # prints last field
-
-awk '{$1=$2=""; print $0}' # don't print fields $1 and $2
-
-awk '$3 ~ /^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/ {print $1,$3}' # print where $3 has an IPv4
-
-tar tvf scripts.tar | awk -F/ '{if (NF<4) print }' # print only first level of files
-
-awk '(NR%2 && /pattern/) || (!(NR%2) && /anotherpattern/)' # (NR%2) even and !(NR%2) uneven
-
-awk 'BEGIN{ FS=";" }{ print $6 }'
-
-awk -F'";"' '{ if (length($6)>31) print length($6),$6 }'
-
-awk '{ if( $1 ~ "swarm" && $3 == "alive") { split($2, arr, ":"); print arr[1]} }' # split '10.32.23.150:8301'
-```
-
-### csv
-```sh
-awk 'BEGIN {FS=","} ($15 != "") && ($19 == "10mbps SDSL" || $20 == "40mbps SDSL") { print .. }'
-
-awk 'BEGIN{FS=";"; TOTAL=0.00}{ if(NR!=1) {
- gsub(/\./,""); # remove dot from numbers like 4.000,00
- gsub(/,/,"."); # replace , with . due to locale problems -.-
- TOTAL +=sprintf("%f",$4);
- printf "%s %.2f %.2f\n",$4,$4,TOTAL
- }
- }END{ printf "%.2f\n",TOTAL }'
-
-awk '{ split($1,swm,"."); split($2,svs,"_"); tmp = svs[1]" "services[swm[1]]; services[swm[1]]=tmp; }END{
- for (i in services) {
- n=split(services[i], foo, " ");
- print i, n, services[i]
- }
- }'
-```
diff --git a/notes/awk.md b/notes/awk.md
index 697b4e51..a7b80c92 100644
--- a/notes/awk.md
+++ b/notes/awk.md
@@ -1,67 +1,149 @@
---
-tags: [lang/awk, linux]
+tags: [linux, macos]
title: awk
created: '2019-07-30T06:19:48.989Z'
-modified: '2019-08-02T07:17:00.040Z'
+modified: '2023-03-23T10:13:22.289Z'
---
# awk
-* initially developed in 1977 by `A`lfred Aho, Peter `W`einberger, and Brian `K`ernighan
-* [Learn awk in Y Minutes](https://learnxinyminutes.com/docs/awk/)
+
+> domain-specific-language for text processing, data extraction and reporting
+> data-driven scripting language
+> name derived from authors surnames: Alfred Aho, Peter Weinberger, and Brian Kernighan
### implementations
-```
-nawk # โnew awkโ, an evolution of oawk, the original UNIX implementation, used on *BSD and widely available on Linux
-mawk # a fast implementation that mostly sticks to standard features
-gawk # the GNU implementation, with many extensions
-Busybox # small, intended for embedded systems, not many features
-````
+
+- [[nawk]]: `new awk` (evolution of `oawk`), the original unix implementation
+- [[mawk]]: a fast implementation that mostly sticks to standard features
+- [[gawk]]: the gnu implementation, with many extensions
+- [[busybox]]: small, intended for embedded systems, not many features
+
+## option
+
```sh
-awk -f # Read the AWK program source from file
+-f SCRIPT # read awk program from file
-awk -F # Field Seperator
+-F ";" # field seperator
```
-### Built-in Variables
+## variables
+
+```sh
+# 2 types
+# variable which defines values which can be changed such as field separator `FS` and record separator `RS`
+# variable which can be used for processing and reports such as Number of records, number of fields
+
+CONVFMT # conversion format used when converting numbers (default %.6g)
+FS # input field separator; regular expression used to separate fields; also settable by option -Ffs.
+NF # number of fields in the current record
+NR # ordinal number of the current record
+FNR # ordinal number of the current record in the current file
+ # Number of Records relative to the current input file / hen using two input files => seperate RecordNumbers
+
+FILENAME # the name of the current input file
+RS # input record separator (default newline)
+OFS # output field separator (default blank)
+ORS # output record separator (default newline)
+OFMT # output format for numbers (default %.6g)
+SUBSEP # separates multiple subscripts (default 034)
+ARGC # argument count, assignable
+ARGV # argument array, assignable; non-null members are taken as filenames
+ENVIRON # array of environment variables; subscripts are names.
```
-# 1. Type: Variable which defines values which can be changed such as field separator and record separator.
-# 2. Type: Variable which can be used for processing and reports such as Number of records, number of fields.
+## functions
-FS # Input field separator variable
+```sh
+printf "%10.0f\n" 1.28071e+09 # print scientific notation as float to stdout
-OFS # Output Field Separator Variable
+var = fprintf("%s %d %.2f\n", "Testing", 1, 3) } # assigns its output to a variable, not stdout
-RS # Record Separator variable
+split($1,swm,"."); # split $1 into array swm[] with optional seperator "."
-ORS # Output Record Separator Variable
+substr("foobar", 2, 3) # => "oob"
-NR # Number of Records Variable / aka line
+substr("foobar", 4) # => "bar"
-NF # Number of Fields in a record / aka $1 $2 ..
+length("foo") # => 3
-FILENAME # Name of the current input file
+tolower("FOO") # => "foo"
-FNR # Number of Records relative to the current input file / when using two input files => seperate RecordNumbers
-```
+toupper("foo") # => "FOO"
-### Built-in Functions
+gsub(/"/, "") #"# remove quotes globally
```
-printf "%10.0f\n" 1.28071e+09 # print scientific notation as float to stdout
-var = fprintf("%s %d %.2f\n", "Testing", 1, 3) }' # assigns its output to a variable, not stdout
+## usage
+
+```sh
+awk '{$1=$1;print}' # trim whitespace from STDOUT
+ # works because assigning something to one of the fields, awk rebuilds the whole record
+ # by joining all fields ($1, ..., $NF) with OFS (space by default)
+awk '{$1=$1};1' # shorter
+awk '{$1=$1};NF' # also remove blank lines, NF: only print records for which the Number of Fields is non-zero
+
+awk '{if (NR!=1) {print} }' # skip first line
+
+awk '{print $NF}' # prints last field
+
+awk '{$1=$2=""; print $0}' # don't print fields $1 and $2
-gsub(/"/, "") # remove quotes globally
+awk '$3 ~ /^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/ {print $1,$3}' # print where $3 has an IPv4
-split($1,swm,"."); # split $1 into array swm[] with optional seperator "."
+tar tvf scripts.tar | awk -F/ '{if (NF<4) print }' # print only first level of files
-substr("foobar", 2, 3) # => "oob"
+awk '(NR%2 && /pattern/) || (!(NR%2) && /anotherpattern/)' # (NR%2) even and !(NR%2) uneven
-substr("foobar", 4) # => "bar"
+awk 'BEGIN{ FS=";" }{ print $6 }'
-length("foo") # => 3
+awk -F'";"' '{ if (length($6)>31) print length($6),$6 }'
-tolower("FOO") # => "foo"
+awk '{ if( $1 ~ "swarm" && $3 == "alive") { split($2, arr, ":"); print arr[1]} }' # split '10.32.23.150:8301'
-toupper("foo") # => "FOO"
+
+echo foo.bar.bbaz.com | awk 'BEGIN{FS="."}{print substr($3,2),$1}'
+
+
+# usage of arrays
+awk '{array[$5] += $4}END{ for(var in array){ printf("%s: %s GB\n",var, array[var]/1024/1024/1024) } }'
+
+awk '{ node[1]+=$3; node[2]+=$4; node[3]+=$5; node[4]+=$6; }END{
+ for(i in node){ printf("elastic-monitor-1-data-%s %s GB\n",i, node[i]/1024) } }'
+
+
+# matching ipv4 pattern
+awk 'BEGIN{ ORS="\n" }{ if ($3 ~ /^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/) { print $1} }'
+
+awk 'BEGIN{ NF=NF RS= OFS=+ }{ \
+ if ($3 ~ /^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/) { \
+ gsub(/^[[:space:]]+|[[:space:]]+$/,"",$1); print $1} \
+ }'
+
+
+# reading csv
+awk 'BEGIN {FS=","} ($15 != "") && ($19 == "10mbps SDSL" || $20 == "40mbps SDSL") { print .. }'
+
+awk 'BEGIN{FS=";"; TOTAL=0.00}{ if(NR != 1) {
+ gsub(/\./,""); # remove dot from numbers like 4.000,00
+ gsub(/,/,"."); # replace , with . due to locale problems -.-
+ TOTAL +=sprintf("%f",$4);
+ printf "%s %.2f %.2f\n",$4,$4,TOTAL
+ }
+ }END{ printf "%.2f\n",TOTAL }'
+
+awk '{
+ split($1,swm,"."); split($2,svs,"_"); tmp = svs[1]" "services[swm[1]]; services[swm[1]]=tmp; }END{
+ for (i in services) { n=split(services[i], foo, " "); print i, n, services[i] }
+ }'
+
+# cursor bounce around the terminal
+# Make your cursor bounce around the terminal. The 400000 in the for loop is just a busy delay. Adjust as needed.
+yes $COLUMNS $LINES | awk 'BEGIN{x=y=e=f=1}{if(x==$1||!x){e*=-1};if(y==$2||!y){f*=-1};x+=e;y+=f;printf "\033[%s;%sH",y,x;for (a=0;a<400000;a++){}}'
```
+
+## see also
+
+- [learnxinyminutes.com/docs/awk](https://learnxinyminutes.com/docs/awk/)
+- [[sed]]
+- [[grep]]
+- [[column]]
diff --git a/notes/aws-iam-authenticator.md b/notes/aws-iam-authenticator.md
new file mode 100644
index 00000000..3727ae0e
--- /dev/null
+++ b/notes/aws-iam-authenticator.md
@@ -0,0 +1,27 @@
+---
+tags: [cloud]
+title: aws-iam-authenticator
+created: '2022-03-24T07:18:31.601Z'
+modified: '2023-03-24T08:24:48.571Z'
+---
+
+# aws-iam-authenticator
+
+> tool to use AWS IAM credentials to authenticate to Kubernetes cluster
+
+## install
+
+```sh
+brew install aws-iam-authenticator
+```
+
+## usage
+
+```sh
+aws-iam-authenticator help
+```
+
+## see also
+
+- [[aws]]
+- [github.com/kubernetes-sigs/aws-iam-authenticator](https://github.com/kubernetes-sigs/aws-iam-authenticator)
diff --git a/notes/aws-nuke.md b/notes/aws-nuke.md
new file mode 100644
index 00000000..418d5cc9
--- /dev/null
+++ b/notes/aws-nuke.md
@@ -0,0 +1,73 @@
+---
+tags: [cloud]
+title: aws-nuke
+created: '2022-02-03T08:04:22.692Z'
+modified: '2023-03-24T08:24:48.590Z'
+---
+
+# aws-nuke
+
+> remove all resources from an aws account
+
+## install
+
+```sh
+wget -c https://github.com/rebuy-de/aws-nuke/releases/download/v2.16.0/aws-nuke-v2.16.0-linux-amd64.tar.gz -O - | sudo tar -xz -C $HOME/bin
+
+docker run --rm -it \
+ -v $(pwd)/.aws:/home/aws-nuke/.aws \
+ quay.io/rebuy/aws-nuke:v2.16.0 \
+ --profile default \
+ --config /home/aws-nuke/.aws/nuke-config.yml
+```
+
+## config
+
+```sh
+cat < nuke-config.yaml
+regions:
+- eu-west-1
+- global
+
+account-blocklist:
+- "999999999999" # production
+
+accounts:
+ "000000000000": {} # aws-nuke-example
+ "111100001111":
+ filters:
+ IAMUser:
+ - "admin"
+ IAMUserPolicyAttachment:
+ - "admin -> AdministratorAccess"
+ IAMUserAccessKey:
+ - "admin -> AKSDAFRETERSDF"
+ - "admin -> AFGDSGRTEWSFEY"
+
+resource-types:
+ excludes:
+ - IAMUser # don't nuke IAM users
+EOF
+```
+
+## option
+
+```sh
+--no-dry-run # to actually nuke resources
+--access-key-id # access key
+--secret-access-key # secret access key
+```
+
+## usage
+
+```sh
+aws-nuke resource-types # list resources
+
+aws-nuke -c config/nuke-config.yml --profile aws-nuke-example
+```
+
+## see also
+
+- [[aws]]
+- [[localstack]]
+
diff --git a/notes/aws.md b/notes/aws.md
new file mode 100644
index 00000000..582cf080
--- /dev/null
+++ b/notes/aws.md
@@ -0,0 +1,551 @@
+---
+tags: [iac]
+title: aws
+created: '2019-07-30T06:19:48.990Z'
+modified: '2022-12-05T14:51:00.473Z'
+---
+
+# aws
+
+> aws cli - unified tool to manage your aws services
+
+## install
+
+```sh
+curl -LO "https://awscli.amazonaws.com/AWSCLIV2.pkg" && installer -pkg ./AWSCLIV2.pkg -target /
+```
+
+## environment
+
+```sh
+AWS_ACCESS_KEY_ID # access key associated with an iam user or role
+AWS_CA_BUNDLE # path to certificate bundle for HTTPS certificate validation
+AWS_CLI_AUTO_PROMPT # enables auto-prompt, two settings can be used: on, on-partial
+AWS_CLI_FILE_ENCODING # encoding used for text files
+AWS_CONFIG_FILE # location of the file that the AWS CLI uses to store configuration profiles. default: ~/.aws/config
+AWS_DATA_PATH # list of additional directories to check outside of the built-in search path of ~/.aws/models
+AWS_DEFAULT_OUTPUT # output format: json, yaml, yaml-stream, text, table
+AWS_DEFAULT_REGION # aws region to send the request to
+AWS_EC2_METADATA_DISABLED # disables use of ec2 instance metadata service (IMDS)
+AWS_MAX_ATTEMPTS # specifies a value of maximum retry attempts the AWS CLI retry handler uses
+AWS_METADATA_SERVICE_NUM_ATTEMPTS # attempts to retrieve credentials once from the instance metadata service before stopping
+AWS_METADATA_SERVICE_TIMEOUT # seconds before connection to instance metadata service should time out
+AWS_PAGER # pager program used for output
+AWS_PROFILE # name of profile with credentials and options
+AWS_REGION # The AWS SDK compatible environment variable that specifies the AWS Region to send the request to
+AWS_RETRY_MODE # Specifies which retry mode AWS CLI uses. There are three retry modes available: legacy (default), standard, and adaptive.
+AWS_ROLE_ARN # ARN of an IAM role with a web identity provider
+AWS_ROLE_SESSION_NAME # name to attach to the role session, provided to RoleSessionName parameter; used with AWS_ROLE_ARN and AWS_WEB_IDENTITY_TOKEN_FILE
+AWS_SECRET_ACCESS_KEY # secret key associated with the access key
+AWS_SESSION_TOKEN # session token value that is required if you are using temporary security credentials retrieved directly from aws sts
+AWS_SHARED_CREDENTIALS_FILE # location of the file that the AWS CLI uses to store access keys. default path ~/.aws/credentials
+AWS_STS_REGIONAL_ENDPOINTS # how to determines aws service endpoint that the cli client uses to talk to the AWS Security Token Service
+ # default value for version 1: "legacy" / version 2: "regional"
+AWS_WEB_IDENTITY_TOKEN_FILE # path to file containing an OAuth 2.0 access token or OpenID Connect ID token
+```
+
+[docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html)
+
+## option
+
+```sh
+--color STRING # support for color output: on, off, auto
+--debug # enables debug logging by providing full python logs; (`CMD 2> FILE`, `CMD &> FILE`)
+--region REGION # override region
+--dry-run
+--output text # json
+--owners amazon
+--profile PROFILE
+--cli-auto-prompt, --no-cli-auto-prompt
+```
+
+[docs.aws.amazon.com/cli/latest/userguide/cli-configure-options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html)
+
+## usage
+
+## configure
+
+```sh
+aws configure
+aws configure list
+aws configure list-profiles
+
+aws --profile PROFILE configure set region REGION
+aws --profile PROFILE configure set default.region REGION
+aws --profile PROFILE configure set aws_access_key_id ACCESS_KEY_ID
+aws --profile PROFILE configure set aws_secret_access_key SECRET_ACCESS_KEY
+aws --profile PROFILE configure set aws_session_token AWS_SESSION_TOKEN
+```
+
+```sh
+cat < ~/.aws/config
+[profile PROFILE_NAME]
+aws_cli_auto_prompt = on|on-partial
+aws_cli_file_encoding = UTF-8
+aws_session_token =
+ca_bundle =
+cli_pager =
+credential_source = Ec2InstanceMetadata
+max_attempts =
+output = json|yaml|yaml-stream|text|table
+region = REGION
+retry_mode =
+role_arn = ROLE_ARN
+role_session_name =
+source_profile = PROFILE_NAME
+web_identity_token_file =
+EOF
+
+cat < ~/.aws/credentials
+[PROFILE_NAME]
+aws_access_key_id = AWS_ACCESS_KEY_ID
+aws_secret_access_key = AWS_SECRET_ACCESS_KEY
+EOF
+```
+
+[stackoverflow.com/replace-aws-keys-with-iam-role-in-aws-credentials](https://stackoverflow.com/a/50382297/14523221)
+
+## cloudtrail
+
+```sh
+aws cloudtrail lookup-events --max-results 1
+
+aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=DescribeVpcs
+# AttributeKeys: AccessKeyId, EventId, EventName, EventSource, ReadOnly, ResourceName, ResourceType, Username
+```
+
+## configservice
+
+```sh
+aws configservice select-resource-config \
+ --expression "SELECT resourceType GROUP BY resourceType" | jq -r '.Results[] | fromjson | .resourceType' | sort
+
+aws securityhub get-findings \
+ --filters \
+ --sort-criteria \
+ --page-size \
+ --max-items
+```
+
+## cloudfront
+
+```sh
+aws cloudfront list-cloud-front-origin-access-identities --output json
+```
+
+## cloudformation
+
+```sh
+aws cloudformation list-stacks --query "StackSummaries[*].StackName" --stack-status-filter \
+ CREATE_IN_PROGRESS \
+ CREATE_COMPLETE \
+ ROLLBACK_IN_PROGRESS \
+ ROLLBACK_FAILED \
+ ROLLBACK_COMPLETE \
+ DELETE_IN_PROGRESS \
+ DELETE_FAILED \
+ UPDATE_IN_PROGRESS \
+ UPDATE_COMPLETE_CLEANUP_IN_PROGRESS \
+ UPDATE_COMPLETE \
+ UPDATE_ROLLBACK_IN_PROGRESS \
+ UPDATE_ROLLBACK_FAILED \
+ UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS \
+ UPDATE_ROLLBACK_COMPLETE \
+ REVIEW_IN_PROGRESS
+```
+
+[[cdk]], [[cfn]], [[terraform]]
+
+## ec2 - elastic cloud compute
+
+```sh
+aws ec2 describe-instances \
+ --filters "Name=tag-key,Values=eks:cluster-name" "Name=tag-value,Values=eksworkshop*" \
+ --query 'Reservations[*].Instances[*].[PrivateDnsName,Tags[?Key==`eks:nodegroup-name`].Value|[0],Placement.AvailabilityZone,PrivateIpAddress,PublicIpAddress]' \
+ --output table
+
+aws ec2 describe-instances \
+ --filters Name=instance-state-name,Values=running \
+ --query "Reservations[*].Instances[*].InstanceId"
+
+ --query 'Images[?CreationDate>=`2016-04-01`][]'
+ --query "sort_by(Images, &CreationDate)[].Name"
+ --query "sort_by(Images, &CreationDate)[].[Name, ImageId]"
+ --query 'Images[*].[ImageId,CreationDate]'
+ --query 'sort_by(Images,&CreationDate)[-1].ImageId'
+ --query 'reverse(sort_by(Images, &CreationDate))[0]'
+ --query 'Images[*].[ImageId,CreationDate,Architecture]'
+
+--filters 'Name=name,Values=ubuntu/images/hvm-ssd/ubuntu-*-amd64-server-*' 'Name=state,Values=available'
+
+# latest ubuntu 20 server arm64 image => [-1:] returns the last element of the array
+--filters "Name=name,Values=ubuntu*20.04-arm64-server*" \
+ --query "sort_by(Images, &CreationDate)[-1:].[Name, ImageId]"
+
+--filters "Name=name,Values=ubuntu/images/hvm-ssd/ubuntu-xenial-16.04*" \
+ --query 'sort_by(Images, &CreationDate)[-1].[CreationDate,Name,ImageId]'
+
+aws autoscaling describe-auto-scaling-groups \
+ --query "AutoScalingGroups[? Tags[? (Key=='eks:cluster-name') && Value=='CLUSTER_NAME']].[AutoScalingGroupName, MinSize, MaxSize,DesiredCapacity]" \
+ --output table
+
+aws autoscaling describe-auto-scaling-groups `# get auto scaling group name` \
+ --query "AutoScalingGroups[? Tags[? (Key=='eks:cluster-name') && Value=='CLUSTER_NAME']].AutoScalingGroupName" \
+ --output text
+
+aws autoscaling update-auto-scaling-group \
+ --auto-scaling-group-name ASG_NAME \
+ --min-size 3 --desired-capacity 3 --max-size 4 # increase/decrease capacities
+
+
+aws ec2 create-security-group \
+ --description 'RDS SG' \
+ --group-name 'RDS_SG' \
+ --vpc-id VPC_ID
+
+aws ec2 describe-subnets `# get public subnet id's used by eks clsuter`\
+ --filters "Name=vpc-id,Values=VPC_ID" "Name=tag:Name,Values=EKS_CLUSTER_NAME/SubnetPublic*" \
+ --query 'Subnets[*].SubnetId' \
+ --output json | jq -c .
+
+
+aws ec2 describe-instance-types --instance-types m6i.large | jq
+```
+
+#### find vpc dependencies when 'DependencyViolation' occure
+
+```sh
+VPC="vpc-ID"
+
+aws ec2 describe-internet-gateways
+ --filters "Name=attachment.vpc-id,Values=$VPC" | jq -r '.InternetGateways[].InternetGatewayId'
+
+aws ec2 describe-subnets
+ --filters 'Name=vpc-id,Values='$VPC | grep SubnetId
+
+aws ec2 describe-route-tables
+ --filters 'Name=vpc-id,Values='$VPC | grep RouteTableId
+
+aws ec2 describe-network-acls
+ --filters 'Name=vpc-id,Values='$VPC | grep NetworkAclId
+
+aws ec2 describe-vpc-peering-connections
+ --filters 'Name=requester-vpc-info.vpc-id,Values='$VPC | grep VpcPeeringConnectionId
+
+aws ec2 describe-vpc-endpoints
+ --filters 'Name=vpc-id,Values='$VPC | grep VpcEndpointId
+
+aws ec2 describe-nat-gateways
+ --filters 'Name=vpc-id,Values='$VPC | grep NatGatewayId
+
+aws ec2 describe-security-groups
+ --filters 'Name=vpc-id,Values='$VPC | grep GroupId
+
+aws ec2 describe-instances
+ --filters 'Name=vpc-id,Values='$VPC | grep InstanceId
+
+aws ec2 describe-vpn-connections
+ --filters 'Name=vpc-id,Values='$VPC | grep VpnConnectionId
+
+aws ec2 describe-vpn-gateways
+ --filters 'Name=attachment.vpc-id,Values='$VPC | grep VpnGatewayId
+
+aws ec2 describe-network-interfaces
+ --filters 'Name=vpc-id,Values='$VPC | grep NetworkInterfaceId
+```
+
+### remove in-/egress rules from default secgroup
+
+```sh
+SEC_GROUP_ID="(aws ec2 describe-security-groups --filter Name=vpc-id,Values=vpc-09cb7d6df2e7f2e82 Name=group-name,Values=default --query 'SecurityGroups[*].[GroupId]' --output text)"
+
+aws ec2 revoke-security-group-ingress --group-id $SEC_GROUP_ID \
+ --ip-permissions "$(aws ec2 describe-security-groups --group-id $SEC_GROUP_ID --query "SecurityGroups[0].IpPermissions")"
+
+aws ec2 revoke-security-group-egress --group-id $SEC_GROUP_ID \
+ --ip-permissions "$(aws ec2 describe-security-groups --group-id sg-0e6d21618a794e886 --query "SecurityGroups[0].IpPermissionsEgress")"
+```
+
+### instance types
+
+```sh
+General Purpose # most popular; used for web servers, development environments
+Compute Optimized # compute-intensive apps such as some scientific modeling or high-performance web servers
+Memory Optimized # memory-intensive apps, such as real-time big data analytics, or running Hadoop or Spark
+Accelerated Computing # additional hardware (GPUs, FPGAs) to provide massive amounts of parallel processing for tasks such as graphics processing
+Storage Optimized # tasks that require huge amounts of storage, specifically with sequential read-writes, such as log processing
+```
+
+- [[ec2-instance-selector]]
+- [[max-pods-calculator]]
+
+## pricing
+
+```sh
+aws pricing describe-services --region us-east-1 | jq -r '.Services[] | .ServiceCode'
+```
+
+```sh
+curl 'https://ec2.shop?region=us-west-2'
+curl 'https://ec2.shop?region=us-west-2&filter=m4,m5,ssd'
+curl 'https://ec2.shop' -H 'accept: json'
+```
+
+- [[ec2-instance-selector]]
+- [ec2.shop](https://ec2.shop)
+- [docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html)
+
+
+## elastic load balancers
+
+```sh
+aws elb describe-load-balancers | jq '.LoadBalancerDescriptions[].LoadBalancerName'
+```
+
+## elastic kubernetes service
+
+```sh
+aws eks list-clusters
+
+aws eks describe-cluster --name CLUSTER_NAME
+
+aws eks describe-cluster --output text --name CLUSTER_NAME `# get vpc id` \
+ --query "cluster.resourcesVpcConfig.vpcId" \
+
+aws eks get-token --cluster-name CLUSTER_NAME | jq -r '.status.token'
+
+aws eks update-kubeconfig --region REGION --name CLUSTER_NAME
+
+aws eks describe-nodegroup --nodegroup-name NODE_GROUP-202200000012 --cluster-name CLUSTER_NAME
+```
+
+## ecs - elastic container service
+
+```sh
+aws ecs list-task-definitions | jq -r '.taskDefinitionArns[]'
+
+aws ecs describe-tasks --tasks TASK
+
+aws ecs put-account-setting-default \
+ --name awsvpcTrunking \
+ --value enabled \
+ --region eu-central-1
+
+aws ecs list-attributes \
+ --target-type container-instance \
+ --attribute-name ecs.awsvpc-trunk-id \
+ --cluster base-cluster \
+ --region eu-central-1
+
+aws ecs execute-command --cluster CLUSTER --task TASK --container CONTAINER --interactive --command "bash"
+```
+
+[[ecs-cli]]
+
+## iam - identity and access management
+
+```sh
+aws iam list-roles --path-prefix /aws-service-role/config.amazonaws.com/ # get roles of service-link
+
+aws iam list-roles | jq -r '.Roles[] | "\(.RoleName): \(.AssumeRolePolicyDocument.Statement[].Principal?)"'
+
+aws iam list-roles | jq '.Roles[] | {role: .RoleName, user: .AssumeRolePolicyDocument.Statement[].Principal.AWS} | select(.user != null)'
+
+aws iam list-policies --query 'Policies[PolicyName==`AmazonS3ReadOnlyAccess`].Arn'
+
+aws iam list-users | jq '.Users[].UserName' \
+ | xargs -I{} aws iam list-access-keys --user-name {} | jq -r '.AccessKeyMetadata[] | "\(.UserName) \(.AccessKeyId)"'
+
+# aws allows assigning only one MFA device (virtual or hardware) to root accounts
+# if the list-virtual-mfa-devices returns valid
+aws iam list-virtual-mfa-devices \
+ --assignment-status Assigned \
+ --query 'VirtualMFADevices[*].SerialNumber' arn: mfa-device currently assigned is virtual, not hardware !
+# if web console won't allow removal of mfa device
+aws iam delete-virtual-mfa-device --serial-number "arn:aws:iam::ACCOUNT_ID:mfa/root-account-mfa-device"
+
+# aws iam - access advisor
+aws iam generate-service-last-accessed-details --arn ARN # returns job-id
+
+aws iam get-service-last-accessed-details --job-id JOB_ID
+
+aws iam create-policy \
+ --policy-name POLICY_NAME \
+ --policy-document file://~/PATH/TO/POLICY.json
+
+
+aws iam put-group-policy \
+ --group-name GROUPE_NAME \
+ --policy-name POLICY_NAME \
+ --policy-document POLICY_DOCUMENT
+
+aws iam create-user --user-name USER_NAME
+
+aws iam add-user-to-group --group-name GROUPE_NAME --user-name USER_NAME
+
+aws iam get-group --group-name GROUP_NAME
+
+aws iam create-access-key --user-name USER_NAME
+```
+
+## relational database service
+
+```sh
+# create RDS Postgresql instance
+aws rds create-db-instance \
+ --db-instance-identifier RDS_NAME \
+ --db-name DB_NAME \
+ --db-instance-class db.t3.micro \
+ --engine postgres \
+ --db-subnet-group-name SEC_GROUP_NAME \
+ --vpc-security-group-ids $RDS_SG \
+ --master-username NAME \
+ --publicly-accessible \
+ --master-user-password RDS_PASSWORD \
+ --backup-retention-period 0 \
+ --allocated-storage 20
+
+aws rds describe-db-instances `# get current status of rds e.g. creating, available,..` \
+ --db-instance-identifier RDS_NAME \
+ --query "DBInstances[].DBInstanceStatus" \
+ --output text
+
+aws rds describe-db-instances `# get database endpoint` \
+ --db-instance-identifier RDS_NAME \
+ --query 'DBInstances[0].Endpoint.Address' \
+ --output text
+
+aws rds delete-db-instance \
+ --db-instance-identifier RDS_NAME \
+ --delete-automated-backups \
+ --skip-final-snapshot
+```
+
+## dynamodb
+
+```sh
+aws dynamodb list-tables
+
+aws dynamodb scan --table-name "TABLE" \
+ --filter-expression "userId = :name" \
+ --expression-attribute-values '{":name":{"S":"7b13....99ea"}}'
+```
+
+## route53
+
+```
+aws route53 list-hosted-zones | jq -r '.HostedZones[] | .Id, .Name'
+```
+
+## route53domains
+
+```sh
+aws --region us-east-1 route53domains list-domains # route53domains api has no global endpoint; only works at region us-east-1
+
+aws --region us-east-1 route53domains get-domain-detail --domain-name DOMAIN | jq -r '.Nameservers[].Name'
+```
+
+## ssm - aw services systems manager
+
+```sh
+# get latest ecs-optimized amazon-linux 2 ami
+aws ssm get-parameters --names /aws/service/ecs/optimized-ami/amazon-linux-2/recommended \
+ | jq '.Parameters[].Value | fromjson'
+
+aws ssm get-parameters --names /aws/service/ecs/optimized-ami/amazon-linux-2/recommended \
+ --region eu-central-1 --query "Parameters[0].Value" | jq 'fromjson'
+```
+
+## sts - security token service
+
+```sh
+aws sts get-caller-identity --query Account --output text # get current account id
+
+aws sts get-access-key-info --access-key-id ACCESS_KEY_ID # returns account id for specified access key id
+
+aws --profile PROFILE sts get-session-token \
+ --duration-seconds 900 `# 15min`\
+ --serial-number arn:aws:iam::ACCOUNT:mfa/USER \
+ --token-code ONETIMECODE
+
+# example using mfa and aws-cli
+export AWS_ACCESS_KEY_ID=AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY=AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN=AWS_SESSION_TOKEN
+aws sts get-session-token --serial-number "arn:aws:iam::ACC_ID:mfa/user.name" --token-code "$(op get totp ID)" # otp
+```
+
+## securityhub
+
+```sh
+aws securityhub get-findings \
+ --filter 'SeverityLabel={Value=CRITICAL,Comparison=EQUALS},ComplianceStatus={Value=FAILED,Comparison=EQUALS},ResourceType={Value=AwsS3Bucket,Comparison=EQUALS}' \
+ | jq -r '.Findings[].Resources[].Id'
+
+aws securityhub get-findings \
+ --filters '{"GeneratorId":[{"Value": "aws-foundational","Comparison":"PREFIX"}],"WorkflowStatus": [{"Value": "NEW","Comparison":"EQUALS"}],"Confidence": [{"Gte": 85}]}' \
+ --sort-criteria '{"Field": "LastObservedAt","SortOrder": "desc"}' \
+ --page-size 5 --max-items 100
+
+aws securityhub get-findings \
+ --filters '{"SeverityLabel":[{"Value": "HIGH","Comparison":"EQUALS"}],"WorkflowStatus": [{"Value":"NEW","Comparison":"EQUALS"}],"WorkflowStatus": [{"Value":"NOTIFIED","Comparison":"EQUALS"}]}' | jq -r '.Findings[].Resources[].Id'
+```
+
+## sqs - simple message queuing service
+
+```sh
+aws sqs list-queues | jq '.QueueUrls[] | select(endswith("dlq"))' \
+ | while read; do
+ eval aws sqs get-queue-attributes --queue-url $REPLY --attribute-names All \
+ | jq -r '.Attributes | select(.ApproximateNumberOfMessages | tonumber > 0) | "\(.ApproximateNumberOfMessages) \(.QueueArn)"';
+ done
+```
+
+## s3 - simple storage service
+
+```sh
+aws s3 list # list buckets
+aws s3 list s3://BUCKET # list objects in BUCKET
+aws s3 ls s3://BUCKET --recursive
+aws s3 rm s3://BUCKET --recursive
+
+aws s3 cp s3://BUCKET/KEY/FILE . # downlaod BUCKET object
+aws s3 sync s3://BUCKET_1 . # download all objects to local dir
+aws s3 sync s3://BUCKET_1 s3://BUCKET_2 --dryrun # diff two buckets
+
+# aws s3api
+aws s3api list-buckets | jq -r '.Buckets[].Name'
+aws s3api list-buckets --query 'Buckets[*].Name'
+
+aws s3api list-objects --bucket BUCKET | jq -r '.Contents[].Key'
+aws s3api list-objects --bucket BUCKET --output text
+
+aws s3api head-bucket --bucket BUCKET # return error if credentials aren't valid
+
+aws s3api get-object-lock-configuration --bucket BUCKET --query 'ObjectLockConfiguration.ObjectLockEnabled' # check if lock config enables
+
+
+aws s3api delete-objects --bucket BUCKET \
+ --delete "$(aws s3api list-object-versions --bucket BUCKET --query='{Objects: Versions[].{Key:Key,VersionId:VersionId}}')"
+
+aws s3api delete-objects --bucket BUCKET \
+ --delete "$(aws s3api list-object-versions --bucket BUCKET --query='{Objects: DeleteMarkers[].{Key:Key,VersionId:VersionId}}')"
+
+# aws s3api list-object-versions --bucket BUCKET | jq '{Objects: [.Versions[] | {Key:.Key, VersionId : .VersionId}], Quiet: false}'
+# aws s3api list-object-versions --bucket BUCKET | jq -M '{Objects: [.["Versions","DeleteMarkers"][]|select(.Key == "key-value")| {Key:.Key,VersionId : .VersionId}], Quiet: false}'
+```
+
+## see also
+
+- [[cdk]]
+- [[aws-nuke]]
+- [[eksctl]]
+- [[amazon-linux-extras]]
+- [[ec2-instance-selector]]
+- [[mc]]
+- [[kubectl]]
+- [[gcloud]]
+- [[jq]], [[yq]]
+- [[op]]
+- [[installer]]
+- [[localstack]], [[minikube]]
+- [[installer]]
+- [AWS Regions and Endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html)
diff --git a/notes/base64.md b/notes/base64.md
new file mode 100644
index 00000000..09286258
--- /dev/null
+++ b/notes/base64.md
@@ -0,0 +1,27 @@
+---
+tags: [linux]
+title: base64
+created: '2020-09-01T08:26:05.388Z'
+modified: '2022-05-17T19:21:12.184Z'
+---
+
+# base64
+
+> encode and decode using base64 representation
+
+## usage
+
+```sh
+base64 -w 0 FILE
+
+base64 -i IN_FILE -o OUT_FILE
+
+echo FOO | python -m base64
+```
+
+## see also
+
+- [[jq]] `@base64d`
+- [[echo]]
+- [[openssl]]
+- [[python]]
diff --git a/notes/basename.md b/notes/basename.md
new file mode 100644
index 00000000..59c4c70c
--- /dev/null
+++ b/notes/basename.md
@@ -0,0 +1,22 @@
+---
+tags: [coreutils]
+title: basename
+created: '2019-10-04T07:16:41.100Z'
+modified: '2022-04-06T11:37:26.896Z'
+---
+
+# basename
+
+> return filename or directory portion of pathname
+
+## usage
+
+```sh
+basename -s .log $(ls /var/log/*.log) # get only filename stripped from extension
+```
+
+## see also
+
+- [[bash pwd]]
+- [[dirname]]
+- [[realpath]]
diff --git a/notes/bash [[.md b/notes/bash [[.md
new file mode 100644
index 00000000..b42d8dcc
--- /dev/null
+++ b/notes/bash [[.md
@@ -0,0 +1,33 @@
+---
+tags: [shell/bash/keyword]
+title: 'bash [['
+created: '2020-09-02T14:24:09.002Z'
+modified: '2022-11-25T10:53:23.523Z'
+---
+
+# bash \[\[
+
+> execute conditional command - returns a status of `0` or `1`
+> EXPRESSION are composed of same primaries used by [[bash test]]
+
+## usage
+
+```sh
+[[ EXPRESSION ]]
+
+
+( EXPRESSION ) # returns value of EXPRESSION
+! EXPRESSION # true if EXPRESSION is false; else false
+EXPR1 && EXPR2 # true if both EXPR1 and EXPR2 are true; else false
+EXPR1 || EXPR2 # true if either EXPR1 or EXPR2 is true; else false
+
+OPERATORS
+`==`, `!=` # string to the right of operator is used as pattern and pattern matching is performed
+`=~` # string to the right of operator is matched as a regular expression
+`&&`, `||` # do not evaluate EXPR2 if EXPR1 is sufficient to determine the expression's value
+```
+
+## see also
+
+- [[bash test]]
+- [[bash built-in vs keyword]]
diff --git a/notes/bash alias.md b/notes/bash alias.md
index 95ff33e4..849c20ff 100644
--- a/notes/bash alias.md
+++ b/notes/bash alias.md
@@ -1,10 +1,29 @@
---
-tags: [bash, bash/builtin]
+tags: [shell/bash/builtin]
title: bash alias
created: '2019-08-02T06:42:37.554Z'
-modified: '2019-08-02T06:44:43.252Z'
+modified: '2022-04-06T11:38:03.695Z'
---
# bash alias
-alias=
+## usage
+
+```sh
+alias l='ls -l' # define alias
+
+alias -p # print all defined aliases in a reusable format
+
+
+# use alias to intercept to change future invocation
+ls
+alias ls='/usr/bin/time ls'
+ls
+unalias ls
+```
+## see also
+
+- [[bash unalias]]
+- [[git log]]
+- [[time]]
+- [cyberciti.biz/tips/bash-aliases-mac-centos-linux-unix/](https://www.cyberciti.biz/tips/bash-aliases-mac-centos-linux-unix.html/)
diff --git a/notes/bash arguments.md b/notes/bash arguments.md
index cbff6bf3..8465d568 100644
--- a/notes/bash arguments.md
+++ b/notes/bash arguments.md
@@ -1,21 +1,15 @@
---
-tags: [bash]
+tags: [shell/bash]
title: bash arguments
created: '2019-07-30T06:19:48.991Z'
-modified: '2019-07-30T06:22:29.779Z'
+modified: '2022-04-06T11:38:10.410Z'
---
# bash arguments
-| | |
-|--|--|
-| `argument` | command is split into an array of strings named arguments; `$0`command-name |
-| `option` | documented type of argument modifying the behavior of a command; `-v` verbose |
-| `parameter` | argument that provides information to either the command or one of its options e.g. in `-o file`, `file` is the parameter of the `-o` option |
-
-
-[Difference between terms: "option", "argument", and "parameter"? - Stack Overflow](http://stackoverflow.com/questions/36495669/difference-between-terms-option-argument-and-parameter)
-[How do I parse command line arguments in Bash? - Stack Overflow](http://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash)
+- `argument` command is split into an array of strings named arguments; `$0`command-name
+- `option` documented type of argument modifying the behavior of a command; `-v` verbose
+- `parameter` argument that provides information to either the command or one of its options e.g. in `-o file`, `file` is the parameter of the `-o` option
## parsing flags
@@ -43,8 +37,38 @@ for i in "$@"; do
;;
esac
done
+
+
+CMD=(docker exec -it)
+ARGS=()
+
+for i in "$@"; do
+ echo "i: $i"
+ case $i in
+ -e=*|--environment=*)
+ # CMD="${i#*=}"
+ echo "case i: ${i#*=}"
+ CMD+=('-e '${i#*=})
+ shift # past argument=value
+ # shift
+ ;;
+ *)
+ ARGS+=($i)
+ ;;
+ esac
+ # shift
+done
+
+echo ${CMD[*]} ${ARGS[*]}
```
-- [Passing named arguments to shell scripts - Unix & Linux Stack Exchange](https://unix.stackexchange.com/a/204927)
-- [What is the meaning of "${1#*-}" - Stack Overflow](https://stackoverflow.com/a/41806827)
+## see also
+
+- [Difference between terms: "option", "argument", and "parameter"?](http://stackoverflow.com/questions/36495669/difference-between-terms-option-argument-and-parameter)
+- [How do I parse command line arguments in Bash?](http://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash)
+- [Passing named arguments to shell scripts](https://unix.stackexchange.com/a/204927)
+- [What is the meaning of "${1#*-}"](https://stackoverflow.com/a/41806827)
- [Parameter expansion [Bash Hackers Wiki]](http://wiki.bash-hackers.org/syntax/pe#substring_removal)
+- [[bash for]]
+- [[bash case]]
+- [[bash shift]]
diff --git a/notes/bash arithmetic - bc - expre.md b/notes/bash arithmetic - bc - expre.md
deleted file mode 100644
index 707943f9..00000000
--- a/notes/bash arithmetic - bc - expre.md
+++ /dev/null
@@ -1,70 +0,0 @@
----
-tags: [bash]
-title: bash arithmetic - bc - expre
-created: '2019-07-30T06:19:48.992Z'
-modified: '2019-07-30T18:47:03.726Z'
----
-
-# bash arithmetic - bc - expre
-
-> most (if not all) GNU/Linux shells only perform `integer` operations.
-
-- [How can I do division with variables in a Linux shell? - Stack Overflow](https://stackoverflow.com/a/18093887)
-- [How to Add Calculations to a Bash Script](https://www.lifewire.com/arithmetic-in-bash-2200566)
-
-## printf
-```sh
-printf "%.3f\n" $((1+1/2)) # 1.000
-
-printf "%.3f\n" $( echo "1+1/2" | bc -l ) # 1.500
-```
-
-
-## bc
-
-> `basic calculator` is an `arbitrary-precision calculator language`
-
-```sh
-bc -l # -l, --mathlib: Uses the predefined math routines.
-
-echo "3.4+7/8-(5.94*3.14)" | bc # = -15.25
-
-echo "2/3" | bc # = 0
-
-echo "scale=2; 2/3" | bc # = .66
-
-echo "(2/3)+(7/8)" | bc # = 0
-
-echo "scale=2;(2/3)+(7/8)" | bc # = 1.53
-
-echo "scale=4;(2/3)+(7/8)" | bc # = 1.5416
-
-echo "scale=6;(2/3)+(7/8)" | bc # = 1.541666
-
-echo "(2/3)+(7/8)" | bc -l # = 1.54166666666666666666
-```
-
-## expr
-> `evaluate expression` using only `integer` and tops out at `2^63 - 1`
-```sh
-expr 1 + 1 # = 2
-
-myvar=$(expr 1 + 1) # $myvar == 2
-
-expr $myvar + 1 # = 3
-
-expr $myvar / 3 # = 1
-
-expr $myvar \* 3 # = 9
-```
-[What is the difference between bcl and expr? Stack Exchange](https://unix.stackexchange.com/a/327468)
-
-## let
-
-```sh
-myvar=6
-
-let myvar+=1
-
-echo $myvar
-```
diff --git a/notes/bash arithmetic expansion.md b/notes/bash arithmetic expansion.md
new file mode 100644
index 00000000..21df5931
--- /dev/null
+++ b/notes/bash arithmetic expansion.md
@@ -0,0 +1,48 @@
+---
+tags: [shell/bash]
+title: bash arithmetic expansion
+created: '2019-07-30T06:19:48.992Z'
+modified: '2022-04-06T11:38:20.902Z'
+---
+
+# bash arithmetic expansion
+
+> most (if not all) GNU/Linux shells only perform `integer` operations.
+
+## usage
+
+```sh
+$((EXPRESSION)) # is arithmetic expansion; return result
+
+((EXPRESSION)) # don't return result; e.g. variable assignment
+```
+
+```sh
+((var=1+2)) # Simple math
+
+((var++))
+((var--))
+((var+=1))
+((var-=1))
+
+
+((var=var2*arr[2])) # Using variables
+
+
+echo $((13380009932/1024/1024/1024))
+
+echo $((13380009932/1024**3)) # 1024 to the power of 3
+```
+
+## see also
+
+- [[bc]]
+- [[expr]]
+- [[bash let]]
+- [[bash printf]]
+- [[bash let.md]]
+- [[bash for]]
+- [[bash braces]]
+- [How can I do division with variables ? - Stack Overflow](https://stackoverflow.com/a/18093887)
+- [How to Add Calculations to a Bash Script](https://www.lifewire.com/arithmetic-in-bash-2200566)
+- [What is the difference between bcl and expr? Stack Exchange](https://unix.stackexchange.com/a/327468)
diff --git a/notes/bash array.md b/notes/bash array.md
index c884a793..ad171930 100644
--- a/notes/bash array.md
+++ b/notes/bash array.md
@@ -1,12 +1,14 @@
---
-tags: [bash, bash/builtin]
+tags: [shell/bash]
title: bash array
created: '2019-08-01T07:14:55.242Z'
-modified: '2019-08-02T06:35:53.806Z'
+modified: '2022-11-29T07:59:05.267Z'
---
# bash array
+## usage
+
```sh
array[0] = val # several ways to define an array
array[1] = val
@@ -15,8 +17,8 @@ array=([2]=val [0]=val [1]=val)
array(val val val)
${array[i]} # displays array's value for this index. If no index is supplied, array element 0 is assumed
-${#array[i]} # to find out the length of any element in the array
-${#array[@]} # to find out how many values there are in the array
+${#array[i]} # length of any element in the array
+${#array[@]} # how many values there are in the array
declare -A SWARM
@@ -27,6 +29,54 @@ echo ${SWARM[@]} # print values
echo ${!SWARM[@]} # print keys
echo ${SWARM[swarm-1]}
-unset SWARM[sswarm-1]
+unset SWARM[swarm-1]
+
+
+declare -a foo=(a b c)
+s=1
+e=2
+foo=("${foo[@]:s:e}") # remove element
+echo ${foo[@]}
+b c
+
+
+function foo() {
+ elem=$1;
+ next=$((elem+1));
+ shift;
+ declare -a bar=($@);
+ len=${#bar[@]};
+ [ $elem -ge $len ] && { echo "elem > len"; return 1; };
+ bar=(${bar[@]:0:elem} ${bar[@]:next});
+ echo "final: ${bar[@]}";
+}
+
+
+Colors=([0]="purple" [1]="reddish-orange" [2]="light green")
+echo ${Colors[@]} # purple reddish-orange light green
+declare | grep Colors # Colors=([0]="purple" [1]="reddish-orange" [2]="light green")
+````
+
+### save line seperate output to array
+
+```sh
+IFS_BAK="$IFS"; IFS=$'\n'; # backup $IFS for restore later
+CDK_STACKS=($(npm run --silent cdk -- list)) # save output in string array, don't wrap subsheln quotes
+```
+
+### check array for multiple values
+
+```sh
+echo "${CF_STACKS[*]}" | grep -f <(printf '%s\n' "${CDK_STACKS[@]}") | wc -l | xargs)
+
+CF_STACKS=("A" "B" "C")
+CDK_STACKS=("A")
+echo "${CF_STACKS[*]}" | grep -f <(printf '%s\n' "${CDK_STACKS[@]}") -c
```
-[Bash associative array examples โ Andy Balaam's Blog](https://www.artificialworlds.net/blog/2012/10/17/bash-associative-array-examples/)
+
+## see also
+
+- [[bash declare]]
+- [[bash mapfile]]
+- [[bash readarray]]
+- [Bash associative array examples โ Andy Balaam's Blog](https://www.artificialworlds.net/blog/2012/10/17/bash-associative-array-examples/)
diff --git a/notes/bash bats.md b/notes/bash bats.md
deleted file mode 100644
index f2ecc387..00000000
--- a/notes/bash bats.md
+++ /dev/null
@@ -1,23 +0,0 @@
----
-tags: [bash]
-title: bash bats
-created: '2019-07-30T06:19:49.026Z'
-modified: '2019-08-01T07:18:14.082Z'
----
-
-# bash bats
-
-
-## debug bats output
-```sh
-@test 'test-a' {
- run bash -c 'echo ERROR; false'
- echo "status = ${status}"
- echo "output = ${output}"
- [ "$status" -eq 0 ]
-}
-```
-
-### examples
-
-[govmomi/test_helper.bash at master ยท vmware/govmomi ยท GitHub](https://github.com/vmware/govmomi/blob/master/govc/test/test_helper.bash)
diff --git a/notes/bash bg.md b/notes/bash bg.md
new file mode 100644
index 00000000..415c56bf
--- /dev/null
+++ b/notes/bash bg.md
@@ -0,0 +1,23 @@
+---
+tags: [shell/bash/builtin]
+title: bash bg
+created: '2019-08-02T06:42:37.556Z'
+modified: '2022-04-06T11:38:32.711Z'
+---
+
+# bash bg
+
+## usage
+
+```sh
+bg # lists stopped or background jobs ; resume a stopped job in the background
+fg # brings the most recent job in the foreground
+fg # brings job to the foreground
+```
+
+## see also
+
+- [[bash jobs]]
+- [[bash fg]]
+- [[bash process-handling]]
+- [[bash waits]]
diff --git a/notes/bash bind.md b/notes/bash bind.md
new file mode 100644
index 00000000..5f0b7268
--- /dev/null
+++ b/notes/bash bind.md
@@ -0,0 +1,43 @@
+---
+tags: [shell/bash/builtin]
+title: bash bind
+created: '2019-08-02T06:42:37.558Z'
+modified: '2023-05-28T16:56:23.007Z'
+---
+
+# bash bind
+
+> set readline key bindings and variables / enable key macros
+
+## option
+
+```sh
+-m KEYMAP # use KEYMAP as the keymap for the duration of command. keymap-names: emacs, emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move, vi-command, vi-insert
+-l # list names of functions
+-P # list function names and bindings
+-p # list functions and bindings in a form that can be reused as input
+-S # list key sequences that invoke macros and their values
+-s # list key sequences that invoke macros and their values in a form that can be reused as input
+-V # list variable names and values
+-v # list variable names and values in a form that can be reused as input
+-q function-name # query about which keys invoke the named function
+-u function-name # unbind all keys which are bound to the named function
+-r KEYSEQ # remove the binding for KEYSEQ
+-f FILENAME # read key bindings from FILENAME
+-x keyseq:shell-command # cause SHELL-COMMAND to be executed when KEYSEQ is entered
+-X # list key sequences bound with -x and associated commands in a form that can be reused as input
+```
+
+## usage
+
+```sh
+bind -X # list key sequences bound with -x and associated commands
+
+bind '"\e[24~":"foobar"' # F12, prints "foobar" on cli ready for further editing
+bind '"\e[24~":"pwd\n"' # keystroke to enter a command immediately add linebreak at end
+```
+
+## see also
+
+- [[gnu readline]]
+- [stackoverflow.com/in-bash-how-do-i-bind-a-function-key-to-a-command](https://stackoverflow.com/questions/4200800/in-bash-how-do-i-bind-a-function-key-to-a-command)
diff --git a/notes/bash braces.md b/notes/bash braces.md
new file mode 100644
index 00000000..36f888bb
--- /dev/null
+++ b/notes/bash braces.md
@@ -0,0 +1,72 @@
+---
+tags: [shell/bash]
+title: bash braces
+created: '2019-09-24T06:43:14.231Z'
+modified: '2023-03-22T10:02:19.307Z'
+---
+
+# bash braces
+
+> `$` character introduces parameter expansion, command substitution, or arithmetic expansion
+
+## subshell
+
+```sh
+$(...) # execute the command in the parens in a subshell and return its stdout
+
+(...) # run the commands listed in the parens in a subshell
+```
+
+## group
+
+```sh
+{...} # execute the commands in the braces as a group
+
+COMMAND | { echo "nope"; exit 1; }
+```
+
+## arithmetic expansion
+
+```sh
+$((...)) # arithmetic expansion and return the result
+$((1+1))
+$((2*2))
+$((4/2))
+$((2**2))
+$((base#number)) # convert number from base to decimal
+$((2#1111)) # 15
+$((8#16)) # 14
+$((16#FF)) # 255
+```
+
+## parameter expansion
+
+```
+${...} # parameter expansion and return the value
+```
+
+## brace expansion
+
+> used to generate stings
+
+```sh
+# consists of a sequence or a comma separated list of items inside curly braces `{}`
+# sequence consists of a starting and ending-item separated by `..`
+{aa,bb,cc,dd} # aa bb cc dd
+{0..12} # 0 1 2 3 4 5 6 7 8 9 10 11 12
+{3..-2} # 3 2 1 0 -1 -2
+{a..g} # a b c d e f g
+{g..a} # g f e d c b a
+a{0..3}b # a0b a1b a2b a3b
+{a,b{1..3},c} # a b1 b2 b3 c
+
+echo file{1,2,3}.txt
+ls -l /etc/{resolv.conf, passwd}
+```
+
+## see also
+
+- [[bash arithmetic expansion]]
+- [[bash parameter expansion]]
+- [double-parenthesis-with-and-without-dollar - stackoverflow](https://stackoverflow.com/a/31255942/2087704)
+- [linuxjournal.com/bash-brace-expansion](https://www.linuxjournal.com/content/bash-brace-expansion)
diff --git a/notes/bash break.md b/notes/bash break.md
new file mode 100644
index 00000000..e6db4f44
--- /dev/null
+++ b/notes/bash break.md
@@ -0,0 +1,36 @@
+---
+tags: [shell/bash/builtin]
+title: bash break
+created: '2019-08-02T06:42:37.559Z'
+modified: '2022-04-27T14:19:26.096Z'
+---
+
+# bash break
+
+> Exit for, while, or until loops.
+
+## usage
+
+```sh
+break n # If N is specified, break N enclosing loops
+
+
+while [ 1 -eq 1 -a 1 -gt 0 ]; do
+ echo "running.."; sleep 1;
+ val=5
+ until [ $val -eq 0 ]; do
+ val=$((--val))
+ rand=$(( ( RANDOM % 5) + 1 ))
+ echo "[rand: $rand] reduced val to: $val.."; sleep 1;
+ if [ $val -lt $rand ]; then
+ break 2;
+ fi
+ done
+done
+```
+
+## see also
+
+- [[bash while]]
+- [[bash for]]
+- [[bash until]]
diff --git a/notes/bash caller.md b/notes/bash caller.md
new file mode 100644
index 00000000..c218cdd9
--- /dev/null
+++ b/notes/bash caller.md
@@ -0,0 +1,8 @@
+---
+tags: [shell/bash/builtin]
+title: bash caller
+created: '2019-08-02T06:42:37.562Z'
+modified: '2021-05-12T08:46:07.607Z'
+---
+
+# bash caller
diff --git a/notes/bash case.md b/notes/bash case.md
index b75b4684..c6d5176b 100644
--- a/notes/bash case.md
+++ b/notes/bash case.md
@@ -1,12 +1,14 @@
---
-tags: [bash, bash/builtin]
+tags: [shell/bash/keyword]
title: bash case
created: '2019-07-30T06:19:48.993Z'
-modified: '2019-08-02T06:35:53.820Z'
+modified: '2021-11-16T08:24:42.397Z'
---
# bash case
+## usage
+
```sh
case expression in
pattern1)
@@ -20,5 +22,8 @@ case expression in
;;
esac
```
-### see also:
-- [bash arguments](:note:581d55d0be23e35bad7f)
+
+## see also
+
+- [[bash if]]
+- [[bash arguments]]
diff --git a/notes/bash cd.md b/notes/bash cd.md
new file mode 100644
index 00000000..a33f6c49
--- /dev/null
+++ b/notes/bash cd.md
@@ -0,0 +1,27 @@
+---
+tags: [shell/bash/builtin]
+title: bash cd
+created: '2019-08-02T06:42:37.564Z'
+modified: '2022-04-27T14:20:01.788Z'
+---
+
+# bash cd
+
+## usage
+
+```sh
+cd # move to homedir
+cd ~ # move to ~ expands to homedir `$HOME`
+
+cd - # change to previous dir
+
+shopt -s cdspell # correct misspelled dir
+```
+
+## see also
+
+- [[bash shopt]]
+- [[bash dirs]]
+- [[bash pushd ]]
+- [[bash pwd]]
+- [[bash redirects]]
diff --git a/notes/bash command.md b/notes/bash command.md
new file mode 100644
index 00000000..26ae27a7
--- /dev/null
+++ b/notes/bash command.md
@@ -0,0 +1,29 @@
+---
+tags: [shell/bash/builtin]
+title: bash command
+created: '2019-08-02T06:42:37.566Z'
+modified: '2022-04-27T14:20:12.206Z'
+---
+
+# bash command
+
+> execute a simple command or display information about commands
+suppressing shell function lookup, or display information about the specified COMMANDs
+
+## usage
+
+```sh
+-p # use a default value for PATH that is guaranteed to find all of the standard utilities
+-v # print a description of COMMAND similar to the `type' builtin
+-V # print a more verbose description of each COMMAND
+```
+
+```sh
+command -v CMD # posix way of checking if CMD is available
+```
+
+## see also
+
+- [[which]]
+- [[bash type]]
+- [[bash hash]]
diff --git a/notes/bash compgen.md b/notes/bash compgen.md
new file mode 100644
index 00000000..0e8c0d55
--- /dev/null
+++ b/notes/bash compgen.md
@@ -0,0 +1,66 @@
+---
+tags: [shell/bash/builtin]
+title: bash compgen
+created: '2019-08-02T06:13:41.072Z'
+modified: '2022-04-27T14:20:30.288Z'
+---
+
+# bash compgen
+
+> display possible completions depending on the options
+
+## usage
+
+```sh
+COMPREPLY # array variable used to store the completions
+COMP_WORDS # array of all words typed after the name of the program the compspec belongs to
+COMP_CWORD # index of COMP_WORDS array pointing to the word the current cursor is at
+ # - index of the word the cursor was when the tab key was pressed
+COMP_LINE # the current command line
+```
+```sh
+-d # names of directory
+-e # names of exported shell variables
+-f # names of file and functions
+-g # names of groups
+-j # names of job
+-s # names of service
+-u # names of userAlias names
+-v # names of shell variables
+```
+
+```sh
+compgen -c # list all the commands you could run
+compgen -c x # names of all commands starting with x
+
+compgen -a # list all the aliases you could run
+compgen -a # names of alias, like alias but only alias names
+
+compgen -b # list all the built-ins you could run
+compgen -b # names of shell builtins => list-builtins, like help
+
+compgen -k # list all the keywords you could run
+compgen -k # names of Shell reserved words
+
+compgen -A function # list all the functions you could run
+compgen -A function -abck # list all the above in one go
+compgen -A variable | grep X # get all variables starting with X; see also: `echo ${!X*}`
+
+
+compgen -W "now tomorrow never"
+now
+tomorrow
+never
+
+compgen -W "now tomorrow never" n
+now
+never
+
+compgen -W "now tomorrow never" t
+tomorrow
+```
+
+## see also
+
+- [[bash]]
+- [[bash type]]
diff --git a/notes/bash complete compgen.md b/notes/bash complete.md
similarity index 66%
rename from notes/bash complete compgen.md
rename to notes/bash complete.md
index 0e88a096..3142698e 100644
--- a/notes/bash complete compgen.md
+++ b/notes/bash complete.md
@@ -1,11 +1,13 @@
---
-tags: [bash]
-title: bash complete compgen
+tags: [shell/bash/builtin]
+title: bash complete
created: '2019-07-30T06:19:48.994Z'
-modified: '2019-08-02T06:13:38.074Z'
+modified: '2022-04-27T14:20:37.150Z'
---
-# bash complete compgen
+# bash complete
+
+## usage
```sh
complete -W "word1 word2 .." command # -W wordlist provide a list of words for completion
@@ -23,4 +25,7 @@ _dothis_completions() {
complete -F _dothis_completions dothis # -F flag defining function that will provide the completions
```
-[Creating a bash completion script](https://iridakos.com/tutorials/2018/03/01/bash-programmable-completion-tutorial.html)
+
+## see also
+
+- [Creating a bash completion script](https://iridakos.com/tutorials/2018/03/01/bash-programmable-completion-tutorial.html)
diff --git a/notes/bash compopt.md b/notes/bash compopt.md
new file mode 100644
index 00000000..a3b42038
--- /dev/null
+++ b/notes/bash compopt.md
@@ -0,0 +1,8 @@
+---
+tags: [shell/bash/builtin]
+title: bash compopt
+created: '2019-08-02T06:42:37.573Z'
+modified: '2021-05-12T08:46:07.723Z'
+---
+
+# bash compopt
diff --git a/notes/bash continue.md b/notes/bash continue.md
new file mode 100644
index 00000000..d5f3f7b5
--- /dev/null
+++ b/notes/bash continue.md
@@ -0,0 +1,8 @@
+---
+tags: [shell/bash/builtin]
+title: bash continue
+created: '2019-08-02T06:42:37.575Z'
+modified: '2021-05-12T08:46:07.746Z'
+---
+
+# bash continue
diff --git a/notes/bash database.md b/notes/bash database.md
deleted file mode 100644
index 79f45e70..00000000
--- a/notes/bash database.md
+++ /dev/null
@@ -1,19 +0,0 @@
----
-tags: [bash]
-title: bash database
-created: '2019-07-30T06:19:48.995Z'
-modified: '2019-07-30T06:22:29.785Z'
----
-
-# bash database
-
-### simplest database
-```sh
-# usage: source db.sh
-# then call db_set or db_get from cli
-
-db_set() { echo "$1,$2" >> database; }
-
-db_get() { grep "^$1," database | sed -e "s/^$1,//" | tail -n 1; }
-```
-[Log-structured storage - Julia Evans](https://jvns.ca/blog/2017/06/11/log-structured-storage/)
diff --git a/notes/bash datatypes.md b/notes/bash datatypes.md
new file mode 100644
index 00000000..1697d37a
--- /dev/null
+++ b/notes/bash datatypes.md
@@ -0,0 +1,21 @@
+---
+tags: [shell/bash]
+title: bash datatypes
+created: '2019-08-19T07:28:23.142Z'
+modified: '2022-04-27T14:20:48.142Z'
+---
+
+# bash datatypes
+
+- string
+- integer
+- array
+- assoc-array
+- declare -A # associative array !
+
+## see also
+
+- [[bash arithmetic]]
+- [[bash test []]
+- [[bash declare]]
+- [[bash declare]]
diff --git a/notes/bash debugging.md b/notes/bash debugging.md
new file mode 100644
index 00000000..df6801ed
--- /dev/null
+++ b/notes/bash debugging.md
@@ -0,0 +1,86 @@
+---
+tags: [shell/bash]
+title: bash debugging
+created: '2019-07-30T06:19:49.021Z'
+modified: '2022-04-27T14:20:55.331Z'
+---
+
+# bash debugging
+
+> some ways to debug shell-scripts
+
+## usage
+
+```sh
+# variables
+${BASH_SOURCE}
+${LINENO}
+${FUNCNAME[0]}
+
+# flags
+bash -n SCRIPT.sh # don't run commands; check for syntax errors only
+set -o noexec # alternative option set inside script
+
+bash -v SCRIPT.sh # echo commands before running them
+set -o verbose # alternative option set inside script
+
+bash -x SCRIPT.sh # echo commands after command-line processing
+set -o xtrace # alternative option set inside script
+````
+
+## redirect xtrace to file
+
+```sh
+#!/usr/bin/env bash
+exec 2>>debug.log
+set -x
+```
+
+## simple debugger
+
+```sh
+read var # set simple breakpoint
+echo -e "dbg> \c"; read cmd; eval $cmd
+
+$ dbg> doSomethingFunction
+$ dbg> someVariable
+```
+
+## debugger
+
+```sh
+echo "LINENO: $LINENO"
+trap 'echo "VARIABLE-TRACE> \$variable = \"$variable\""' DEBUG # prints value of $variable after every command
+
+variable=29; line=$LINENO
+
+echo " Just initialized \$variable to $variable in line number $line."
+
+let "variable *= 3"; line=$LINENO
+
+echo " Just multiplied \$variable by 3 in line number $line."
+
+exit 0
+
+# The "trap 'command1 . . . command2 . . .' DEBUG" construct is
+#+ more appropriate in the context of a complex script,
+#+ where inserting multiple "echo $variable" statements might be
+#+ awkward and time-consuming.
+
+# Output of script:
+#
+# VARIABLE-TRACE> $variable = ""
+# VARIABLE-TRACE> $variable = "29"
+# Just initialized $variable to 29.
+# VARIABLE-TRACE> $variable = "29"
+# VARIABLE-TRACE> $variable = "87"
+# Just multiplied $variable by 3.
+# VARIABLE-TRACE> $variable = "87"
+```
+
+## see also
+
+- [[bash trap]]
+- [[bash prompt]]
+- [tldp.org/LDP/abs/html/debugging](http://tldp.org/LDP/abs/html/debugging.html)
+- [wiki.bash-hackers.org/scripting/debuggingtips#making_xtrace_more_useful](https://wiki.bash-hackers.org/scripting/debuggingtips#making_xtrace_more_useful)
diff --git a/notes/bash declare.md b/notes/bash declare.md
index 7328bdbe..acb0d041 100644
--- a/notes/bash declare.md
+++ b/notes/bash declare.md
@@ -1,73 +1,53 @@
---
-tags: [bash]
+tags: [shell/bash]
title: bash declare
created: '2019-07-30T06:19:48.996Z'
-modified: '2019-07-30T06:22:29.786Z'
+modified: '2023-06-28T08:27:14.740Z'
---
# bash declare
-`declare` and `typeset` are synonym
+> set variable values and attributes
-```sh
-declare
-
- -r # readonly
-
- -i # integer
-
- -a # array
-
- -A # associative array !
-
- -f # function(s)
-
- -x # export
-
- -x var=$value
-
-# just using the option prints all values of one type
-
-declare -xp # exported vairables
-
-declare -f # list sourced functions
-
-declare -F # list only function names
-
-declare -p # show variables
-
-
-declare -a # variables are treated as arrays
+## option
-declare -A # variables are treated as associative arrays
-
-declare -f # uses funtion names only
-
-declare -F # displays function names without definitions
-
-declare -i # the variables are treaded as integers
-
-declare -r # makes the variables read-only
-
-declare -x # marks the variables for export via the environment
+```sh
+# print all values of one type
+-xp # exported vairables
+-f # list sourced functions
+-F # list only function names
+-p # show variables
+-a # variables are treated as arrays
+
+-a # array
+-A # variables are treated as associative arrays
+-f # uses funtion names only
+-F # displays function names without definitions
+-i # the variables are treaded as integers
+-r # makes the variables read-only
+-x # marks the variables for export via the environment
```
-http://tldp.org/LDP/abs/html/declareref.html
+## usage
-## useful for identifying variables, environmental, ..
```sh
-declare | grep HOME
-HOME=/home/bozo
-
+declare -r foo=bar # readonly
-zzy=68
-declare | grep zzy
-zzy=68
+declare -a arr=('aa' 'bb' 'cc' 'dd' 'ee')
+declare -x var=$value
-Colors=([0]="purple" [1]="reddish-orange" [2]="light green")
-echo ${Colors[@]}
-purple reddish-orange light green
-declare | grep Colors
-Colors=([0]="purple" [1]="reddish-orange" [2]="light green")
+# useful for identifying variables, environmental, ..
+declare | grep foo # foo=bar
+declare | grep Colors # Colors=([0]="purple" [1]="reddish-orange" [2]="light green")
```
+
+## see also
+
+- [[bash export]]
+- [[bash set]]
+- [[bash unset]]
+- [[bash typeset]]
+- [[bash array]]
+- [[bash readarray]]
+- [declareref - tldp.org](http://tldp.org/LDP/abs/html/declareref.html)
diff --git a/notes/bash dirs.md b/notes/bash dirs.md
new file mode 100644
index 00000000..a2754005
--- /dev/null
+++ b/notes/bash dirs.md
@@ -0,0 +1,38 @@
+---
+tags: [shell/bash/builtin]
+title: bash dirs
+created: '2019-08-02T06:42:37.579Z'
+modified: '2023-06-28T08:26:50.469Z'
+---
+
+# bash dirs
+
+> display directory stack
+
+## option
+
+```sh
+-c # clear the directory stack by deleting all of the elements
+-l # do not print tilde-prefixed versions of directories relative to your home directory
+-p # print the directory stack with one entry per line
+-v # print the directory stack with one entry per line prefixed with its position in the stack
++N # displays Nth entry counting from left of the list shown by dirs starting with zero
+-N # displays Nth entry counting from right of the list shown by dirs starting with zero
+```
+
+## env
+
+```sh
+DIRSTACK
+```
+
+## usage
+
+```sh
+dirs
+```
+
+## see also
+
+- [[bash popd]]
+- [[bash pushd]]
diff --git a/notes/bash disown.md b/notes/bash disown.md
new file mode 100644
index 00000000..a42f629c
--- /dev/null
+++ b/notes/bash disown.md
@@ -0,0 +1,23 @@
+---
+tags: [shell/bash/builtin]
+title: bash disown
+created: '2019-08-02T06:42:37.580Z'
+modified: '2022-01-17T08:05:10.070Z'
+---
+
+# bash disown
+
+> removes the process from the list of jobs
+
+## usage
+
+```sh
+disown PROC_ID
+disown JOB_ID
+```
+
+## see also
+
+- [[bash kill]]
+- [[bash jobs]]
+- [[bash process-handling]]
diff --git a/notes/bash echo.md b/notes/bash echo.md
new file mode 100644
index 00000000..0f0e2b01
--- /dev/null
+++ b/notes/bash echo.md
@@ -0,0 +1,60 @@
+---
+tags: [shell/bash/builtin]
+title: bash echo
+created: '2019-08-02T06:42:37.582Z'
+modified: '2023-05-19T10:40:33.953Z'
+---
+
+# bash echo
+
+> write arguments to stdout
+
+## option
+
+```sh
+-n # do not append a newline
+-e # enable interpretation of the following backslash escapes
+-E # explicitly suppress interpretation of backslash escapes
+```
+
+## usage
+
+```sh
+echo -n "USER:PWD" | base64 # not linebreak !
+
+echo $'\112' # print character from octal
+echo $'\x4a' # print character from hex
+```
+
+## url encoding
+
+> urls can only be sent over the Internet using the ASCII character-set.
+
+- urls often contain characters outside the `ascii` set and has to be converted into a valid `ascii` format
+- url encoding replaces unsafe `ascii` characters with a `%` followed by two hexadecimal digits
+- urls cannot contain spaces - encoding normally replaces a space with a `+` sign or with `%20`
+
+```sh
+# encode
+echo -ne 'some random\nbytes' | xxd -plain | tr -d '\n' | sed 's/\(..\)/%\1/g'
+curl -s -o /dev/null -w "%{url_effective}\n" --get --data-urlencode "some random" --data-urlencode "foo=bar" ""
+
+# decode
+url_decode ()
+{
+ : "${*//+/ }";
+ echo -e "${_//%/\\x}"
+}
+```
+
+## see also
+
+- [[od]]
+- [[tr]]
+- [[xxd]]
+- [[fmt]]
+- [[ascii]]
+- [[base64]]
+- [[bash printf]]
+- [[bash variables]]
+- [how-to-urlencode-data-for-curl-command](https://stackoverflow.com/questions/296536/how-to-urlencode-data-for-curl-command)
diff --git a/notes/bash emacs shortcuts.md b/notes/bash emacs shortcuts.md
deleted file mode 100644
index 5f5f9e29..00000000
--- a/notes/bash emacs shortcuts.md
+++ /dev/null
@@ -1,36 +0,0 @@
----
-tags: [bash]
-title: bash emacs shortcuts
-created: '2019-07-30T06:19:49.019Z'
-modified: '2019-08-02T06:48:01.800Z'
----
-
-# bash emacs shortcuts
-
-| shortcut | does |
-|--|--|
-| CTRL+A | move to beginning of line |
-| CTRL+B | moves backward one character |
-| CTRL+E | moves to end of line |
-| CTRL+F | moves forward one character |
-| CTRL+C | halts the current command |
-| CTRL+G | aborts the current editing command and ring the terminal bell |
-| CTRL+D | deletes one character backward or logs out of current session, similar to exit |
-| CTRL+U | kills backward from point to the beginning of line |
-| CTRL+W | kills the word behind the cursor |
-| CTRL+Y | retrieves (yank) last item killed |
-| CTRL+J | same as RETURN |
-| CTRL+K | deletes forward to end of line |
-| CTRL+L | clears screen and redisplay the line |
-| CTRL+M | same as RETURN |
-| CTRL+O | same as RETURN, then displays next line in history file |
-| CTRL+T | transposes two characters |
-| CTRL+V | makes the next character typed verbatim |
-| CTRL+X | lists the possible filename completefions of the current word |
-| CTRL+Z | stops the current command, resume with fg in the foreground or bg in the background |
-| CTRL+N | next line in command history |
-| CTRL+P | previous line in command history |
-| CTRL+R | searches backward |
-| CTRL+S | searches forward |
-
-[macos - Is there a way to make alt-f and alt-b jump word forward and backward instead of printing ฦ and โซ on Mac? - Stack Overflow](https://stackoverflow.com/questions/20146972/is-there-a-way-to-make-alt-f-and-alt-b-jump-word-forward-and-backward-instead-of)
diff --git a/notes/bash enable.md b/notes/bash enable.md
new file mode 100644
index 00000000..a02a1ae9
--- /dev/null
+++ b/notes/bash enable.md
@@ -0,0 +1,30 @@
+---
+tags: [shell/bash/builtin]
+title: bash enable
+created: '2019-08-02T06:42:37.583Z'
+modified: '2022-04-27T14:21:37.092Z'
+---
+
+# bash enable
+
+> eable and disable shell builtins
+
+## options
+
+```sh
+-a print a list of builtins showing whether or not each is enabled
+-n disable each NAME or display a list of disabled builtins
+-p print the list of builtins in a reusable format
+-s print only the names of Posix `special' builtins
+```
+
+## options controlling dynamic loading
+
+```sh
+-f Load builtin NAME from shared object FILENAME
+-d Remove a builtin loaded with -f
+```
+
+## see also
+
+- [[bash]]
diff --git a/notes/bash environment.md b/notes/bash environment.md
index a21b7010..dd5710ad 100644
--- a/notes/bash environment.md
+++ b/notes/bash environment.md
@@ -1,21 +1,24 @@
---
-tags: [bash]
+tags: [shell/bash]
title: bash environment
created: '2019-07-30T06:19:48.998Z'
-modified: '2019-07-30T06:22:29.787Z'
+modified: '2022-04-27T14:21:42.580Z'
---
# bash environment
-```sh
-bash -x # dump what bash runs on startup http://superuser.com/a/144777
-
-env
-
-printenv
+## usage
+```sh
shopt -p # show alle options
( set -o posix ; set ) | less # set shows all shell variables (exported or not); -o posix => only variables
```
-[What is the difference between 'env' and 'printenv' ?](https://unix.stackexchange.com/questions/123473/what-is-the-difference-between-env-and-printenv)
+
+## see also
+
+- [[bash shopt]]
+- [[bash set]]
+- [[bash debugging]]
+- [[bash declare]]
+- [What is the difference between 'env' and 'printenv' ?](https://unix.stackexchange.com/questions/123473/what-is-the-difference-between-env-and-printenv)
diff --git a/notes/bash eval.md b/notes/bash eval.md
index 7ca1fa90..c413756b 100644
--- a/notes/bash eval.md
+++ b/notes/bash eval.md
@@ -1,58 +1,55 @@
---
-tags: [bash, bash/builtin]
+tags: [shell/bash/builtin]
title: bash eval
created: '2019-07-30T06:19:49.005Z'
-modified: '2019-08-02T07:00:45.670Z'
+modified: '2022-01-17T08:08:05.670Z'
---
# bash eval
>`eval` - construct command by concatenating arguments
+## usage
+
```sh
foo='ls -lah'
eval $foo
-```
-```sh
c="echo"; a1="Hello, "; a2="World!"; eval $c $a1 $a2
-```
-### usage
-
-#### Perform var assignment using var names passed as string values.
-```sh
+# Perform var assignment using var names passed as string values.
key="mykey"
val="myval"
eval $key=$val
echo $mykey
myval
-```
+# building a command array because bash handles double-quotes differently
+# on command execution - this can be problematic when variables contain spaces
+# e.g. --network="${NETWORKD}"
+# --networkd=Docker Test
+# here `Test` would be the next option instead of the argument of --network
+cmd=(
+ docker-machine \
+ create \
+ --driver vmwarevsphere \
+ --vmwarevsphere-datacenter=\"${ENV_VSPHERE_DATACENTER}\" \
+ --vmwarevsphere-network=\"${ENV_VSPHERE_NETWORK}\" \
+ ${DOCKER_HOST_FQDN}
+)
+eval "${cmd[@]}"
-#### run cron command from file
-```sh
-# /etc/cron.d/repeatme
-*/10 * * * * root program arg1 arg2
+# run cron command from file /etc/cron.d/repeatme
+# */10 * * * * root program arg1 arg2
eval $( cut -d ' ' -f 6- /etc/cron.d/repeatme)
```
-[The perils of Bash โevalโ - .debug - Medium](https://medium.com/dot-debug/the-perils-of-bash-eval-cc5f9e309cae)
+## see also
-
-#### building create command that respects quotes !
-```sh
-ENV_VSPHERE_HOSTSYSTEM='cluster/vhost01.domain.net'
-ENV_VSPHERE_BOOT2DOCKER_URL='file:///Users/user/boot2docker.iso'
-
-CMD=(
-docker-machine create
---vmwarevsphere-username=\"${ENV_VSPHERE_USERNAME}\"
---vmwarevsphere-boot2docker-url=\"${ENV_VSPHERE_BOOT2DOCKER_URL}\"
-foo.node.ddev.domain.net
-)
-
-eval ${CMD[@]}
-```
+- [[cut]]
+- [[crontab]]
+- [[bash exec]]
+- [[docker-machine]]
+- [the perils of bash `eval`](https://medium.com/dot-debug/the-perils-of-bash-eval-cc5f9e309cae)
diff --git a/notes/bash exec.md b/notes/bash exec.md
index 33109166..bb13c80e 100644
--- a/notes/bash exec.md
+++ b/notes/bash exec.md
@@ -1,17 +1,69 @@
---
-tags: [bash, bash/builtin]
+tags: [shell/bash/builtin]
title: bash exec
created: '2019-07-30T06:19:49.006Z'
-modified: '2019-07-30T06:23:11.515Z'
+modified: '2022-04-27T14:22:02.698Z'
---
# bash exec
+> execute a command that completely replaces the current process. The current shell process is destroyed, and entirely replaced by the command you specify
+
- replace shell with command
- shell-`PID` == command-`PID`
- `echo $$ == /proc/self`
- spawns new proc
+## usage
+
+```sh
+-cl
+-a NAME
+```
+
+```sh
+exec FILE # redirects stdout to a file - sends all command output that would normally go to stdout to that file
+
+exec N > FILE # affects the entire script or current shell. Redirection in the PID of the script or shell from that point on has changed.
+N > FILE # affects only the newly-forked process, not the entire script or shell
+
+
+# causes file descriptor 3 to be opened for reading and writing on the specified tcp socket
+# if command not specified, any redirections take effect in current shell and return status is 0
+exec 3<>/dev/tcp/www.google.com/80
+echo -e "GET / HTTP/1.1\r\nhost: http://www.google.com\r\nConnection: close\r\n\r\n" >&3
+cat <&3
+
+```
+
```sh
-exec
+cat < FILE
+POST /some/pathh HTTP/1.0
+User-Agent: curl/7.37.0
+Host: localhost
+Accept: */*
+Content-Length: 7
+Content-Type: application/x-www-form-urlencoded
+
+var=val
+EOF
+
+exec 5<>/dev/tcp/www.google.com/80
+cat FILE >&5
+cat <&5 # reply
```
+
+[unix.stackexchange.com/how-to-run-the-http-request-without-using-curl](https://unix.stackexchange.com/a/234089/440548)
+
+## see also
+
+- [[bash eval]]
+- [[bash read]]
+- [[filesystem hierarchy standard]]
diff --git a/notes/bash exit.md b/notes/bash exit.md
new file mode 100644
index 00000000..7a382ef5
--- /dev/null
+++ b/notes/bash exit.md
@@ -0,0 +1,20 @@
+---
+tags: [shell/bash/builtin]
+title: bash exit
+created: '2019-08-02T06:42:37.588Z'
+modified: '2022-04-27T14:22:10.397Z'
+---
+
+# bash exit
+
+> exits shell with a status of N If N is omitted, the exit status is that of the last command executed
+
+## usage
+
+```sh
+exit 1;
+```
+
+## see also
+
+- [[bash return]]
diff --git a/notes/bash export.md b/notes/bash export.md
new file mode 100644
index 00000000..304dacc1
--- /dev/null
+++ b/notes/bash export.md
@@ -0,0 +1,43 @@
+---
+tags: [shell/bash/builtin]
+title: bash export
+created: '2019-08-02T06:42:37.589Z'
+modified: '2022-03-03T09:23:51.708Z'
+---
+
+# bash export
+
+> export will make variables/functions available to all shells forked from the current shell.
+
+## option
+
+```sh
+-f # refer to shell functions
+-n # remove the export property from each NAME
+-p # display a list of all exported variables and functions
+-- # disables further option processing.
+```
+
+## usage
+
+```sh
+export -p # list exported variables and functions, same as `declare -x`
+
+export -n # remove the export property from each NAME
+
+export -f myFunc # pass function to any child processes
+
+export A=1 B=2 C=3 # mutliple vairables
+
+env # print exported vairables
+```
+
+## see also
+
+- [[env]]
+- [[bash]]
+- [[bash declare]]
+- [[bash set]]
+- [[bash unset]]
+- [[bash declare]]
+- [[heredoc]]
diff --git a/notes/bash fc.md b/notes/bash fc.md
index c9d172e5..93c8aeb1 100644
--- a/notes/bash fc.md
+++ b/notes/bash fc.md
@@ -1,15 +1,15 @@
---
-tags: [bash, bash/builtin]
+tags: [shell/bash/builtin]
title: bash fc
created: '2019-07-30T06:19:49.048Z'
-modified: '2019-08-02T06:50:07.514Z'
+modified: '2023-04-15T09:33:14.623Z'
---
# bash fc
-`fix command`
-> open last command from history in editor and run
+> `fix command` - open last command from history in editor and run
+## usage
```sh
fc -l -1000 # list last 1000 command from history
@@ -21,16 +21,19 @@ alias r='fc -s' # typing `r cc' runs the last command beginning with `cc'
# and typing `r' re-executes the last command.
```
-
## running in script
-if you can't source you have to set option and source history !!
+
```sh
#!/bin/bash
-HISTFILE=~/.bash_history # Or wherever you bash history file lives
-set -o history # enable history
+# if you can't source you have to set option and source history !!
+
+HISTFILE=~/.bash_history # or wherever you bash history file lives
+set -o history # enable history
history | grep git
```
-["history" stops working when run inside bash script - Unix & Linux Stack Exchange](https://unix.stackexchange.com/a/112362/193945)
+## see also
-[Rapidly invoke an editor to write a long, complex, or tricky command](https://www.commandlinefu.com/commands/view/1446/rapidly-invoke-an-editor-to-write-a-long-complex-or-tricky-command)
+- [[bash history]]
+- ["history" stops working when run inside bash script - Unix & Linux Stack Exchange](https://unix.stackexchange.com/a/112362/193945)
+- [Rapidly invoke an editor to write a long, complex, or tricky command](https://www.commandlinefu.com/commands/view/1446/rapidly-invoke-an-editor-to-write-a-long-complex-or-tricky-command)
diff --git a/notes/bash fg.md b/notes/bash fg.md
new file mode 100644
index 00000000..f934e366
--- /dev/null
+++ b/notes/bash fg.md
@@ -0,0 +1,39 @@
+---
+tags: [shell/bash/builtin]
+title: bash fg
+created: '2019-08-02T06:42:37.596Z'
+modified: '2023-04-12T11:53:07.214Z'
+---
+
+# bash fg
+
+> move job to the foreground
+
+## usage
+
+```sh
+%N # job number [N]
+%S # invocation of job begins with string "S"
+%?S # invocation of job contains within it string "S"
+%% # "current" job (last job stopped in foreground or started in background)
+%+ # "current" job (last job stopped in foreground or started in background)
+%- # last job
+$! # last background process
+```
+
+```sh
+fg # brings a background job into the foreground
+fg %+ # brings most recently invoked background job
+fg %- # brings second most recently invoked background job
+fg %N # brings job number N
+fg %string # brings job whose command begins with string
+fg %?string # brings job whose command contains string
+```
+
+## see also
+
+- [[bash jobs]]
+- [[bash bg]]
+- [[bash process-handling]]
+- [[bash waits]]
+- [[mktemp]]
diff --git a/notes/bash for.md b/notes/bash for.md
index cdf38aeb..622e9805 100644
--- a/notes/bash for.md
+++ b/notes/bash for.md
@@ -1,90 +1,57 @@
---
-tags: [bash]
+tags: [shell/bash/keyword]
title: bash for
created: '2019-07-30T06:19:49.007Z'
-modified: '2019-07-30T06:22:29.790Z'
+modified: '2022-04-27T14:22:34.833Z'
---
# bash for
-```sh
-for x := 1 to 10 do
-begin
- statements
-end
-```
+> execute commands for each member in a list
+
+## usage
```sh
-for name [in list]; do
- statements that can use $name
+for name [in words]; do
+ command $name;
done
-```
-```sh
f(){ for arg; do echo $arg; done } # without `in` cycle thorugh positional arguments
-```
-[Bash "for" loop without a "in foo bar..." part - Unix & Linux Stack Exchange](https://unix.stackexchange.com/a/417296/193945)
-#### set
-```sh
+
+# set
set 1 2 3
-for i do
- echo "$i"
-done
-```
+for i do echo "$i"; done
-#### range
-> Bash v4.0+ has inbuilt support for setting up a step value using `{START..END..INCREMENT}` syntax:
-```sh
-for i in {0..10..2}; do
- echo "Welcome $i times"
-done
-```
+# seq
+for i in $(seq 1 2 20); do echo "count: $i"; done
-#### seq
-```sh
-for i in $(seq 1 2 20); do
- echo "Welcome $i times"
-done
-```
-#### three-expression c-style
+# range bash-v4.0+ has inbuilt support for setting up a step value using `{START..END..INCREMENT}` syntax:
+for i in {0..10..2}; do echo "count: $i"; done
-```sh
-for (( EXP1; EXP2; EXP3 )); do
- command1
- ..
-done
+# three-expression c-style
+for (( EXP1; EXP2; EXP3 )); do echo "test"; done
for (( initialisation ; ending condition ; update )); do
statements...
done
-for (( c=1; c<=5; c++ )); do
- echo "Welcome $c times"
-done
-```
+for (( c=1; c<=5; c++ )); do echo "count: $c"; done
-#### infinite loop
-```sh
-for (( ; ; )); do
- echo "infinite loops [ hit CTRL+C to stop]"
-done
-```
+# infinite loop
+for (( ; ; )); do echo "infinite loops [ hit CTRL+C to stop]"; done
-#### break
-```sh
+# break
for I in 1 2 3 4 5; do
- statements1
+ STATEMENT1
if (disaster-condition); then
break # Abandon the loop.
fi
- statements3 #While good and, no disaster-condition.
+ STATEMENT3 #While good and, no disaster-condition.
done
-```
-#### continue
-```sh
+# continue
for f in $FILES ; do
if [ -f ${f}.bak ]; then # if .bak backup file exists, read next file
echo "Skiping $f file..."
@@ -93,3 +60,11 @@ for f in $FILES ; do
cp $f $f.bak # make a backup
done
```
+
+## see also
+
+- [[xargs]]
+- [[seq]]
+- [[bash arithmetic expansion]]
+- [[bash function]]
+- [Bash "for" loop without a "in foo bar..." part - Unix & Linux Stack Exchange](https://unix.stackexchange.com/a/417296/193945)
diff --git a/notes/bash function.md b/notes/bash function.md
new file mode 100644
index 00000000..b931eb04
--- /dev/null
+++ b/notes/bash function.md
@@ -0,0 +1,62 @@
+---
+tags: [shell/bash/keyword]
+title: bash function
+created: '2019-07-30T06:19:49.008Z'
+modified: '2022-04-27T14:22:49.998Z'
+---
+
+# bash function
+
+> keyword `function` defines a shell function
+
+## usage
+
+```sh
+# the function refers to passed arguments by position (positional parameters)
+# `$@` expands positional params to seperate words: `$1` `$2`..`$N`
+# `$*` expands positional params to one words: `$1c$2c..` `c` is the first character of `IFS`
+# `$#` holds the number of positional parameters.
+
+function func() {
+ return 0;
+}
+
+func() ( # run function as subshell
+ echo 0;
+)
+
+func(){
+ for arg; do echo $arg; done # without `in` cycle thorugh positional arguments
+}
+
+
+unset -f functname # deletes a function definition
+
+declare -f # displays all defined functions in your login session
+
+
+# simple bash database - usage: source db.sh
+db_set() { echo "$1,$2" >> database; }
+db_get() { grep "^$1," database | sed -e "s/^$1,//" | tail -n 1; }
+```
+
+## variables
+
+```sh
+${FUNCNAME[0]} # Current function
+
+${FUNCNAME[1]} # Parent function
+
+${FUNCNAME[2]} # So on and so forth
+
+${FUNCNAME[@]} # All functions including parents
+```
+
+## see also
+
+- [[bash]]
+- [[bash return]]
+- [[bash local]]
+- [[bash parameter expansion]]
+- [arguments - What is $@ in Bash? - Stack Overflow](https://stackoverflow.com/a/3898681/2087704)
+- [Log-structured storage - Julia Evans](https://jvns.ca/blog/2017/06/11/log-structured-storage/)
diff --git a/notes/bash functions.md b/notes/bash functions.md
deleted file mode 100644
index 15d7dfca..00000000
--- a/notes/bash functions.md
+++ /dev/null
@@ -1,33 +0,0 @@
----
-tags: [bash]
-title: bash functions
-created: '2019-07-30T06:19:49.008Z'
-modified: '2019-07-30T06:22:29.791Z'
----
-
-# bash functions
-
-The function refers to passed arguments by position (positional parameters).
-`$@` expands positional params to seperate words: `$1` `$2`..`$N`
-`$*` expands positional params to one words: `$1c$2c..` `c` is the first character of `IFS`
-`$#` holds the number of positional parameters.
-
-[arguments - What is $@ in Bash? - Stack Overflow](https://stackoverflow.com/a/3898681/2087704)
-
-```sh
-function func() {
- ..
-}
-```
-
-### run function as subshell
-```sh
-func() (
-)
-```
-
-```sh
-unset -f functname # deletes a function definition
-
-declare -f # displays all defined functions in your login session
-```
diff --git a/notes/bash getops.md b/notes/bash getops.md
deleted file mode 100644
index bc6973d8..00000000
--- a/notes/bash getops.md
+++ /dev/null
@@ -1,32 +0,0 @@
----
-tags: [bash]
-title: bash getops
-created: '2019-07-30T06:19:49.009Z'
-modified: '2019-07-30T06:22:29.791Z'
----
-
-# bash getops
-
-```sh
-while getopts u:d:p:f: option; do
- case "${option}" in
- u)
- USER=${OPTARG}
- ;;
- d)
- DATE=${OPTARG}
- ;;
- p)
- PRODUCT=${OPTARG}
- ;;
- f)
- FORMAT=$OPTARG
- ;;
- esac
-done
-
-echo $USER
-echo $DATE
-echo $PRODUCT
-echo $FORMAT
-```
diff --git a/notes/bash getopts.md b/notes/bash getopts.md
new file mode 100644
index 00000000..14558ebe
--- /dev/null
+++ b/notes/bash getopts.md
@@ -0,0 +1,37 @@
+---
+tags: [shell/bash]
+title: bash getopts
+created: '2019-07-30T06:19:49.009Z'
+modified: '2022-04-27T14:22:56.680Z'
+---
+
+# bash getopts
+
+> parse positional parameters as options
+
+## usage
+
+```sh
+OPTIND # option-index; initialized to 1
+OPTARG # getopts places argument to OPTARG when option requires argument
+OPTSTRING # contains option letters to be recognized;
+ # if a letter is followed by a colon, the option is expected to have an argument, which should be separated from it by white space
+OPTERR # default: 1, if set 0, getopts disables the printing of error messages
+```
+
+```sh
+while getopts u:d:p:f: option; do
+ case "${option}" in
+ u) USER=${OPTARG} ;;
+ d) DATE=${OPTARG} ;;
+ p) PRODUCT=${OPTARG} ;;
+ f) FORMAT=$OPTARG ;;
+ esac
+done
+```
+
+## see also
+
+- [[bash while]]
+- [[bash case]]
+- [[bash arguments]]
diff --git a/notes/bash globbing.md b/notes/bash globbing.md
index b380bc69..2080438b 100644
--- a/notes/bash globbing.md
+++ b/notes/bash globbing.md
@@ -1,66 +1,63 @@
---
-tags: [bash]
+tags: [shell/bash]
title: bash globbing
created: '2019-07-30T06:19:49.009Z'
-modified: '2019-07-30T06:22:29.792Z'
+modified: '2022-04-27T14:23:05.524Z'
---
# bash globbing
-wildcards aka `pathname-expansion` refered to as globbing.
-pathname-expansion `expands`: `*`,`?`, `.` and `[..]`
-```sh
-# wildcards:
-
-# * - Matches any string, including the null string
-# List all JPEG files
-ls *.jpg
-
-# ? - Matches any single (one) character.
-# List JPEG files with 1 char names (eg a.jpg, 1.jpg)
-ls ?.jpg
-
-# [...] - Matches any one of the enclosed characters.
-# Remove JPEG files that start with a capital letter
-rm [A-Z]*.jpg
+> wildcards aka `pathname-expansion` refered to as `globbing`
+> pathname-expansion expands: `*`, `?`, `.`, `[..]`
-```
+## usage
```sh
man bash # some globbing explained
-```
-## extended globbing
-```sh
-?(pattern-list) # Matches zero or one occurrence of the given patterns
-*(pattern-list) # Matches zero or more occurrences of the given patterns
-+(pattern-list) # Matches one or more occurrences of the given patterns
-@(pattern-list) # Matches one of the given patterns
-!(pattern-list) # Matches anything except one of the given patterns
-```
+# wildcards
+# * Matches any string, including the null string
+# ? Matches any single (one) character
+# [...] Matches any one of the enclosed characters
-## dotglob
-If set, bash includes filenames beginning with a `.` in the results of pathname expansion.
+ls *.jpg # list all jpg files
-```sh
-shopt -s extglob # set extended globbint
+ls ?.jpg # list jpg files with 1 char names (eg `a.jpg`, `1.jpg`)
+rm [A-Z]*.jpg # rm jpg files that start with a capital letter
+
+# dotglob
+# if set, bash includes filenames beginning with a `.` in the results of pathname expansion
+shopt -s extglob # set extended globbint
shopt -u dotglob # unset dotglob
-```
-## extglob
+# extended globbing - `shopt -s extglob`
+# ?(pattern-list) Matches zero or one occurrence of the given patterns
+# *(pattern-list) Matches zero or more occurrences of the given patterns
+# +(pattern-list) Matches one or more occurrences of the given patterns
+# @(pattern-list) Matches one of the given patterns
+# !(pattern-list) Matches anything except one of the given patterns
-If set, the extended pattern matching features described above under Pathname Expansion are enabled.
-[Path name expansion - Linux Shell Scripting Tutorial - A Beginner's handbook](http://bash.cyberciti.biz/guide/Path_name_expansion)
+ls +(ab|def)*+(.jpg|.gif) # list all the jpg and gif files that start with either "ab" or "def
+ls ab*.jpg ab*.gif def*.jpg def*.gif # without extended globbing
+ls ab+(2|3).jpg # list all files that match regex "ab(2|3)+.jpg"
-```sh
-echo file{1,2,3}.txt
+# list all the files that aren't jpgs or GIFs
+ls *!(.jpg|.gif) # wrong ".jpg" and the ".gif" of any file's name end up getting matched by the "*" and the null string at the end of the file
+ls !(*.jpg|*.gif) # right
-ls -l /etc/{resolv.conf, passwd}
+ls !(+(ab|def)*+(.jpg|.gif)) # list all the files that aren't jpg or gif files and start with either "ab" or "def"
```
+## see also
+
+- [[bash shopt]]
+- [[bash parameter expansion]]
+- [linuxjournal.com/content/bash-extended-globbing](https://www.linuxjournal.com/content/bash-extended-globbing)
+- [Path name expansion - Linux Shell Scripting Tutorial - A Beginner's handbook](http://bash.cyberciti.biz/guide/Path_name_expansion)
+
diff --git a/notes/bash hash.md b/notes/bash hash.md
new file mode 100644
index 00000000..e2ed29f5
--- /dev/null
+++ b/notes/bash hash.md
@@ -0,0 +1,34 @@
+---
+tags: [linux, macos, shell/bash/builtin]
+title: bash hash
+created: '2019-08-02T06:42:37.599Z'
+modified: '2022-04-27T14:23:33.799Z'
+---
+
+# bash hash
+
+> remember or display program locations
+
+- bash checks the hash table for the name to find the executable
+- there is no need to put the script in your PATH, unless you want it to be available in all new shells
+
+
+## usage
+
+```sh
+hash # display current hash-table
+
+hash -l # display hash-table in format that is usable as input
+
+hash -p /foo.sh foo # add command with path and alias
+
+hash -d foo # delete remembered location
+
+hash -r # clear hash-tabl
+```
+
+## see also
+
+- [[bash type]]
+- [[bash command]]
+- [[which]]
diff --git a/notes/bash help.md b/notes/bash help.md
new file mode 100644
index 00000000..3a6fad17
--- /dev/null
+++ b/notes/bash help.md
@@ -0,0 +1,36 @@
+---
+tags: [shell/bash/builtin]
+title: bash help
+created: '2019-08-02T06:42:37.601Z'
+modified: '2022-11-25T10:57:31.810Z'
+---
+
+# bash help
+
+> display information about builtin commands
+
+## option
+
+```sh
+-d # output short description
+-m # display usage in pseudo-manpage format
+-s # output only a short usage synopsis for each topic matching PATTERN
+```
+
+## usage
+
+```sh
+help # displays brief summaries of builtin commands
+
+help CMD # find out more about the function CMD
+
+man -k # find out more about commands not in this list
+info # find out more about commands not in this list
+info bash # find out more about the shell in general
+```
+
+## see also
+
+- [[man]]
+- [[command-not-found]]
+- [[bash \[\[]]
diff --git a/notes/bash history expansion.md b/notes/bash history expansion.md
index 9827188d..da5d9491 100644
--- a/notes/bash history expansion.md
+++ b/notes/bash history expansion.md
@@ -1,82 +1,80 @@
---
-tags: [bash]
+tags: [shell/bash]
title: bash history expansion
created: '2019-07-30T06:19:49.010Z'
-modified: '2019-07-30T06:22:29.792Z'
+modified: '2022-04-27T14:27:39.423Z'
---
# bash history expansion
-`bang bang`
+> introduce words from the history list into the input stream, making it easy to repeat commands, insert the arguments to a previous command into the current input line, or fix errors in previous commands quickly
+
+## usage
```sh
+! # Start a history substitution, except when followed by a space, tab, the end of the line,
+ # โ=โ or โ(โ (when the extglob shell option is enabled using the shopt builtin).
+
+!! # `bang bang`: Refer to the previous command. This is a synonym for โ!-1โ
!! # repeats the last command
sudo !!
-!-2 # relative to current index
-
+!n # Refer to command line n.
!14934 # executes command in history with number 14934
-!m # executes command in history starting with "m.."
+!-n # Refer to the command n lines back.
+!-2 # relative to current index
+!1-$:p
+!string # Refer to the most recent command preceding the current position in the history list starting with string.
+!m # executes command in history starting with "m.."
!ech # e.g. autocompletes last command starting with ech maybe echo something
-```
+!ech:p # :p prints command
-### modifieres
-> After the optional word designator, you can add a sequence of one or more of the following modifiers, each preceded by a `:`
-```sh
+!^ # get the first argument of a particular command
+ls ls !^
-h # Remove a trailing pathname component, leaving only the head.
-t # Remove all leading pathname components, leaving the tail.
-r # Remove a trailing suffix of the form โ.suffixโ, leaving the basename.
-e # Remove all but the trailing suffix.
+!$ # get the last argument
+mkdir foo && cd !$
-p # Print the new command but do not execute it.
-!ech:p # :p prints command
+!* # get all arguments, but not the command itself
-q # Quote the substituted words, escaping further substitutions.
-x # Quote the substituted words as with โqโ, but break into words at spaces, tabs, and newlines.
-s/old/new/ # Substitute new for the first occurrence of old in the event line. Any delimiter may be used in place of โ/โ. The delimiter may be quoted in old and new with a single backslash. If โ&โ appears in new, it is replaced by old. A single backslash will quote the โ&โ. The final delimiter is optional if it is the last character on the input line.
-& # Repeat the previous substitution.
-g
-a # Cause changes to be applied over the entire event line. Used in conjunction with โsโ, as in gs/old/new/, or with โ&โ.
-G # Apply the following โsโ modifier once to each word in the event.
+!# # entire command line typed so far
+!?string[?] # Refer to the most recent command preceding the current position in the history list containing string.
+ # trailing `?` may be omitted if the string is followed immediately by a newline
+
+^string1^string2^ # quick substitution - repeat the last command, replacing string1 with string2
+# Equivalent to
+!!:s/string1/string2/.
```
-[Bash Reference Manual - Modifiers](https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Modifiers)
+## modifieres
-### Expanding for historical arguments
+after optional word designator, you can add a sequence of one or more of the following modifiers, each preceded by `:`
```sh
-ls !^ # get the first argument of a particular command
-
-!$ # get the last argument
-
-!1-$:p #
-
-
-!* # get all arguments (but not the command itself)
+h # remove a trailing pathname component, leaving only the head
+t # remove all leading pathname components, leaving the tail
+r # remove a trailing suffix of the form โ.suffixโ, leaving the basename
+e # remove all but the trailing suffix
+p # print the new command but do not execute it.
+q # quote the substituted words, escaping further substitutions.
+x # quote the substituted words as with โqโ, but break into words at spaces, tabs, and newlines
+
+s/old/new/ # Substitute new for the first occurrence of old in the event line. Any delimiter may be used in place of `/`
+# delimiter may be quoted in old and new with a single backslash.
+# If โ&โ appears in new, it is replaced by old.
+# A single backslash will quote the โ&โ. The final delimiter is optional if it is the last character on the input line.
+# & repeat the previous substitution
+# g
+# a cause changes to be applied over the entire event line. Used in conjunction with โsโ, as in gs/old/new/, or with โ&โ
+# G apply the following โsโ modifier once to each word in the event
```
-```sh
-! # Start a history substitution, except when followed by a space, tab, the end of the line,
- # โ=โ or โ(โ (when the extglob shell option is enabled using the shopt builtin).
-!n # Refer to command line n.
-!-n # Refer to the command n lines back.
-!! # Refer to the previous command. This is a synonym for โ!-1โ.
-!string # Refer to the most recent command preceding the current position in the history list starting with string.
-
-!?string[?] # Refer to the most recent command preceding the current position in the history list containing string.
- # The trailing โ?โ may be omitted if the string is followed immediately by a newline.
-
-^string1^string2^ # Quick Substitution. Repeat the last command, replacing string1 with string2.
-# Equivalent to
-!!:s/string1/string2/.
-
-!# # The entire command line typed so far.
-
-```
+## see also
-[Bash Event-Designators](https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Event-Designators)
+- [[bash history]]
+- [Bash Event-Designators](https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Event-Designators)
+- [Bash Reference Manual - Modifiers](https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Modifiers)
diff --git a/notes/bash history.md b/notes/bash history.md
new file mode 100644
index 00000000..c2602918
--- /dev/null
+++ b/notes/bash history.md
@@ -0,0 +1,79 @@
+---
+tags: [shell/bash/builtin]
+title: bash history
+created: '2019-08-02T06:42:37.603Z'
+modified: '2023-06-28T08:37:31.485Z'
+---
+
+# bash history
+
+> display or manipulate the history list
+
+## environment
+
+```sh
+man bash # get available env vars
+
+HISTTIMEFORMAT # format-string strftime(3) to print the time stamp for each displayed history entry
+HISTTIMEFORMAT='%F %T ' # => "10 2023-04-21 vi README.md"
+HISTTIMEFORMAT='%F %T %t' # => "10 2023-04-21 11:50:06 vi README.md"
+
+HISTFILE # alternative history-file defaults to `~/.bash_history`
+unset HISTFILE # don't save to history
+
+HISTFILESIZE=1000000
+HISTSIZE=1000000
+
+HISTCONTROL
+HISTCONTROL=ignorespace # start command with space to not get saved
+HISTCONTROL=ignoredups # ignore duplicate liens
+HISTCONTROL=ignoreboth # ignore both above
+
+
+
+HISTCONTROL # colon-separated list of values controlling how commands are saved on the history list.
+ # If the list of values includes ignorespace, lines which begin with a space character are not saved in the history list. A value of ignoredups causes lines matching the previous history entry to not be saved. A value of ignoreboth is shorthand for ignorespace and ignoredups. A value of erasedups causes all previous lines matching the current line to be removed from the history list before that line is saved. Any value not in the above list is ignored. If HISTCONTROL is unset, or does not include a valid value, all lines read by the shell parser are saved on the history list, subject to the value of HISTIGNORE. The second and subsequent lines of a multi-line compound command are not tested, and are added to the history regardless of the value of HISTCONTROL.
+HISTFILE # filename in which command history is saved default value is ~/.bash_history. If unset history is not saved
+HISTFILESIZE # max number of lines contained in the history file. When this variable is assigned a value, the history file is truncated, if necessary, to contain no more than that number of lines by removing the oldest entries. The history file is also truncated to this size after writing it when a shell exits. If the value is 0, the history file is truncated to zero size. Non-numeric values and numeric values less than zero inhibit truncation. The shell sets the default value to the value of HISTSIZE after reading any startup files.
+HISTIGNORE # colon-separated list of patterns used to decide which command lines should be saved on the history list. Each pattern is anchored at the beginning of the line and must match the complete line (no implicit `*' is appended). Each pattern is tested against the line after the checks specified by HISTCONTROL are applied. In addition to the normal shell pattern matching characters, `&' matches the previous history line. `&' may be escaped using a backslash; the backslash is removed before attempting a match. The second and subsequent lines of a multi-line compound command are not tested, and are added to the history regardless of the value of HISTIGNORE. The pattern matching honors the setting of the extglob shell option.
+HISTSIZE # number of commands to remember in the command history If the value is 0, commands are not saved in the history list
+HISTTIMEFORMAT # If variable is set and not null, its value is used as a strftime(3) to print the time stamp associated with each history entry displayed by the history builtin
+```
+
+## option
+
+```sh
+-c # clear the history list by deleting all of the entries
+-d offset # delete the history entry at position OFFSET. Negative offsets count back from the end of the history list
+-a # append history lines from this session to the history file
+-n # read all history lines not already read from the history file and append them to the history list
+-r # read the history file and append the contents to the history list
+-w # write the current history to the history file
+-p # perform history expansion on each ARG and display the result without storing it in the history list
+-s # append the ARGs to the history list as a single entry
+```
+
+## usage
+
+```sh
+shopt -s histappend # don't overwrite history file after each session
+shopt -s cmdhist # force commands entered on more than one line to be adjusted to fit on only one for parsing
+
+PROMPT_COMMAND='history -a'
+
+history 1
+
+# top 30 entries
+history | awk '{print $2}' | sort | uniq -c | sort -rn | head -30 | \
+ awk '!max{max=$1;}{r=""; i=s=100*$1/max; while(i-->0)r=r"#"; printf "%50s %5d %s %s",$2,$1,r,"\n";}'
+```
+
+## see also
+
+- [[wc]]
+- [[bash fc]]
+- [[bash shopt]]
+- [[bash redirect]]
+- [[bash history expansion]]
+- [sanctum.geek.nz/arabesque/better-bash-history/](https://sanctum.geek.nz/arabesque/better-bash-history/)
+- [stackoverflow.com/execute-command-without-keeping-it-in-history](https://stackoverflow.com/questions/8473121/execute-command-without-keeping-it-in-history)
diff --git a/notes/bash i_o redirects.md b/notes/bash i_o redirects.md
deleted file mode 100644
index 8774bb2d..00000000
--- a/notes/bash i_o redirects.md
+++ /dev/null
@@ -1,38 +0,0 @@
----
-tags: [bash]
-title: bash i_o redirects
-created: '2019-07-30T06:19:49.011Z'
-modified: '2019-07-30T06:22:29.793Z'
----
-
-# bash i/o redirects
-
-```sh
-cmd1|cmd2 # pipe; takes standard output of cmd1 as standard input to cmd2
-> file # directs standard output to file
-< file # takes standard input from file
->> file # directs standard output to file; append to file if it already exists
->|file # forces standard output to file even if noclobber is set
-n>|file # forces output to file from file descriptor n even if noclobber is set
-<> file # uses file as both standard input and standard output
-n<>file # uses file as both input and output for file descriptor n
-
-<file # directs file descriptor n to file
-n>file # directs file description n to file; append to file if it already exists
-```
-
-```sh
-n>& # duplicates standard output to file descriptor n
-n<& # duplicates standard input from file descriptor n
-n>&m # file descriptor n is made to be a copy of the output file descriptor
-n<&m # file descriptor n is made to be a copy of the input file descriptor
-&>file # directs standard output and standard error to file
-
-<&- # closes the standard input
->&- # closes the standard output
-n>&- # closes the ouput from file descriptor n
-n<&- # closes the input from file descripor n
-```
diff --git a/notes/bash if.md b/notes/bash if.md
index 40366f39..0ed972eb 100644
--- a/notes/bash if.md
+++ b/notes/bash if.md
@@ -1,24 +1,32 @@
---
-tags: [bash, bash/builtin]
+tags: [shell/bash/keyword]
title: bash if
created: '2019-07-30T06:19:49.011Z'
-modified: '2019-07-30T06:38:58.263Z'
+modified: '2022-06-02T12:10:40.605Z'
---
# bash if
+> execute commands based on conditional
+
+## usage
+
```sh
statement1 && statement2 # and operator
statement1 || statement2 # or operator
-```
-```sh
+
if condition; then
statements
-[elif condition
- then statements...]
-[else
- statements]
+elif condition; then
+ statements
+else
+ statements
fi
```
+
+## see also
+
+- [[bash case]]
+- [[bash test]]
diff --git a/notes/bash ifs.md b/notes/bash ifs.md
index 2ac3ee59..611bc759 100644
--- a/notes/bash ifs.md
+++ b/notes/bash ifs.md
@@ -1,19 +1,16 @@
---
-tags: [bash]
+tags: [shell/bash]
title: bash ifs
created: '2019-07-30T06:19:49.012Z'
-modified: '2019-07-30T06:22:29.794Z'
+modified: '2022-04-27T14:28:08.568Z'
---
# bash ifs
-`internal field seperator`
-
-- [WordSplitting - Greg's Wiki](http://mywiki.wooledge.org/WordSplitting)
-- [Word splitting [Bash Hackers Wiki]](http://wiki.bash-hackers.org/syntax/expansion/wordsplit)
-
+> `internal field seperator`
occurs once any of the following expansions are done (and only then!)
+
- `Parameter expansion`: `${}`
- `Command substitution`: `$()`
- `Arithmetic expansion`: `$(())`
@@ -21,22 +18,21 @@ occurs once any of the following expansions are done (and only then!)
Bash will scan the results of these expansions for special `IFS` characters that mark word boundaries. This is only done on results that are not double-quoted!
The IFS variable holds the characters that Bash sees as word boundaries in this step. The default contains the characters
+
- ``
- ``
- ``
+## usage
+
```sh
IFS= # sets the internal field separator to "no value".
# , , and are therefore considered part of a word,
# which will preserve white space in the file names.
IFS=$'\t' # sets tab as field seperator
-
IFS=$'\n' # sets linebreak as field seperator
-```
-## example
-```sh
mystring="foo:bar baz rab"
IFS=
@@ -44,3 +40,8 @@ for word in $mystring; do
echo "Word: $word"
done
```
+
+## see also
+
+- [WordSplitting - Greg's Wiki](http://mywiki.wooledge.org/WordSplitting)
+- [Word splitting [Bash Hackers Wiki]](http://wiki.bash-hackers.org/syntax/expansion/wordsplit)
diff --git a/notes/bash jobs.md b/notes/bash jobs.md
new file mode 100644
index 00000000..b4b679ee
--- /dev/null
+++ b/notes/bash jobs.md
@@ -0,0 +1,34 @@
+---
+tags: [shell/bash/builtin]
+title: bash jobs
+created: '2019-08-02T06:42:37.604Z'
+modified: '2022-04-27T14:28:16.927Z'
+---
+
+# bash jobs
+
+> lists the jobs running in the background, giving the job number
+
+## usage
+
+```sh
+%N # Job number [N]
+%S # Invocation (command-line) of job begins with string S
+%?S # Invocation (command-line) of job contains within it string S
+%% # "current" job (last job stopped in foreground or started in background)
+%+ # "current" job (last job stopped in foreground or started in background)
+%- # Last job
+$! # Last background process
+```
+
+```sh
+jobs # lists all jobs (use with -l to see associated PID)
+```
+
+## see also
+
+- [[bash kill]]
+- [[bash process-handling]]
+- [[bash fg]]
+- [[bash bg]]
+- [[bash wait]]
diff --git a/notes/bash kill.md b/notes/bash kill.md
new file mode 100644
index 00000000..bd75c71e
--- /dev/null
+++ b/notes/bash kill.md
@@ -0,0 +1,48 @@
+---
+tags: [shell/bash/builtin]
+title: bash kill
+created: '2019-08-02T06:42:37.606Z'
+modified: '2023-06-28T08:27:34.830Z'
+---
+
+# bash kill
+
+> send a signal to a job
+
+- is a shell builtin for two reasons:
+ - it allows job IDs to be used instead of process IDs
+ - it allows processes to be killed if the limit on processes that you can create is reached
+
+- send processes-identified by PID or JOBSPEC the signal named by SIGSPEC or SIGNUM
+- if neither SIGSPEC nor SIGNUM is present, then SIGTERM is assumed
+
+## option
+
+```sh
+-s SIG # SIG is a signal name
+-n SIG # SIG is a signal number
+-l # list the signal names; if arguments follow `-l' they are assumed to be signal numbers for which names should be listed
+-L # synonym for -l
+```
+
+## usage
+
+```sh
+kill -l # list signals
+
+kill -signal PID
+
+kill -1 PID # SIGHUP
+kill -9 PID # SIGKILL
+kill -15 PID # SIGTERM
+```
+
+## see also
+
+- [[signal]]
+- [[bash jobs]]
+- [[kill]]
+- [[pkill]]
+- [[ps]]
+- [linux.die.net/man/2/kill](https://linux.die.net/man/2/kill)
+
diff --git a/notes/bash let.md b/notes/bash let.md
new file mode 100644
index 00000000..7bed2723
--- /dev/null
+++ b/notes/bash let.md
@@ -0,0 +1,25 @@
+---
+tags: [shell/bash/builtin]
+title: bash let
+created: '2019-08-02T06:42:37.607Z'
+modified: '2022-04-27T14:29:25.433Z'
+---
+
+# bash let
+
+> evaluate arithmetic expressions
+
+## usage
+
+```sh
+myvar=6
+
+let myvar+=1
+
+echo $myvar
+```
+
+## see also
+
+- [[bc]]
+- [[bash arithmetic expansion]]
diff --git a/notes/bash local.md b/notes/bash local.md
new file mode 100644
index 00000000..06fd84bb
--- /dev/null
+++ b/notes/bash local.md
@@ -0,0 +1,27 @@
+---
+tags: [shell/bash/builtin]
+title: bash local
+created: '2019-08-02T06:42:37.608Z'
+modified: '2022-04-27T14:29:32.238Z'
+---
+
+# bash local
+
+> Local variables can only be used within a function; they are visible only to the function where they are defined and its children
+
+## usage
+
+```sh
+foo(){
+
+ local foo="bar"
+ echo "foo: $foo"
+}
+foo
+echo "foo: $foo"
+```
+
+## see also
+
+- [[bash function]]
+- [[bash return]]
diff --git a/notes/bash logout.md b/notes/bash logout.md
new file mode 100644
index 00000000..11b6adec
--- /dev/null
+++ b/notes/bash logout.md
@@ -0,0 +1,20 @@
+---
+tags: [shell/bash/builtin]
+title: bash logout
+created: '2019-08-02T06:42:37.610Z'
+modified: '2022-04-27T14:29:38.435Z'
+---
+
+# bash logout
+
+> exit a login shell
+
+## usage
+
+```sh
+logout [N] # exits a login shell with exit status N. Returns an error if not executed in a login shell.
+```
+
+## see alos
+
+- [[bash]]
diff --git a/notes/bash mapfile.md b/notes/bash mapfile.md
index 594fc70b..169b6fb8 100644
--- a/notes/bash mapfile.md
+++ b/notes/bash mapfile.md
@@ -1,27 +1,45 @@
---
-tags: [bash, bash/builtin]
+tags: [shell/bash/builtin]
title: bash mapfile
created: '2019-07-30T06:19:49.014Z'
-modified: '2019-07-30T06:23:11.516Z'
+modified: '2022-04-27T14:29:48.400Z'
---
# bash mapfile
-## synopsis
-```sh
-mapfile [-n COUNT] [-O ORIGIN] [-s COUNT] [-t] [-u FD] [-C CALLBACK] [-c QUANTUM] [ARRAY]
+> read lines from stdin into an indexed array variable
-readarray [-n COUNT] [-O ORIGIN] [-s COUNT] [-t] [-u FD] [-C CALLBACK] [-c QUANTUM] [ARRAY]
-```
+## option
+```sh
+-c QUANTUM # Specifies the number of lines that have to be read between every call to the callback specified with -C - default QUANTUM is 5000
+-C CALLBACK # Specifies a callback, which can be any shell code, the index of the array that will be assigned, and the line is appended at evaluation time
+-n COUNT # Reads at most COUNT lines, then terminates. If COUNT is 0, then all lines are read (default)
+-O ORIGIN # Starts populating the given array ARRAY at the index ORIGIN rather than clearing it and starting at index 0
+-s COUNT # Discards the first COUNT lines read
+-t # Remove any trailing newline from a line read, before it is assigned to an array element
+-u FD # Read from filedescriptor FD rather than standard input
+```
-### example
+## usage
```sh
+readarray
+
+mapfile
+
mapfile -t < <(printf "Line 1\nLine 2\nLine 3")
printf "%s\n" "${MAPFILE[@]}"
-mapfile FOORRAY < <(consul-node dev | awk '{ if( $1 ~ "swarm" && $3 == "alive") { split($2, arr, ":"); print $1, arr[1]} }')
+mapfile FOORRAY < <(CMD | awk '{ if( $1 ~ "swarm" && $3 == "alive") { split($2, arr, ":"); print $1, arr[1]} }')
echo ${FOORAY[@]}
```
+
+## see also
+
+- [wiki-dev.bash-hackers.org/commands/builtin/mapfile](https://wiki-dev.bash-hackers.org/commands/builtin/mapfile)
+- [[bash read]]
+- [[bash array]]
+- [[bash readarray]]
+- [[yq]]
diff --git a/notes/bash parameter expansion.md b/notes/bash parameter expansion.md
index fdb92d42..e8807c62 100644
--- a/notes/bash parameter expansion.md
+++ b/notes/bash parameter expansion.md
@@ -1,48 +1,158 @@
---
-tags: [bash]
+tags: [shell/bash]
title: bash parameter expansion
created: '2019-07-30T06:19:49.015Z'
-modified: '2019-07-30T06:22:29.796Z'
+modified: '2021-11-08T16:04:06.116Z'
---
# bash parameter expansion
+> `${parameter}` the value of parameter is substituted
+
+## positional parameter
```sh
-$@ # expands positional params to seperate words: `$1` `$2`..`$N`
-$* # expands positional params to one words: `$1c$2c..` `c` is the first character of `IFS`
+${0} # ($0) expands to the name of the shell or shell script. This is set at shell initialization.
+ # If Bash is invoked with a file of commands (see Shell Scripts), $0 is set to the name of that file.
+ # If Bash is started with the -c option (see Invoking Bash), then $0 is set to the first argument after the string to be executed, if one is present.
+ # Otherwise, it is set to the filename used to invoke Bash, as given by argument zero.
+${1}
+```
+
+## special parameter
+
+```sh
+${@} # expands positional params to seperate words: `$1`, `$2`, ..`$N`
+${*} # expands positional params to one words: `$1c$2c..` `c` is the first character of `IFS`
+
+${*} # expands to the positional parameters, starting from one. When the expansion is not within double quotes, each positional parameter expands to a separate word. In contexts where it is performed, those words are subject to further word splitting and pathname expansion. When the expansion occurs within double quotes, it expands to a single word with the value of each parameter separated by the first character of the IFS special variable. That is, "$*" is equivalent to "$1c$2cโฆ", where c is the first character of the value of the IFS variable. If IFS is unset, the parameters are separated by spaces. If IFS is null, the parameters are joined without intervening separators.
+
+${@} # expands to the positional parameters, starting from one. In contexts where word splitting is performed, this expands each positional parameter to a separate word; if not within double quotes, these words are subject to word splitting. In contexts where word splitting is not performed, this expands to a single word with each positional parameter separated by a space. When the expansion occurs within double quotes, and word splitting is performed, each parameter expands to a separate word. That is, "$@" is equivalent to "$1" "$2" โฆ. If the double-quoted expansion occurs within a word, the expansion of the first parameter is joined with the beginning part of the original word, and the expansion of the last parameter is joined with the last part of the original word. When there are no positional parameters, "$@" and $@ expand to nothing (i.e., they are removed).
+
+${#} # `$#` expands to the number of positional parameters in decimal.
+
+${?} # `$?` expands to the exit status of the most recently executed foreground pipeline.
+
+${-} # `$-` expands to the current option flags as specified upon invocation, by the set builtin command, or those set by the shell itself (such as the -i option).
+
+
+${$} # `$$` expands to the process ID of the shell. In subshell, it expands to the process ID of the invoking shell, not the subshell
+
+${!} # `$!` expands to the process ID of the job most recently placed into the background, whether executed as an asynchronous command or using the bg builtin (see Job Control Builtins).
+
+
+${_} # `$_` At shell startup, set to the absolute pathname used to invoke the shell or shell script being executed
+ # set to final argument of previous command executed.
+```
+
+## indirect expansion
+
+```sh
+NAME="VARIABLE"
+VARIABLE=42
+echo ${!NAME} # 42
+
+# exceptions to this are the expansions of:
+${!prefix*}
+${!name[@]}
```
## substring
```sh
${PARAMETER#PATTERN} # match from beginning/left to end/right
-
+# --->
${PARAMETER##PATTERN} # more greedy
-${PARAMETER%PATTERN} # match from end/right to beginning/left
+${PARAMETER%PATTERN} # match from end/right to beginning/left
+# <---
${PARAMETER%%PATTERN} # more greendy
+${pages%%[[:cntrl:]]} # remove carriage-return symbol \r
-${string:position} # Extracts substring from $string at $position.
+for i in $(ls -d docker-*); do mv $i ${i#docker-}; done # remove prefix "docker-" from directories
+
+[ ! -z "${NUM##*[!0-9]*}" ] && { echo "is a number: $NUM"; } # check if number
+```
+
+## substring expansion
+
+```sh
+${string:offset} # Extracts substring from $string at $offset
# If the $string parameter is "*" or "@", then this extracts the positional parameters,
- # [1] starting at $position.
+ # [1] starting at $offset.
-${string:position:length} # Extracts $length characters of substring from $string at $position.
+${string:offset:length} # extracts $length characters of substring from $string at $offset.
FOO="9781786466204-go_design_patterns.pdf"
-
echo ${FOO:0:13}; # 9781786466204
echo ${FOO:14}; # go_design_patterns.pdf
```
+## string replacement
+
```sh
-for i in $(ls -d docker-*); do mv $i ${i#docker-}; done # remove prefix "docker-" from directories
+${var/Pattern/Replacement} # First match of Pattern, within var replaced with Replacement
+${var//Pattern/Replacement} # All matches of Pattern, within var replaced with Replacement
-[ ! -z "${NUM##*[!0-9]*}" ] && { echo "is a number: $NUM"; } # check if number
+# e.g. url decoding:
+: "${*//+/ }";
+echo -e "${_//%/\\x}"
```
+## modifie alphabetic characters
+
+- if pattern is omitted, it is treated like a `?`, which matches every character.
+- if parameter is `@` or `*`, the case modification operation is applied to each positional parameter in turn, and the expansion is the resultant list
+- if parameter is an array variable subscripted with `@` or `*`, the case modification operation is applied to each member of the array in turn, and the expansion is the resultant list.
+
+```sh
+${parameter^pattern}
+${parameter^^pattern}
+
+${parameter,pattern}
+${parameter,,pattern}
+
+echo ${FOO^^} # all upercase
+
+echo ${foo,,} # all to lowercase
+echo ${foo^^} # all to upercase
+```
+
+## pattern matching
+
+```sh
+* # matches any string including null string
+? # matches any single character
+[...] # machtes any one of enclosed characters, character-ranges and character classes
+ # [a-z], [A-E] character ranges
+ # if the first character is a `!` or `^` then any character not enclosed is matched
+[:class:] # [:word:] matches letters, digits, and the character `_`
+ # [:alnum:] [:alpha:] [:ascii:] [:blank:] [:cntrl:] [:digit:] [:graph:]
+ # [:lower:] [print:] [:punct:] [:space:] [:upper:] [:xdigit:]
+
+## extended pattern list
+# if the `extglob` shell option is enabled (`shopt -s extglob`)
+# a `pattern-list` is a list of one or more patterns separated by a `|`
+?(pattern-list) # Matches zero or one occurrence of the given patterns
+*(pattern-list) # Matches zero or more occurrences of the given patterns
++(pattern-list) # Matches one or more occurrences of the given patterns
+@(pattern-list) # Matches one of the given patterns
+!(pattern-list) # Matches anything except one of the given patterns
+```
+## see also
+
+- [[tr]]
+- [[bash]]
+- [[bash braces]]
+- [[bash globbing]]
+- [[bash set unset]]
+- [[bash source vs execute]]
+- [gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Shell-Parameter-Expansion](https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Shell-Parameter-Expansion)
+- [gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Shell-Parameters](https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Shell-Parameters)
+- [gnu.org/software/bash/manual/html_node/Pattern-Matching](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html)
+- [Remove \\r from echoing out in bash script - Super User](https://superuser.com/a/1215968)
diff --git a/notes/bash printf.md b/notes/bash printf.md
index ff3b6642..2bb14f13 100644
--- a/notes/bash printf.md
+++ b/notes/bash printf.md
@@ -1,24 +1,68 @@
---
-tags: [bash, bash/builtin]
+tags: [shell/bash/builtin]
title: bash printf
created: '2019-07-30T06:19:49.208Z'
-modified: '2019-08-02T06:35:53.824Z'
+modified: '2023-05-19T10:38:37.969Z'
---
# bash printf
+> formats and prints ARGUMENTS under control of the FORMAT
+
+## option
+
```sh
-printf '%x\n' 12 # print hex: C
+-v VAR # assign the output to shell variable VAR rather than display it on the standard output
+```
-printf "\33c" # clear screen
+## format
-printf "time: %s sec\n" $(expr $end - $start)
+```sh
+%b # expand backslash escape sequences in the corresponding argument
+%q # quote the argument in a way that can be reused as shell input
+%(fmt)T # output the date-time string resulting from using FMT as a format string for strftime(3)
+```
+## usage
+
+```sh
+printf '%x\n' 12 # print hex: C
+
+printf '\112\n' # octal
+printf '\x4a\n' # hex
+
+printf "\\$(printf %o 74)\n" # octal
+printf "\\$(printf %o 74)\n" # octal
+
+printf "time: %s sec\n" $(expr $end - $start)
echo "$(printf '*%.s' {1..40})" # draw line seperator
-```
+printf "%q" "${pages}"
-```sh
-printf "%q\n" * # show non visible characters in file name e.g.
+printf "%q\n" * # show non visible characters in file name e.g.
+
+
+printf "\33c" # clear screen
+printf "\033c";
+
+# arithmetic float
+printf "%.3f\n" $((1+1/2)) # 1.000
+printf "%.3f\n" $( echo "1+1/2" | bc -l ) # 1.500
+
+# progress spinner
+i=1; sp="/-\|"; echo -n ' '; while :; do printf "\b${sp:i++%${#sp}:1}"; done
+
+for ((i=32;i<127;i++)) do printf "\\$(printf %03o "$i")"; done printf "\n" # print all avail. characters
```
+
+## see also
+
+- [[stat]]
+- [[watch]]
+- [[bc]]
+- [[echo]]
+- [[od]]
+- [[seq]]
+- [[ascii]]
+- [[bash arithmetic expansion]]
diff --git a/notes/bash process substitution.md b/notes/bash process substitution.md
new file mode 100644
index 00000000..5f1f3388
--- /dev/null
+++ b/notes/bash process substitution.md
@@ -0,0 +1,34 @@
+---
+tags: [shell/bash]
+title: bash process substitution
+created: '2019-09-05T09:17:23.395Z'
+modified: '2021-05-12T08:46:51.212Z'
+---
+
+# bash process substitution
+
+> process substiution feeds the output of a process (or processes) into the stdin of another process.
+> process substitution uses `/dev/fd/` files to send the results of the process(es)
+
+## usage
+```sh
+>(command_list)
+
+<(command_list)
+
+
+echo >(true)
+/dev/fd/63
+
+echo <(true)
+/dev/fd/63
+```
+
+
+## see also
+- [[tee]]
+- [[vault]]
+- [[bash redirects]]
+- [[bash read]]
+- [tldp.org/.../process-sub.html](http://tldp.org/LDP/abs/html/process-sub.html)
+- [what-is-the-portable-posix-way-to-achieve-process-substitution](https://unix.stackexchange.com/questions/309547/what-is-the-portable-posix-way-to-achieve-process-substitution)
diff --git a/notes/bash process-handling.md b/notes/bash process-handling.md
index 7c42212f..61fc3ba0 100644
--- a/notes/bash process-handling.md
+++ b/notes/bash process-handling.md
@@ -1,68 +1,32 @@
---
-tags: [bash]
+tags: [shell/bash]
title: bash process-handling
created: '2019-07-30T06:19:49.016Z'
-modified: '2019-08-01T07:17:40.346Z'
+modified: '2022-02-10T10:08:59.725Z'
---
# bash process-handling
-[Job Control Commands](http://tldp.org/LDP/abs/html/x9644.html)
+## bash option enable/disabe job-control
-### bash option enable/disabe job-control
-
-[bash set](:note:cc0c0257-f4c9-46ff-a590-c2eff219f6fa) `set -o monitor / set -m`
+`set -o monitor / set -m`
## move to background
> to suspend a job, type `CTRL+Z` while it is running. You can also suspend a job with `CTRL+Y`. This is slightly different from `CTRL+Z` in that the process is only stopped when it attempts to read input from terminal. Of course, to interupt a job, type `CTRL+C`
-```sh
-myCommand & # runs job in the background and prompts back the shell
-```
-## jobs
-> Lists the jobs running in the background, giving the job number
-```sh
-jobs # lists all jobs (use with -l to see associated PID)
-```
-## fg
-```sh
-fg # brings a background job into the foreground
-fg %+ # brings most recently invoked background job
-fg %- # brings second most recently invoked background job
-fg %N # brings job number N
-fg %string # brings job whose command begins with string
-fg %?string # brings job whose command contains string
-```
-
-## bg
```sh
-bg # lists stopped or background jobs ; resume a stopped job in the background
-fg # brings the most recent job in the foreground
-fg # brings job to the foreground
+myCommand & # runs job in the background and prompts back the shell
```
+## see also
-
-| Notation | Meaning |
-|-- |-- |
-| `%N` | Job number [N] |
-| `%S` | Invocation (command-line) of job begins with string S |
-| `%?S` | Invocation (command-line) of job contains within it string S |
-| `%%` | "current" job (last job stopped in foreground or started in background) |
-| `%+` | "current" job (last job stopped in foreground or started in background) |
-| `%-` | Last job |
-| `$!` | Last background process |
-
-
-## disown
-> removes the process from the list of jobs
-```sh
-disown [PID|JID]
-```
-
-### wait
-```sh
-wait # waits until all background jobs have finished
-```
+- [[bash jobs]]
+- [[bash fg]]
+- [[bash bg]]
+- [[bash disown]]
+- [[bash wait]]
+- [[bash set]]
+- [Job Control Commands](http://tldp.org/LDP/abs/html/x9644.html)
+- [[nohup]]
diff --git a/notes/bash cli processing cycle.md b/notes/bash processing cycle.md
similarity index 77%
rename from notes/bash cli processing cycle.md
rename to notes/bash processing cycle.md
index fc282c8b..aa827c77 100644
--- a/notes/bash cli processing cycle.md
+++ b/notes/bash processing cycle.md
@@ -1,24 +1,25 @@
---
-tags: [bash]
-title: bash cli processing cycle
+tags: [shell/bash]
+title: bash processing cycle
created: '2019-07-30T06:19:48.994Z'
-modified: '2019-08-01T07:20:15.368Z'
+modified: '2021-05-12T08:46:51.259Z'
---
-# bash cli processing cycle
+# bash processing cycle
> The default order for command lookup is `functions`, followed by `built-ins`, with scripts and executables last.
> There are three built-ins that you can use to override this order: `command`, `builtin` and `enable`.
-
+## usage
```sh
command # removes alias and function lookup. Only built-ins and commands found in the search path are executed
-```
-```sh
+
builtin # looks up only built-in commands, ignoring functions and commands found in PATH
-```
-```sh
+
enable # enables and disables shell built-ins
```
+
+## see also
+- [[bash command]]
diff --git a/notes/bash prompt.md b/notes/bash prompt.md
index 51da9dba..108befcc 100644
--- a/notes/bash prompt.md
+++ b/notes/bash prompt.md
@@ -1,16 +1,27 @@
---
-tags: [bash]
+tags: [shell/bash]
title: bash prompt
created: '2019-07-30T06:19:49.017Z'
-modified: '2019-07-30T06:22:29.799Z'
+modified: '2023-06-28T08:35:02.463Z'
---
# bash prompt
+> `man bash` at the section `PROMPTING`
+
+## env
+
```sh
-# PS1 -
-PS1="${GREEN}\u${DEFAULT}@${CYAN}${HOST}${DEFAULT}:${BLUE}\w${DEFAULT}${BRANCH}${GREY}${SETPROXY}${RED}${ERRPROMPT}${DEFAULT}\$ "
+PS1
+PROMPT_DIRTRIM
+PROMPT_COMMAND
+```
+
+## usage
+
+```sh
+PS1="${GREEN}\u${DEFAULT}@${CYAN}${HOST}${DEFAULT}:${BLUE}\w${DEFAULT}${BRANCH}${GREY}${SETPROXY}${RED}${ERRPROMPT}${DEFAULT}\$ "
# PS2 - linebreak symbol e.g. ">"
PS2='> ' # used in multiline commands
@@ -26,16 +37,79 @@ PROMPT_DIRTRIM=1 # see also prompt PS1="\W"
# You can set this in your bash shell config to flip a table whenever a command fails with a non-zero exit status.
PROMPT_COMMAND='[ $? -eq 0 ] || printf "(โฏยฐโกยฐ๏ผโฏ๏ธต โปโโป\n"'
+
+prompt_command () {
+ if [ $? -eq 0 ]; then # set an error string for the prompt, if applicable
+ ERRPROMPT=" "
+ else
+ ERRPROMPT='->($?) '
+ fi
+}
```
+## escape sequences
```sh
-prompt_command () {
- if [ $? -eq 0 ]; then # set an error string for the prompt, if applicable
- ERRPROMPT=" "
- else
- ERRPROMPT='->($?) '
- fi
+\a # an ASCII bell character (07)
+\d # the date in "Weekday Month Date" format (e.g., "Tue May 26")
+\D{format} # format is passed to strftime(3) and the result is inserted into the prompt string; braces are required. e.g. '\D{%F %T}'
+\e # an ASCII escape character (033)
+\h # the hostname up to the first `.'
+\H # the hostname
+\j # the number of jobs currently managed by the shell
+\l # the basename of the shell's terminal device name
+\n # newline
+\r # carriage return
+\s # the name of the shell, the basename of $0 (the portion following the final slash)
+\t # the current time in 24-hour HH:MM:SS format
+\T # the current time in 12-hour HH:MM:SS format
+\@ # the current time in 12-hour am/pm format
+\A # the current time in 24-hour HH:MM format
+\u # the username of the current user
+\v # the version of bash (e.g., 2.00)
+\V # the release of bash, version + patch level (e.g., 2.00.0)
+\w # the current working directory, with $HOME abbreviated with a tilde (uses the value of the PROMPT_DIRTRIM variable)
+\W # the basename of the current working directory, with $HOME abbreviated with a tilde
+\! # the history number of this command
+\# # the command number of this command
+\\$ # if the effective UID is 0, a #, otherwise a $
+\nnn # the character corresponding to the octal number nnn
+\\ # a backslash
+\[ # begin a sequence of non-printing characters, which could be used to embed a terminal control sequence into the prompt
+\] # end a sequence of non-printing characters
+
+# d date in "Weekday Month Date" format (e.g., "Tue May 26")
+# e an ASCII escape character (033)
+# h hostname up to the first .
+# H full hostname
+# j number of jobs currently run in background
+# l basename of the shells terminal device name
+# n newline
+# r carriage return
+# s name of the shell, the basename of $0 (the portion following the final slash)
+# t current time in 24-hour HH:MM:SS format
+# T current time in 12-hour HH:MM:SS format
+# @ current time in 12-hour am/pm format
+# A current time in 24-hour HH:MM format
+# u username of the current user
+# v version of bash (e.g., 4.00)
+# V release of bash, version + patch level (e.g., 4.00.0)
+# w Complete path of current working directory
+# W basename of the current working directory
+# ! history number of this command
+# # the command number of this command
+# $ if the effective UID is 0, a #, otherwise a $
+# nnn character corresponding to the octal number nnn
+# \ a backslash
+# [ begin a sequence of non-printing characters, which could be used to embed a terminal control sequence into the prompt
+# ] end a sequence of non-printing characters
```
-[My new favorite Bash prompt - BrettTerpstra.com](http://brettterpstra.com/2009/11/17/my-new-favorite-bash-prompt/)
+
+## see also
+
+- [[bash]]
+- [[bash select]]
+- [[bash debugging]]
+- [bneijt.nl/add-a-timestamp-to-your-bash-prompt/](https://bneijt.nl/blog/post/add-a-timestamp-to-your-bash-prompt/)
+- [My new favorite Bash prompt - BrettTerpstra.com](http://brettterpstra.com/2009/11/17/my-new-favorite-bash-prompt/)
diff --git a/notes/bash pushd.md b/notes/bash pushd.md
new file mode 100644
index 00000000..abb8ea58
--- /dev/null
+++ b/notes/bash pushd.md
@@ -0,0 +1,30 @@
+---
+tags: [shell/bash/builtin]
+title: bash pushd
+created: '2019-08-02T06:42:37.617Z'
+modified: '2023-04-12T11:52:47.224Z'
+---
+
+# bash pushd
+
+> add/remove directories to/from stack
+
+## usage
+
+```sh
+pushd /opt/path/logs # switch to path and put on the stack
+
+pushd +2 # bring the 3rd directory on the stack to the front (0-based) and rotating the stack
+
+
+pushd $(mktemp -d)
+
+popd
+```
+
+## see also
+
+- [[bash dirs]]
+- [[mktemp]]
+- [[z]]
+- [[bash fd]]
diff --git a/notes/bash pwd.md b/notes/bash pwd.md
new file mode 100644
index 00000000..24fffa1a
--- /dev/null
+++ b/notes/bash pwd.md
@@ -0,0 +1,28 @@
+---
+tags: [shell/bash/builtin]
+title: bash pwd
+created: '2019-08-02T06:42:37.618Z'
+modified: '2021-05-12T08:46:08.283Z'
+---
+
+# bash pwd
+
+> print the name of the current working directory
+
+## usage
+
+```sh
+pwd -L # print the value of $PWD if it names the current working directory
+
+pwd -P # print the physical directory, without any symbolic links
+
+
+SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" # script path
+
+CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # if `cd` works return current working dir
+```
+
+## see also
+
+- [[basename dirname]]
+- [reliable-way-for-a-bash-script-to-get-the-full-path](https://stackoverflow.com/questions/4774054/reliable-way-for-a-bash-script-to-get-the-full-path-to-itself/4774063)
diff --git a/notes/bash read.md b/notes/bash read.md
index 2803d01f..7a61a86c 100644
--- a/notes/bash read.md
+++ b/notes/bash read.md
@@ -1,40 +1,60 @@
---
-tags: [bash, bash/builtin]
+tags: [shell/bash/builtin]
title: bash read
created: '2019-07-30T06:19:49.017Z'
-modified: '2019-08-02T06:35:53.827Z'
+modified: '2022-03-11T08:37:58.622Z'
---
# bash read
+> Read a line from the stdin and split it into fields
+## environment variables
-## password input
```sh
-local PASSWORD
-read -s -p "Password:" PASSWORD
-
- # -s do not echo input coming from a terminal
- # -p prompt output the string PROMPT without a trailing newline before attempting to read
+REPLY #
```
-### READ variable
-```sh
-while read; do echo "$REPLY"; done
+## option
-echo "Hello, world!" | (read; echo "$REPLY")
+```sh
+-a # save to array
+-n # defines the required character count to stop reading
+-s # hides the user's input
+-r # causes the string to be interpreted "raw" (without considering backslash escapes)
+-s # do not echo input coming from a terminal
+-p # prompt output the string PROMPT without a trailing newline before attempting to read
```
-> the entire line of text is stored in the variable REPLY
+## usage
```sh
+echo 1 2 | { read a b; echo $a $b; }
+
+read a b < <(echo 1 2); echo $a $b; # save to multiple vairables
+
+read -a foo < <(echo 1 2); # save to array
+
+
+read input synonym for [[bash mapfile]] - read lines from a FILE into an array variable
+
+## option
+
+```sh
+-d DELIM # delimiter to terminate lines, instead of newline
+-n COUNT # Copy at most COUNT lines. If COUNT is 0, all lines are copied
+-O ORIGIN # Begin assigning to ARRAY at index ORIGIN. The default index is 0
+-s COUNT # Discard first COUNT lines read
+-t # remove trailing DELIM from each line read (default newline)
+-u FD # Read lines from file descriptor FD instead of the stdin
+-C CALLBACK # Evaluate CALLBACK each time QUANTUM lines are read
+-c quantum # Specify the number of lines read between each call to CALLBACK
+```
+
+## usage
+
+```sh
+readarray ARRAY < <(yq e '.coolActions[]' sample.yaml)
+ echo "${ARRAY[1]}"
+
+string='Paris, France, Europe';
+readarray -td, ARRAY <<<"$string";
+declare -p ARRAY;
+# declare -a ARRAY=([0]="Paris" [1]=" France" [2]=$' Europe\n')
+
+readarray -td: ARRAY <<<$STRING # split here-string into array STRING="8:30"
+```
+
+## see also
+
+- [[bash read]]
+- [[bash array]]
+- [[bash declare]]
+- [[bash redirects]]
+- [[yq]]
+- [[jq]]
diff --git a/notes/bash readonly.md b/notes/bash readonly.md
new file mode 100644
index 00000000..baad4365
--- /dev/null
+++ b/notes/bash readonly.md
@@ -0,0 +1,31 @@
+---
+tags: [shell/bash/builtin]
+title: bash readonly
+created: '2019-08-02T06:42:37.624Z'
+modified: '2022-02-10T09:07:55.251Z'
+---
+
+# bash readonly
+
+> mark shell variables as unchangeable
+
+## usage
+
+```sh
+-a # refer to indexed array variables
+-A # refer to associative array variables
+-f # refer to shell functions
+-p # display a list of all readonly variables or functions, depending on whether or not the -f option is given
+
+-- # disables further option processing
+```
+
+```sh
+readonly
+```
+
+## see also
+
+- [[bash export]]
+- [[bash set]]
+- [[bash unset]]
diff --git a/notes/bash redirects.md b/notes/bash redirects.md
new file mode 100644
index 00000000..e57ef118
--- /dev/null
+++ b/notes/bash redirects.md
@@ -0,0 +1,99 @@
+---
+tags: [shell/bash]
+title: bash redirects
+created: '2019-07-30T06:19:49.011Z'
+modified: '2023-04-21T12:07:35.076Z'
+---
+
+# bash redirects
+
+## usage
+
+```sh
+# "pipe"
+COMMAND1 | COMMAND2 # takes stdout of COMMAND1 as stdin to COMMAND2
+
+# "redirect"
+1> FILE # directs stdout to FILE
+> FILE # directs stdout to FILE
+
+CMD > FILE
+CMD 1> FILE
+
+< FILE # takes stdin from FILE
+
+>> FILE # directs stdout to FILE; append to FILE if it already exists
+>|FILE # forces stdout to FILE even if noclobber is set
+n>|FILE # forces output to FILE from FILE descriptor n even if noclobber is set
+<> FILE # uses FILE as both stdin and stdout
+n<>FILE # uses FILE as both input and output for file descriptor n
+```
+
+## here-doc
+
+```sh
+[n]<<[-]word # here-document
+ here-document
+delimiter
+
+echo < FILE
+Hello World
+EOF
+```
+
+## here-string
+
+```sh
+[n]<<< word # here-string
+```
+
+```sh
+<() # process substitution
+< <() # process substitution
+
+n>FILE # directs FILE descriptor n to FILE
+n>FILE # directs FILE description n to FILE; append to file if it already exists
+
+&[FILEDESCRIPTOR] # reference to value of filedescriptor
+
+n>& # duplicates stdout to file descriptor n
+n<& # duplicates stdin from file descriptor n
+n>&m # file descriptor n is made to be a copy of the output file descriptor
+n<&m # file descriptor n is made to be a copy of the input file descriptor
+&>FILE # directs stdout and standard error to FILE
+
+<&- # closes the stdin
+>&- # closes the stdout
+n>&- # closes the ouput from FILE descriptor n
+n<&- # closes the input from FILE descripor n
+
+
+&>/dev/null # shorthand for `1> /dev/null 2> /dev/null`
+
+command 1>&- 2>&- # http://www.cyberciti.biz/faq/how-to-redirect-output-and-errors-to-devnull/#comment-40252
+job 1>&- 2>&- & # additional & at end of job to put it in backgrounds
+command 1>&- 2>&- & # additional & at end of command to put it in backgrounds
+```
+
+## dash
+
+> redirection from stdin to stdout or stdout to stdin
+
+```sh
+cat - # redirects from stdin to stdout
+echo "whatever" | cat - # redirects from stdin to stdout
+grep "foo" FILE | diff FILE2 -
+```
+
+## see also
+
+- [[tee]]
+- [[tar]]
+- [[heredoc]]
+- [[bash read]]
+- [[bash readarray]]
+- [[bash history]]
+- [[bash exec]]
+- [[bash process substitution]]
+- [tldp.org/special-chars.html](http://tldp.org/LDP/abs/html/special-chars.html#DASHREF2)
diff --git a/notes/bash return.md b/notes/bash return.md
new file mode 100644
index 00000000..39032782
--- /dev/null
+++ b/notes/bash return.md
@@ -0,0 +1,23 @@
+---
+tags: [shell/bash/builtin]
+title: bash return
+created: '2019-08-02T06:42:37.626Z'
+modified: '2021-05-12T08:46:08.376Z'
+---
+
+# bash return
+
+> return from a shell function
+> Causes a function or sourced script to exit with the return value specified by N.
+> If N is omitted, the return status is that of the last command executed within the function or script.
+
+## usage
+```sh
+foo() {
+ return 1;
+}
+```
+
+## see also
+- [[bash exit]]
+- [[bash function]]
diff --git a/notes/bash select.md b/notes/bash select.md
index 5fae7d82..12f9e73c 100644
--- a/notes/bash select.md
+++ b/notes/bash select.md
@@ -1,15 +1,23 @@
---
-tags: [bash]
+tags: [shell/bash/keyword]
title: bash select
created: '2019-07-30T06:19:49.018Z'
-modified: '2019-07-30T06:22:29.800Z'
+modified: '2021-05-12T08:46:30.763Z'
---
# bash select
+> select words from a list and execute commands
+
+## usage
```sh
+# tip set: $PS3
select name [in list]; do
statements that can use $name
done
```
-> tip: set `$PS3` [bash prompt](:note:594e41b14e562b5dcc8c)
+
+## see also
+- [[bash prompt]]
+- [[bash read]]
+
diff --git a/notes/bash set.md b/notes/bash set.md
index 6f5c2bbf..e5431c58 100644
--- a/notes/bash set.md
+++ b/notes/bash set.md
@@ -1,66 +1,70 @@
---
-tags: [bash, bash/builtin]
+tags: [shell/bash/builtin]
title: bash set
created: '2019-07-30T06:19:49.019Z'
-modified: '2019-08-01T07:17:16.828Z'
+modified: '2023-03-22T10:07:28.455Z'
---
# bash set
-> modify shell behavior
-> Set or unset values of shell options and positional parameters.
+> set/unset values and attributes of shell variables and functions.
+> modify shell behavior - [[bash set]] or [[bash unset]] values of shell options and positional parameters
-```sh
-set 1 2 3 | echo $@ # set positional params
-```
-
-## shell behavior
-
-```sh
-set -o # print all options
-
-$- # prints The current set of options in your current shell.
-```
-[What does $- mean in Bash? - Stack Overflow](https://stackoverflow.com/a/42757277/2087704)
+## option
-#### set / unset
```sh
-# set # unset
-set -o OPTION set +o OPTION
-set -x set +x
-```
+# set # unset
+set -o OPTION set +o OPTION
+set -x set +x
-### options
-```sh
-# set -o OPTION shorthand
-set -o allexport set -a
-set -o braceexpand set -B
+set -o allexport set -a # each variable or function that is created/modified is given export-attribute and marked for export
+set -o braceexpand set -B
set -o emacs
-set -o errexit set -e
-set -o errtrace set -E # exit on error
-set -o functrace set -T
-set -o hashall set -h
-set -o histexpand set -H
+set -o errexit set -e
+set -o errtrace set -E # exit on error
+set -o functrace set -T
+set -o hashall set -h
+set -o histexpand set -H
set -o history # e.g. using `fc` when not sourcing script
set -o ignoreeof
-set -o keyword set -k
-set -o monitor set -m # jobcontrol => fg/bg
-set -o noclobber set -C
-set -o noexec set -n
-set -o noglob set -f
+set -o keyword set -k
+set -o monitor set -m # enable jobcontrol => fg/bg
+set -o noclobber set -C
+set -o noexec set -n
+set -o noglob set -f # disable filename-expansion "globbing"
set -o nolog
-set -o notify set -b
-set -o nounset set -u
-set -o onecmd set -t
-set -o physical set -P
+set -o notify set -b
+set -o nounset set -u # exit when use undeclared variables
+set -o onecmd set -t
+set -o physical set -P
set -o pipefail
set -o posix
-set -o privileged set -p
-set -o verbose set -v
+set -o privileged set -p
+set -o verbose set -v
set -o vi
-set -o xtrace set -x
+set -o xtrace set -x
+```
+
+## usage
+
+```sh
+set 1 2 3 | echo $@ # set positional params
+
+set | grep 'RANDOM=' # find non exported variable
+
+# shell behavior
+echo $- # prints The current set of options in your current shell
+set -o # print all options
```
-[bash - Set and Shopt - Why Two? - Unix & Linux Stack Exchange](https://unix.stackexchange.com/a/425642/193945)
+## see also
-[Bash Reference Manual: Modifying Shell Behavior](https://www.gnu.org/software/bash/manual/html_node/Modifying-Shell-Behavior.html)
+- [[env]]
+- [[bash]]
+- [[bash export]]
+- [[bash declare]]
+- [[bash unset]]
+- [[bash parameter expansion]]
+- [Set and Shopt - Unix & Linux Stack Exchange](https://unix.stackexchange.com/a/425642/193945)
+- [Bash Reference Manual: Modifying Shell Behavior](https://www.gnu.org/software/bash/manual/html_node/Modifying-Shell-Behavior.html)
+- [What does $- mean in Bash? - Stack Overflow](https://stackoverflow.com/a/42757277/2087704)
diff --git a/notes/bash shift.md b/notes/bash shift.md
new file mode 100644
index 00000000..4001aa22
--- /dev/null
+++ b/notes/bash shift.md
@@ -0,0 +1,25 @@
+---
+tags: [shell/bash/builtin]
+title: bash shift
+created: '2019-08-02T06:42:37.629Z'
+modified: '2021-05-12T08:46:08.424Z'
+---
+
+# bash shift
+
+> shift positional parameters
+
+## usage
+```sh
+for i in "$@"; do
+ case $i in
+ -e=*|--environment=*)
+ echo "case i: ${i#*=}"
+ CMD+=('-e '${i#*=})
+ shift;
+ esac
+done
+```
+
+## see also
+- [[bash arguments]]
diff --git a/notes/bash shopt.md b/notes/bash shopt.md
index ee5020c2..8a6bfff6 100644
--- a/notes/bash shopt.md
+++ b/notes/bash shopt.md
@@ -1,22 +1,44 @@
---
-tags: [bash, bash/builtin]
+tags: [shell/bash/builtin]
title: bash shopt
created: '2019-07-30T06:19:49.237Z'
-modified: '2019-08-02T06:51:22.430Z'
+modified: '2022-02-10T09:18:43.410Z'
---
# bash shopt
-> Historically, the set command was used to turn options on and off. As the number of options grew, set became more difficult to use because options are represented by single letter codes. As a result, Bash provides the `shopt` command to turn options on and off by name instead of a letter.
+> set and unset shell options
-### set-and-unset-shell-options:
-```
- -s set, enable
- -u unset, disable
- -q quite mode
- -p print
+ Change the setting of each shell option OPTNAME. Without any option
+ arguments, list each supplied OPTNAME, or all shell options if no
+ OPTNAMEs are given, with an indication of whether or not each is set.
+
+
+Historically, the `set` was used to turn options on and off. As the number of options grew, `set` became more difficult to use because options are represented by single letter codes.
+As a result, bash provides the `shopt` command to turn options on and off by name instead of a letter.
+
+## usage
+
+```sh
+-o # restrict OPTNAMEs to those defined for use with `set -o'
+-p # print each shell option with an indication of its status
+-q # suppress output
+-s # enable (set) each OPTNAME
+-u # disable (unset) each OPTNAME
```
```sh
-shopt -p # print all options
+shopt -p # print all options
+shopt -p cdspell # same as `unset -u`
+shopt -p promptvars # same as `set -s`
+
+shopt -s histappend # closing session will appended to HISTFILE rather than overwriting it
```
+
+## see also
+
+- [[bash]]
+- [[bash set]]
+- [[bash unset]]
+- [[bash history]]
+- [[env]]
diff --git a/notes/bash snippets.md b/notes/bash snippets.md
deleted file mode 100644
index 5b3ee23b..00000000
--- a/notes/bash snippets.md
+++ /dev/null
@@ -1,51 +0,0 @@
----
-tags: [bash, bash/builtin, printf]
-title: bash snippets
-created: '2019-07-30T06:19:48.991Z'
-modified: '2019-08-02T06:35:53.830Z'
----
-
-# bash snippets
-
-
-```sh
-env x='() { :;}; echo vulnerable' bash -c "echo this is a test" # shell-shock
-
-[ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "click" # russian roulette
-
-
-
-# generate random 32 character alphanumeric string (lowercase only)
-cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
-
-```
-
-### bash colors
-```sh
-color=1;
-
-while [ "$color" -lt "245" ]; do
- echo -ne "$color: \\033[38;5;${color}mhello\\033[48;5;${color}mworld\\033[0m "
- [ $(( color % 12 )) -eq "0" ] && { echo ""; }
- ((color++));
-done
-```
-
-## top 30 history entries
-```sh
-history | awk '{print $2}' | sort | uniq -c | sort -rn | head -30 | \
- awk '!max{max=$1;}{r=""; i=s=100*$1/max; while(i-->0)r=r"#"; printf "%50s %5d %s %s",$2,$1,r,"\n";}'
-```
-
-## measure-disk-space-of-certain-file-types-in-aggregate
-```sh
-for i in $(find . -type f | perl -ne 'print $1 if m/\.([^.\/]+)$/' | sort -u); do \
- echo "$i"": ""$(du -hac **/*."$i" \
- | tail -n1 \
- | awk '{print $1;}')";
- done \
- | sort -h -k 2 -r
-
-
-sudo lsof -i :80 | grep LISTEN # lsof command find out what is using port 80
-```
diff --git a/notes/bash source vs call.md b/notes/bash source vs call.md
deleted file mode 100644
index ca94853c..00000000
--- a/notes/bash source vs call.md
+++ /dev/null
@@ -1,55 +0,0 @@
----
-tags: [bash]
-title: bash source vs call
-created: '2019-07-30T06:19:49.020Z'
-modified: '2019-07-30T06:22:29.802Z'
----
-
-# bash source vs call
-
-```bash
-[[ "${BASH_SOURCE[0]}" == "${0}" ]] && { echo "script ${BASH_SOURCE[0]} must be sourced."; exit 1; }
-```
-https://askubuntu.com/questions/53177/bash-script-to-set-environment-variables-not-working
-
-```sh
-
-
-# if [[ ${script_name} = ${this_script} ]] ; then
-# echo "running me directly"
-# else
-# echo "sourced from ${script_name}"
-# fi
-
-
-#
-# ${0#-}: '#-' needed if sourced no path
-if [ "$( basename ${0#-} )" == "$( basename ${BASH_SOURCE} )" ]; then
- docker-connect $@
-fi
-
-# if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then
-# echo "sourcing script ${BASH_SOURCE[0]}"
-# fi
-#
-# if [[ "$(basename ${BASH_SOURCE[0]})" == "${0}" ]]; then
-# echo "calling function:" docker-connect "$@"
-# fi
-
-
-
-# [ "$_" != "$0" ] && echo "Script is being sourced" || echo "Script is a subshell"
-#
-# docker-connect $@
-
-
-# bash ./docker-connect.sh
-# ./docker-connect.sh
-
-
-
-# docker-connect
-# ./docker-connect
-# bash ./docker-connect
-
-```
diff --git a/notes/bash source.md b/notes/bash source.md
new file mode 100644
index 00000000..6fbc0188
--- /dev/null
+++ b/notes/bash source.md
@@ -0,0 +1,32 @@
+---
+tags: [shell/bash/builtin]
+title: bash source
+created: '2019-08-02T06:42:37.632Z'
+modified: '2021-05-12T08:46:08.468Z'
+---
+
+# bash source
+
+> execute commands from a file in the current shell
+
+## usage
+```sh
+source foo.sh
+
+. foo.sh
+
+
+# determine if script is sourced or executed
+# ${0#-}: '#-' needed if sourced no path
+if [ "$( basename ${0#-} )" == "$( basename ${BASH_SOURCE} )" ]; then COMMAND $@; fi
+
+if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then echo "sourcing script ${BASH_SOURCE[0]}"; fi
+
+if [[ "$(basename ${BASH_SOURCE[0]})" == "${0}" ]]; then echo "calling function:" docker-connect "$@"; fi
+
+[ "$_" != "$0" ] && echo "Script is being sourced" || echo "Script is a subshell"
+```
+
+## see also
+- [[bash]]
+- [[bash parameter expansion]]
diff --git a/notes/bash suspend.md b/notes/bash suspend.md
new file mode 100644
index 00000000..edb32eeb
--- /dev/null
+++ b/notes/bash suspend.md
@@ -0,0 +1,21 @@
+---
+tags: [shell/bash/builtin]
+title: bash suspend
+created: '2019-08-02T06:42:37.633Z'
+modified: '2022-02-10T10:13:52.778Z'
+---
+
+# bash suspend
+
+> suspend the execution of this shell until it receives a SIGCONT signal
+
+## usage
+
+```sh
+suspend
+```
+
+## see also
+
+- [[bash logout]]
+- [[bash exit]]
diff --git a/notes/bash test [.md b/notes/bash test [.md
deleted file mode 100644
index 26b435dc..00000000
--- a/notes/bash test [.md
+++ /dev/null
@@ -1,54 +0,0 @@
----
-tags: [bash]
-title: 'bash test ['
-created: '2019-07-30T06:19:49.021Z'
-modified: '2019-07-30T06:22:29.802Z'
----
-
-# bash test [
-
-[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)
-
-### operator
-```sh
--a # and operator inside a test conditional expression
--o # or operator inside a test conditional expression
-```
-
-### string
-```sh
-str1=str2 # str1 matches str2
-str1!=str2 # str1 does not match str2
-str1str2 # str1 is greater than str2
--n str1 # str1 is non-zero length (has length greater than 0)
--z str1 # str1 is zero-length (has length 0)
-```
-
-### file
-```sh
--a file # file exists
--d file # file exists and is a directory
--e file # file exists; same -a
--f file # file exists and is a regular file (i.e., not a directory or other special type of file)
--r file # you have read permission
--r file # file exists and is not empty
--w file # your have write permission
--x file # you have execute permission on file, or directory search permission if it is a directory
--N file # file was modified since it was last read
--O file # you own file
--G file # file's group ID matches yours (or one of yours, if you are in multiple groups)
-file1 -nt file2 # file1 is newer than file2
-file1 -ot file2 # file1 is older than file2
-```
-
-### int
-```sh
-# arg1 and arg2 may be positive or negative integers
-arg1 -lt arg2 # less than
-arg1 -le arg2 # less than or equal
-arg1 -eq arg2 # equal
-arg1 -ge arg2 # greater than or equal
-arg1 -gt arg2 # greater than
-arg1 -ne arg2 # not equal
-```
diff --git a/notes/bash test.md b/notes/bash test.md
new file mode 100644
index 00000000..04830a46
--- /dev/null
+++ b/notes/bash test.md
@@ -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)
diff --git a/notes/bash time.md b/notes/bash time.md
new file mode 100644
index 00000000..f1cb42a2
--- /dev/null
+++ b/notes/bash time.md
@@ -0,0 +1,30 @@
+---
+tags: [shell/bash/keyword]
+title: bash time
+created: '2019-08-02T08:39:11.840Z'
+modified: '2022-06-16T10:55:57.225Z'
+---
+
+# bash time
+
+> report time consumed by pipeline's execution
+
+## option
+
+```sh
+-p # print the timing summary in the portable Posix format
+```
+
+## usage
+
+```sh
+time cat # quick stop watch
+
+# time goes over whole line pipes and redirects !
+time grep '^#' ~/.bashrc | { i=0; while read -r; do printf '%4d %s\n' "$((++i))" "$REPLY"; done; } > bashrc_numbered 2>/dev/null
+```
+
+## see also
+
+- [[time]]
+- [[timeout]]
diff --git a/notes/bash times.md b/notes/bash times.md
new file mode 100644
index 00000000..a3ba4856
--- /dev/null
+++ b/notes/bash times.md
@@ -0,0 +1,18 @@
+---
+tags: [shell/bash/builtin]
+title: bash times
+created: '2019-08-02T06:42:37.637Z'
+modified: '2021-05-12T08:46:08.535Z'
+---
+
+# bash times
+
+> prints the accumulated user and system times for the shell and all of its child processes
+
+## usage
+```sh
+times
+```
+
+## see also
+- [[bash time]]
diff --git a/notes/bash trap and debugger.md b/notes/bash trap and debugger.md
deleted file mode 100644
index 389ed70e..00000000
--- a/notes/bash trap and debugger.md
+++ /dev/null
@@ -1,111 +0,0 @@
----
-tags: [bash]
-title: bash trap and debugger
-created: '2019-07-30T06:19:49.021Z'
-modified: '2019-07-30T06:22:29.802Z'
----
-
-# bash trap and debugger
-
-```sh
-bash -n scriptname # don't run commands; check for syntax errors only
-set -o noexec # alternative (set option in script)
-
-bash -v scriptname # echo commands before running them
-set -o verbose # alternative (set option in script)
-
-bash -x scriptname # echo commands after command-line processing
-set -o xtrace # alternative (set option in script)
-```
-
-## breakpoint
-```sh
-read var # simple breakpoint
-echo -e "dbg> \c"; read cmd; eval $cmd
-
-$ dbg> doSomethingFunction
-$ dbg> someVariable
-```
-
-## trap
-```sh
-trap 'echo "VARIABLE-TRACE> \$DOCKER_HOST= \"$DOCKER_HOST\""' DEBUG
-```
-```sh
-trap cmd sig1 sig2 # executes a command when a signal is received by the script
-trap "" sig1 sig2 # ignores that signals
-trap - sig1 sig2 # resets the action taken when the signal is received to the default
-```
-
-```sh
-# golang like defer
-# https://twitter.com/TheNikhita/status/1061973769470795776
-scratch=$(mktemp -d -t tmp.XXXXXXXX)
-function finish {
- rm -rf "$scratch"
-}
-trap finish EXIT
-```
-
-
-```sh
-trap 'echo $varname' EXIT # useful when you want to print out the values of variables at the point that your script exits
-
-function errtrapย {
- es=$?
- echo "ERROR line $1: Command exited with status $es."
-}
-
-trap 'errtrap $LINENO' ERR # is run whenever a command in the surrounding script or function exists with non-zero status
-
-function dbgtrap {
- echo "badvar is $badvar"
-}
-
-trap dbgtrap DEBUG # causes the trap code to be executed before every statement in a function or script
-# ...section of code in which the problem occurs...
-trap - DEBUG # turn off the DEBUG trap
-
-function returntrap {
- echo "A return occured"
-}
-
-trap returntrap RETURN # is executed each time a shell function or a script executed with the . or source commands finishes executing
-```
-
-```sh
-#!/bin/bash
-
-echo "LINENO: $LINENO"
-
-trap 'echo "VARIABLE-TRACE> \$variable = \"$variable\""' DEBUG # Echoes the value of $variable after every command.
-
-variable=29; line=$LINENO
-
-echo " Just initialized \$variable to $variable in line number $line."
-
-let "variable *= 3"; line=$LINENO
-
-echo " Just multiplied \$variable by 3 in line number $line."
-
-exit 0
-
-# The "trap 'command1 . . . command2 . . .' DEBUG" construct is
-#+ more appropriate in the context of a complex script,
-#+ where inserting multiple "echo $variable" statements might be
-#+ awkward and time-consuming.
-
-# Thanks, Stephane Chazelas for the pointer.
-
-
-# Output of script:
-#
-# VARIABLE-TRACE> $variable = ""
-# VARIABLE-TRACE> $variable = "29"
-# Just initialized $variable to 29.
-# VARIABLE-TRACE> $variable = "29"
-# VARIABLE-TRACE> $variable = "87"
-# Just multiplied $variable by 3.
-# VARIABLE-TRACE> $variable = "87"
-```
-[Debugging](http://tldp.org/LDP/abs/html/debugging.html)
diff --git a/notes/bash trap.md b/notes/bash trap.md
new file mode 100644
index 00000000..742b299b
--- /dev/null
+++ b/notes/bash trap.md
@@ -0,0 +1,81 @@
+---
+tags: [shell/bash/builtin]
+title: bash trap
+created: '2019-08-02T06:42:37.638Z'
+modified: '2022-02-10T10:09:42.974Z'
+---
+
+# bash trap
+
+> Defines and activates handlers to be run when the shell receives signals or other conditions
+
+## usage
+
+```sh
+trap -l # print a list of signal names and their corresponding numbers
+
+trap -p CMD # display the trap commands associated with each SIGNAL_SPEC
+
+trap 'echo "VARIABLE-TRACE> \$DOCKER_HOST= \"$DOCKER_HOST\""' DEBUG # debugging
+
+trap CMD sig1 sig2 # executes a command when a signal is received by the script
+
+trap "" sig1 sig2 # ignores that signals
+
+trap - sig1 sig2 # resets the action taken when the signal is received to the default
+```
+
+## signals
+
+```sh
+name value effect shortcut
+-- -- -- --
+SIGHUP 1 Hangup
+SIGINT 2 Interrupt from keyboard ctrl + c
+SIGKILL 9 Kill-Signal cannot be caught, blocked or ignored !
+SIGTERM 15 Terminate-Signal
+SIGSTOP 17, 19, 23 Stop proc ctl + z cannot be caught, blocked or ignored !
+```
+
+## go defer
+
+```sh
+# golang like defer
+# https://twitter.com/TheNikhita/status/1061973769470795776
+scratch=$(mktemp -d -t tmp.XXXXXXXX)
+function finish {
+ rm -rf "$scratch"
+}
+trap finish EXIT
+```
+
+```sh
+trap 'echo $varname' EXIT # useful when you want to print out the values of variables at the point that your script exits
+
+function errtrapย {
+ es=$?
+ echo "ERROR line $1: Command exited with status $es."
+}
+
+trap 'errtrap $LINENO' ERR # is run whenever a command in the surrounding script or function exists with non-zero status
+
+function dbgtrap {
+ echo "badvar is $badvar"
+}
+
+trap dbgtrap DEBUG # causes the trap code to be executed before every statement in a function or script
+# ...section of code in which the problem occurs...
+trap - DEBUG # turn off the DEBUG trap
+
+function returntrap {
+ echo "A return occured"
+}
+
+trap returntrap RETURN # is executed each time a shell function or a script executed with the . or source commands finishes executing
+```
+
+## see also
+
+- [[signal]]
+- [[bash debugging]]
+- [[mktemp]]
diff --git "a/notes/bash true false \352\236\211.md" "b/notes/bash true false \352\236\211.md"
new file mode 100644
index 00000000..de8e87b2
--- /dev/null
+++ "b/notes/bash true false \352\236\211.md"
@@ -0,0 +1,15 @@
+---
+tags: [shell/bash/builtin]
+title: 'bash true false :'
+created: '2019-08-02T06:42:37.640Z'
+modified: '2021-05-12T08:46:08.563Z'
+---
+
+# bash true false :
+
+> Return a successful result.
+
+## usage
+
+## see also
+- [[bash while]]
diff --git a/notes/bash type.md b/notes/bash type.md
index a89f676f..d7822beb 100644
--- a/notes/bash type.md
+++ b/notes/bash type.md
@@ -1,20 +1,33 @@
---
-tags: [bash]
+tags: [shell/bash]
title: bash type
created: '2019-07-30T06:19:49.022Z'
-modified: '2019-07-30T06:22:29.803Z'
+modified: '2021-05-12T08:46:51.330Z'
---
# bash type
> A `builtin` is a command provided by the shell, rather than by an external program
-[bash - What is the difference between a builtin command and one that is not? - Unix & Linux Stack Exchange](http://unix.stackexchange.com/a/11456)
+## usage
```sh
type ls # find out if command is avail and if builtin
-command -V ls # same as above
+type -t type # single word which is one of `alias`, `keyword`, `function`, `builtin`, `file` or ``
+ # if NAME is an alias, shell reserved word, shell function, shell builtin, disk file, or not found, respectivel
+command -V ls # same as above
type -F # list functions
+
+type -a time # all locations containing an executable named
+# time is a shell keyword
+# time is /usr/bin/time
```
+
+## see also
+- [[bash compgen]]
+- [[bash command]]
+- [[which]]
+- [What is the difference between a builtin command and one that is not?](http://unix.stackexchange.com/a/11456)
+- [https://askubuntu.com/a/1054460/219213](https://askubuntu.com/a/1054460/219213)
diff --git a/notes/bash typeset.md b/notes/bash typeset.md
new file mode 100644
index 00000000..679e7492
--- /dev/null
+++ b/notes/bash typeset.md
@@ -0,0 +1,22 @@
+---
+tags: [shell/bash/builtin]
+title: bash typeset
+created: '2019-08-02T06:42:37.644Z'
+modified: '2022-02-10T09:11:56.553Z'
+---
+
+# bash typeset
+
+> set variable values and attributes
+
+## usage
+
+a synonym for [[bash declare]]
+
+```sh
+help declare
+```
+
+## see also
+
+- [[bash declare]]
diff --git a/notes/bash ulimit.md b/notes/bash ulimit.md
new file mode 100644
index 00000000..234ff9e1
--- /dev/null
+++ b/notes/bash ulimit.md
@@ -0,0 +1,64 @@
+---
+tags: [container, shell/bash/builtin]
+title: bash ulimit
+created: '2019-08-02T06:42:37.646Z'
+modified: '2023-03-22T10:03:05.385Z'
+---
+
+# bash ulimit
+
+> provides control over the resources available to the shell and processes it creates, on systems that allow such control
+
+## option
+
+```sh
+-S # use the `soft` resource limit
+-H # use the `hard` resource limit
+
+-a # all current limits are reported
+-b # socket buffer size
+-c # maximum size of core files created
+-d # maximum size of a process's data segment
+-e # maximum scheduling priority (`nice')
+-f # maximum size of files written by the shell and its children
+-i # maximum number of pending signals
+-l # maximum size a process may lock into memory
+-m # maximum resident set size
+-n # maximum number of open file descriptors
+-p # pipe buffer size
+-q # maximum number of bytes in POSIX message queues
+-r # maximum real-time scheduling priority
+-s # maximum stack size
+-t # maximum amount of cpu time in seconds
+-u # maximum number of user processes
+-v # size of virtual memory
+-x # maximum number of file locks
+```
+
+## usage
+
+```sh
+ulimit -a # show all ulimits
+
+ulimit -nH # check hard limit for filedescriptors
+ulimit -nS # check soft limit for filedescriptors
+
+ulimit -u # max num of processes user can start
+ulimit -uH # hard limit of processes user can start
+ulimit -uS # soft limit of processes user can start
+
+ulimit -c # filesize for core-dumps; default=0
+
+ulimit -l # max locked memory (kbytes)
+ # memlock see docker-compose
+ # memlock: locks sets of pages in memory => jvm-gc goes thorugh all pages of Heap !
+ # mlockall: lock all pages
+```
+
+## see alos
+
+- [[sysctl]]
+- [[systemctl]]
+- [[nproc]]
+- [[docker-compose]]
+- [[elasticsearch]]
diff --git a/notes/bash umask.md b/notes/bash umask.md
new file mode 100644
index 00000000..52c88392
--- /dev/null
+++ b/notes/bash umask.md
@@ -0,0 +1,55 @@
+---
+tags: [linux, shell/bash/builtin]
+title: bash umask
+created: '2019-07-30T06:19:49.162Z'
+modified: '2021-06-07T07:04:00.000Z'
+---
+
+# bash umask
+
+> is a builtin, that controls file creation mode mask and determins initial file-permission values
+> doesnt enforce rights it forbids them !
+> filter strips away permissions
+
+## usage
+
+```sh
+OCTAL BIN NEG-BIN rwx
+0 000 111 rwx
+1 001 110 rw-
+2 010 101 r-x
+3 011 100 r--
+4 100 011 -wx
+5 101 010 -w-
+6 110 001 --x
+7 111 000 ---
+```
+
+```sh
+4000 = SUID = Set UserID => -r-xr-sr-x
+2000 = SGUID = Set GroupID => -r-xr-lr-x
+1000 = sticky Bit
+0000 = no special modes
+```
+
+```sh
+0 002
+
+ 000 000 010
+ rwx rwx r-x
+
+
+0 022
+
+ 000 010 010
+ rwx r-x r-x
+
+
+0 027
+
+ 000 010 111
+ rwx r-x ---
+```
+
+## see also
+- [[chmod]]
diff --git a/notes/bash unalias.md b/notes/bash unalias.md
new file mode 100644
index 00000000..6293492a
--- /dev/null
+++ b/notes/bash unalias.md
@@ -0,0 +1,26 @@
+---
+tags: [shell/bash/builtin]
+title: bash unalias
+created: '2019-08-02T06:42:37.649Z'
+modified: '2021-05-12T08:46:08.654Z'
+---
+
+# bash unalias
+
+> Remove each NAME from the list of defined aliases.
+
+## usage
+
+```sh
+# options
+# -a
+unalias -a # remove all alias definitions
+
+# alternatively prepend `\` to command to not use alias
+\CMD
+```
+
+
+## see also
+- [[bash alias]]
+- [[bash time]]
diff --git a/notes/bash unset.md b/notes/bash unset.md
new file mode 100644
index 00000000..ea995f3c
--- /dev/null
+++ b/notes/bash unset.md
@@ -0,0 +1,31 @@
+---
+tags: [shell/bash]
+title: bash unset
+created: '2022-02-10T09:01:46.925Z'
+modified: '2023-03-22T10:26:37.755Z'
+---
+
+# bash unset
+
+> unset values and attributes of shell variables and functions
+
+## usage
+
+```sh
+-f # treat each NAME as a shell function
+-v # treat each NAME as a shell variable
+-n # treat each NAME as a name reference and unset the variable itself rather than the variable it references
+```
+
+```sh
+unset # Without options, unset first tries to unset a variable, and if that fails,tries to unset a function
+ # Some variables cannot be unset; also see `readonly'
+
+unset -v ${!DOCKER_*} # unset all variables starting with DOCKER_
+```
+
+## see also
+
+- [[env]]
+- [[bash set]]
+- [[bash readonly]]
diff --git a/notes/bash until.md b/notes/bash until.md
index 42dca0df..40a5c184 100644
--- a/notes/bash until.md
+++ b/notes/bash until.md
@@ -1,26 +1,42 @@
---
-tags: [bash]
+tags: [shell/bash/keyword]
title: bash until
created: '2019-07-30T06:19:49.023Z'
-modified: '2019-07-30T06:22:29.804Z'
+modified: '2022-06-02T12:13:45.739Z'
---
# bash until
+> execute commands as long as a test does not succeed
+
+## usage
+
```sh
until condition; do
statements
done
-```
-### wait for database to come up
-
-```sh
+# wait for database to come up
until nc -z -v -w30 "$DB_HOST" "$DB_PORT"; do
echo "Waiting for database connection..."
- sleep 2
+ sleep 2;
+done
+
+# wait for hostname to be resolvable
+until ping -c1 ${HOSTNAME_FQDN} >/dev/null 2>&1; do
+ echo "waiting for ${HOSTNAME_FQDN} to resolve ..";
+ sleep 1;
+done
+
+# wait for all containres to shut down
+until [ $(docker info --format '{{.ContainersRunning}}') -eq 0 ]; do
+ sleep 1;
done
```
-### see also
-- [nc](:note:56c4ea6dc4bb6d30d593)
+## see also
+
+- [[bash break]]
+- [[bash test []]]
+- [[nc]]
+- [[sleep]]
diff --git a/notes/bash variables.md b/notes/bash variables.md
index 85f7b564..3065c54e 100644
--- a/notes/bash variables.md
+++ b/notes/bash variables.md
@@ -1,46 +1,55 @@
---
-tags: [bash]
+tags: [shell/bash]
title: bash variables
created: '2019-07-30T06:19:49.023Z'
-modified: '2019-08-01T07:14:53.484Z'
+modified: '2022-06-02T12:13:10.661Z'
---
# bash variables
+## usage
+
```sh
varname=value # defines a variable
varname=value command # defines a variable to be in the environment of a particular subprocess
+
echo $varname # checks a variable's value
echo $$ # prints process ID of the current shell
echo $! # prints process ID of the most recently invoked background job
echo $? # displays the exit status of the last command
+
export VARNAME=value # defines an environment variable (will be available in subprocesses)
-```
-```sh
${varname:-word} # if varname exists and isn't null, return its value; otherwise return word
${varname:=word} # if varname exists and isn't null, return its value; otherwise set it word and then return its value
-${varname:?message} # if varname exists and isn't null, return its value; otherwise print varname, followed by message and abort the current command or script
+${varname:?'message'} # if varname exists and isn't null, return its value; otherwise print varname, followed by message and abort the current command or script
${varname:+word} # if varname exists and isn't null, return word; otherwise return null
${varname:offset:length} # performs substring expansion. It returns the substring of $varname starting at offset and up to length characters
-```
-```sh
+
+
${variable#pattern} # if the pattern matches the beginning of the variable's value, delete the shortest part that matches and return the rest
${variable##pattern} # if the pattern matches the beginning of the variable's value, delete the longest part that matches and return the rest
${variable%pattern} # if the pattern matches the end of the variable's value, delete the shortest part that matches and return the rest
${variable%%pattern} # if the pattern matches the end of the variable's value, delete the longest part that matches and return the rest
-```
-```sh
+
+
${variable/pattern/string} # the longest match to pattern in variable is replaced by string. Only the first match is replaced
${variable//pattern/string} # the longest match to pattern in variable is replaced by string. All matches are replaced
${#varname} # returns the length of the value of the variable as a character string
-```
-```sh
+
+
*(patternlist) # matches zero or more occurences of the given patterns
+(patternlist) # matches one or more occurences of the given patterns
?(patternlist) # matches zero or one occurence of the given patterns
@(patternlist) # matches exactly one of the given patterns
!(patternlist) # matches anything except one of the given patterns
```
+
+## see also
+
+- [[bash export]]
+- [[bash echo]]
+- [[bash parameter expansion ]]
+- [[env]]
diff --git a/notes/bash wait.md b/notes/bash wait.md
new file mode 100644
index 00000000..66f00e82
--- /dev/null
+++ b/notes/bash wait.md
@@ -0,0 +1,23 @@
+---
+tags: [shell/bash/builtin]
+title: bash wait
+created: '2019-08-02T06:42:37.652Z'
+modified: '2021-05-12T08:46:08.678Z'
+---
+
+# bash wait
+
+> `wait` for job completion and return exit status
+
+## usage
+```sh
+wait # waits until all background jobs have finished
+```
+
+## see also
+- [[bash process-handling]]
+- [[bash jobs]]
+- [[bash bg]]
+- [[bash fg]]
+- [[bash time]]
+- [[timeout]]
diff --git a/notes/bash while.md b/notes/bash while.md
index 521d45cb..1ccdc22b 100644
--- a/notes/bash while.md
+++ b/notes/bash while.md
@@ -1,24 +1,29 @@
---
-tags: [bash, bash/builtin]
+tags: [shell/bash/keyword]
title: bash while
created: '2019-07-30T06:19:49.024Z'
-modified: '2019-07-30T18:47:33.032Z'
+modified: '2022-06-02T12:12:32.373Z'
---
# bash while
-```sh
-while condition; do
- statements
-done
-```
+> execute commands as long they succeed
+
+## usage
```sh
+while condition; do statements done
+
+
command | while read foo; do
echo $foo
done
-```
-```sh
+
while read; do eval echo "$REPLY"; done < config.yml
```
+
+## see also
+
+- [[watch]]
+- [[bash read]]
diff --git "a/notes/bash \342\210\226[\342\210\226[.md" "b/notes/bash \342\210\226[\342\210\226[.md"
new file mode 100644
index 00000000..44621c47
--- /dev/null
+++ "b/notes/bash \342\210\226[\342\210\226[.md"
@@ -0,0 +1,11 @@
+---
+tags: [shell/bash]
+title: 'bash โ[โ['
+created: '2022-11-25T10:57:39.016Z'
+modified: '2023-03-24T08:26:40.140Z'
+---
+
+# bash โ[โ[
+# bash \[\[
+
+> interesting filname -> research
diff --git a/notes/bash.md b/notes/bash.md
index f1c7a30d..ca42f570 100644
--- a/notes/bash.md
+++ b/notes/bash.md
@@ -1,20 +1,269 @@
---
-tags: [bash]
+tags: [shell/bash]
title: bash
created: '2019-07-30T06:19:49.025Z'
-modified: '2019-07-30T06:22:29.764Z'
+modified: '2022-04-06T11:37:34.390Z'
---
# bash
-> At its base, a shell is simply a `macro processor` that executes commands. The term `macro processor` means functionality where text and symbols are expanded to create larger expressions.
->
-[Bash Reference Manual](https://www.gnu.org/software/bash/manual/bash.html?source=post_page---------------------------#What-is-a-shell_003f)
+> at its base, a shell is simply a `macro processor` that executes commands
+> the term `macro processor` means functionality where text and symbols are expanded to create larger expressions
+
+[gnu.org/what-is-a-shell](https://www.gnu.org/software/bash/manual/html_node/What-is-a-shell_003f.html)
+
+## option
+
+```sh
+# option name effect
+-B,+B brace expansion # enable/disable brace expansion
+-C noclobber # prevent overwriting of files by redirection. overridden by `>|`
+-D # List double-quoted strings prefixed by $, but do not execute commands in script
+-a allexport # export all defined variables
+-b notify # Notify when jobs running in background terminate (not of much use in a script)
+-c .. # Read commands from `..`
+
+# checkjobs: Informs user of any open jobs upon shell exit
+-e errexit # abort script at first error, when a command exits with non-zero status; except in `until` or `while` loops, if-tests, list constructs
+-f noglob # filename expansion (globbing) disabled
+
+# globstar: globbing star-match Enables the ** globbing operator. Usage: shopt -s globstar
+-i interactive # runs script in interactive mode
+-n noexec # read commands in script, but dont execute; syntax check
+-o OPT # Invoke the Option-Name option
+-o posix POSIX # Change the behavior of Bash, or invoked script, to conform to POSIX standard.
+-o pipefail pipefailure # Causes a pipeline to return the exit status of the last command in the pipe that returned a non-zero return value.
+-p privileged # Script runs as "suid" (caution!)
+-r restricted # Script runs in restricted mode
+-s stdin # read commands from STDIN
+-t # exit after first command
+-u nounset # Attempt to use undefined variable outputs error message, and forces an exit
+-v verbose # Print each command to stdout before executing it
+-x xtrace # similar to -v, but expands commands
+
+- # end of options flag; all other arguments are positional parameters
+-- # unset positional parameters. If arguments given (-- arg1 arg2), positional parameters set to arguments.
+```
+
+## special parameter
+
+```sh
+0 # expands to current shell e.g. $0 => "-bash"
+! # expands to the process ID of the job most recently placed into the background
+$ # expands to process ID of the shell
+- # expands to current bash option flags, specified by the `set` or `bash -i`
+# # expands to number of positional parameters in decimal
+@ # expands to positional parameters
+* # expands to positional parameters
+```
+
+## shell variables
```sh
-bash -c "echo 1" # -c read command-string
+_ # At shell startup, set to the pathname used to invoke the
+
+BASH # expands to the full filename used to invoke this instance
+BASHOPTS
+BASHPID
+BASH_ALIASES
+BASH_ARGC
+BASH_ARGV
+BASH_ARGV0
+BASH_CMDS
+BASH_COMMAND
+BASH_EXECUTION_STRING
+BASH_LINENO
+BASH_LOADABLES_PATH
+BASH_REMATCH
+BASH_SOURCE
+BASH_SUBSHELL
+BASH_VERSINFO
+BASH_VERSION
+${BASH_VERSINFO[@]} # as array
+
+COMP_CWORD
+COMP_KEY
+COMP_LINE
+COMP_POINT
+COMP_TYPE
+COMP_WORDBREAKS
+COMP_WORDS
+COPROC # array variable (see Arrays below) created to hold the
+
+DIRSTACK
+EPOCHREALTIME
+EPOCHSECONDS
+EUID # expands to the effective user ID of the current user,
+
+FUNCNAME
+${FUNCNAME[@]} # all functions including parents
+
+GROUPS # array variable containing the list of groups of which
+HISTCMD
+HOSTNAME
+HOSTTYPE
+LINENO # Each time this parameter is referenced, the shell
+MACHTYPE
+MAPFILE
+OLDPWD # previous working directory as set by the cd command.
+OPTARG # value of the last option argument processed by the
+OPTIND # index of the next argument to be processed by the
+OSTYPE # Automatically set to a string that describes the operating
-bash -i # shell is interactive.
+PIPESTATUS
+PPID # process ID of the shell's parent. This variable is
+PWD # current working directory as set by the cd command.
+RANDOM # time this parameter is referenced, it expands to a
+READLINE_LINE
+READLINE_MARK
+READLINE_POINT
+REPLY # Set to the line of input read by the `read` builtin command
+SECONDS
+SHELLOPTS
+SHLVL # incremented by one each time an instance of bash is
+SRANDOM
+UID # expands to the user ID of the current user, initialized at
-bash -l # act as if it had been invoked as a login shell
+BASH_COMPAT
+BASH_ENV
+BASH_XTRACEFD
+
+CDPATH The search path for the cd command. This is a colon-
+CHILD_MAX
+COLUMNS
+COMPREPLY
+EMACS If bash finds this variable in the environment when the
+ENV Expanded and executed similarly to BASH_ENV (see
+EXECIGNORE
+FCEDIT The default editor for the fc builtin command.
+FIGNORE
+FUNCNEST
+GLOBIGNORE
+
+HISTCONTROL
+HISTFILE
+HISTFILESIZE
+HISTIGNORE
+HISTSIZE
+HISTTIMEFORMAT
+
+HOME # home directory of the current user
+HOSTFILE
+IFS # Internal Field Separator that is used for word
+IGNOREEOF
+INPUTRC
+INSIDE_EMACS
+LANG # used to determine the locale category for any category not
+LC_ALL # overrides the value of LANG and any other
+LC_COLLATE
+LC_CTYPE
+LC_MESSAGES
+LC_NUMERIC
+LC_TIME
+LINES # Used by the select compound command to determine the
+MAIL #
+MAILCHECK
+MAILPATH
+OPTERR # if set to the value 1, bash displays error messages
+PATH # search path for commands. It is a colon-separated
+POSIXLY_CORRECT
+PROMPT_COMMAND
+PROMPT_DIRTRIM
+PS0 # value of this parameter is expanded (see PROMPTING
+PS1 # value of this parameter is expanded (see PROMPTING
+PS2 # value of this parameter is expanded as with PS1 and
+PS3 # value of this parameter is used as the prompt for the
+PS4 # value of this parameter is expanded as with PS1 and
+SHELL # expands to the full pathname to the shell
+TIMEFORMAT
+TMOUT # if set to a value greater than zero, TMOUT is treated as
+TMPDIR # if set, bash uses its value as the name of a directory in
+auto_resume
+histchars
```
+
+[[bash export]] [[env]] [[bash set]]
+
+## usage
+
+```sh
+bash -c "echo 1" # read command-string
+
+bash --debugger
+
+bash --debugger
+PS4='+ ${BASH_SOURCE[0]} '
+set -x ; __git_ps1 ; set +x
+
+# variable assignment
+# Why can you not have spaces around an equal sign in a shell variable assignment statement?
+# Bash is quirky as programming languages, because first and foremost it's a command interpreter, not programming languages
+# It's not a programming languages that launch commands. It's a command launchers that has a programming language
+foo=bar # is not a command
+foo = bar # the foo might be a command
+
+
+env x='() { :;}; echo vulnerable' bash -c "echo this is a test" # shell-shock
+
+[ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "click" # russian roulette
+
+cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 # generate random 32 character alphanumeric string (lowercase only)
+
+# bash colors
+color=1;
+while [ "$COLOR" -lt "245" ]; do
+ echo -ne "$COLOR: \\033[38;5;${color}mhello\\033[48;5;${color}mworld\\033[0m "
+ [ $(( COLOR % 12 )) -eq "0" ] && { echo ""; }
+ ((COLOR++));
+done
+
+# inline multiline comments
+echo \
+ "mutliline" `# using:` \
+ "with" `# comments :o` \
+ "comments."
+```
+
+## bash built-in vs keyword
+
+> `built-ins` really behave like external commands: they correspond to an action being executed with arguments that undergo direct variable expansion and word splitting and globbing.
+> A builtin can modify the shell's internal state!
+> `keyword` is something that allows for sophisticated behavior! it's part of the shell's grammar.
+
+## usage
+
+```sh
+compgen -b # list built-ins
+compgen -k # list keywords
+type COMMAND # can return keyword, builtin or exec
+
+# [ vs [[
+# [ is a bultin
+# [[ is a keyword
+STRING_WIHT_SPACES='some spaces here'
+if [[ -n $STRING_WIHT_SPACES ]]; then echo "The string is non-empty" fi
+if [ -n $STRING_WIHT_SPACES ]; then echo "The string is non-empty" fi # bash: [: too many arguments
+
+
+# time is a keyword
+# it goes over whole line pipes and redirects
+time grep '^#' ~/.bashrc | { i=0; while read -r; do printf '%4d %s\n' "$((++i))" "$REPLY"; done; } > bashrc_numbered 2>/dev/null
+```
+
+## see also
+
+- [[ash]], [[dash]], [[zsh]]
+- [[bash prompt]]
+- [[bash debugging]]
+- [[bash parameter expansion]]
+- [[bash test []]
+- [[bash compgen]]
+- [[bash time]]
+- [[time]]
+- [[bash variables]]
+- [man7.org/linux/man-pages/man1/bash](https://man7.org/linux/man-pages/man1/bash.1.html)
+- [gnu.org/software/bash/manual/bash](https://www.gnu.org/software/bash/manual/bash.html?#What-is-a-shell_003f)
+- [tldp.org/html/internalvariables.html](https://www.tldp.org/LDP/abs/html/internalvariables.html)
+- [whats-the-difference-between-shell-builtin-and-shell-keyword](https://askubuntu.com/a/590335/219213)
+- [twitter.com/UnixToolTip/status/1220040690203348993](https://twitter.com/UnixToolTip/status/1220040690203348993)
+
diff --git a/notes/bat.md b/notes/bat.md
new file mode 100644
index 00000000..dec01ba1
--- /dev/null
+++ b/notes/bat.md
@@ -0,0 +1,48 @@
+---
+tags: [linux, shell]
+title: bat
+created: '2022-01-18T11:18:10.918Z'
+modified: '2023-03-25T12:24:03.868Z'
+---
+
+# bat
+
+> [[cat]] clone with syntax highlighting and git integration writen [[rust]]
+
+## install
+
+```sh
+brew install bat
+```
+
+## option
+
+```sh
+-A # Show and highlight non-printable characters
+-n # show line numbers (only)
+```
+
+## usage
+
+```sh
+bat FILE
+
+bat src/*.rs # Display multiple files at once
+
+bat > note.md # quickly create a new file
+
+curl -s https://sh.rustup.rs | bat # Read from stdin, determine the syntax automatically
+ # highlighting will only work if the syntax can be determined from the first line of the file
+ # usually through a shebang such as #!/bin/sh)
+
+yaml2json .travis.yml | json_pp | bat -l json # Read from stdin, specify the language explicitly
+
+bat header.md content.md footer.md > document.md # contact files
+
+bat f - g # output 'f', then stdin, then 'g'.
+```
+
+## see also
+
+- [[cat]]
+- [[rust]]
diff --git a/notes/bats.md b/notes/bats.md
new file mode 100644
index 00000000..11187376
--- /dev/null
+++ b/notes/bats.md
@@ -0,0 +1,82 @@
+---
+tags: [shell]
+title: bats
+created: '2019-07-30T06:19:49.026Z'
+modified: '2023-03-22T11:01:52.203Z'
+---
+
+# bats
+
+> `bats` is a `TAP-compliant` testing framework for bash, which provides a simple way to verify that the UNIX programs behave as expected
+
+## env
+
+```sh
+BATS_TEST_FILENAME # fully expanded path to the Bats test file
+BATS_TEST_DIRNAME # directory in which the Bats test file # is located
+BATS_TEST_NAMES # array of function names for each test case
+BATS_TEST_NAME # name of the function containing the current test case
+BATS_TEST_DESCRIPTION # description of the current test case
+BATS_TEST_NUMBER # (1-based) index of the current test case in the test file
+BATS_TMPDIR # location to a directory that may be used to store temporary files
+```
+
+## usage
+
+```sh
+bats TEST.bats # running tests
+
+
+#debug bats output
+@test 'test-a' {
+ run bash -c 'echo ERROR; false'
+ echo "status = ${status}"
+ echo "output = ${output}"
+ [ "$status" -eq 0 ]
+}
+
+# ! needs space between string and {
+# closing } must be on new line
+@test "Check that ls is available" {
+ command -v ls
+}
+
+@test "Check the we have a /tmp directory" {
+ run stat /tmp
+ # standart bash test
+ # $status and $output available
+ echo $output
+ [ $status = 0 ]
+}
+
+@test "Check that total is listed" {
+ run ls -l
+ echo ${lines[0]}
+ [[ ${lines[0]} =~ "total" ]]
+}
+
+
+setup() {
+ source "$BATS_TEST_DIRNAME/../bash_profile"
+ script="$(basename $BATS_TEST_FILENAME)"
+ script="${script%.*}"
+}
+
+@test "get usage: bluegreen-active" {
+ script="$(basename $BATS_TEST_FILENAME)"
+ script="${script%.*}"
+ run "bluegreen-active -h"
+# echo "output: $output"
+# echo "status: $status"
+# echo ${lines[0]}
+# [ "$status" -eq 0 ]
+ [ "${lines[0]}" = "usage: source $script.sh ENV" ]
+}
+```
+
+## see also
+
+- [[rtf]]
+- [github.com/sstephenson/bats](https://github.com/sstephenson/bats)
+- [govmomi/test_helper.bash ยท GitHub](https://github.com/vmware/govmomi/blob/master/govc/test/test_helper.bash)
+- [engineyard.com/bats-test-command-line-tools](https://www.engineyard.com/blog/bats-test-command-line-tools)
diff --git a/notes/baud.md b/notes/baud.md
new file mode 100644
index 00000000..7cf58b52
--- /dev/null
+++ b/notes/baud.md
@@ -0,0 +1,19 @@
+---
+tags: [Notebooks]
+title: baud
+created: '2020-04-16T08:53:03.889Z'
+modified: '2020-09-02T17:51:11.665Z'
+---
+
+# baud
+
+> common measure of symbol rate, which is one of the components that determine the speed of communication over a data channel
+
+- unit for symbol rate or modulation rate in symbols per second or pulses per second
+- is the number of distinct symbol changes (signaling events) made to the transmission medium per second in a digitally modulated signal or a bd rate line code.
+- `baud` is related to gross bit rate, which can be expressed in bits per second
+- If there are precisely two symbols in the system (`0`,`1`), then baud and bit per second `bit/s` are equivalent
+
+
+## see also
+- [[baudot]]
diff --git a/notes/baudot.md b/notes/baudot.md
new file mode 100644
index 00000000..b78b5b74
--- /dev/null
+++ b/notes/baudot.md
@@ -0,0 +1,25 @@
+---
+tags: [Notebooks]
+title: baudot
+created: '2020-04-16T08:49:57.649Z'
+modified: '2020-09-02T17:49:18.634Z'
+---
+
+# baudot
+
+> character encoding for telegraphy invented by รmile Baudot
+
+- was the predecessor to the International Telegraph Alphabet No. 2 (`ITA2`)
+- the most common teleprinter code in use until the advent of `ascii`
+- each character in the alphabet is represented by a series of `5 bits`
+- the symbol rate measurement is known as `baud`, and is derived from the same name
+
+```
+ _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F
+0_ NUL 0000 A 0041 E 0045 / 002F Y 0059 U 0055 I 0049 O 004F FS 000E J 004A G 0047 H 0048 B 0042 C 0043 F 0046 D 0044
+1_ SP 0020 - 002D X 0058 Z 005A S 0053 T 0054 W 0057 V 0056 DEL 007F K 004B M 004D L 004C R 0052 Q 0051 N 004E P 0050
+```
+* character + unicode-codepoint
+## see also
+- [[baud]]
+- [[ascii]]
diff --git a/notes/bc.md b/notes/bc.md
new file mode 100644
index 00000000..e0e1d465
--- /dev/null
+++ b/notes/bc.md
@@ -0,0 +1,44 @@
+---
+tags: [shell]
+title: bc
+created: '2019-09-24T06:25:36.082Z'
+modified: '2023-03-22T09:48:39.898Z'
+---
+
+# bc
+
+> `basic calculator` is an `arbitrary-precision calculator language`
+
+## option
+
+```sh
+-l, --mathlib # uses the predefined math routines
+```
+
+## usage
+
+```sh
+echo "(2/3)+(7/8)" | bc -l # 1.54166666666666666666
+echo "(2/3)+(7/8)" | bc # 0
+
+
+echo "3.4+7/8-(5.94*3.14)" | bc # -15.25
+
+echo "2/3" | bc # 0
+
+echo "scale=2; 2/3" | bc # .66
+
+echo "scale=2;(2/3)+(7/8)" | bc # 1.53
+
+echo "scale=4;(2/3)+(7/8)" | bc # 1.5416
+
+echo "scale=6;(2/3)+(7/8)" | bc # 1.541666
+```
+
+## see also
+
+- [[bash arithmetic expansion]]
+- [[expr]]
+- [[bash printf]]
+- [[bash let]]
+- [[math]]
diff --git a/notes/bfg.md b/notes/bfg.md
new file mode 100644
index 00000000..bfdd8a89
--- /dev/null
+++ b/notes/bfg.md
@@ -0,0 +1,43 @@
+---
+tags: [linux]
+title: bfg
+created: '2020-11-20T23:52:19.801Z'
+modified: '2023-04-21T06:22:12.511Z'
+---
+
+# bfg
+
+> removes large or troublesome blobs like git-filter-branch does, but faster. And written in Scala
+
+
+## install
+
+```sh
+```
+
+## option
+
+```sh
+```
+
+## usage
+
+```sh
+bfg --strip-blobs-bigger-than 100M --replace-text banned.txt REPO.git
+
+bfg --delete-files id_{dsa,rsa} REPO.git # delete all files named 'id_rsa' or 'id_dsa'
+
+bfg --strip-blobs-bigger-than 50M REPO.git # remove all blobs bigger than 50 megabytes
+
+bfg --replace-text passwords.txt REPO.git # replace passwords listed in file
+# (prefix lines 'regex:' or 'glob:' if required) with ***REMOVED*** wherever they occur in repository
+
+# remove all folders or files named '.git' - a reserved filename in Git.
+# these often become a problem when migrating to Git from other source-control systems like Mercurial
+bfg --delete-folders .git --delete-files .git --no-blob-protection REPO.git
+```
+
+## see also
+
+- [[git]]
+- [rtyley.github.io/bfg-repo-cleaner/](https://rtyley.github.io/bfg-repo-cleaner/)
diff --git a/notes/big o notation.md b/notes/big o notation.md
new file mode 100644
index 00000000..3dc5481d
--- /dev/null
+++ b/notes/big o notation.md
@@ -0,0 +1,51 @@
+---
+tags: [Notebooks]
+title: big o notation
+created: '2019-07-30T06:19:49.029Z'
+modified: '2020-02-04T12:32:22.140Z'
+---
+
+# big o notation
+
+## usage
+```javascript
+var calcVariance(data) {
+
+ var sum = 0.0;
+ var squareSum = 0.0;
+ var n = data.length;
+
+ for ( var i = 0; i < n; i++) {
+
+ sum += data[i];
+ squareSum += data[i] * data [i];
+ }
+
+ var variance = ( squareSum - ( sum * sum ) / n ) / n ;
+ var average =
+}
+```
+
+## recursion
+
+### factoral recursion with bash
+```sh
+#!/usr/local/bin/bash
+fact() {
+ local -i n=${1:0}
+ (( n == 0 )) && echo 1 && return
+ (( nm1 = n - 1 ))
+ (( result = n * $(fact $nm1) ))
+ echo $result
+}
+
+for i in {1..25}; do
+ echo fact ${i} is: $(fact ${i})
+done
+```
+
+## see also
+- [Big-O Algorithm Complexity Cheat Sheet (Know Thy Complexities!) @ericdrowell](http://bigocheatsheet.com/)
+- [Big-O notation explained by a self-taught programmer](https://justin.abrah.ms/computer-science/big-o-notation-explained.html)
+- [Big-O notation (article) | Algorithms | Khan Academy](https://www.khanacademy.org/computing/computer-science/algorithms/asymptotic-notation/a/big-o-notation)
+- [A beginner's guide to Big O notation - Rob Bell](https://rob-bell.net/2009/06/a-beginners-guide-to-big-o-notation/)
diff --git a/notes/blockdev.md b/notes/blockdev.md
new file mode 100644
index 00000000..e849adba
--- /dev/null
+++ b/notes/blockdev.md
@@ -0,0 +1,20 @@
+---
+tags: [filesystem, linux]
+title: blockdev
+created: '2019-07-30T06:19:49.053Z'
+modified: '2020-03-12T14:06:39.523Z'
+---
+
+# blockdev
+
+## usage
+```sh
+blockdev --getbsz /dev/sda
+4096 # blocksize of filesystem is 4kB
+```
+
+## see also
+- [[chmod]]
+- [[sysfs]]
+- [[procfs]]
+
diff --git a/notes/brazel.md b/notes/brazel.md
new file mode 100644
index 00000000..ab675dd9
--- /dev/null
+++ b/notes/brazel.md
@@ -0,0 +1,26 @@
+---
+tags: [buildsystem]
+title: brazel
+created: '2021-11-13T09:45:45.798Z'
+modified: '2023-03-23T08:49:00.543Z'
+---
+
+# brazel
+
+> build and test tool similar to [[make]], [[mvn]], and [[gradle]], which uses a human-readable, high-level build language
+
+## install
+
+```sh
+brew install bazel
+```
+
+## usage
+
+```sh
+bazel
+```
+
+## see also
+
+- [[kubectl]]
diff --git a/notes/brctl.md b/notes/brctl.md
new file mode 100644
index 00000000..f7fa8da0
--- /dev/null
+++ b/notes/brctl.md
@@ -0,0 +1,30 @@
+---
+tags: [linux, network]
+title: brctl
+created: '2019-08-28T12:22:49.494Z'
+modified: '2023-03-22T10:03:27.163Z'
+---
+
+# brctl
+
+> `brctl` ethernet bridge administration is used to set up, maintain, and inspect the ethernet bridge configuration in the linux kernel
+
+## install
+
+```sh
+yum install bridge-utils
+```
+
+## usage
+
+```sh
+ip add show docker0
+
+brctl show docker0
+```
+
+## see also
+
+- [[docker network]]
+- [[ip]]
+
diff --git a/notes/brew.md b/notes/brew.md
new file mode 100644
index 00000000..feecd7d7
--- /dev/null
+++ b/notes/brew.md
@@ -0,0 +1,126 @@
+---
+tags: [macos, packagemanager]
+title: brew
+created: '2019-07-30T06:19:49.028Z'
+modified: '2023-06-19T07:10:18.111Z'
+---
+
+# brew
+
+> package manager for macos
+
+## install
+
+```sh
+/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
+
+echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.bashrc # for macos on m1
+```
+
+## env
+
+```sh
+HOMEBREW_BREW_GIT_REMOTE # at install put git mirror of Homebrew/brew here
+HOMEBREW_CORE_GIT_REMOTE # at install put git mirror of Homebrew/homebrew-core here
+HOMEBREW_NO_INSTALL_CLEANUP # don't run brew cleanup
+HOMEBREW_NO_ENV_HINTS # don't show hints
+```
+
+## usage
+
+```sh
+brew list # list all installed formulae and casks
+brew list --cask # list casks only
+
+brew bundle --help
+brew bundle dump # write all installed casks/formulae/images/taps into Brewfile in current directory
+
+brew search PACKAGE
+brew search gnu # list possible installed gnu utils
+brew info gnu
+
+brew update # update brew itself
+brew up # alias for update
+
+brew outdated # list outdated formulae installed
+
+brew upgrade PACKAGE
+
+brew cleanup -s # Scrub the cache, including downloads
+ # -n, --dry-run
+ # -v, --verbose
+
+brew doctor # check your system for potential problems
+
+
+brew deps --tree --installed vim # list dependecies of vim formulae
+
+brew deps --formula --for-each $(brew leaves) `# list all formulas that aren't dependents of any other formulas (leaves)` \
+ | sed "s/^.*:/$(tput setaf 4)&$(tput sgr0)/" # https://stackoverflow.com/a/55445034/14523221
+
+brew deps --include-build --tree $(brew leaves) vim # get dependencies printed hierarchically
+
+
+brew missing # check the given formula kegs for missing dependencies
+
+brew man # generate brew man-pages
+
+brew install grep --with-default-names # used with-default-names to avoid prefixing with "g"
+
+brew install
+ inetutils
+ gnu-getopt
+ findutils
+ pstree
+ rmtrash
+ mkcert
+ bash-completion@2
+ stats # https://github.com/exelban/stats
+
+
+brew install --cask qlvideo
+
+brew unlink PACKAGE # switch between mutliple version of package
+brew link PACKAGE@10
+```
+
+## cask - extension to brew allowing management of gui apps
+
+```sh
+brew cask
+
+brew cask install CASK
+
+brew cask install google-chrome # install
+brew cask install insomnia
+
+brew cask create my-cask # create-cask
+
+ls /usr/local/Caskroom # ls installed caskes
+```
+
+## tap - adds more repos to the list of formulae that brew tracks, updates, and installs from
+
+```sh
+brew tap # list tapped repositories
+
+brew tap tapname # add tap
+
+brew untap tapname # remove a tap
+
+brew tap caskroom/cask # get cask
+```
+
+## see also
+
+- [[softwareupdate]]
+- [[xcode-select]]
+- [[asdf]]
+- [caskroom.github.io/search](https://caskroom.github.io/search)
+- [how to install and use gnu grep in macos](https://apple.stackexchange.com/questions/193288/how-to-install-and-use-gnu-grep-in-osx)
+- [how to replace macos utilities with gnu core utilities](https://apple.stackexchange.com/questions/69223/how-to-replace-mac-os-x-utilities-with-gnu-core-utilities)
+- [how to use gnu sed on macos](https://stackoverflow.com/questions/30003570/how-to-use-gnu-sed-on-mac-os-x)
+- [Updating shell with Homebrew](https://johndjameson.com/blog/updating-your-shell-with-homebrew/)
+- [how to update bash on macos](https://superuser.com/questions/857250/how-to-update-bash-on-mac-os-x-yosemite)
+- [[nix]]
+- [[ruby]]
diff --git a/notes/bsdmainutils.md b/notes/bsdmainutils.md
new file mode 100644
index 00000000..6ffb38b0
--- /dev/null
+++ b/notes/bsdmainutils.md
@@ -0,0 +1,34 @@
+---
+tags: [bsdmainutils]
+title: bsdmainutils
+created: '2020-09-03T08:56:16.986Z'
+modified: '2023-03-22T08:26:14.165Z'
+---
+
+# bsdmainutils
+
+> package contains programs in BSD-style Unix systems
+
+## usage
+
+- [[banner]]
+- [[calendar]]
+- [[cal]] or [[ncal]]
+- [[col]]
+- [[colcrt]]
+- [[colrm]]
+- [[column]]
+- [[from]]
+- [[hexdump]] or [[hd]]
+- [[look]]
+- [[lorder]]
+- [[ul]]
+- [[and]]
+- [[write]]
+- used to contain [[whois]] and [[vacation]], which are now distributed in own packages.
+
+## see also
+
+- [[coreutils]]
+- [[moreutils]]
+- [[column]]
diff --git a/notes/buildah.md b/notes/buildah.md
new file mode 100644
index 00000000..79ce4e6e
--- /dev/null
+++ b/notes/buildah.md
@@ -0,0 +1,42 @@
+---
+tags: [buildsystem, container]
+title: buildah
+created: '2021-10-19T11:40:08.335Z'
+modified: '2023-05-30T07:26:14.227Z'
+---
+
+# buildah
+
+
+## install
+
+```sh
+yum -y install buildah
+```
+
+## usage
+
+```sh
+buildah from centos
+
+buildah run centos-working-container yum install httpd -y
+
+buildah copy centos-working-container index.html /var/www/html/index.html
+
+buildah config --entrypoint "/usr/sbin/httpd -DFOREGROUND" centos-working-container
+
+buildah commit centos-working-container redhat-website
+
+buildah bud -t fedora-httpd # bud = "build-using-dockerfile"
+
+buildah images
+```
+
+## see also
+
+- [[podman]]
+- [[skopeo]]
+- [[docker]]
+- [[crictl]]
+- [[pack]]
+- [buildah.io](https://buildah.io/)
diff --git a/notes/bun.md b/notes/bun.md
new file mode 100644
index 00000000..2734ef48
--- /dev/null
+++ b/notes/bun.md
@@ -0,0 +1,44 @@
+---
+tags: [javascript, runtime, typescript, zig]
+title: bun
+created: '2023-05-23T06:55:46.191Z'
+modified: '2023-05-24T08:46:01.758Z'
+---
+
+# bun
+
+> all-in-one toolkit for [[javascript]] and [[typescript]] apps
+
+## install
+
+```sh
+brew tap oven-sh/bun && brew install bun
+```
+
+## usage
+
+```sh
+bun init
+
+bun index.ts
+
+bun test # run tests
+
+bun run start # run the `start` script
+
+bun install โ # install a package
+
+bunx cowsay "Hello, world!" # execute a package
+
+
+bun add -d bun-types # add dev dependency to project
+bun add figlet
+bun add -d @types/figlet # TypeScript users only
+```
+
+## see also
+
+- [[zig]]
+- [[node]], [[js]], [[deno]]
+- [[javascript]]
+- [github.com/oven-sh/bun](https://github.com/oven-sh/bun)
diff --git a/notes/bundle rake.md b/notes/bundle rake.md
new file mode 100644
index 00000000..07662e5b
--- /dev/null
+++ b/notes/bundle rake.md
@@ -0,0 +1,30 @@
+---
+tags: [ruby]
+title: bundle rake
+created: '2020-01-02T13:04:55.184Z'
+modified: '2022-03-03T15:46:10.727Z'
+---
+
+# bundle rake
+
+> make-like build utility for Ruby
+
+## usage
+
+```sh
+bundle exec rake -T # list rake tasks
+
+bundle exec rake gitlab:env:info RAILS_ENV=production
+
+bundle exec rake gitlab:backup:create RAILS_ENV=production # /home/git/data/backups/
+
+bundle exec rake gitlab:backup:restore RAILS_ENV=production
+
+app:rake gitlab:backup:create
+```
+
+## see also
+
+- [[ruby]]
+- [[make]]
+- [[gitlab-rake]]
diff --git a/notes/bundle.md b/notes/bundle.md
new file mode 100644
index 00000000..98570ed9
--- /dev/null
+++ b/notes/bundle.md
@@ -0,0 +1,29 @@
+---
+tags: [ruby]
+title: bundle
+created: '2019-07-30T06:19:49.225Z'
+modified: '2022-03-03T15:46:05.239Z'
+---
+
+# bundle
+
+> ruby dependency management
+
+## usage
+
+```sh
+bundle env
+
+which bundle ruby gem
+
+bundle list
+
+bundler exec
+```
+
+## see also
+
+- [[ruby]]
+- [[bundle rake]]
+- [sameersbn/docker-gitlab - github.com](https://github.com/sameersbn/docker-gitlab/tree/e56b05963e86be76c6d17d9c6068a0d49e1e4306)
+- [[composer]]
diff --git a/notes/busybox.md b/notes/busybox.md
new file mode 100644
index 00000000..27a49ad5
--- /dev/null
+++ b/notes/busybox.md
@@ -0,0 +1,32 @@
+---
+tags: [linux]
+title: busybox
+created: '2019-07-30T06:19:49.154Z'
+modified: '2021-11-11T08:28:23.551Z'
+---
+
+# busybox
+
+> busybox is like a swiss army knife: one thing with many functions
+
+## usage
+
+> commands in `/bin` or `/usr/bin` would be `symlinks` to `busybox`
+
+```sh
+--list # ..
+--help # ..
+```
+
+```sh
+busybox | head -1
+```
+
+## see also
+
+- [[ash]]
+- [[awk]]
+- [[crond]]
+- [[docker-machine]]
+- [[head]]
+- [[netstat]]
diff --git a/notes/c array.md b/notes/c array.md
new file mode 100644
index 00000000..ac2e236c
--- /dev/null
+++ b/notes/c array.md
@@ -0,0 +1,22 @@
+---
+tags: [c]
+title: c array
+created: '2020-04-24T09:37:42.906Z'
+modified: '2020-05-16T11:30:43.705Z'
+---
+
+# c array
+
+> can only store primitive data types like int and float
+> passing array to function, the array decays into a pointer !
+> strings are stored as character-arrays
+
+## usage
+```c
+int a[3]; /* declares array of size 3 */
+
+3[a] /* from reddit "intelectual" way of declaring an array ..lol */
+```
+## see also
+- [[c vector]]
+- [[string.h]]
diff --git a/notes/c include.md b/notes/c include.md
new file mode 100644
index 00000000..96b289d0
--- /dev/null
+++ b/notes/c include.md
@@ -0,0 +1,39 @@
+---
+tags: [c]
+title: c include
+created: '2020-04-24T09:16:35.459Z'
+modified: '2020-07-02T06:41:23.031Z'
+---
+
+# c include
+
+> `#include` directive shall identify a header or source file that can be processed by the implementation
+
+## usage
+```c
+#include /* preprocessor search in -I directories and in predefined directories first, then in the .c file's directory */
+
+#include "filename" /* preprocessor search the source directory first, and then revert to -I and predefined */
+
+
+
+/*
+ "include-guard" aka "macro-guard", "header-guard" or "file-guard"
+ is a particular construct used to avoid the problem of double inclusion
+*/
+#ifndef GUARD_H
+#define GUARD_H
+
+struct foo {
+ int member;
+};
+
+#endif /* GUARD_H */
+```
+## see also
+- [[gcc]]
+- [[nm]]
+- [[ld]]
+- [[ldd]]
+- [stackoverflow.com/how-are-implementations-of-stdlib-functions-stored-and-linked](https://stackoverflow.com/a/24920452/2087704)
+- [c standard](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf#page=182)
diff --git a/notes/c operators.md b/notes/c operators.md
new file mode 100644
index 00000000..db6e0f4f
--- /dev/null
+++ b/notes/c operators.md
@@ -0,0 +1,87 @@
+---
+tags: [c]
+title: c operators
+created: '2020-04-24T10:42:43.426Z'
+modified: '2020-05-16T11:32:01.766Z'
+---
+
+# c operators
+
+> an operator is a symbol that tells the compiler to perform a certain mathematical or logical manipulation, they are used to manipulate data and variables
+
+
+## arithmetic operators
+```c
++ /* adds two operands */
+- /* subtract second operands from first */
+* /* multiply two operand */
+/ /* divide numerator by denominator */
+% /* remainder of division */
+++ /* Increment operator */
+-- /* Decrement operator */
+```
+
+## relational operators
+```c
+== /* Check if two operand are equal */
+!= /* Check if two operand are not equal. */
+> /* Check if operand on the left is greater than operand on the right */
+< /* Check operand on the left is smaller than right operand */
+>= /* check left operand is greater than or equal to right operand */
+<= /* Check if operand on left is smaller than or equal to right operand */
+```
+
+## logical operators
+```c
+&& /* Logical AND */
+|| /* Logical OR */
+! /* Logical NOT */
+```
+
+## bitwise operators
+> perform manipulations of data at bit level
+> also perform shifting of bits from right to left
+> are not applied to `float` or `double`
+```c
+& /* Bitwise AND */
+| /* Bitwise OR */
+^ /* Bitwise exclusive OR */
+ /* truth table */
+ /* a b a & b a | b a ^ b */
+ /* 0 0 0 0 0 */
+ /* 0 1 0 1 1 */
+ /* 1 0 0 1 1 */
+ /* 1 1 1 1 0 */
+
+<< /* left shift */
+>> /* right shift */
+
+0001000 << 2 = 0100000
+0001000 >> 2 = 0000010
+```
+
+## assignment operators
+```c
+ = /* assigns values from right side operands to left side operand */
++= /* adds right operand to the left operand and assign the result to left */
+-= /* subtracts right operand from the left operand and assign the result to left operand */
+*= /* mutiply left operand with the right operand and assign the result to left operand */
+/= /* divides left operand with the right operand and assign the result to left operand */
+%= /* calculate modulus using two operands and assign the result to left operand */
+```
+
+## conditional/ternary operators
+```c
+expression1 ? expression2 : expression3
+```
+
+## special operators
+```c
+sizeof /* Returns the size of an variable sizeof(x) return size */
+& /* Returns the address of an variable &x ; return address */
+* /* Pointer to a variable *x ; dereference pointer */
+```
+
+## see also
+- [[string.h]] strlen
+
diff --git a/notes/c printf.md b/notes/c printf.md
index b03d8d76..b1322032 100644
--- a/notes/c printf.md
+++ b/notes/c printf.md
@@ -1,17 +1,24 @@
---
-tags: [lang/c, printf]
+tags: [c]
title: c printf
created: '2019-08-01T07:29:42.543Z'
-modified: '2019-08-01T07:29:54.308Z'
+modified: '2023-03-23T09:27:40.583Z'
---
# c printf
+> formatted output conversion - `man 3 printf`
+
+## usage
+
```c
-printf("format", args) // is used to print the data onto the standard output which is often a computer monitor.
+printf("format", args) /* is used to print the data onto the standard output which is often a computer monitor */
-sprintf(char *, "format", args) // stores the formated data in a string pointed to by the char pointer
+sprintf(char *, "format", args) /* stores the formated data in a string pointed to by the char pointer */
-fprintf(FILE *fp, "format", args) // formated data is saved on a file which is pointed to by the file pointer
+fprintf(FILE *fp, "format", args) /* formated data is saved on a file which is pointed to by the file pointer*/
```
-[c - Difference between fprintf, printf and sprintf? - Stack Overflow](https://stackoverflow.com/a/30969793)
+
+## see also
+
+- [c - Difference between fprintf, printf and sprintf? - Stack Overflow](https://stackoverflow.com/a/30969793)
diff --git a/notes/c segfault.md b/notes/c segfault.md
new file mode 100644
index 00000000..d9628f74
--- /dev/null
+++ b/notes/c segfault.md
@@ -0,0 +1,47 @@
+---
+tags: [c]
+title: c segfault
+created: '2019-07-30T07:58:36.045Z'
+modified: '2020-07-24T09:20:42.442Z'
+---
+
+# c segfault
+
+`stackoverflow`
+> segmentation fault occurs when a program attempts to access a memory location that it is not allowed to access,
+> or attempts to access a memory location in a way that is not allowed
+> e.g. attempting to write to a read-only location, or to overwrite part of the operating system
+
+## example
+```c
+#include
+#include
+
+int main(int argc, char **argv) {
+
+ char myString[10] = "foo bar";
+ puts(myString);
+ printf("%s\n", myString);
+
+ char buffer [500];
+ strcpy(buffer, argv[1]);
+ return 0;
+}
+```
+
+```c
+int *i;
+int main(void) {
+ return*i;
+}
+```
+
+> Dangling Reference (pointer) problem means that trying to access an object or variable whose contents have already been deleted from memory, e.g:
+```c
+int *arr = new int[20];
+delete arr;
+cout<
-#include
-
-int main(int argc, char **argv) {
-
- char myString[10] = "foo bar";
- puts(myString);
- printf("%s\n", myString);
-
- char buffer [500];
- strcpy(buffer, argv[1]);
- return 0;
-}
-```
diff --git a/notes/c variable.md b/notes/c variable.md
deleted file mode 100644
index 1e4f9847..00000000
--- a/notes/c variable.md
+++ /dev/null
@@ -1,20 +0,0 @@
----
-tags: [lang/c]
-title: c variable
-created: '2019-07-30T07:57:55.607Z'
-modified: '2019-07-30T08:01:45.869Z'
----
-
-# c variable
-
-```c
-int **test // pointer to a pointer
-```
-### variable types
-```c
-char
-int
-float
-double
-void
-```
diff --git a/notes/c++.md b/notes/c++.md
new file mode 100644
index 00000000..d4b4fcb6
--- /dev/null
+++ b/notes/c++.md
@@ -0,0 +1,25 @@
+---
+tags: [c]
+title: c++
+created: '2020-08-27T11:03:25.881Z'
+modified: '2023-05-08T18:11:23.272Z'
+---
+
+# c++
+
+> cpp
+
+## usage
+
+```sh
+
+```
+
+## see also
+
+- [[g++]]
+- [[gcc]]
+- [[c]]
+- [[clang++]]
+- [[rust]]
+
diff --git a/notes/c.md b/notes/c.md
new file mode 100644
index 00000000..23339fc7
--- /dev/null
+++ b/notes/c.md
@@ -0,0 +1,74 @@
+---
+tags: [c]
+title: c
+created: '2019-08-19T12:57:28.967Z'
+modified: '2023-05-19T11:32:30.888Z'
+---
+
+# c
+
+> general-purpose, procedural language supporting structured programming, lexical variable scope, and recursion, with a static type system
+> imperative procedural language. designed to be compiled to provide low-level access to memory and language constructs that map efficiently to machine instructions, all with minimal runtime support
+
+## types
+
+> 4 basic arithmetic type specifiers: `char`, `int`, `float`, `double`
+> and modifiers: `signed`, `unsigned`, `short`, `long`
+
+```c
+/* char type */
+ char /* 1%c 1 byte -128 to 127 or 0 to 255 */
+signed char /* 1%c 1 byte -128 to 127 */
+unsigned char /* 1%c 1 byte 0 to 255 */
+
+/* integer types */
+ int /* 2/4%d 2/4 bytes -32,768 to 32,767 or -2,147,483,648 to 2,147,483,647 */
+unsigned int /* 2/4%u 2/4 bytes 0 to 65,535 or 0 to 4,294,967,295 */
+short int /* 2 %hd 2 bytes -32,768 to 32,767 */
+unsigned short /* 2 bytes 0 to 65,535 */
+long int /* 4/8%li 8 bytes -9223372036854775808 to 9223372036854775807 */
+long long int /* 8 %lli */
+unsigned long int /* 4%lu 8 bytes 0 to 18446744073709551615 */
+unsigned long long int /* 8%llu */
+
+
+/* floating-point types */
+float /* 4%f 4 byte 1.2E-38 to 3.4E+38 6 decimal-places */
+double /* 8%lf 8 byte 2.3E-308 to 1.7E+308 15 decimal-places */
+long double /* 0/12 or 16%Lf 10 byte 3.4E-4932 to 1.1E+4932 19 decimal-places */
+
+/* Enumerated types */
+/* arithmetic types used to define variables that can only assign certain discrete integer value */
+
+/* void type */
+void /* void indicates that no value is available. */
+
+/* derived types */
+/* Pointer types, Array types, Structure types, Union types, Function types */
+int **test /* pointer to a pointer */
+```
+
+[[typing]]
+
+## string memory
+
+```c
+const char *str = "Stack"; // Static Read-only Code segment
+char *str = "Stack"; // Static Read-only Code segment
+char *str = malloc(...); // Dynamic Read-write Heap
+char str[] = "Stack"; // Static Read-write Stack
+char strGlobal[10] = "Global"; // Static Read-write Data Segment (R/W)
+```
+
+[stackoverflow.com/a/16021546/14523221](https://stackoverflow.com/a/16021546/14523221)
+
+## see also
+
+- [[man]]
+- [[libc]]
+- [[asm]], [[wasm]]
+- [[clang]]
+- [[typesystem]]
+- [[sqlite]]
+- [[rust]], [[rustc]], [[cargo]]
+
diff --git a/notes/cabal.md b/notes/cabal.md
new file mode 100644
index 00000000..31f8facc
--- /dev/null
+++ b/notes/cabal.md
@@ -0,0 +1,37 @@
+---
+tags: [buildsystem, compiler, haskell]
+title: cabal
+created: '2023-05-23T12:04:26.570Z'
+modified: '2023-05-24T08:40:15.434Z'
+---
+
+# cabal
+
+> `C`ommon `A`rchitecture for `B`uilding `A`pplications and `L`ibraries
+> system for building and packaging Haskell libraries and programs
+
+## install
+
+```sh
+brew install cabal-install
+```
+
+## usage
+
+```sh
+cabal update
+cabal install elm-repl
+
+cabal init
+
+cabal build
+
+cabal run
+
+cabal install # install executable
+```
+
+## see also
+
+- [[haskell]]
+- [[elm]]
diff --git a/notes/cal.md b/notes/cal.md
new file mode 100644
index 00000000..1e81ae86
--- /dev/null
+++ b/notes/cal.md
@@ -0,0 +1,20 @@
+---
+tags: [bsdmainutils]
+title: cal
+created: '2020-06-08T08:22:58.962Z'
+modified: '2023-03-22T08:26:05.129Z'
+---
+
+# cal
+
+> displays a calendar
+
+## usage
+
+```sh
+cal -y 2020 # show year 2020
+```
+
+## see also
+
+- [[date]]
diff --git a/notes/calibre.md b/notes/calibre.md
new file mode 100644
index 00000000..dfd8d17e
--- /dev/null
+++ b/notes/calibre.md
@@ -0,0 +1,30 @@
+---
+tags: [linux, macos]
+title: calibre
+created: '2021-02-25T16:55:40.941Z'
+modified: '2023-03-25T12:25:33.854Z'
+---
+
+# calibre
+
+## install
+
+```sh
+brew install --cask calibre
+apt-get install calibre
+```
+
+## usage
+
+```sh
+ebook-convert "book.epub" "book.mobi"
+
+ebook-convert "book.azw3" "book.pdf"
+
+for book in *.epub; do echo "converting: $book"; ebook-convert "$book" "$(basename "$book" .epub).mobi"; done
+```
+
+## see also
+
+- [[markdown]]
+- [[gc]]
diff --git a/notes/cap theorem.md b/notes/cap theorem.md
new file mode 100644
index 00000000..85847053
--- /dev/null
+++ b/notes/cap theorem.md
@@ -0,0 +1,44 @@
+---
+tags: [Notebooks]
+title: cap theorem
+created: '2021-12-26T14:43:50.251Z'
+modified: '2023-05-24T14:42:19.842Z'
+---
+
+# cap theorem
+
+> aka `Brewer's theorem`
+
+```
+C A P
+| | โโ consistency
+| โโโโ availability
+โโโโโโ partition
+```
+
+@startuml
+(consistency) -- (availability)
+(partition) - (availability)
+(consistency) - (partition)
+@enduml
+
+## used by:
+
+- `rabbitmq` Clustering: CP
+- Federation/shovel: AP
+
+
+`A.C.I.D.` vs `B.A.S.E.`
+
+CA-DataBase: postgres -> single node
+
+AP-DataBase: avail. + part. tol. -> cassandra, couchbase, (nosql eventual consistency)
+
+CP-DataBase: spanner, cockroach
+
+mvcc mutliversionconcurencycontrol
+
+## see also
+
+- [[erlang]], [[rabbitmqctl]]
+- [infoq.com/articles/cap-twelve-years-later-how-the-rules-have-changed/](https://www.infoq.com/articles/cap-twelve-years-later-how-the-rules-have-changed/)
diff --git a/notes/capabilities.md b/notes/capabilities.md
new file mode 100644
index 00000000..f7c9a5ea
--- /dev/null
+++ b/notes/capabilities.md
@@ -0,0 +1,37 @@
+---
+tags: [container]
+title: capabilities
+created: '2020-01-17T07:20:37.598Z'
+modified: '2020-09-02T17:34:07.171Z'
+---
+
+# capabilities
+
+> capabilities are properties of processes
+
+### Traditionally there are three sets:
+- Permitted capabilities `p`: capabilities that may be "activated" in the current process.
+- Effective capabilities `e`: capabilities that are currently usable in the current process.
+- Inheritable capabilities `i`: file capabilities that may be inherited.
+
+
+### categories of processes:
+- privileged processes: effective user ID is 0, referred to as `superuser` or `root`
+- unprivileged processes: effective UID is nonzero
+
+Privileged processes bypass all kernel permission checks
+unprivileged processes are subject to full permission checking based on the process's credentials (usually: effective UID, effective GID, and supplementary group list)
+
+## usage
+```sh
+man 7 capabilities
+```
+
+## capabilities list
+```sh
+CAP_IPC_LOCK # lock memory
+```
+## see also
+- [[capsh]]
+- [[getcap]]
+- [[docker-compose]]
diff --git a/notes/capsh.md b/notes/capsh.md
new file mode 100644
index 00000000..8622c9d1
--- /dev/null
+++ b/notes/capsh.md
@@ -0,0 +1,37 @@
+---
+tags: [container, linux]
+title: capsh
+created: '2020-01-15T09:24:40.443Z'
+modified: '2020-08-31T09:34:13.641Z'
+---
+
+# capsh
+
+> capability shell wrapper
+
+## usage
+
+```sh
+capsh --print
+
+capsh \
+ --caps="cap_net_raw+eip cap_setpcap,cap_setuid,cap_setgid+ep" \
+ --keep=1 \
+ --user=foo \
+ --addamb=cap_net_raw \
+ --print \
+ --
+
+capsh \
+ --caps="cap_net_raw+eip cap_setpcap,cap_setuid,cap_setgid+ep" \
+ --keep=1 \
+ --user=nobody \
+ --addamb=cap_net_raw \
+ -- \
+ -c "./ping -c1 127.0.0.1"
+```
+
+## see also
+
+- [[capabilities]]
+- [[getcap]]
diff --git a/notes/cargo.md b/notes/cargo.md
new file mode 100644
index 00000000..003f59da
--- /dev/null
+++ b/notes/cargo.md
@@ -0,0 +1,58 @@
+---
+tags: [packagemanager, rust]
+title: cargo
+created: '2020-02-27T16:59:23.781Z'
+modified: '2023-05-10T14:12:38.092Z'
+---
+
+# cargo
+
+> package manager for rust
+
+## install
+
+```sh
+curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
+```
+
+will add the [[cargo]], [[rustc]] and [[rustup]]
+
+## usage
+
+```sh
+cargo install --list # list installed crates
+cargo install CRATE
+cargo install-update CRATE
+
+cargo build # build your project with
+
+cargo run # run your project with
+
+cargo test # test your project with
+
+cargo doc # build documentation for your project with
+
+cargo publish # publish a library to crates.io with
+
+cargo new hello-rust # init new project
+
+
+# fun projects
+cargo install \
+ exa \
+ rm-improved \
+ jless \
+ gping \
+ cargo-update \
+ mdcat
+ alacritty
+```
+
+## see also
+
+- [[rust]]
+- [[rustup]]
+- [[exa]]
+- [[rip]]
+- [[jless]]
+- [doc.rust-lang.org/cargo](https://doc.rust-lang.org/cargo/index.html)
diff --git a/notes/cat.md b/notes/cat.md
new file mode 100644
index 00000000..719d17aa
--- /dev/null
+++ b/notes/cat.md
@@ -0,0 +1,45 @@
+---
+tags: [coreutils, macos]
+title: cat
+created: '2019-09-04T06:20:06.676Z'
+modified: '2022-06-17T09:24:39.620Z'
+---
+
+# cat
+
+> concatenate and print files
+
+## option
+
+```sh
+-e # display non printin characters
+-s # Squeeze multiple adjacent empty lines, causing the output to be single spaced
+```
+
+## usage
+
+```sh
+cat > FILE # then start typing and SIGINT to save
+
+# cat heredoc to file
+cat < FILE
+some random text
+EOF
+
+cat > FILE < apple clang - the Clang C, C++, and Objective-C compiler
+
+## install
+
+```sh
+```
+
+## usage
+
+```sh
+cc -o OUT FILE.c
+```
+
+## see also
+
+- [[clang]]
+- [[gcc]]
+- [[make]]
+- [[xcode-select]]
+
diff --git a/notes/cdk.md b/notes/cdk.md
new file mode 100644
index 00000000..d3c16982
--- /dev/null
+++ b/notes/cdk.md
@@ -0,0 +1,70 @@
+---
+tags: [iac]
+title: cdk
+created: '2022-09-27T06:58:06.755Z'
+modified: '2023-03-22T09:16:37.554Z'
+---
+
+# cdk
+
+> aws cloud development kit
+
+## install
+
+```sh
+npm install -g aws-cdk # install latest version
+npm install -g aws-cdk@X.YY.Z # install specific version
+```
+
+## usage
+
+```sh
+npm run --silent cdk -- diff # run cdk via npm
+
+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 bootstrap --show-template # render template
+
+cdk bootstrap --trust AWS_ACCOUNT --trust-for-lookup AWS_ACCOUNT \
+ --cloudformation-execution-policies 'arn:aws:iam::aws:policy/POLICY' \
+ --template cdk_bootstrap_template.yml
+
+cdk deploy # deploys specified stack(s)
+
+cdk deploy --ci -e STACK
+
+cdk destroy # destroys specified stack(s)
+
+cdk destroy --ci STACK
+
+cdk diff # compares specified stack and its dependencies with deployed stack(s) or a local cloudformation template
+
+cdk diff --ci -e STACK
+
+cdk metadata # displays metadata about the specified stack
+
+cdk metadata -j BaseStack 2>/dev/null | jq '.["/BaseStack/chatbot-slack/Resource"][].type'
+
+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]]
diff --git a/notes/certutil.md b/notes/certutil.md
new file mode 100644
index 00000000..66347198
--- /dev/null
+++ b/notes/certutil.md
@@ -0,0 +1,38 @@
+---
+tags: [linux, macos]
+title: certutil
+created: '2023-07-12T07:32:56.035Z'
+modified: '2023-07-19T11:17:39.576Z'
+---
+
+# certutil
+
+> manage keys and certificate in both NSS databases and other NSS tokens
+
+## install
+
+```sh
+brew install nss
+```
+
+## usage
+
+```sh
+certutil -N -d [sql:]DIR # create new db
+
+certutil -R -k rsa -g 1024 \
+ -s "CN=John Smith,O=Example Corp,L=Mountain View,ST=California,C=US" \
+ -d sql:$HOME/nssdb -p 650-555-0123 -a -o cert.cer
+
+certutil -S -s "CN=Example CA" -n my-ca-cert -x -t "C,C,C" -1 -2 -5 -m 3650 # self signed cert
+
+certutil -S -s "CN=My Server Cert" -n my-server-cert -c "my-ca-cert" -t "u,u,u" -1 -5 -6 -8 -m 730
+```
+
+## see also
+
+- [[openssl]]
+- [[cosign]]
+- [[mkcert]]
+- [manpages.ubuntu.com/manpages/xenial/en/man1/certutil.1.html](https://manpages.ubuntu.com/manpages/xenial/en/man1/certutil.1.html)
+- [www-archive.mozilla.org/projects/security/pki/nss/tools/certutil](https://www-archive.mozilla.org/projects/security/pki/nss/tools/certutil)
diff --git a/notes/cfn.md b/notes/cfn.md
new file mode 100644
index 00000000..e52fcff3
--- /dev/null
+++ b/notes/cfn.md
@@ -0,0 +1,29 @@
+---
+tags: [iac]
+title: cfn
+created: '2022-09-27T06:56:03.247Z'
+modified: '2023-03-22T09:16:30.280Z'
+---
+
+# cfn
+
+> `cloud formation cli` to author own resource providers, hooks, and modules
+
+## 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]]
diff --git a/notes/cgroup.md b/notes/cgroup.md
new file mode 100644
index 00000000..a44d6282
--- /dev/null
+++ b/notes/cgroup.md
@@ -0,0 +1,36 @@
+---
+tags: [container, linux]
+title: cgroup
+created: '2020-02-26T12:44:48.090Z'
+modified: '2023-04-11T20:23:05.675Z'
+---
+
+# cgroup
+
+## install
+
+```sh
+yum install libcgroup libcgroup-tools
+```
+
+## usage
+
+```sh
+lssubsys -am # show all subsystems (unmounted ones) and mountpoints
+
+CGROUP_ID="cgroup_$(shuf -i 1000-2000 -n 1)"
+
+cgcreate -g "cpu,cpuacct,memory:$CGROUP_ID"
+cgset -r cpu.share=512 "$CGROUP_ID"
+cgset -r memory.limit_in_bytes=1000000000 "$CGROUP_ID"
+cgexec -g "cpu,cpuacct,memory:$CGROUP_ID" \
+ unshare "-fmuipn --mount-proc" \
+ chroot "$PWD" \
+ /bin/sh -c "/bin/mount -t proc proc /proc && hostname container-fun-times && /usr/bin/fish"
+```
+
+## see also
+
+- [[docker]]
+- [[container]]
+- [twitter.com/b0rk/status/1230606332681691136](https://twitter.com/b0rk/status/1230606332681691136)
diff --git a/notes/chattr.md b/notes/chattr.md
new file mode 100644
index 00000000..c36e3413
--- /dev/null
+++ b/notes/chattr.md
@@ -0,0 +1,57 @@
+---
+tags: [linux]
+title: chattr
+created: '2019-10-04T09:02:35.919Z'
+modified: '2020-03-03T12:52:29.948Z'
+---
+
+# chattr
+
+> `chattr` changes the file attributes on a Linux file system.
+
+## usage
+```sh
+chattr +i file # make file imutable / read-only
+chattr -i file # remove read-only restriction
+
+chattr +a file # append-only
+chattr -a file # remove append-only
+
+chattr -R +i ./dir/ # apply restriction to all files in dir
+
+# format of a symbolic mode is +-=[aAcCdDeijsStTu]
+# + causes the selected attributes to be added to the existing attributes of the files
+# - causes them to be removed
+# = causes them to be the only attributes that the files have.
+# letters select the new attributes for the files:
+# a append only
+# A no atime updates
+# c compressed
+# C no copy on write
+# d no dump
+# D synchronous directory updates
+# e extent format
+# i immutable
+# j data journalling
+# s secure deletion
+# synchronous
+# S updates
+# t no tail-merging
+# T top of directory hierarchy
+# u undeletable
+# read-only attributes, and may be listed by lsattr but not modified by chattr
+# E compression error
+# h huge file
+# I indexed directory
+# N inline data
+# X compression raw access
+# Z compressed dirty file
+```
+
+## see also
+- [[lsattr]]
+- [[chflags]]
+- [[chmod]]
+- [[btrfs]]
+- [[ext4]]
+- [[xfs]]
diff --git a/notes/chezmoi.md b/notes/chezmoi.md
new file mode 100644
index 00000000..df32c281
--- /dev/null
+++ b/notes/chezmoi.md
@@ -0,0 +1,44 @@
+---
+tags: [go]
+title: chezmoi
+created: '2023-05-15T15:31:24.441Z'
+modified: '2023-05-15T15:34:59.978Z'
+---
+
+# chezmoi
+
+## install
+
+```sh
+brew install chezmoi
+```
+
+## usage
+
+```sh
+chezmoi help
+
+chezmoi init
+
+chezmoi add ~/.bashrc
+
+chezmoi edit ~/.bashrc
+
+chezmoi diff
+
+chezmoi -v apply
+
+chezmoi cd # open subshell to commit changes
+git add .
+git commit -m "Initial commit"
+exit
+
+
+chezmoi init --apply https://github.com/$GITHUB_USERNAME/dotfiles.git # setup with single command
+chezmoi init --apply $GITHUB_USERNAME # short: if github user and repo /dotfiles exist
+```
+
+## see also
+
+- [[bash]], [[git]]
+- [[go]]
diff --git a/notes/chflags.md b/notes/chflags.md
new file mode 100644
index 00000000..c7c258c1
--- /dev/null
+++ b/notes/chflags.md
@@ -0,0 +1,14 @@
+---
+tags: [macos]
+title: chflags
+created: '2019-10-04T09:04:59.828Z'
+modified: '2020-02-04T12:21:27.287Z'
+---
+
+# chflags
+
+## usage
+
+## see also
+- [[chattr]]
+- [[chmod]]
diff --git a/notes/chmod.md b/notes/chmod.md
new file mode 100644
index 00000000..866b61b1
--- /dev/null
+++ b/notes/chmod.md
@@ -0,0 +1,55 @@
+---
+tags: [coreutils, macos]
+title: chmod
+created: '2019-10-04T09:17:53.956Z'
+modified: '2023-03-22T09:07:24.277Z'
+---
+
+# chmod
+
+> change file modes or Access Control Lists
+
+## usage
+
+```sh
+chmod [u|g][+|-][r|w|x]
+# | | ^
+# | | |
+# | | read write execute
+# | add or remove
+# user or group
+
+# _ rwx rwx rwx [int] owner:group
+# ^ ^
+# | |
+# | number of hardlinks
+# special permissions flag
+# |
+# _ no special permissions
+# d directory
+# l file or dir as symlink
+# s setuid/set guid => run executable as owner with owner permissions
+# t sticky bit
+```
+
+## usage
+
+```sh
+chmod 755 FILE
+
+chmod 644 DIR
+
+chmod -R 644 DIR
+
+chmod g-w FILE # remove write from group
+chmod u+rw FILE # give permission read, write to user
+```
+
+## see also
+
+- [[chown]]
+- [[ls]]
+- [[lsattr]]
+- [[chattr]]
+- [[filesystem]]
+- [[bash umask]]
diff --git a/notes/chown.md b/notes/chown.md
new file mode 100644
index 00000000..7d7806a3
--- /dev/null
+++ b/notes/chown.md
@@ -0,0 +1,20 @@
+---
+tags: [coreutils, macos]
+title: chown
+created: '2020-03-03T12:55:34.728Z'
+modified: '2023-03-22T09:07:32.606Z'
+---
+
+# chown
+
+> change file owner and group
+
+## usage
+
+```sh
+chown 1000:0 file
+```
+
+## see also
+
+- [[chown]]
diff --git a/notes/chronyc.md b/notes/chronyc.md
new file mode 100644
index 00000000..a503d02b
--- /dev/null
+++ b/notes/chronyc.md
@@ -0,0 +1,49 @@
+---
+tags: [linux]
+title: chronyc
+created: '2019-10-26T17:54:31.118Z'
+modified: '2023-03-23T08:46:02.859Z'
+---
+
+# chronyc
+
+> command-line interface for chrony daemon
+
+## usage
+
+```sh
+chronyc -a makestep # cancel any remaining correction that was being slewed and jump the system clock by the equivalent amount, making it correct immediately => update your system clock quickly
+
+chronyc tracking
+
+chronyc sourcestats # displays information about the drift rate and offset estimation process for each of the sources
+
+chronyc sources -v # displays information about the current time sources that chronyd is accessing
+
+# MS Name/IP address Stratum Poll Reach LastRx Last sample
+# ===============================================================================
+# #* GPS0 0 4 377 11 -479ns[ -621ns] +/- 134ns
+# ^? a.b.c 2 6 377 23 -923us[ -924us] +/- 43ms
+# ^+ d.e.f 1 6 377 21 -2629us[-2619us] +/- 86ms
+#
+#
+# M indicates the mode of the source:
+# ^ means a server
+# = means a peer
+# # indicates a locally connected reference clock
+#
+# S state of the sources
+# * indicates the source to which chronyd is current synchronised.
+# + indicates other acceptable sources.
+# ? indicates sources to which connectivity has been lost.
+# x indicates a clock which chronyd thinks is is a falseticker
+# ~ indicates a source whose time appears to have too much variability. shown at start-up, until at least 3 samples have been gathered from it
+```
+
+## see also
+
+- [[chronyd]]
+- [[date]]
+- [[hwclock]]
+- https://blacksaildivision.com/ntp-centos
+- https://docs.fedoraproject.org/en-US/Fedora/18/html/System_Administrators_Guide/sect-Checking_if_chrony_is_synchronized.html
diff --git a/notes/chronyd.md b/notes/chronyd.md
new file mode 100644
index 00000000..d99d76e5
--- /dev/null
+++ b/notes/chronyd.md
@@ -0,0 +1,31 @@
+---
+tags: [linux, systemd]
+title: chronyd
+created: '2019-10-26T17:55:51.285Z'
+modified: '2023-03-23T08:45:48.486Z'
+---
+
+# chronyd
+
+> `chrony` background daemon
+
+## install
+
+```sh
+yum install chrony
+```
+
+## usage
+
+```sh
+/etc/chrony.conf # config
+
+systemctl start chronyd.service
+
+systemctl enable chronyd.service
+```
+
+## see also
+
+- [[chronyc]]
+- [[timedatectl]]
diff --git a/notes/cifs.md b/notes/cifs.md
new file mode 100644
index 00000000..a7b23dd5
--- /dev/null
+++ b/notes/cifs.md
@@ -0,0 +1,19 @@
+---
+tags: [filesystem]
+title: cifs
+created: '2019-08-23T11:02:40.863Z'
+modified: '2023-03-22T09:12:57.703Z'
+---
+
+# cifs
+
+`common internet file system` aka `smb - server message block`
+
+> operates as an application-layer or presentation-layer network protocol
+> used for shared access to files, printers, and serial ports ..
+
+## usage
+
+## see also
+
+- [[nfs]]
diff --git a/notes/clang++.md b/notes/clang++.md
new file mode 100644
index 00000000..10ebcdcc
--- /dev/null
+++ b/notes/clang++.md
@@ -0,0 +1,20 @@
+---
+tags: [c]
+title: clang++
+created: '2023-05-08T18:11:29.257Z'
+modified: '2023-05-24T08:41:43.324Z'
+---
+
+# clang++
+
+> clang...
+
+## usage
+
+```sh
+clang++ -g -Wall -o FILE FILE.cpp
+```
+
+## see also
+
+- [[c]], [[g++]]
diff --git a/notes/clang.md b/notes/clang.md
new file mode 100644
index 00000000..81fc31d9
--- /dev/null
+++ b/notes/clang.md
@@ -0,0 +1,41 @@
+---
+tags: [c, compiler]
+title: clang
+created: '2020-08-27T10:58:10.930Z'
+modified: '2023-05-13T15:14:40.334Z'
+---
+
+# clang
+
+> [[c]], [[c++]], and [[objective-c]] compiler encompassing preprocessing, parsing, optimization, code generation, assembly, and linking
+
+## option
+
+```sh
+--target=wasm32 # tells a compiler to use WebAssembly as a target for compilation.
+-03 # applies a maximum amount of optimizations
+-nostdlib # tells not to use system libraries, as they are useless in the context of a browser.
+-Wl,--no-entry # tell linker to ignore the absence of main() /no entry function
+-Wl,--export-all # tell linker to export all the c functions from the webassembly module
+```
+
+## usage
+
+```sh
+clang \
+ --target=wasm32 \
+ -O3 \
+ -nostdlib \
+ -Wl,--no-entry \
+ -Wl,--export-all \
+ -o FILE.wasm \
+ FILE.c
+```
+
+## see also
+
+- [[emcc]]
+- [[c]], [[cc]], [[c++]]
+- [[objective-c]]
+- [[wasm]]
+- [[make]]
diff --git a/notes/cmake.md b/notes/cmake.md
new file mode 100644
index 00000000..a348b323
--- /dev/null
+++ b/notes/cmake.md
@@ -0,0 +1,42 @@
+---
+tags: [buildsystem, c, linux, macos]
+title: cmake
+created: '2020-08-27T11:35:46.274Z'
+modified: '2023-05-08T11:07:28.173Z'
+---
+
+# cmake
+
+> generator of buildsystems - can produce `Makefile`, `ninja` build files, etc. from same `CMakeLists.txt`
+
+## install
+
+```sh
+brew install cmake
+```
+
+## usage
+
+```sh
+cmake -version
+
+cmake .
+```
+
+## CMakeLists.txt
+
+```txt
+cmake_minimum_required(VERSION 2.8.9)
+project (hello)
+add_executable(hello helloworld.cpp)
+```
+
+## see also
+
+- [[git]]
+- [[make]]
+- [[ninja]]
+- [[clang]]
+- [[gcc]]
+- [[rust]]
+- [stackoverflow.com/.../difference-between-using-makefile-and-cmake-to-compile-the-code](https://stackoverflow.com/questions/25789644/difference-between-using-makefile-and-cmake-to-compile-the-code/25790020)
diff --git a/notes/cmctl.md b/notes/cmctl.md
new file mode 100644
index 00000000..46761d23
--- /dev/null
+++ b/notes/cmctl.md
@@ -0,0 +1,42 @@
+---
+tags: [container]
+title: cmctl
+created: '2022-03-16T06:30:28.296Z'
+modified: '2023-03-22T10:20:49.197Z'
+---
+
+# cmctl
+
+> cli for managing `cert-manager` resources inside kubernetes
+
+## install
+
+```sh
+OS=$(go env GOOS); ARCH=$(go env GOARCH); curl -sSLO https://github.com/cert-manager/cert-manager/releases/download/v1.7.1/cmctl-$OS-$ARCH.tar.gz
+tar xzf cmctl-$OS-$ARCH.tar.gz
+sudo mv cmctl /usr/local/bin
+
+cmctl completion bash >$(brew --prefix)/etc/bash_completion.d/cmctl
+```
+
+## environment variables
+
+```sh
+```
+
+## option
+
+```sh
+```
+
+## usage
+
+```sh
+cmctl check api
+```
+
+## see also
+
+- [[kubectl]]
+- [[go]]
+- [[openssl]]
diff --git a/notes/code.md b/notes/code.md
new file mode 100644
index 00000000..e6fbcb26
--- /dev/null
+++ b/notes/code.md
@@ -0,0 +1,71 @@
+---
+tags: [editor]
+title: code
+created: '2020-08-26T06:37:28.787Z'
+modified: '2022-10-25T14:43:23.840Z'
+---
+
+# code
+
+> cli bash-wrapper staring visual studio code
+
+## option
+
+```sh
+-h --help # print usage
+-d, --diff FILE FILE # diff files
+-a, --add DIR # add to last active window
+-g, --goto # open file at path on specified line and char pos
+-n, --new-window # force open new window
+-r, --reuse-window # force open file or dir in opened window
+-w --wait # wait for the files to be closed before returning
+--locale LOCALE # locale to use e.g. en-US, zh-TW
+--user-data-dir DIR # specifies the directory that user data is kept in. Can be used to open multiple distinct instances of Code
+
+--extensions-dir DIR # Set the root path for extensions
+--list-extensions # List the installed extensions
+--show-versions # Show versions of installed extensions, when using --list-extension
+--category # Filters installed extensions by provided category, when using --list-extension
+--install-extension EXTENSION # installs or updates extension
+--uninstall-extension ID # uninstalls an extension
+--enable-proposed-api ID # enables proposed API features for extensions
+
+-v --version # Print version
+--verbose # Print verbose output (implies --wait)
+--log LEVEL # log levels: 'critical', 'error', 'warn', 'info', 'debug', 'trace', 'off'
+-s --status # print process usage and diagnostics information
+--prof-startup # Run CPU profiler during startup
+--disable-extensions # disable all installed extensions
+--disable-extension EXT_ID # disable an extension
+--sync [on|off] # turn sync on or off
+--inspect-extensions PORT # allow debugging and profiling of extensions. connection URI via developer tools
+
+--disable-gpu # disable GPU hardware acceleration
+--max-memory # Max memory size for a window (in Mbytes)
+--telemetry # Shows all telemetry events which VS code collects
+```
+
+## usage
+
+```sh
+code DIR
+
+ps aux | grep code | code - # read from stdin
+
+code --list-extensions --show-versions | column -t -s@
+```
+
+## command palette
+
+```sh
+โ + โง + p # open command palette
+
+workbench.action.reloadWindow # usefull to restart lang server etc
+```
+
+## see also
+
+- [[vim]]
+- [[idea]]
+- [[atom]]
+- [[macos keyboard shortcuts]]
diff --git a/notes/coffee.md b/notes/coffee.md
new file mode 100644
index 00000000..c44e91ee
--- /dev/null
+++ b/notes/coffee.md
@@ -0,0 +1,65 @@
+---
+tags: [compiler, javascript]
+title: coffee
+created: '2023-05-13T12:00:15.256Z'
+modified: '2023-05-19T12:49:42.109Z'
+---
+
+# coffee
+
+> execute scripts, compile `.coffee` files into `.js`, and provide a repl
+
+## install
+
+```sh
+npm install --save-dev coffeescript # locally for a project
+npm install --global coffeescript # globally to execute .coffee files anywhere
+```
+
+## option
+
+```sh
+-c, --compile # Compile a .coffee script into a .js JavaScript file of the same name
+-t, --transpile # pipe compilerโs output through Babel before saving or running the generated js
+-m, --map # generate source maps alongside the compiled JavaScript files. Adds sourceMappingURL directives to the JavaScript as well
+-M, --inline-map # just like --map, but include the source map directly in the compiled JavaScript files, rather than in a separate file
+-i, --interactive # Launch an interactive CoffeeScript session to try short snippets. Identical to calling coffee with no arguments
+-o, --output DIR # Write out all compiled JavaScript files into the specified directory. Use in conjunction with --compile or --watch
+-w, --watch # Watch files for changes, rerunning the specified command when any file is updated
+-p, --print # Instead of writing out the JavaScript as a file, print it directly to stdout
+-s, --stdio # Pipe in CoffeeScript to STDIN and get back JavaScript over STDOUT
+-l, --literate # parses code as Literate CoffeeScript. You only need to specify this when passing in code directly over stdio, or using some sort of extension-less file name
+-e, --eval # compile and print a little snippet of CoffeeScript directly from the command line
+-r, --require MODULE # require() given module before starting the REPL or evaluating the code given with the --eval flag
+-b, --bare # compile js without the top-level function safety wrapper
+--no-header # suppress header
+--nodejs # forward options directly to node executable, useful options, --debug, --debug-brk, --max-stack-size, and --expose-gc
+--ast # generate an abstract syntax tree of nodes of the CoffeeScript. Used for integrating with JavaScript build tools
+--tokens # instead of parsing the CoffeeScript, just lex it, and print out the token stream. Used for debugging the compiler
+-n, --nodes # instead of compiling the CoffeeScript, just lex and parse it, and print out the parse tree. Used for debugging the compiler
+```
+
+## usage
+
+```sh
+coffee # start repl
+
+coffee --compile --output lib/ src/ # compile a directory tree of .coffee files in src into a parallel tree of .js files in lib
+
+coffee --watch --compile experimental.coffee # watch a file for changes, and recompile it every time the file is saved
+
+coffee --join project.js --compile src/*.coffee # concatenate a list of files into a single script
+
+coffee -bpe "alert i for i in [0..10]" # print out the compiled JS from a one-liner
+
+coffee -o lib/ -cw src/ # All together now, watch and recompile an entire project as you work on it
+
+cat src/cake.coffee | coffee -sc
+
+coffee -e "console.log num for num in [10..1]"
+```
+
+## see also
+
+- [[javascript]]
+- [[coffeescript]]
diff --git a/notes/coffeescript.md b/notes/coffeescript.md
new file mode 100644
index 00000000..6d64432c
--- /dev/null
+++ b/notes/coffeescript.md
@@ -0,0 +1,32 @@
+---
+tags: [javascript]
+title: coffeescript
+created: '2023-05-13T11:57:06.368Z'
+modified: '2023-05-24T08:41:17.237Z'
+---
+
+# coffeescript
+
+> little language that compiles into [[javascript]]
+
+## install
+
+[[coffee]]
+
+## language
+
+```js
+class Animal
+ constructor: (@name, @species) ->
+
+ speak: ->
+ console.log "Hi, I'm #{@name} the #{@species}!"
+
+dog = new Animal("Buddy", "dog")
+dog.speak()
+```
+
+## see also
+
+- [[typescript]]
+- [coffeescript.org](https://coffeescript.org)
diff --git a/notes/colima.md b/notes/colima.md
new file mode 100644
index 00000000..e5afdd3d
--- /dev/null
+++ b/notes/colima.md
@@ -0,0 +1,56 @@
+---
+tags: [container, linux, macos, virtualization]
+title: colima
+created: '2023-05-30T07:23:59.486Z'
+modified: '2023-06-15T06:55:58.973Z'
+---
+
+# colima
+
+> containers in [[lim]] - container runtimes on macoss (and Linux) with minimal setup
+
+## install
+
+```sh
+brew install colima
+```
+
+## option
+
+```sh
+-h, --help # help for colima
+-p, --profile PROFILE # profile name, for multiple instances (default "default")
+-v, --verbose # enable verbose log
+ --version # version for colima
+ --very-verbose # enable more verbose log
+```
+
+## usage
+
+```sh
+colima completion # generate completion script
+colima delete # delete and teardown Colima
+colima help # help about any command
+colima kubernetes # manage Kubernetes cluster
+colima list # list instances
+colima nerdctl # run nerdctl (requires containerd runtime)
+colima restart # restart Colima
+colima ssh # SSH into the VM
+colima ssh-config # show SSH connection config
+
+colima start # start Colima
+colima start --arch x86_64 --cpu 4 --memory 16
+
+colima status # show the status of Colima
+colima stop # stop Colima
+colima template # edit the template for default configurations
+colima version # print the version of Colima
+```
+
+## see also
+
+- [[lima]]
+- [[qemu]]
+- [[docker]]
+- [[nerdctl]]
+- [github.com/abiosoft/colima](https://github.com/abiosoft/colima)
diff --git a/notes/colordiff.md b/notes/colordiff.md
new file mode 100644
index 00000000..022ae37b
--- /dev/null
+++ b/notes/colordiff.md
@@ -0,0 +1,24 @@
+---
+tags: [linux, macos]
+title: colordiff
+created: '2021-03-15T10:32:24.153Z'
+modified: '2023-03-24T08:27:43.255Z'
+---
+
+# colordiff
+
+## install
+
+```sh
+brew install colordiff
+```
+
+## usage
+
+```sh
+colordiff FILE1 FILE"
+```
+
+## see also
+
+- [[diff]]
diff --git a/notes/column.md b/notes/column.md
new file mode 100644
index 00000000..a5f03cc9
--- /dev/null
+++ b/notes/column.md
@@ -0,0 +1,36 @@
+---
+tags: [bsdmainutils]
+title: column
+created: '2020-07-27T11:16:40.585Z'
+modified: '2022-05-30T06:34:02.410Z'
+---
+
+# column
+
+> columnate lists
+
+## option
+
+```sh
+-s # characters to be used to delimit columns for the -t option (default: delimited with whitespace)
+-t # determine number of columns the input contains and create a table
+-c # output is formatted for a display columns wide
+-x # fill columns before filling rows
+```
+
+## usage
+
+```sh
+column FILE -t -s "|" # file containers lines like "foo|bar|baz"
+
+column -s, -t # delimiter ,
+
+CMD | column -t
+```
+
+## see also
+
+- [[mount]]
+- [[tput]]
+- [[sort]]
+- [[awk]]
diff --git a/notes/php composer.md b/notes/composer.md
similarity index 50%
rename from notes/php composer.md
rename to notes/composer.md
index 46020116..915dc922 100644
--- a/notes/php composer.md
+++ b/notes/composer.md
@@ -1,17 +1,19 @@
---
-tags: [lang/php]
-title: php composer
+tags: [php]
+title: composer
created: '2019-07-30T06:19:49.206Z'
-modified: '2019-07-30T08:04:18.070Z'
+modified: '2022-02-01T14:34:21.495Z'
---
-# php composer
+# composer
+
+> dependency manager for php
## install
-```sh
-curl -sS https://getcomposer.org/installer | php
-```
+`curl -sS https://getcomposer.org/installer | php`
+
+## usage
```sh
composer require vendor-name/package-name
@@ -24,3 +26,8 @@ composer update --lock
composer dump-autoload --optimize
```
+
+## see also
+
+- [[php]]
+- [[bundle]]
diff --git a/notes/consul.md b/notes/consul.md
new file mode 100644
index 00000000..25f0086f
--- /dev/null
+++ b/notes/consul.md
@@ -0,0 +1,62 @@
+---
+tags: [iac]
+title: consul
+created: '2019-08-28T09:45:08.570Z'
+modified: '2023-03-23T08:43:35.067Z'
+---
+
+# consul
+
+> consul is controlled via cli which takes a subcommand (`agent`, `members`..)
+
+## usage
+
+```sh
+consul catalog nodes -http-addr=host # working against remove consul-cluster
+
+consul catalog nodes -service=swarm-a -detailed
+
+
+consul services deregister -id=SERVICEID # find out service-id via curl api
+
+
+consul watch -type=service -service=
+
+consul watch -type=service -service=service
+
+
+
+consul operator raft list-peers
+
+
+consul members -http-addr=HOST
+
+consul force-leave -http-addr=HOST MEMBER # remove member
+
+consul members -status=left -http-addr=HOST # get left members
+
+
+consul kv get -keys
+
+consul kv get -http-addr=consul.foo.bar -recurse openstorage
+
+consul kv get openstorage/cluster/database | jq
+
+
+consul kv put footest @file.json # from file
+
+cat < "bundling up dependecies so we can ship code in a repeatable and secure way" - definition
+
+- isolated process
+- namespaces
+- cgroups
+- layered FS
+
+### namespaces
+
+> Isolation - what can we see ?
+
+- pid
+- mnt ("pivot_root"/ chroot)
+- net
+- UTS (=`Unix Time Shairing`: hostname, domainname)
+- IPC (message queues)
+- user
+
+
+### cgroups
+
+> resource sharing
+
+- limit sets of `procs` and `taskids` enforce resource sharing
+- `/sys/fs/cgroup`
+
+## see also
+
+- [[containerd]]
+- [[docker]]
+- [[cgroup]]
+- [[linuxkit]]
+- [[runc]]
+- [[procps]]
+- [[java]]
diff --git a/notes/containerd.md b/notes/containerd.md
new file mode 100644
index 00000000..f27b6c29
--- /dev/null
+++ b/notes/containerd.md
@@ -0,0 +1,55 @@
+---
+tags: [container]
+title: containerd
+created: '2020-03-12T13:44:44.636Z'
+modified: '2023-03-15T09:49:34.996Z'
+---
+
+# containerd
+
+> container runtime with an emphasis on simplicity, robustness and portability
+
+## install
+
+```sh
+wget https://github.com/containerd/containerd/archive/v1.3.2.zip && unzip v1.3.2.zip
+```
+
+## usage
+
+```sh
+containerd config default > /etc/containerd/config.toml # genrate default config
+```
+
+GPRC General Remote Procedure Call
+CNCF Cloud Native Computing Foundation
+"rich-client"-model
+
+```
++---------------------------------------------------------+
+| docker architecture |
++----------------+--------------+-----------------+-------+
+| docker | containerd | containerd-shim | runc |
+| engine/daemon | | | |
++----------------+--------------+-----------------+-------+
+
+ cli
+ v
+ docker engine/daemon
+ v
+ containerd
+ |
+ +-------+--------+
+ v v v
+ shim shim shim
+ runc runc runc
+```
+
+## see also
+
+- [[zip]]
+- [[ctr]]
+- [[docker]]
+- [[nerdctl]]
+- [[container]]
+- [containerd.io/docs/getting-started](https://containerd.io/docs/getting-started/)
diff --git a/notes/coreutils.md b/notes/coreutils.md
new file mode 100644
index 00000000..72a72e76
--- /dev/null
+++ b/notes/coreutils.md
@@ -0,0 +1,88 @@
+---
+tags: [coreutils]
+title: coreutils
+created: '2020-09-01T07:42:52.948Z'
+modified: '2023-05-15T13:05:34.885Z'
+---
+
+# coreutils
+
+> basic file, shell, and text manipulation utilities of the gnu operating system
+
+[[numfmt]] - see [[crane]]
+
+
+## install
+
+```sh
+brew install coreutils
+```
+
+## commonly used tools provided by this package include
+
+- [[chmod]] - changes file modes/permissions
+- [[chown]] - change file owner and group ownership
+- [[chroot]] - Changes the root directory
+- [[cp]] - copy files and directories
+- [[dd]] - copies and converts a file
+- [[df]] - shows disk free space on filesystems
+- [[du]] - shows disk usage on filesystems
+- [[ln]] - creates file links
+- [[ls]] - list directory contents
+- [[mkdir]] - create directories
+- [[mv]] - move/rename files
+- [[rm]] - remove/deletes files
+- [[rmdir]] - remove empty directories
+- [[touch]] - changes file timestamps or create empty files
+
+## text/shell utilities
+
+- [[\[\[]] or [[test]] - Check file types and compare values
+- [[basename]] - strip directory and suffix from filenames
+- [[cat]] - print (and concatenate) files to the standard output
+- [[comm]] - compare two sorted files line by line
+- [[cut]] - remove sections from each line of files
+- [[dirname]] - Removes the last level or filename from a given pathname
+- [[echo]] - Prints a line of text
+- [[expand unexpand]] - convert tabs to/from spaces
+- [[false]] - Returns an unsuccessful exit status
+- [[fmt]] - simple optimal text formatter
+- [[fold]] - wrap each input line to fit in specified width
+- [[head]] - output the first part of files
+- [[join]] - join lines of two files on a common field
+- [[md5sum]] - compute and check MD5 message digest
+- [[paste]] - merge lines of files
+- [[pr]] - convert text files for printing
+- [[seq]] - Print numeric sequences
+- [[sleep]] - Suspends execution for a specified time
+- [[sort]] - sort lines of text files
+- [[split]] - split a file into pieces
+- [[tail]] - output the last part of files
+- [[tee]] - Sends output to multiple files
+- [[tr]] - translate or delete characters
+- [[true]] - Returns a successful exit status
+- [[uniq]] - remove duplicate lines from a sorted file
+- [[wc]] - print the number of bytes, words, and lines in files
+- [[yes]] - Print a string repeatedly
+
+## system utilities
+
+- [[date]] - Prints/sets the system date and time
+- [[env]] - Displays/modifies the environment
+- [[groups]] - Print the groups that the user is a member of
+- [[hostname]] - Print or set the machine name
+- [[id]] - Print real/effective uid/gid
+- [[nice]] - Modify scheduling priority
+- [[pwd]] - Print the current working directory
+- [[su]] - Allows you to adopt the id of another user or superuser (see also sudo)
+- [[uname]] - Print system information
+- [[who]] - Print a list of all users currently logged in
+- [[whoami]] - Print effective user id
+
+## see also
+
+- [[bsdmainutils]]
+- [[moreutils]]
+- [[procps]]
+- [[net-tools]]
+- [wiki.debian.org/coreutils](https://wiki.debian.org/coreutils)
diff --git a/notes/cosign.md b/notes/cosign.md
new file mode 100644
index 00000000..59fe46ad
--- /dev/null
+++ b/notes/cosign.md
@@ -0,0 +1,46 @@
+---
+tags: [container, crypto, linux, macos]
+title: cosign
+created: '2023-07-04T11:18:58.179Z'
+modified: '2023-07-19T11:19:31.595Z'
+---
+
+# cosign
+
+> securely sign artifacts (release files, container images, binaries, bill of material manifests..)
+> signing materials are then stored in a tamper-resistant public log
+
+## install
+
+```sh
+brew install cosign
+```
+
+## env
+
+```sh
+COSIGN_PASSWORD
+```
+
+## usage
+
+```sh
+cosign sign-blob FILE --output-signature FILE --output-certificate FILE # sign a blob with google sign-in (experimental)
+
+cosign sign-blob --key cosign.key FILE # sign a blob with a local key pair file
+
+cosign sign-blob --key awskms://[ENDPOINT]/[ID/ALIAS/ARN] FILE # sign a blob with a key pair stored in aws kms
+
+cosign sign-blob --key gcpkms://projects/[PROJECT]/locations/global/keyRings/[KEYRING]/cryptoKeys/[KEY] FILE # sign a blob with a key pair stored in Google Cloud KMS
+
+cosign sign-blob --key hashivault://[KEY] FILE # sign a blob with a key pair stored in Hashicorp Vault
+```
+
+## see also
+
+- [[docker]]
+- [[crane]]
+- [[gpg]]
+- [[vault]]
+- [[openssl]]
+- [[uuidgen]]
diff --git a/notes/cp.md b/notes/cp.md
new file mode 100644
index 00000000..74f18822
--- /dev/null
+++ b/notes/cp.md
@@ -0,0 +1,40 @@
+---
+tags: [coreutils, macos]
+title: cp
+created: '2020-08-03T12:02:25.389Z'
+modified: '2022-04-09T09:35:41.742Z'
+---
+
+# cp
+
+> copy files
+
+## option
+
+```sh
+-n # do not overwrite existing file, overrides any previous -f or -i
+
+-l # create hard links to regular files in a hierarchy instead of copying
+
+-R # if source designates a dir, it copies the directory and the entire subtree connected at that point
+ # if source ends in /, contents of the directory are copied rather than the directory, symbolic links are copied
+```
+
+## usage
+
+```sh
+cp foo bar # make a copy of file foo named bar
+
+cp *.txt /tmp # copy group of files to dir
+
+cp -R DIR /tmp # copy the dir (including subdirectories) to the /tmp dir
+
+cp --update SOURCE DEST # copy only when the SOURCE file is newer than the DEST file or when the DEST file is missing
+```
+
+## see also
+
+- [[ln]]
+- [[mv]]
+- [[pbcopy pbpaste]]
+- [[rsync]]
diff --git a/notes/cpan.md b/notes/cpan.md
new file mode 100644
index 00000000..61661b5d
--- /dev/null
+++ b/notes/cpan.md
@@ -0,0 +1,18 @@
+---
+tags: [packagemanager]
+title: cpan
+created: '2020-03-18T15:00:40.335Z'
+modified: '2020-09-02T17:29:42.347Z'
+---
+
+# cpan
+
+> easily interact with CPAN from the command line - `Comprehensive Perl Archive Network`
+
+## usage
+```sh
+cpan -l # list modules
+```
+
+## see also
+- [[perl]]
diff --git a/notes/cpio.md b/notes/cpio.md
new file mode 100644
index 00000000..4453ebb2
--- /dev/null
+++ b/notes/cpio.md
@@ -0,0 +1,30 @@
+---
+tags: [macos]
+title: cpio
+created: '2023-05-17T07:50:35.672Z'
+modified: '2023-05-17T07:52:46.444Z'
+---
+
+# cpio
+
+> copy files to and from archives
+
+## option
+
+```sh
+-i # input - Read an archive from standard input (unless overridden) and extract the contents to disk or (if the -t option is specified) list the contents to standard output
+-o # output - Read a list of filenames from standard input and produce a new archive on standard output (unless overridden) containing the specified items
+-p # pass-through - Read a list of filenames from standard input and copy the files to the specified directory
+```
+
+## usage
+
+```sh
+cat Payload | gunzip -dc | cpio -i
+```
+
+## see also
+
+- [[xar]]
+- [[gunzip]]
+- [[installer]]
diff --git a/notes/crane.md b/notes/crane.md
new file mode 100644
index 00000000..060527e6
--- /dev/null
+++ b/notes/crane.md
@@ -0,0 +1,55 @@
+---
+tags: [container]
+title: crane
+created: '2021-10-19T11:44:42.215Z'
+modified: '2023-07-04T11:27:50.870Z'
+---
+
+# crane
+
+> tool for interacting with remote images and registries
+
+## install
+
+```sh
+brew install crane
+```
+
+## usage
+
+```sh
+crane export ubuntu - | tar -tvf - | less # List files in an image
+
+crane export ubuntu - | tar -Oxf - etc/passwd # Extract a single file from an image
+ # Note: Be sure to remove the leading `/` from the path (not `/etc/passwd`). This behavior will not follow symlinks.
+
+crane append -f <(tar -f - -c some-dir/) -t IMAGE # Bundle directory contents into an image
+ # default: produces an image with one layer containing the directory contents.
+ # Add `-b ${BASE_IMAGE}` to append the layer to a base image instead.
+
+crane mutate IMAGE --entrypoint=some-dir/entrypoint.sh # make an executable in the appended layer the image's entrypoint.
+
+# because `crane append` emits the full image reference, these calls can even be chained together:
+# will bundle `SOME_DIR/` into an image, push it, mutate its entrypoint to `SOME_DIR/entrypoint.sh`, and push that new image by digest
+crane mutate $(crane append -f <(tar -f - -c SOME_DIR/) -t IMAGE) --entrypoint=SOME_DIR/entrypoint.sh
+
+
+diff <(crane config busybox:1.32 | jq) <(crane config busybox:1.33 | jq) # diff two configs
+diff <(crane manifest busybox:1.32 | jq) <(crane manifest busybox:1.33 | jq) # diff two manifests
+
+
+crane manifest gcr.io/buildpacks/builder:v1 | jq '.config.size + ([.layers[].size] | add)' # get total image size
+crane manifest gcr.io/buildpacks/builder:v1 | jq '.config.size + ([.layers[].size] | add)' | numfmt --to=iec # make human-readable by passing to numfmt
+
+
+crane digest IMAGE
+```
+
+## see also
+
+- [[skopeo]]
+- [[coreutils]]
+- [[cosign]]
+- [[jq]]
+- [github.com/google/go-containerregistry/crane/README.md](https://github.com/google/go-containerregistry/blob/main/cmd/crane/README.md)
+- [github.com/google/go-containerregistry/crane/recipes.md](https://github.com/google/go-containerregistry/blob/main/cmd/crane/recipes.md)
diff --git a/notes/crc.md b/notes/crc.md
new file mode 100644
index 00000000..37885e33
--- /dev/null
+++ b/notes/crc.md
@@ -0,0 +1,58 @@
+---
+tags: [container]
+title: crc
+created: '2023-03-13T11:11:53.909Z'
+modified: '2023-05-17T08:00:54.634Z'
+---
+
+# crc
+
+> `C`ode`R`eady`C`ontainers - tool that manages a local OpenShift 4.x cluster
+
+## install
+
+```sh
+curl -LO https://developers.redhat.com/content-gateway/file/pub/openshift-v4/clients/crc/2.18.0/crc-macos-installer.pkg
+installer -pkg crc-macos-installer.pkg -target /
+```
+
+## option
+
+```sh
+-h, --help # help for crc
+ --log-level string # log level [debug | info | warn | error]
+```
+
+## usage
+
+```sh
+crc setup # set up your host operating system for the OpenShift Local virtual machine
+
+crc start # create a minimal OpenShift 4 cluster locally
+
+crc bundle # Manage CRC bundles
+crc cleanup # Undo config changes
+crc completion # Generate the autocompletion script for the specified shell
+crc config # Modify crc configuration
+crc console # Open the OpenShift Web Console in the default browser
+crc delete # Delete the instance
+crc help # Help about any command
+crc ip # Get IP address of the running OpenShift cluster
+crc oc-env # Add the 'oc' executable to PATH
+crc podman-env # Setup podman environment
+crc status # Display status of the OpenShift cluster
+crc stop # Stop the instance
+crc version # print version information
+```
+
+## see also
+
+- [[oc]]
+- [[istioctl]]
+- [[podman]]
+- [[helm]]
+- [[kubectl]]
+- [[minikube]]
+- [[installer]]
+- [github.com/crc-org/crc](https://github.com/crc-org/crc)
+- [github.com/crc-org/crc/wiki/Debugging-guide](https://github.com/crc-org/crc/wiki/Debugging-guide)
diff --git a/notes/crictl.md b/notes/crictl.md
new file mode 100644
index 00000000..1551e846
--- /dev/null
+++ b/notes/crictl.md
@@ -0,0 +1,34 @@
+---
+tags: [container]
+title: crictl
+created: '2021-05-27T09:57:46.096Z'
+modified: '2023-05-30T07:25:29.582Z'
+---
+
+# crictl
+
+> `cri-o` - cli for CRI-compatible container runtimes
+
+## install
+
+```sh
+dnf install cri-tools
+```
+
+## usage
+
+```sh
+crictl start CONTAINER_ID
+
+crictl inspect CONTAINER_ID
+```
+
+## see also
+
+- [[docker]], [[podman]]
+- [[ctr]]
+- [[kubectl]]
+- [[skopeo]]
+- [[buildah]]
+- [cri-o.io](https://cri-o.io/)
+- [github.com/cri-o/tutorials/crictl](https://github.com/cri-o/cri-o/blob/master/tutorials/crictl.md)
diff --git a/notes/crond.md b/notes/crond.md
new file mode 100644
index 00000000..06075dc7
--- /dev/null
+++ b/notes/crond.md
@@ -0,0 +1,19 @@
+---
+tags: [linux]
+title: crond
+created: '2020-01-24T08:58:21.997Z'
+modified: '2020-09-02T17:51:21.611Z'
+---
+
+# crond
+
+> daemon to execute scheduled commands
+
+## usage
+```sh
+crond -L /var/lib/boot2docker/log/crond.log # busybox boot2docker log to file
+```
+## see also
+- [[crontab]]
+- [[busybox]]
+- [[systemd]]
diff --git a/notes/crontab.md b/notes/crontab.md
new file mode 100644
index 00000000..36c10a46
--- /dev/null
+++ b/notes/crontab.md
@@ -0,0 +1,57 @@
+---
+tags: [linux]
+title: crontab
+created: '2019-07-30T06:19:49.031Z'
+modified: '2020-09-01T12:56:04.468Z'
+---
+
+# crontab
+
+> maintains crontab files for individual users
+
+## usage
+```sh
+crontab FILE # install crontab from FILE or stdin if the pseudo-filename `-' is given
+
+crontab -e # edit or create crontab file: /var/spool/cron/crontabs/USER
+
+crontab -r # remove your crontab file.
+
+crontab -v # display the last time you edited your crontab file. (This option is only available on a few systems.)
+
+crontab -l # crontab list of cronjobs , display crontab file contents.
+
+crontab -u $USER -l # find out which user has a crontab; see also /var/spool/cron/crontabs
+
+crontab -l | tee >(head -n1) | grep "^[^#;]" # show only active jobs
+
+# log files
+/var/lib/boot2docker/log/crond.log # boot2docker
+/var/spool/cron/crontabs/USER # location of cron files for individual users
+
+# example crontab file
+# .--------------------------- minute (0 - 59)
+# | .--------------------- hour (0 - 23)
+# | | .--------------- day of month (1 - 31)
+# | | | .--------- month (1 - 12) OR jan,feb,mar,apr ...
+# | | | | .--- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
+# | | | | |
+# * * * * * USER CMD
+#
+# * * * * * CMD # every minute; cron has a 60 sec granularity and can't go lower !
+# */10 * * * * CMD # every 10th minute
+# 00 * * * * CMD # every hour
+# 0 22 * * 1-5 CMD # at 22:00 on every day-of-week from Monday through Friday
+#
+# 30 18 * * * rm /path/dir/* > /cronlogs/file.log # cron execution log
+# 0 9 * * * USER [ -x /usr/lib/mailman/cron/disabled ] && /usr/lib/mailman/cron/disabled
+```
+
+## see also
+
+- [[crond]]
+- [[tree]]
+- [[bash process substitution]]
+- [[bash eval]]
+- [crontab.guru](https://crontab.guru/)
+- [Location of the crontab file](http://unix.stackexchange.com/a/196010)
diff --git a/notes/cryptsetup.md b/notes/cryptsetup.md
new file mode 100644
index 00000000..839dd970
--- /dev/null
+++ b/notes/cryptsetup.md
@@ -0,0 +1,42 @@
+---
+tags: [crypto]
+title: cryptsetup
+created: '2020-01-20T19:52:26.328Z'
+modified: '2023-03-24T08:19:13.979Z'
+---
+
+# cryptsetup
+
+> utility used to conveniently set up disk encryption based on the DMCrypt kernel module
+
+## install
+
+```sh
+apt-get install cryptsetup
+yum install cryptsetup-luks
+```
+
+## usage
+
+```sh
+cryptsetup -v my_disk_mapper # doesnt work ?!
+
+cryptsetup luksFormat -c aes-cbc-essiv:sha256 -s 256 /dev/sdc1
+
+cryptsetup luksOpen /dev/sda my_disk_mapper
+
+cryptsetup luksOpen -d /etc/.crypto/cr_crypto.keyfile /dev/sdc1 cr_crypto # use keyfile
+
+cryptsetup luksClose /dev/mapper/my_disk_mapper
+
+cryptsetup luksDump /dev/xvdc # dump LUKS headers
+```
+
+## see also
+
+- [[mount]]
+- [[fdisk]]
+- [[dd]]
+- [medium.com/@amritanshu16/how-to-mount-luks-encrypted-disk-in-raspbian](https://medium.com/@amritanshu16/how-to-mount-luks-encrypted-disk-in-raspbian-821b0a56c18e)
+- [linuxwiki.de/cryptsetup](https://linuxwiki.de/cryptsetup)
+- [cyberciti.biz/security/howto-linux-hard-disk-encryption-with-luks-cryptsetup-command/](https://www.cyberciti.biz/security/howto-linux-hard-disk-encryption-with-luks-cryptsetup-command/)
diff --git a/notes/ctr.md b/notes/ctr.md
new file mode 100644
index 00000000..d2c08832
--- /dev/null
+++ b/notes/ctr.md
@@ -0,0 +1,30 @@
+---
+tags: [container]
+title: ctr
+created: '2020-03-12T13:48:00.174Z'
+modified: '2022-01-27T09:45:28.586Z'
+---
+
+# ctr
+
+> default cli named ctr based on the GRPC api - create and manage containers run with containerd
+
+## usage
+
+```sh
+ctr --help # very helpful
+
+ctr tasks ls # list current running services
+
+ctr containers start redis /containers/redis
+
+ctr events # get events
+```
+
+## see also
+
+- [github.com/projectatomic/containerd/cli](https://github.com/projectatomic/containerd/blob/master/docs/cli.md)
+- [[containerd]]
+- [[linuxkit]]
+- [[docker]]
+- [[crictl]]
diff --git a/notes/curator.md b/notes/curator.md
new file mode 100644
index 00000000..cf0c379c
--- /dev/null
+++ b/notes/curator.md
@@ -0,0 +1,50 @@
+---
+tags: [elasticsearch]
+title: curator
+created: '2019-09-19T08:01:33.456Z'
+modified: '2022-11-23T11:23:24.017Z'
+---
+
+# curator
+
+> `curator`,`curator_cli` and `es_repo_mgr`
+
+## install
+
+```sh
+pip install elasticsearch-curator
+```
+
+## usage
+
+```sh
+~/.curator/.curator.yml # config
+
+curator [--config CONFIG.YML] [--dry-run] ACTION_FILE.YML
+```
+
+## curator_cli
+
+```sh
+curator_cli show_indices --filter_list '{"filtertype":"pattern","kind":"prefix","value":"myindex"}'
+```
+
+## es_repo_mgr
+
+> snapshot repository manager for Elasticsearch curator
+
+```sh
+es_repo_mgr show
+
+es_repo_mgr --config .curator/config.yml create fs --help
+es_repo_mgr create fs --repository es_snapshot_name --location es_snapshot_path --compression true
+es_repo_mgr --config .curator/config.yml create fs --repository filebeat_backup --location /bkp --compression True --skip_repo_fs_check True
+
+es_repo_mgr delete
+```
+
+## see also
+
+- [[pip]]
+- [[elasticsearch api]]
+
diff --git a/notes/curl.md b/notes/curl.md
index c351474c..4f87a2f1 100644
--- a/notes/curl.md
+++ b/notes/curl.md
@@ -1,140 +1,153 @@
---
-tags: [bash, heredoc, linux/network]
+tags: [linux, network]
title: curl
created: '2019-07-30T06:19:49.032Z'
-modified: '2019-08-02T06:57:15.223Z'
+modified: '2023-04-21T07:24:28.378Z'
---
# curl
+> `"c"-url` - transfer a url
+
+## install
+
+```sh
+brew install curl
+```
+
+## env
+
```sh
-curl -O url # write output to a local file named
+CURL_HOME
+```
+
+## config
-curl -LO githuburl # redo the request on the new place/redirect
+```sh
+cat < ~/.curlrc
+progress-bar
+-w "\n"
+EOF
+```
-curl -o filename url # write output to a local file named
+## option
-curl -s url # --silent
+```sh
+-O # write output to a file named like original
+-o filename # write output to a file named filename
+--remote-name-all
+--compressed # automatically decompress the content
-curl --data "param1=value1¶m2=value2" http://hostname/resource
+-L # redo the request on the new place/redirect
+-s, --silent # silent
-curl --form "fileupload=@filename.txt" http://hostname/resource
+-H 'Host: foo.com' # set Host-Header
+-w, --write-out #
-curl -XPOST -d @filename http://hostname/resource
+-v, -vv, -vvv # verbose level
+--trace-ascii FILE # enables full trace dump of all incoming and outgoing data
+ # overrides --trace and -v, --verbose.
+--trace FILE # full trace dump of all incoming and outgoing data
```
-## data heredoc
+## usage
+
```sh
-curl -0 -v -XPOST \
- http://www.example.com/api/users \
- -d @- << EOF
-{
- "field1": "test"
-}
+curl -vv telnet://127.0.0.1:7878 # send data via telnet
+
+curl -v -XOPTIONS URL # check for CORS - if headers Access-Control-Allow-{Headers,Methods,Origin} are present
+curl -s -H "Origin: http://localhost" -v HOST 2>&1 | grep access # check access-* headers
+
+curl -XGET --data "param1=val1¶m2=val2" "http://HOST/resource" # sending data via GET
+
+curl -XGET --form "fileupload=@FILENAME" "http://HOST/resource" # sending data via GET
+
+curl -XPOST "URL" -d @FILENAME # sending data via POST and filenamedescriptor
+
+# format json data und let curl use data from STDIN
+jq --null-input --arg yaml "$(/dev/null \
- | grep dns
-```
-[curl and HTTP 1.1 keepalive test traffic](http://lzone.de/blog/curl+and+HTTP+1.1+keepalive+test+traffic)
-
-## curl-formatting
-```sh
-for i in {1..20}; do \
- # mesure-time
- curl -s -w "%{time_total}\n" -o /dev/null http://stage.domain.com; \
-done
-curl -o /dev/null -s -w %{time_connect}:%{time_starttransfer}:%{time_total} $URL
-```
-```sh
-timmelookup: %{time_namelookup}\n
-time_connect: %{time_connect}\n
-time_appconnect: %{time_appconnect}\n
-time_pretransfer: %{time_pretransfer}\n
-time_redirect: %{time_redirect}\n
-time_starttransfer: %{time_starttransfer}\n
------------------------------------------\n
-time_total: %{time_total}\n
+ --keepalive -K <(printf 'url="https://example.com/"\n%.0s' {1..10000}) 2>/dev/null
+
+# mesure time
+for i in {1..20}; do curl -s -w "%{time_total}\n" -o /dev/null URL; done
+curl -o /dev/null -s -w "%{time_connect}:%{time_starttransfer}:%{time_total}" URL
+
+
+# "poor-mans-keep-alive"
+nc -l 8080 # seperate sessions
+curl HOST localhost:8080 # "trick" curl to keep the first connection open
```
-## extracting from wikipedia
+## dict protocol - aliases
+
```sh
-curl -sS "https://en.wikipedia.org/wiki/List_of_Olympic_medalists_in_judo?action=raw" \
- | grep -Eoi "flagIOCmedalist\|\[\[(.+)\]\]" \
- | cut -c"19-" | cut -d \] -f 1 | cut -d \| -f 2 | sort | uniq -c | sort -nr # extracting-data-from-wikipedia
+curl dict://dict.org/m:curl # m match and find
+curl dict://dict.org/d:heisenbug:jargon # d define and lookup
+curl dict://dict.org/find:curl
+
+# Commands that break the URL description of the RFC (but not the DICT protocol) are
+curl dict://dict.org/show:db
+curl dict://dict.org/show:strat
```
-[Extracting data from Wikipedia using curl, grep, cut and other shell commands | Loige](http://loige.co/extracting-data-from-wikipedia-using-curl-grep-cut-and-other-bash-commands)
-## cache
+## gopher
```sh
-curl -H 'Cache-Control: no-cache' --url "http://www.example.com"
-
-curl --url "http://www.example.com?$(date +%s)"
+curl gopher://gopherddit.com
```
-[linux - Curl command without using cache - Stack Overflow](https://stackoverflow.com/questions/31653271/curl-command-without-using-cache)
+## see also
+
+- [[nc]]
+- [[wget]]
+- [[telnet]]
+- [[xargs]]
+- [[bash exec]]
+- [[bash echo]]
+- [everything.curl.dev](https://everything.curl.dev/)
+- [curl and HTTP 1.1 keepalive test traffic](http://lzone.de/blog/curl+and+HTTP+1.1+keepalive+test+traffic)
+- [loige.co/extracting-data-from-wikipedia](http://loige.co/extracting-data-from-wikipedia-using-curl-grep-cut-and-other-bash-commands)
+- [stackoverflow.com/curl-command-without-using-cache](https://stackoverflow.com/questions/31653271/curl-command-without-using-cache)
diff --git a/notes/cut.md b/notes/cut.md
new file mode 100644
index 00000000..bd3fee0b
--- /dev/null
+++ b/notes/cut.md
@@ -0,0 +1,31 @@
+---
+tags: [coreutils]
+title: cut
+created: '2020-01-26T16:58:23.384Z'
+modified: '2022-01-31T14:00:39.838Z'
+---
+
+# cut
+
+> remove sections from each line of files
+
+## usage
+
+```sh
+-d, --delimiter=DELIM # use DELIM instead of TAB for field delimiter
+-f, --fields=LIST # select only these fields;
+ # also print any line that contains no delimiter character,
+ # unless the -s option is specified
+-s, --only-delimited # do not print lines not containing delimiters
+```
+
+```sh
+cut -d ' ' -f 6-
+```
+
+## see also
+
+- [[tr]]
+- [[cut]]
+- [[awk]]
+- [[bash eval]]
diff --git a/notes/dart.md b/notes/dart.md
new file mode 100644
index 00000000..e5218e60
--- /dev/null
+++ b/notes/dart.md
@@ -0,0 +1,42 @@
+---
+tags: [compiler, dart]
+title: dart
+created: '2023-05-12T08:08:04.263Z'
+modified: '2023-05-13T15:14:29.542Z'
+---
+
+# dart
+
+> client-optimized language for developing multi-platform apps
+
+- type safe, static type checking
+- sound null safety, values can't be null, unless required
+- dartvm offers a jit-compiler with incremental recompilation (enabling hot reload)
+- dart aot-compiler can compile to native ARM or x64 machine code
+
+## install
+
+```sh
+brew tap dart-lang/dart
+brew install dart
+```
+
+## install
+
+```sh
+dart create -t console cli # create project using console template
+
+dart analyze
+
+dart test
+
+dart run # run programm
+
+dart pub get # download dependencies after adding
+
+dart compile exe bin/cli.dart # compile to binary
+```
+
+## see also
+
+- [dart.dev/overview](https://dart.dev/overview)
diff --git a/notes/dash.md b/notes/dash.md
new file mode 100644
index 00000000..7bbe4723
--- /dev/null
+++ b/notes/dash.md
@@ -0,0 +1,28 @@
+---
+tags: [shell]
+title: dash
+created: '2021-05-12T08:47:27.799Z'
+modified: '2023-03-22T09:23:46.764Z'
+---
+
+# dash
+
+> `dash` โ command interpreter shell
+
+> `debian almquist shell` a modern posix-compliant implementation of bourne shell `sh`
+> `dash` is not `bash` compatible, but `bash` tries to be mostly compatible with POSIX, and thus `dash`
+> main benefits are speed of execution and use of very limited resources
+
+## usage
+
+```sh
+echo $0 # print current shell
+```
+
+## see also
+
+- [[bash]], [[ash]], [[zsh]]
+- [wiki.archlinux.org/Dash](https://wiki.archlinux.org/title/Dash)
+- [wiki.ubuntu.com/DashAsBinSh](https://wiki.ubuntu.com/DashAsBinSh)
+- [man7.org/linux/man-pages/man1/dash](https://man7.org/linux/man-pages/man1/dash.1.html)
+
diff --git a/notes/date.md b/notes/date.md
index ce7fa0a6..c59e0280 100644
--- a/notes/date.md
+++ b/notes/date.md
@@ -1,38 +1,71 @@
---
-tags: [bash]
+tags: [coreutils]
title: date
created: '2019-07-30T06:19:49.033Z'
-modified: '2019-07-30T14:03:19.330Z'
+modified: '2023-05-15T13:06:55.706Z'
---
# date
-```sh
-man strftime
- # %F is equivalent to ``%Y-%m-%d''.
- # %k is replaced by the hour (24-hour clock) as a decimal number (0-23); single digits are preceded by a blank.
-```
+> print or set the system date and time
+
+## install
```sh
-date -v -11d # subtract 11 days from current date
+brew install coreutils
```
-## formatting
+## option
+
```sh
-date +"%m-%d-%y_%H-%M"
+-u, --utc, --universal # print or set UTC (=Coordinated Universal Time)
```
-## convert UTC
+## string format
```sh
-# convert a local time to UTC
-date -u -d "$(date -d "8am")"
+man strftime
+
+%a # weekday Mon
+%A # weekday Monday
-# a UTC time to local
-date -d "$(date -u -d "10am")"
+%F # is equivalent to "%Y-%m-%d"
+%k # is replaced by the 24-hour as decimal number (0-23); single digits are preceded by a blank
+
+%s # unix timestamp
```
-## convert unix timestamp
+## usage
+
```sh
-date -r 1563533492792
+date "+%s" # get unix timestamp
+date "+%F_%T" # 2020-01-30_13:16:52
+date "+%F_%H-%M" # 2020-01-30_13-16
+date +"%m-%d-%y_%H-%M" # month day year, hour minute
+
+date -r "1563533492792" # convert unix timestamp on bsd/macos
+gdate -d "@1563533492792" # convert unix timestamp on linux
+
+date -u -d "$(date -d "8am")" # convert local time to UTC
+
+date -d "$(date -u -d "10am")" # convert UTC time to local
+
+date -v -11d # subtract 11 days from current date on bsd/macos
+
+gdate -I -d "2019-01-01 + 1 day" # add 1 day to date
+gdate -d "$(gdate +%F) + 1 day" +%F # add 1 day
+for i in {1..5}; do mkdir $(gdate -d "$(gdate +%F) + $i day" +%F_%a); done
+
+gdate -d "2019-01-01" +%A # get short weekday from date
+
+# calculate days difference
+echo "$(( ( $(gdate "+%s") - $(gdate -d "2020-10-13T08:30:10+00:00" "+%s") )/(60*60*24) ))"
```
+
+## see also
+
+- [[coreutils]]
+- [[cal]]
+- [[strftime]]
+- [[hwclock]]
+- [[timedatectl]]
diff --git a/notes/dd.md b/notes/dd.md
new file mode 100644
index 00000000..eaa5fb2d
--- /dev/null
+++ b/notes/dd.md
@@ -0,0 +1,47 @@
+---
+tags: [coreutils, macos]
+title: dd
+created: '2019-07-30T06:19:49.033Z'
+modified: '2023-03-22T09:08:10.631Z'
+---
+
+# dd
+
+> `disk dump`
+
+## usage
+
+```sh
+# bs=n Set both input and output block size to n bytes
+# count=n Copy only n input blocks
+
+dd if=/dev/zero of=/Users/user/filesize/foo.dat bs=1m count=24
+# 24+0 records in
+# 24+0 records out
+# 25165824 bytes transferred in 0.026832 secs (937899773 bytes/sec)
+
+
+# i/o performance testing
+dd if=/dev/zero of=/data/$(date +"%m-%d-%y_%H-%M").test bs=1G count=1 oflag=direct
+# 1+0 records in
+# 1+0 records out
+# 1073741824 bytes (1.1 GB, 1.0 GiB) copied, 1.94133 s, 553 MB/s
+
+oflag=direct # use direct I/O for data allowed to make use of kernel buffering (it just causes a flush+wait for completion periodically
+oflag=dsync # use synchronized I/O for data trust that all my parameters are sensible and turn off as much kernel buffering as you can"
+oflag=sync # likewise, but also for metadata
+
+# write zeros to /dev/mapper/backup2 encrypted device / will allocate block data with zeros
+# ensures outside world will see this as random data i.e. it protect against disclosure of usage patterns:
+pv -tpreb /dev/zero | dd of=/dev/mapper/backup2 bs=128M
+
+dd if=/dev/zero of=/dev/mapper/backup2 status=progress
+```
+
+## see also
+
+- [[cryptsetup]]
+- [[pv]]
+- [macos illegal numeric value](https://rendezvouswithpavan.wordpress.com/2015/06/16/dd-bs-illegal-numeric-value-error-on-mac-os-x/)
+- [thomas-krenn.com/en/wiki/Linux_I/O_Performance_Tests_using_dd](https://www.thomas-krenn.com/en/wiki/Linux_I/O_Performance_Tests_using_dd)
+- [why is dd with direct flag much slower than dsync](https://stackoverflow.com/a/50882704/2087704)
diff --git a/notes/defaults.md b/notes/defaults.md
new file mode 100644
index 00000000..f81b0d7b
--- /dev/null
+++ b/notes/defaults.md
@@ -0,0 +1,74 @@
+---
+tags: [macos]
+title: defaults
+created: '2019-07-30T06:19:49.183Z'
+modified: '2023-06-02T06:21:34.519Z'
+---
+
+# defaults
+
+> access macos user defaults system
+
+## show hidden files
+
+```sh
+defaults write NSGlobalDomain AppleShowAllExtensions -bool true # display file-extensions
+
+defaults write com.apple.finder AppleShowAllFiles TRUE # display dot-files
+defaults write com.apple.Finder AppleShowAllFiles true
+
+killall Finder # restart finder need to take effect
+```
+
+## .DS_Store
+
+```sh
+defaults write com.apple.desktopservices DSDontWriteNetworkStores true # disable .DS_Store creation
+```
+
+## keyboard
+
+```sh
+defaults write -g ApplePressAndHoldEnabled -bool false # Disable Popup / Enable Key Repeat
+defaults read NSGlobalDomain KeyRepeat # default: 6
+defaults read NSGlobalDomain InitialKeyRepeat # default: 25
+defaults write -g InitialKeyRepeat -int 10
+defaults write -g KeyRepeat -int 1
+defaults delete NSGlobalDomain KeyRepeat # revert to default
+defaults delete NSGlobalDomain InitialKeyRepeat # revert to default
+```
+
+[apple.stackexchange.com/how-to-increase-keyboard-key-repeat-rate-on-os-x](https://apple.stackexchange.com/questions/10467/how-to-increase-keyboard-key-repeat-rate-on-os-x/83923#83923)
+
+## toggle display items on desktop
+
+```sh
+defaults write com.apple.finder CreateDesktop false
+killall Finder
+defaults write com.apple.finder CreateDesktop true
+killall Finder
+```
+
+## screenshots
+
+```sh
+defaults write com.apple.screencapture location "$HOME/Pictures/screenshots" # save to diff location
+defaults write com.apple.screencapture name screenshot # use diff name prefix
+```
+
+## displays app switcher on both the screens `โ + tab`
+
+```sh
+defaults write com.apple.Dock appswitcher-all-displays -bool true
+killall Dock
+```
+
+[superuser.com/a/1625752/1236589](https://superuser.com/a/1625752/1236589)
+
+## see also
+
+- [[tmux]]
+- [[open]]
+- [[mdfind]]
+- [[macos keyboard shortcuts]]
+- [[system_profiler]]
diff --git a/notes/deno.md b/notes/deno.md
new file mode 100644
index 00000000..bcc8f586
--- /dev/null
+++ b/notes/deno.md
@@ -0,0 +1,100 @@
+---
+tags: [javascript, runtime, rust, typescript]
+title: deno
+created: '2023-05-19T12:51:29.466Z'
+modified: '2023-05-24T08:45:57.081Z'
+---
+
+# deno
+
+> "dee-no" - [[javascript]], [[typescript]], and [[wasm]] runtime based on v8, written in [[rust]]
+
+## install
+
+```sh
+brew install deno
+```
+
+## env
+
+```sh
+DENO_AUTH_TOKENS # semi-colon separated list of bearer tokens and hostnames to use when fetching remote modules from private repositories
+DENO_TLS_CA_STORE # comma-separated list of order dependent certificate stores. Possible values: "system", "mozilla". Defaults to "mozilla".
+DENO_CERT # load certificate authority from PEM encoded file
+DENO_DIR # set the cache directory
+DENO_INSTALL_ROOT # set deno install's output directory (defaults to $HOME/.deno/bin)
+DENO_REPL_HISTORY # set REPL history file path History file is disabled when the value is empty (defaults to $DENO_DIR/deno_history.txt)
+DENO_NO_PACKAGE_JSON # disables auto-resolution of package.json
+DENO_NO_PROMPT # set to disable permission prompts on access (alternative to passing --no-prompt on invocation)
+DENO_NO_UPDATE_CHECK # set to disable checking if a newer Deno version is available
+DENO_V8_FLAGS # set V8 command line options
+DENO_JOBS # number of parallel workers used for the --parallel flag with the test subcommand. Defaults to number of available CPUs.
+HTTP_PROXY # proxy address for HTTP requests (module downloads, fetch)
+HTTPS_PROXY # proxy address for HTTPS requests (module downloads, fetch)
+NPM_CONFIG_REGISTRY # URL to use for the npm registry.
+NO_COLOR # set to disable color
+NO_PROXY # comma-separated list of hosts which do not use a proxy (module downloads, fetch)
+```
+
+## option
+
+```sh
+ --unstable # enable unstable features and APIs
+-q, --quiet # suppress diagnostic output
+-h, --help # print help (see more with '--help')
+-V, --version # print version
+```
+
+## usage
+
+```sh
+deno # starte repl
+
+deno help compile
+
+deno bench # run benchmarks
+deno cache # cache the dependencies
+deno check # Type-check the dependencies
+
+deno compile # UNSTABLE: Compile the script into a self contained executable
+deno compile -h
+deno compile --help
+
+deno completions # generate shell completions
+deno coverage # print coverage reports
+deno doc # show documentation for a module
+deno eval # eval script
+deno fmt # Format source files
+deno init # initialize a new project
+deno info # show info about cache or info related to source file
+deno install # install script as an executable
+deno uninstall # Uninstall a script previously installed with deno install
+deno lsp # start the language server
+deno lint # Lint source files
+deno repl # read Eval Print Loop
+
+deno run # run a js or ts script
+deno run SCRIPT.ts # run typescript
+
+deno task # run a task defined in the configuration file
+deno test # run tests
+deno types # print runtime TypeScript declarations
+deno upgrade # Upgrade deno executable to given version
+deno vendor # Vendor remote modules into a local directory
+deno help # print this message or the help of the given subcommand(s)
+```
+
+## repl
+
+```js
+_ // yields the last evaluated expression
+_error // yields the last thrown error
+
+clear() // clears the entire terminal screen
+close() // close the current REPL session
+```
+
+## see also
+
+- [[node]], [[js]]
+- [github.com/denoland/deno](https://github.com/denoland/deno)
diff --git a/notes/devops.md b/notes/devops.md
new file mode 100644
index 00000000..7e60e6cb
--- /dev/null
+++ b/notes/devops.md
@@ -0,0 +1,99 @@
+---
+tags: [Notebooks]
+title: devops
+created: '2019-07-30T06:19:49.034Z'
+modified: '2023-04-24T09:37:10.381Z'
+---
+
+# devops
+
+> tries to solve a human problem: lack of communication and collaboration
+> => profound culture shift (communication daily)
+
+Cultur
+Automation
+Lean
+Measurement
+Sharing
+
+CI: deploys per day => relative success; 10+ deploys per dai "allspaw"
+
+> DevOps also characterized by operations staff making use of many of the same techniques as developers for their systems work
+
+Agile (Biz + Dev) | <- | DevOps (Dev + Ops)
+--|--|--
+Agile Software Development | | Agile Software Delivery and Operations
+Agile Values (manifesto) | | DevOps Values (people over process over tools)
+Agile Principles [12] | | DevOps Principles (CAMS, Infra-as-Code)
+Agile Methods (xp, scrum) | | DevOps Methods (Kanba, Visible-Ops)
+Agile Practices (standup, backlog) | | DevOps Practices (ci/cd)
+Agile Tools (jira) | | DevOps (jenkins, ansibles, aws, docker)
+
+### aproach to fixing 3 Problems through
+- culture
+- automation
+- measurement and sharing
+
+### Fundamental Assumptions of DevOps
+
+Achieving:
+1. Frequent
+2. Reliable deployments and
+3. stable production environment
+
+---
+
+## devopscon berlin 2018
+
+### best practices
+- events not metrics
+- dashboards can be misleading (dashborad = artefact of past failure)
+- sampling not aggregation
+- instrumentation
+- events tell storeis (high cardinalities e.g. (high) UUID vs (low) gender )
+
+## sustain devops culture
+- devops is a people problems
+- intentions is to support decision making
+- theory of constraints
+- "walk in my shoes" (watch others do their job, solve specific problem)
+- cultural mindset (people will adapt, clear expectation and boundaries)
+- invocation vs predictability (be clear about time-slots and coutcome)
+- growing people like plants (environment, balanced fertilizer)
+- "society of emergency docktors" => short attention spanc
+- appreciate solved problems not just corssing of checklist !
+ - e.g. dba-queryy -> stupid dev, bt 30% load reduced !
+- __Autonomy FOLLOWS alignment__ <= company goal !!
+- judgement in retrospective is easy
+- devops -> collaboration -> look outside your box -> empathy
+
+## monitoring the uknown
+- statsd, openTSDB
+- `Root Cause Analysis`
+ - method of problem solving used for identifying the root-cause of faults or problems
+ - a factor is considered a root-cause if removal fromt he problem-fault-sequence prevents the final undesirable event from reocouring
+
+## keynote
+- "consistency bias"
+- devops is a revolutionary adaptation to adapt to exponensial change
+- maxim: Adapt or die
+- "lean thinking" silos
+- be disruptive or be disrupted
+- frequency of innovation
+
+F. Winslow Tylor | W.Edward Deming
+--|--
+Efficienty Movement | Lean Movement
+Power & Fear | Japan after WWII
+
+- "change for change's sake is dangerous" if not "anchored-change"
+- control vs adaptation
+- hirarchy vs decentralization
+
+## see also
+
+- [[12 factor app]]
+- [[gitops]]
+- [theagileadmin.com/what-is-devops/](https://theagileadmin.com/what-is-devops/)
+- [[kubernetes]]
+
diff --git a/notes/df.md b/notes/df.md
new file mode 100644
index 00000000..a2db7ccd
--- /dev/null
+++ b/notes/df.md
@@ -0,0 +1,31 @@
+---
+tags: [coreutils, filesystem]
+title: df
+created: '2019-07-30T06:19:49.036Z'
+modified: '2023-03-22T09:13:08.619Z'
+---
+
+# df
+
+> `disk free` reports the amount of available disk space being used by file systems.
+
+## option
+
+```sh
+-h, --human-readable # human readable, print sizes in powers of 1024 (e.g., 1023M)
+-H, --si # print sizes in powers of 1000 (e.g., 1.1G)
+-l # print only information about locally-mounted filesystems
+-T, --print-type # print filesystem type e.g. aufs, ext4 ... does not work on macos !
+-i # free inodes
+```
+
+## usage
+
+```sh
+df -h
+```
+
+## see also
+
+- [[du]]
+- [[ls]]
diff --git a/notes/diff.md b/notes/diff.md
index fbaf1f79..6c3c92fa 100644
--- a/notes/diff.md
+++ b/notes/diff.md
@@ -1,26 +1,44 @@
---
-tags: [bash, linux]
+tags: [linux]
title: diff
created: '2019-07-30T06:19:49.036Z'
-modified: '2019-07-30T18:53:00.131Z'
+modified: '2023-04-20T08:22:01.581Z'
---
# diff
-```sh
-diff -y file1.json file2.json # -y, --side-by-side
-diff --unified file1.json file2.json
+> compare files line by line
+
+## option
+
+```sh
+-q, --brief # output only whether files differ
+-i, --ignore-case # ignore case differences in file contents
+-y, --side-by-side # output in two columns
+-W NUM, --width=NUM # output at most NUM (default 130) print columns
```
+## usage
+
```sh
+diff -q FILE1 FILE2 # only output if files differ
+diff -y FILE1 FILE2 # side-by-side
+
+diff --suppress-common-lines -y -W $(tput cols) FILE1 FILE2 # dynamic width, side-by-side
+
+diff -y -W $(tput cols) <(CMD | jq -S) <(CMD | jq -S)
+
+diff --unified FILE1 FILE2
+
diff <(sort <(md5deep -r /$1/) |cut -f1 -d' ') <(sort <(md5deep -r /$2/) |cut -f1 -d' ')
-diff -y <(curl -s https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash) <(cat `brew --prefix`/etc/bash_completion.d/git-completion.bash)
+diff -y <(curl -s URL) <(cat $(brew --prefix)/PATH/git-completion.bash)
```
+## see also
-### dynamic width
-```sh
-diff -y -W $(tput cols) <(docker service inspect pp-backend_application) <(docker service inspect presseportal-backend_application)
-```
-[Make diff Use Full Terminal Width in Side-by-Side Mode - Unix & Linux Stack Exchange](https://unix.stackexchange.com/a/9303)
+- [[tput]]
+- [[column]]
+- [[colordiff]]
+- [[bash process substitution]]
+- [Make diff Use Full Terminal Width in Side-by-Side Mode - Unix & Linux Stack Exchange](https://unix.stackexchange.com/a/9303)
diff --git a/notes/dig.md b/notes/dig.md
new file mode 100644
index 00000000..cd78fe18
--- /dev/null
+++ b/notes/dig.md
@@ -0,0 +1,142 @@
+---
+tags: [dns, linux]
+title: dig
+created: '2019-07-30T06:19:49.037Z'
+modified: '2023-03-20T08:59:52.633Z'
+---
+
+# dig
+
+> `domain information groper`
+
+## install
+
+```
+brew install bind
+
+apt-get install dnsutils
+yum install bind-utils
+apk add --no-cache bind-tools
+```
+
+## env
+
+```sh
+IDN_DISABLE # turn off IDN support
+```
+
+## option
+
+```sh
+-h # Print a usage summary
+-v # prints version number and exit
+-4 # only IPv4 should be used
+-6 # only IPv6 should be used
+-b ADDR[PORT] # sets the source IP address of the query. The address must be a valid address on one of the host's network interfaces, or "0.0.0.0" or "::"
+-c CLASS # sets the query class. default class is IN; other classes are HS for Hesiod records or CH for Chaosnet records
+-f FILE # sets batch mode, in which dig reads a list of lookup requests to process from the given file
+-m # enables memory usage debugging
+-p port # sends the query to a non-standard port on the server, instead of the default port 53. test name server configured to listen for queries on a non-standard port
+-q name # specifies the domain name to query. This is useful to distinguish the name from other arguments.
+-r # options from $HOME/.digrc should not be read
+-t TYPE # resource record type to query. default query type is A, unless -x
+-t TYPEnn # zone transfer can be requested by specifying a type of AXFR. When an incremental zone transfer (IXFR) is required, set the type to ixfr=N
+-u # print query times should be provided in microseconds instead of milliseconds
+-x ADDR # sets simplified reverse lookups, for mapping addresses to names. no need to provide the name, class, and type arguments as dig automatically
+ # performs a lookup for a name like 94.2.0.192.in-addr.arpa and sets the query type and class to PTR and IN respectively
+-k KEYFILE # signs queries using TSIG or SIG(0) using a key read from the given file. Key files can be generated using tsig-keygen
+-y [HMAC:]KEYNAME:SECRET # signs queries using TSIG with the given authentication key
+ # KEYNAME - name of the key
+ # SECRET - base64-encoded shared secret
+ # HMAC - key algorithm; hmac-md5, hmac-sha1, hmac-sha224, hmac-sha256, hmac-sha384, or hmac-sha512
+```
+
+[[dns]]
+
+## .digrc
+
+```sh
+cat < $HOME/.digrc
++nostats +nocomments +nocmd +noquestion +recurse
+EOF
+```
+
+## query options
+
+```sh
++short #
++[no]all # set or clear all display flags.
++[no]qr # print [don't print] the query as it is sent. By default, the query is not printed.
++noall #
++answer #
++ttlid
+```
+
+## return codes
+
+```sh
+0 # DNS response received, including NXDOMAIN status
+1 # usage error
+8 # couldn't open batch file
+9 # no reply from server
+10 # internal error
+```
+
+## usage
+
+```sh
+dig +short example.com
+
+dig @server name type # use specific nameserver, ff no server argument is provided, dig consults /etc/resolv.conf
+
+dig +noall +answer +authority +additional example.com
+
+dig +noall +answer ns {example.com,example.net,example.org} # authorative query
+
+dig +noall +answer {example.com,example.net,example.org} # non authorative query
+
+dig @8.8.8.8 +trace github.com
+
+
+dig SOA HOST # SOA - `start of authority`
+ns-2048.awsdns-64.net. hostmaster.example.com. 1 7200 900 1209600 86400
+# | | | | | | |
+# | | | | | | minimum ttl - value defines length of time recursive resolver should cache
+# | | | | | time in seconds that secondary server will keep trying to complete a zone transfer
+# | | | | retry interval seconds, that secondary server waits before retrying a failed zone transfer
+# | | | refresh time seconds
+# | | serial number, can be incremented when a record is updated
+# | email address of admin @ is replace with .
+# nameserver that created the SOA record
+```
+
+## axfr
+
+> `asynchronous transfer full range`
+
+- protocol for `"zone transfers"` for replication of [[dns]] data accross multiple dns-servers
+- mechanism used by the DNS system to transfer zone information for a primary DNS server to several secondary DNS servers
+- client-initiated request
+- edit information on primary DNS server then use AXFR from secondary DNS server to download the entire zone
+
+```sh
+dig +short ns zonetransfer.me
+nsztm1.digi.ninja.
+nsztm2.digi.ninja.
+
+dig axfr zonetransfer.me @nsztm1.digi.ninja. # initiate an AXFR request to get a copy of the zone from the primary server
+```
+
+[acunetix.com/blog/articles/dns-zone-transfers-axfr](https://www.acunetix.com/blog/articles/dns-zone-transfers-axfr/)
+
+## see also
+
+- [[dns]]
+- [[whois]]
+- [[host]]
+- [[nslookup]]
+- [[rndc]]
+- [[BIND]]
+- [[dnstop]]
+- [TTL when querying for any record with dig - Super User](https://superuser.com/a/873408/341187)
+- [jvns.ca/blog/how-updating-dns-works/](https://jvns.ca/blog/how-updating-dns-works/)
diff --git a/notes/dirname.md b/notes/dirname.md
new file mode 100644
index 00000000..eac41748
--- /dev/null
+++ b/notes/dirname.md
@@ -0,0 +1,22 @@
+---
+tags: [coreutils]
+title: dirname
+created: '2020-09-01T07:57:37.197Z'
+modified: '2020-10-06T07:07:37.194Z'
+---
+
+# dirname
+
+> removes last level or filename from a given pathname
+
+## usage
+```sh
+dirname /foo/bar/baz # returns `/foo/bar`
+
+CURRENTDIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+```
+
+## see also
+- [[bash pwd]]
+- [[basename]]
+- [[realpath]]
diff --git a/notes/diskutil.md b/notes/diskutil.md
new file mode 100644
index 00000000..31de1139
--- /dev/null
+++ b/notes/diskutil.md
@@ -0,0 +1,32 @@
+---
+tags: [macos]
+title: diskutil
+created: '2019-07-30T06:19:49.184Z'
+modified: '2023-05-30T08:57:03.259Z'
+---
+
+# diskutil
+
+> modify, verify and repair local disks
+
+## usage
+
+```sh
+diskutil list
+
+diskutil unmount /dev/disk2
+
+diskutil eject /dev/disk2
+
+diskutil secureErase freespace 4 /Volumes/Macintosh\ HD
+# 0 Single-pass zero-fill erase
+# 1 Single-pass random-fill erase
+# 2 US DoD 7-pass secure erase
+# 3 Gutmann algorithm 35-pass secure erase
+# 4 US DoE algorithm 3-pass secure erase
+```
+
+## see also
+
+- [[dd]]
+- [[hdiutil]]
diff --git a/notes/distributed tracing.md b/notes/distributed tracing.md
new file mode 100644
index 00000000..d9db497a
--- /dev/null
+++ b/notes/distributed tracing.md
@@ -0,0 +1,31 @@
+---
+tags: [Notebooks]
+title: distributed tracing
+created: '2019-07-30T06:19:49.038Z'
+modified: '2020-02-01T08:29:09.268Z'
+---
+
+# distributed tracing
+
+`span`
+- individual unit of work, are named and have start+end timestamp
+
+`trace`
+- made of multiple spans
+- can be thought of as a `directed acyclic graph`
+@startuml
+(a)->(b)
+(a)->(d)
+(b)->(e)
+(c)->(d)
+(d)->(e)
+@enduml
+
+`baggage`
+- reference or unique-ID + Data (kev:val) => `span-conect`
+
+## see also
+[Intro to Distributed Tracing](https://www.kartar.net/2019/07/intro-to-distributed-tracing)
+[opentracing.io/docs/overview/spans](https://opentracing.io/docs/overview/spans/)
+
+
diff --git a/notes/distributed.md b/notes/distributed.md
new file mode 100644
index 00000000..b55f436f
--- /dev/null
+++ b/notes/distributed.md
@@ -0,0 +1,18 @@
+---
+tags: [Notebooks]
+title: distributed
+created: '2019-07-30T06:19:49.038Z'
+modified: '2021-12-26T14:43:46.735Z'
+---
+
+# distributed
+
+## quorum
+
+> minimum number of votes that a distributed transaction has to optain to be allowed to perform operation in a distributed system
+> => enforces consistent operations in a distributed system
+
+
+## see also
+
+- [[cap theorem]]
diff --git a/notes/dmesg.md b/notes/dmesg.md
new file mode 100644
index 00000000..ddb5d499
--- /dev/null
+++ b/notes/dmesg.md
@@ -0,0 +1,76 @@
+---
+tags: [linux]
+title: dmesg
+created: '2019-08-28T06:45:42.937Z'
+modified: '2021-06-08T05:40:59.995Z'
+---
+
+# dmesg
+
+> `display message or driver message` prints the message buffer of the kernel
+
+## usage
+
+```sh
+-C, --clear # clear the kernel ring buffer
+-c, --read-clear # read and clear all messages
+-D, --console-off # disable printing messages to console
+-d, --show-delta # show time delta between printed messages
+-e, --reltime # show local time and time delta in readable format
+-E, --console-on # enable printing messages to console
+-F, --file FILE # use the file instead of the kernel log buffer
+-f, --facility LIST # restrict output to defined facilities:
+ # kern - kernel messages
+ # user - random user-level messages
+ # mail - mail system
+ # daemon - system daemons
+ # auth - security/authorization messages
+ # syslog - messages generated internally by syslogd
+ # lpr - line printer subsystem
+ # news - network news subsystem
+-H, --human # human readable output
+-k, --kernel # display kernel messages
+-L, --color # colorize messages
+-l, --level LIST # comma separated list of restrict output to defined levels:
+ # emerg - system is unusable
+ # alert - action must be taken immediately
+ # crit - critical conditions
+ # err - error conditions
+ # warn - warning conditions
+ # notice - normal but significant condition
+ # info - informational
+ # debug - debug-level messages
+-n, --console-level LEVEL # set level of messages printed to console
+-P, --nopager # do not pipe output into a pager
+-r, --raw # print the raw message buffer
+-S, --syslog # force to use syslog(2) rather than /dev/kmsg
+-s, --buffer-size SIZE # buffer size to query the kernel ring buffer
+-t, --notime # don't print messages timestamp
+-T, --ctime # show human readable timestamp (could be inaccurate if you have used SUSPEND/RESUME)
+-u, --userspace # display userspace messages
+-w, --follow # wait for new messages
+-x, --decode # decode facility and level to readable string
+
+-h, --help # display this help and exit
+-V, --version # output version information and exit
+```
+
+```sh
+/var/log/dmesg # log file
+
+dmesg
+
+dmesg -c # clear dmesg buffer logs
+
+dmesg -T # show timestamp
+
+dmesg -u # only userspace messages
+
+dmesg -f user # facility
+
+dmesg --level=err,warn
+```
+
+## see also
+- [[sysctl]]
+- [[syslog]]
diff --git a/notes/dmidecode.md b/notes/dmidecode.md
new file mode 100644
index 00000000..cc09882d
--- /dev/null
+++ b/notes/dmidecode.md
@@ -0,0 +1,28 @@
+---
+tags: [linux]
+title: dmidecode
+created: '2020-02-04T17:11:08.680Z'
+modified: '2023-03-25T12:26:34.344Z'
+---
+
+# dmidecode
+
+> DMI table decoder - tool for dumping a computer's DMI (some say SMBIOS ) table contents in a human-readable format.
+
+## option
+
+```sh
+-t, --type TYPE #
+```
+
+## usage
+
+```sh
+dmidecode -t 1 # 1 = System
+
+dmidecode --type BIOS
+```
+
+## see also
+
+- [linux.die.net/man/8/dmidecode](https://linux.die.net/man/8/dmidecode)
diff --git a/notes/dns.md b/notes/dns.md
new file mode 100644
index 00000000..13631efd
--- /dev/null
+++ b/notes/dns.md
@@ -0,0 +1,92 @@
+---
+tags: [dns]
+title: dns
+created: '2019-07-30T06:19:49.040Z'
+modified: '2023-03-20T08:28:39.786Z'
+---
+
+# dns
+
+> domain name system
+
+- port 53 UDP/TCP
+- `RFC 882` -> `RFC 1034`
+- `RFC 883` -> `RFC 1035`
+- "forward lookup"
+- DNS-DB: NameServer
+- ZoneFile: SOA (=Start of Authority), NAS, A, AAAA, CNAME, MX, PTR, TXT
+
+
+## namespace
+
+## zone
+
+## record
+
+> administrative concept, defines a part of the DNS namespace
+
+## resource records
+
+```sh
+Resource records
+Type Type ID Defining RFC Description Function
+A 1 RFC 1035 Address record Returns a 32-bit IPv4 address, most commonly used to map hostnames to an IP address of the host, but it is also used for DNSBLs, storing subnet masks in RFC 1101, etc.
+AAAA 28 RFC 3596 IPv6 address record Returns a 128-bit IPv6 address, most commonly used to map hostnames to an IP address of the host.
+AFSDB 18 RFC 1183 AFS database record Location of database servers of an AFS cell. This record is commonly used by AFS clients to contact AFS cells outside their local domain. A subtype of this record is used by the obsolete DCE/DFS file system.
+APL 42 RFC 3123 Address Prefix List Specify lists of address ranges, e.g. in CIDR format, for various address families. Experimental.
+CAA 257 RFC 6844 Certification Authority Authorization DNS Certification Authority Authorization, constraining acceptable CAs for a host/domain
+CDNSKEY 60 RFC 7344 Child copy of DNSKEY record, for transfer to parent
+CDS 59 RFC 7344 Child DS Child copy of DS record, for transfer to parent
+CERT 37 RFC 4398 Certificate record Stores PKIX, SPKI, PGP, etc.
+CNAME 5 RFC 1035 Canonical name record Alias of one name to another: the DNS lookup will continue by retrying the lookup with the new name.
+CSYNC 62 RFC 7477 Child-to-Parent Synchronization Specify a synchronization mechanism between a child and a parent DNS zone. Typical example is declaring the same NS records in the parent and the child zone
+DHCID 49 RFC 4701 DHCP identifier Used in conjunction with the FQDN option to DHCP
+DLV 32769 RFC 4431 DNSSEC Lookaside Validation record For publishing DNSSEC trust anchors outside of the DNS delegation chain. Uses the same format as the DS record. RFC 5074 describes a way of using these records.
+DNAME 39 RFC 6672 Delegation name record Alias for a name and all its subnames, unlike CNAME, which is an alias for only the exact name. Like a CNAME record, the DNS lookup will continue by retrying the lookup with the new name.
+DNSKEY 48 RFC 4034 DNS Key record The key record used in DNSSEC. Uses the same format as the KEY record.
+DS 43 RFC 4034 Delegation signer The record used to identify the DNSSEC signing key of a delegated zone
+EUI48 108 RFC 7043 MAC address (EUI-48) A 48-bit IEEE Extended Unique Identifier.
+EUI64 109 RFC 7043 MAC address (EUI-64) A 64-bit IEEE Extended Unique Identifier.
+HINFO 13 RFC 8482 Host Information Providing Minimal-Sized Responses to DNS Queries That Have QTYPE=ANY
+HIP 55 RFC 8005 Host Identity Protocol Method of separating the end-point identifier and locator roles of IP addresses.
+HTTPS 65 IETF Draft HTTPS Binding RR that improves performance for clients that need to resolve many resources to access a domain. More info in this IETF Draft by DNSOP Working group and Akamai technologies.
+IPSECKEY 45 RFC 4025 IPsec Key Key record that can be used with IPsec
+KEY 25 RFC 2535, RFC 2930 Key record Used only for SIG(0) (RFC 2931) and TKEY (RFC 2930)
+KX 36 RFC 2230 Key Exchanger record Used with some cryptographic systems (not including DNSSEC) to identify a key management agent for the associated domain-name
+LOC 29 RFC 1876 Location record Specifies a geographical location associated with a domain name
+MX 15 RFC 1035, RFC 7505 Mail exchange record List of mail exchange servers that accept email for a domain
+NAPTR 35 RFC 3403 Naming Authority Pointer Allows regular-expression-based rewriting of domain names which can then be used as URIs, further domain names to lookups, etc.
+NS 2 RFC 1035 Name server record Delegates a DNS zone to use the given authoritative name servers
+NSEC 47 RFC 4034 Next Secure record Part of DNSSECโused to prove a name does not exist. Uses the same format as the (obsolete) NXT record.
+NSEC3 50 RFC 5155 Next Secure record version 3 An extension to DNSSEC that allows proof of nonexistence for a name without permitting zonewalking
+NSEC3PARAM 51 RFC 5155 NSEC3 parameters Parameter record for use with NSEC3
+OPENPGPKEY 61 RFC 7929 OpenPGP public key record A DNS-based Authentication of Named Entities (DANE) method for publishing and locating OpenPGP public keys in DNS for a specific email address using an OPENPGPKEY DNS resource record.
+PTR 12 RFC 1035 PTR Resource Record [de] Pointer to a canonical name. Unlike a CNAME, DNS processing stops and just the name is returned. The most common use is for implementing reverse DNS lookups, but other uses include such things as DNS-SD.
+RRSIG 46 RFC 4034 DNSSEC signature Signature for a DNSSEC-secured record set. Uses the same format as the SIG record.
+RP 17 RFC 1183 Responsible Person Information about the responsible person(s) for the domain. Usually an email address with the @ replaced by a .
+SIG 24 RFC 2535 Signature Signature record used in SIG(0) (RFC 2931) and TKEY (RFC 2930).[7] RFC 3755 designated RRSIG as the replacement for SIG for use within DNSSEC.[7]
+SMIMEA 53 RFC 8162 S/MIME cert association Associates an S/MIME certificate with a domain name for sender authentication.
+SOA 6 RFC 1035, RFC 2308 Start of [a zone of] authority record Specifies authoritative information about a DNS zone, primary name server, email of domain administrator, domain serial number, timers relating to refreshing the zone
+SRV 33 RFC 2782 Service locator Generalized service location record, used for newer protocols instead of creating protocol-specific records such as MX.
+SSHFP 44 RFC 4255 SSH Public Key Fingerprint Resource record for publishing SSH public host key fingerprints in the DNS, in order to aid in verifying the authenticity of the host. RFC 6594 defines ECC SSH keys and SHA-256 hashes
+SVCB 64 IETF Draft Service Binding RR that improves performance for clients that need to resolve many resources to access a domain. More info in this IETF Draft by DNSOP Working group and Akamai technologies.
+TA 32768 โ DNSSEC Trust Authorities Part of a deployment proposal for DNSSEC without a signed DNS root. See the IANA database and Weiler Spec for details. Uses the same format as the DS record.
+TKEY 249 RFC 2930 Transaction Key record A method of providing keying material to be used with TSIG that is encrypted under the public key in an accompanying KEY RR.
+TLSA 52 RFC 6698 TLSA certificate association A record for DANE
+TSIG 250 RFC 2845 Transaction Signature Can be used to authenticate dynamic updates as coming from an approved client, or to authenticate responses as coming from an approved recursive name server similar to DNSSEC.
+TXT 16 RFC 1035 Text record Originally for arbitrary human-readable text ,c arries machine-readable data, such as specified by RFC 1464, opportunistic encryption, Sender Policy Framework, DKIM, DMARC, DNS-SD
+URI 256 RFC 7553 Uniform Resource Identifier Can be used for publishing mappings from hostnames to URIs.
+ZONEMD 63 RFC 8976 Message Digests for DNS Zones Provides a cryptographic message digest over DNS zone data at rest.
+```
+
+
+## see also
+
+- [[axfr]]
+- [[spf]]
+- [[dig]]
+- [[nslookup]]
+- [[dnsmasq]]
+- [[aws]]
+- [No domain defined in /etc/resolv.conf](https://unix.stackexchange.com/a/128096/193945)
+- [cloudflare.com/learning/dns/dns-records/](https://www.cloudflare.com/learning/dns/dns-records/)
diff --git a/notes/dnsmasq.md b/notes/dnsmasq.md
new file mode 100644
index 00000000..96724cdf
--- /dev/null
+++ b/notes/dnsmasq.md
@@ -0,0 +1,34 @@
+---
+tags: [dns]
+title: dnsmasq
+created: '2020-08-05T09:18:05.574Z'
+modified: '2022-04-19T08:31:48.411Z'
+---
+
+# dnsmasq
+
+> lightweight dhcp- and caching dns-server
+
+## install
+
+`yum install dnsmasq`, `apt-get install dnsmasq`
+
+## usage
+
+```sh
+/etc/init.d/dnsmasq restart
+
+systemctl [start|enable|status] dnsmasq
+
+/etc/dnsmasq.conf
+
+dnsmasq --test # check config syntax for errors
+```
+
+## see also
+
+- [[dns]]
+- [[dig]]
+- [[BIND]]
+- [[dhcp]]
+- [wiki.archlinux.org/index.php/dnsmasq](https://wiki.archlinux.org/index.php/dnsmasq)
diff --git a/notes/dnstop.md b/notes/dnstop.md
new file mode 100644
index 00000000..6e343ba6
--- /dev/null
+++ b/notes/dnstop.md
@@ -0,0 +1,28 @@
+---
+tags: [dns, linux, macos]
+title: dnstop
+created: '2019-09-17T05:04:56.977Z'
+modified: '2023-03-22T09:08:38.019Z'
+---
+
+# dnstop
+
+> displays various tables of dns traffic on your network
+
+## install
+
+```sh
+brew install dnstop
+```
+
+## usage
+
+```sh
+dnstop en0
+```
+
+## see also
+
+- [dns.measurement-factory.com/dnstop.8.html](http://dns.measurement-factory.com/tools/dnstop/dnstop.8.html)
+- [[dig]]
+- [[dnsmasq]]
diff --git a/notes/docker network.md b/notes/docker network.md
new file mode 100644
index 00000000..c4719e38
--- /dev/null
+++ b/notes/docker network.md
@@ -0,0 +1,67 @@
+---
+tags: [container]
+title: docker network
+created: '2019-07-30T06:19:49.041Z'
+modified: '2023-03-22T10:10:46.206Z'
+---
+
+# docker network
+
+## docker overlay network
+
+- network namepsace
+- XVLAN
+- Netlink
+- distributed KV-Store (consul)
+
+```
+โโโโโโโโโโโโโโโ (VXLAN Tunnel Endpoint)
+โ container โโโดโโโโโ โโโโโโโ โโโโโโโโ โโโโโโโโโโโโโโโโโ
+โโโโโโโโโโโโโค veth โโโโโค br0 โโโโโโโค VTEP โโโโโโโค vxlan tunnel โ
+ โโโโโโโโ โโโโโโโ โโโโโโโโ โโโโโโโโโโโโโโโโโ
+ โโโโโโโโโโโโโโโโโโโโโ
+VTEP encapsulates Frames by adding VXLAN-Header
+
+ โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโ
+ โ Ethernet Frame โ VXLAN-Header โ
+ โโโโโโโโโโโโโโโโโโดโโโฌโโโโโโโโโโโโ
+ โโ VNID
+```
+
+`L3` segement routing IP (`network`)
+`L2` broadcast MAC (`Datalink`)
+
+## usage
+
+```sh
+## debugging inside container
+docker exec container ip addr show
+
+docker exec container ip route
+
+# create entwork and attach container
+docker network create -d bridge --subnet 1.2.3.0/24 my_bridge
+
+docker network create --driver bridge --subnet 192.168.100.0/24 --ip-range 192.168.100.0/24 my-bridge-network
+
+docker run -itd --name c2 --net my_bridge busybox sh
+
+docker run -itd --name c3 --net my_bridge --ip 20.10.0.254 busybox sh
+
+docker run -itd --name c3 --net my_bridge --ip 10.23.6.33 busybox sh
+
+docker run -d --name C2 --net my_bridge -p 5000:80 nginx
+
+docker run -itd --name c1 busyboy sh
+
+docker run -itd --name c1-1 --network host busybox sh
+```
+
+## see also
+
+- [[brctl]]
+- [[nat]]
+- [[servicemesh]]
+- [Docker Reference Architecture - success.docker.com](http://success.docker.com/article/networking)
+- [Demystifying Docker overlay networking โ nigelpoulton.com](http://blog.nigelpoulton.com/demystifying-docker-overlay-networking/)
+
diff --git a/notes/docker-compose.md b/notes/docker-compose.md
new file mode 100644
index 00000000..f0d17100
--- /dev/null
+++ b/notes/docker-compose.md
@@ -0,0 +1,77 @@
+---
+tags: [container]
+title: docker-compose
+created: '2019-08-28T09:08:43.657Z'
+modified: '2023-03-13T11:21:26.149Z'
+---
+
+# docker-compose
+
+> `docker-compose` for defining and running multi-container `docker` applications
+
+## usage
+
+```sh
+docker-compose -f docker-compose.yml config # render final yaml
+
+docker-compose ps
+
+docker-compose up -d service_name
+```
+
+## `docker-compose.yml`
+
+```yml
+# compose file version 2 reference
+ulimits: # this is docker-compose only !
+ memlock:
+ soft: -1
+ hard: -1
+
+cap_add:
+ - ALL
+
+cap_drop:
+ - NET_ADMIN
+ - SYS_ADMIN
+```
+
+```yml
+# compose file version 3 reference
+cap_add:
+ - ALL
+cap_drop:
+ - NET_ADMIN
+ - SYS_ADMIN
+```
+[[capabilities]], [[ulimit]]
+
+```yml
+# terrafrom dev setup
+version: '2.4'
+
+services:
+ terraform:
+ build:
+ context: .
+ args:
+ TAG: 0.12.6
+ image: docker-registry/terraform:0.12.6
+ tty: true
+ stdin_open: true
+ environment:
+ TF_VAR_vsphere_server: ${vsphere_server}
+ TF_VAR_vsphere_user: ${vsphere_user}
+ TF_VAR_vsphere_password: ${vsphere_password}
+ volumes:
+ - ./:/opt/terraform/
+ - /var/run/docker.sock:/var/run/docker.sock
+```
+
+## see also
+
+- [[docker]]
+- [[kubectl]]
+- [[yaml]]
+- [[localstack]], [[minikube]]
+
diff --git a/notes/docker-machine.md b/notes/docker-machine.md
new file mode 100644
index 00000000..21062818
--- /dev/null
+++ b/notes/docker-machine.md
@@ -0,0 +1,59 @@
+---
+tags: [container]
+title: docker-machine
+created: '2019-07-30T06:19:49.044Z'
+modified: '2023-03-22T10:10:46.214Z'
+---
+
+# docker-machine
+
+> tool that lets you install and manage [[docker]] on virtual hosts
+
+## option
+
+```sh
+
+```
+
+## usage
+
+```sh
+# create on virtualbox
+docker-machine create \
+ -d virtualbox \
+ --virtualbox-boot2docker-url file:///home/boot2docker.iso \
+ --virtualbox-disk-size=10000 \
+ --virtualbox-memory=1024 \
+ --engine-opt bip=10.20.30.40/24 \
+ --engine-insecure-registry HOST:PORT \
+ HOST
+
+docker-machine \
+ create \
+ --driver vmwarevsphere \
+ --vmwarevsphere-username=\"${ENV_VSPHERE_USERNAME}\" \
+ --vmwarevsphere-password=\"${ENV_VSPHERE_PASSWORD}\" \
+ --vmwarevsphere-vcenter=\"${ENV_VSPHERE_VCENTER}\" \
+ --vmwarevsphere-datacenter=\"${ENV_VSPHERE_DATACENTER}\" \
+ --vmwarevsphere-network=\"${ENV_VSPHERE_NETWORK}\" \
+ --vmwarevsphere-cpu-count=\"${ENV_VSPHERE_CPU_COUNT}\" \
+ --vmwarevsphere-memory-size=\"${ENV_VSPHERE_MEMORY_SIZE}\" \
+ --vmwarevsphere-disk-size=\"${ENV_VSPHERE_DISK_SIZE}\" \
+ --vmwarevsphere-datastore=\"${ENV_VSPHERE_DATASTORE}\" \
+ --vmwarevsphere-hostsystem=\"${ENV_VSPHERE_HOSTSYSTEM}\" \
+ --vmwarevsphere-boot2docker-url=\"${ENV_VSPHERE_BOOT2DOCKER_URL}\" \
+ --engine-opt bip=\"${ENV_DOCKER_BIP}\" \
+ --engine-opt dns=\"${ENV_DNS}\" \
+ --engine-opt dns-search=\"${ENV_DOCKER_DOMAIN}\" \
+ --engine-insecure-registry=\"${ENV_DOCKER_REGISTRY_ADDRESS1}\" \
+ --engine-insecure-registry=\"${ENV_DOCKER_REGISTRY_ADDRESS2}\" \
+ --tls-san=\"${DOCKER_HOST_FQDN}\" \
+ ${DOCKER_HOST_FQDN}
+```
+
+## see also
+
+- [[k3s]]
+- [[docker]]
+- [[minikube]]
+- [[vboxmanage]]
diff --git a/notes/docker.md b/notes/docker.md
new file mode 100644
index 00000000..c37f4621
--- /dev/null
+++ b/notes/docker.md
@@ -0,0 +1,120 @@
+---
+tags: [container]
+title: docker
+created: '2019-07-30T06:19:49.045Z'
+modified: '2023-07-04T11:18:52.809Z'
+---
+
+# docker
+
+> self-sufficient runtime for containers
+
+## install
+
+```sh
+brew install docker docker-compose
+
+# when using the .dmg
+brew install bash-completion # prerquesite
+ln -s /Applications/Docker.app/Contents/Resources/etc/docker.bash-completion $(brew --prefix)/etc/bash_completion.d/docker
+ln -s /Applications/Docker.app/Contents/Resources/etc/docker-compose.bash-completion $(brew --prefix)/etc/bash_completion.d/docker-compose
+
+curl -LO https://desktop.docker.com/mac/main/{arm64,amd64}/Docker.dmg
+hdiutil attach Docker.dmg
+/Volumes/Docker/Docker.app/Contents/MacOS/install
+hdiutil detach /Volumes/Docker
+```
+
+## env
+
+```sh
+DOCKER_API_VERSION # API version to use
+DOCKER_BUILDKIT # enable or disable buildkit e.g. "failed to solve with frontend dockerfile.v0: failed to create LLB definition:.."
+DOCKER_CONFIG # location of your client configuration
+DOCKER_CERT_PATH # location of your authentication keys
+DOCKER_CLI_EXPERIMENTAL # enable experimental features for the cli (e.g. enabled or disabled)
+DOCKER_DRIVER # graph driver to use
+DOCKER_HOST # daemon socket to connect to
+DOCKER_NOWARN_KERNEL_VERSION # prevent warnings that your Linux kernel is unsuitable for Docker
+DOCKER_RAMDISK # if set will disable โpivot_rootโ
+DOCKER_STACK_ORCHESTRATOR # Configure the default orchestrator to use when using docker stack management commands
+DOCKER_TLS # when set docker uses TLS
+DOCKER_TLS_VERIFY # when set docker uses TLS and verifies the remote
+DOCKER_CONTENT_TRUST # when set docker uses notary to sign and verify images. equates to --disable-content-trust=false for build, create, pull, push, run
+DOCKER_CONTENT_TRUST_SERVER # url of notary server to use. defaults to same URL as the registry
+DOCKER_HIDE_LEGACY_COMMANDS # when set docker hides legacy top-level commands (`docker rm`, `docker pull`, ..)
+DOCKER_TMPDIR # location for temporary Docker files
+
+# connect to docker host
+export DOCKER_API_VERSION=1.38 DOCKER_TLS_VERIFY=1 DOCKER_CERT_PATH=/path/to/certs DOCKER_HOST=tcp://10.32.23.187:2376
+```
+
+## usage
+
+```sh
+docker ps --no-trunc # wide view, full command
+
+docker system prune --all --volumes --force
+
+docker exec -it --env 'PS1=[CMD]\w \$ ' IMGAE CMD # setting prompt for interactive use
+docker exec -it --env 'PS1=['$ENV'] \s-\v\$ ' IMAGE CMD
+
+docker run --rm -v $(pwd):$(pwd) -w $(pwd) IMAGE CMD # run CMD and place result in working dir
+
+docker run --rm httpd:2.4-alpine htpasswd -nbB admin PASSWORD | cut -d ":" -f 2 # generate password and exit
+
+docker run -it -v /var/run/docker.sock:/var/run/docker.sock ubuntu:latest \ `# run docker from inside container`
+ sh -c "apt-get update ; apt-get install docker.io -y ; bash"
+
+
+# filter
+docker ps -a --no-trunc --filter name=^/foo$ # list container who's name is "/foo"
+
+docker image ls --filter label=org.opencontainers.image.vendor="Elastic"
+
+
+docker logs nginx 2>&1 | grep "127." # debugging: grepping logs with 2>&1
+
+
+docker events
+
+
+docker inspect 0 # low level information about container
+
+docker inspect CONTAINER_ID | jq '.[] | .Config .Image'
+
+docker inspect --format '{{.State.Running}}' CONTAINER_ID # container running
+
+docker inspect --format '{{ index .Config.Labels "com.foo.bar" }}' foo # index function: can lookup arbitrary strings in the map
+
+docker inspect --format "{{.State.Status}}" CONTAINER_ID &>/dev/null
+
+
+docker stats $(docker inspect -f '{{.Name}}' $(docker ps -q) | cut -c 2-)
+
+docker stats $(docker ps --format={{.Names}})
+
+
+docker swarm update --task-history-limit=1 # swarm task-history
+
+docker node inspect $(docker node ls --format '{{.Hostname}}')| jq -r '.[].ManagerStatus.Addr' # get node ip
+
+
+docker network inspect -f '{{range $container_id, $container_def := .Containers}} {{$container_id}}^{{index $container_def "Name"}} {{end}}'
+
+docker network disconnect -f $network_name $container_name
+```
+
+## see also
+
+- [[brew]]
+- [[kubectl]]
+- [[docker-compose]]
+- [[minikube]]
+- [[cosign]]
+- [[hdiutil]], [[softwareupdate]]
+- [[go-template]]
+- [[12 factor app]]
+- [stackoverflow.com/questions/42364695/how-to-clear-docker-task-history#](https://stackoverflow.com/questions/42364695/how-to-clear-docker-task-history#)
+- [github.com/moby/moby/issues/31698#issuecomment-320294893](https://github.com/moby/moby/issues/31698#issuecomment-320294893)
+- [docs.docker.com/engine/reference/commandline/cli/#environment-vairables](https://docs.docker.com/engine/reference/commandline/cli/#environment-vairables)
diff --git a/notes/dockerd.md b/notes/dockerd.md
new file mode 100644
index 00000000..8097380c
--- /dev/null
+++ b/notes/dockerd.md
@@ -0,0 +1,37 @@
+---
+tags: [container]
+title: dockerd
+created: '2020-01-03T13:18:17.258Z'
+modified: '2020-09-02T17:26:40.522Z'
+---
+
+# dockerd
+
+> docker daemon
+
+## usage
+```sh
+systemctl stop docker
+
+vim /etc/default/docker
+
+ DOCKER_OPTS="-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock"
+
+
+vim /lib/systemd/system/docker.service
+ ..
+ ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://
+
+
+
+iptables -A INPUT -p tcp --dport 2375 -j ACCEPT # ! not safe for restart
+
+
+systemctl start docker
+```
+
+## see also
+- [[docker]]
+- [[systemctl]]
+- [[iptables]]
+- [[hyperkit]]
diff --git a/notes/dot.md b/notes/dot.md
new file mode 100644
index 00000000..af7b6470
--- /dev/null
+++ b/notes/dot.md
@@ -0,0 +1,35 @@
+---
+tags: [linux, macos]
+title: dot
+created: '2020-01-20T08:57:17.661Z'
+modified: '2023-03-25T12:30:47.828Z'
+---
+
+# dot
+
+> dot draws directed graphs as hierarchie
+
+## install
+
+```sh
+apk add graphviz
+brew install graphviz
+```
+
+## option
+
+```sh
+-Tv # set output format to 'v'
+```
+
+## usage
+
+```sh
+dot -Tsvg > graph.svg
+```
+
+## see also
+
+- [[terraform]]
+- [[open]]
+- [[markdown]]
diff --git a/notes/dpkg.md b/notes/dpkg.md
index e9748dad..070dff40 100644
--- a/notes/dpkg.md
+++ b/notes/dpkg.md
@@ -1,56 +1,65 @@
---
-tags: [linux/packagemanager]
+tags: [linux, packagemanager]
title: dpkg
created: '2019-07-30T20:19:32.637Z'
-modified: '2019-07-30T20:25:02.659Z'
+modified: '2020-01-22T14:21:53.378Z'
---
# dpkg
-## instal package
-```sh
-dpkg -i package.deb
-```
-#### dependency problems preven configuration
+> package manager for debian
+
+## usage
```sh
+dpkg -i package.deb # install package
+
+# dependency problems prevent configuration
apt install ./package.deb
apt --fix-broken install
-```
-## find install packages
-```sh
-dpkg -l | head -3
+
+dpkg -S $(which ip) # find out package
+
+dpkg -S free. # find out package
+
+
+# search in dpkg database
+dpkg-query -S '/bin/ls'
+dpkg-query -S 'passwd*'
+dpkg-query --search '/path/to/file'
+dpkg-query --search '/usr/bin/passwd'
+dpkg-query --search '/etc/passwd'
+
+
+dpkg -l | head -3 # find install packages
dpkg --list |grep "^rc" | cut -d " " -f 3 | xargs sudo dpkg --purge # remove marked "rc"
-```
-## dpkg flags
-```
-First letter -> desired package state ("selection state"):
- u ... unknown
- i ... install
- r ... remove/deinstall
- p ... purge (remove including config files)
- h ... hold
-
-Second letter -> current package state:
- n ... not-installed
- i ... installed
- c ... config-files (only the config files are installed)
- u ... unpacked
- f ... half-configured (configuration failed for some reason)
- h ... half-installed (installation failed for some reason)
- w ... triggers-awaited (package is waiting for a trigger from another package)
- t ... triggers-pending (package has been triggered)
-
-Third letter -> error state (you normally shouldn't see a thrid letter):
- r ... reinst-required (package broken, reinstallation required)
-```
-[What do the various dpkg flags like 'ii' 'rc' mean? - Ask Ubuntu](http://askubuntu.com/a/18807)
+# dpkg flags
+# First letter -> desired package state ("selection state"):
+# u ... unknown
+# i ... install
+# r ... remove/deinstall
+# p ... purge (remove including config files)
+# h ... hold
+# Second letter -> current package state:
+# n ... not-installed
+# i ... installed
+# c ... config-files (only the config files are installed)
+# u ... unpacked
+# f ... half-configured (configuration failed for some reason)
+# h ... half-installed (installation failed for some reason)
+# w ... triggers-awaited (package is waiting for a trigger from another package)
+# t ... triggers-pending (package has been triggered)
+# Third letter -> error state (you normally shouldn't see a thrid letter):
+# r ... reinst-required (package broken, reinstallation required)
+
-## repositories
-```sh
grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* # list-all-repos
dpkg -r srcclr # remove ?!
```
+
+## see also
+- [[packagemanagers]]
+- [What do the various dpkg flags like 'ii' 'rc' mean? - Ask Ubuntu](http://askubuntu.com/a/18807)
diff --git a/notes/dtrace.md b/notes/dtrace.md
new file mode 100644
index 00000000..0d41f137
--- /dev/null
+++ b/notes/dtrace.md
@@ -0,0 +1,22 @@
+---
+tags: [c]
+title: dtrace
+created: '2020-03-13T13:14:20.494Z'
+modified: '2023-03-25T12:42:08.758Z'
+---
+
+# dtrace
+
+## usage
+
+```sh
+man -k dtrace
+
+dtrace -l -P 'hyperkit$target' -p $(pgrep -f hyperkit)
+```
+
+## see also
+
+- [[hyperkit]]
+- [[strace]]
+- [[signal]]
diff --git a/notes/du.md b/notes/du.md
new file mode 100644
index 00000000..24242ab0
--- /dev/null
+++ b/notes/du.md
@@ -0,0 +1,59 @@
+---
+tags: [coreutils, filesystem]
+title: du
+created: '2019-07-30T06:19:49.046Z'
+modified: '2023-03-22T09:13:33.358Z'
+---
+
+# du
+
+> `disk usage` estimates and displays the disk space used by files.
+
+## env
+
+```sh
+BLOCKSIZE # if set, and -k is not specified, the block counts will be displayed in units of that size block
+ # if not set, and -k is not specified, the block counts will be displayed in 512-byte blocks
+```
+
+## option
+
+```sh
+-c # display a grand total
+-h # "Human-readable" output. Use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte
+-k # sizes in kilobytes (default)
+-s # display only a total for each argument
+-s # display an entry for each specified file. (Equivalent to -d 0)
+```
+
+## usage
+
+```sh
+du -sk ./* | sort -nr # total in kb
+
+du -chsh ./*
+
+du -chsh aufs/diff/* | sort -rk 1 | head -20 # top 20 largest file
+
+du -s * | awk '{sum+=$1} END {print sum}' # sum up disk usage
+
+du -hst # sum up disk usage
+
+du -a . | sort -n -r | head -n 10 # list-top-10-biggest-directories
+
+tar cf - /folder-with-big-files -P | pv -s $(du -sb /folder-with-big-files | awk '{print $1}') | gzip > big-files.tar.gz
+
+
+# measure-disk-space-of-certain-file-types-in-aggregate
+for i in $(find . -type f | perl -ne 'print $1 if m/\.([^.\/]+)$/' | sort -u); do \
+ echo "$i"": ""$(du -hac **/*."$i" | tail -n1 | awk '{print $1;}')";
+done | sort -h -k 2 -r
+```
+
+## see also
+
+- [[df]]
+- [[sort]]
+- [[tar]]
+- [[gzip]]
+- [[pv]]
diff --git a/notes/duckduckgo.md b/notes/duckduckgo.md
new file mode 100644
index 00000000..2350d999
--- /dev/null
+++ b/notes/duckduckgo.md
@@ -0,0 +1,28 @@
+---
+tags: [Notebooks]
+title: duckduckgo
+created: '2020-01-23T08:27:54.958Z'
+modified: '2023-05-24T08:47:15.099Z'
+---
+
+# duckduckgo
+
+> search engine
+
+## usage
+
+```sh
+!die find # foreward search to die.net for man pages
+!m # google maps
+!yt # youtube
+!man
+!manpage
+
+!aws TERM # aws documentation
+!tmg # terraform module registry
+```
+
+## see also
+
+- [[firefox]]
+- [duckduckgo.com/bang](https://duckduckgo.com/bang)
diff --git a/notes/ec2-instance-selector.md b/notes/ec2-instance-selector.md
new file mode 100644
index 00000000..d0628602
--- /dev/null
+++ b/notes/ec2-instance-selector.md
@@ -0,0 +1,43 @@
+---
+tags: [cloud]
+title: ec2-instance-selector
+created: '2022-01-18T19:33:51.186Z'
+modified: '2023-03-24T08:24:24.426Z'
+---
+
+# ec2-instance-selector
+
+> recommends instance types based on resource criteria like vcpus and memory
+
+## install
+
+```sh
+brew tap aws/tap
+brew install ec2-instance-selector
+```
+
+## environment
+
+```sh
+AWS_PROFILE # select aws profile
+```
+
+## option
+
+```sh
+-r REGION # region
+```
+
+## usage
+
+```sh
+ec2-instance-selector --service eks
+
+ec2-instance-selector --memory 4 --vcpus 2 --cpu-architecture x86_64 -r REGION -o table
+
+ec2-instance-selector --network-performance 100 --usage-class spot -r REGION
+```
+
+## see also
+
+- [[aws]]
diff --git a/notes/ecs-cli.md b/notes/ecs-cli.md
new file mode 100644
index 00000000..2037b932
--- /dev/null
+++ b/notes/ecs-cli.md
@@ -0,0 +1,29 @@
+---
+tags: [container]
+title: ecs-cli
+created: '2022-09-30T07:14:13.775Z'
+modified: '2023-03-22T10:19:58.638Z'
+---
+
+# 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]]
diff --git a/notes/ed.md b/notes/ed.md
new file mode 100644
index 00000000..a7a126f8
--- /dev/null
+++ b/notes/ed.md
@@ -0,0 +1,21 @@
+---
+tags: [editor]
+title: ed
+created: '2022-02-15T10:47:55.594Z'
+modified: '2023-03-22T10:24:47.847Z'
+---
+
+# ed
+
+> ed
+
+## usage
+
+```sh
+ed
+```
+
+## see also
+
+- [[grep]]
+- [[vim]]
diff --git a/notes/eksctl.md b/notes/eksctl.md
new file mode 100644
index 00000000..3f073fd3
--- /dev/null
+++ b/notes/eksctl.md
@@ -0,0 +1,92 @@
+---
+tags: [container]
+title: eksctl
+created: '2021-10-13T09:32:12.878Z'
+modified: '2023-03-22T10:19:58.630Z'
+---
+
+# eksctl
+
+> for creating and managing clusters on [[aws]] EKS, written in [[go]], uses `cloudformation`, was created by weaveworks
+
+## install
+
+```sh
+brew tap weaveworks/tap && brew install weaveworks/tap/eksctl
+```
+
+## option
+
+```sh
+--profile=PROFILE # aws profile used to connect
+```
+
+## usage
+
+```sh
+eksctl utils write-kubeconfig PROFILE_NAME
+
+eksctl utils associate-iam-oidc-provider `# create iam oicd provider` \
+ --region AWS_REGION \
+ --cluster CLUSTER_NAME \
+ --approve
+
+eksctl get cluster --name NAME --region REGION
+
+eksctl create cluster --name CLUSTER --nodes 4
+
+
+# completely scaling down nodes to zero use this (max=0 threw errors)
+eksctl scale nodegroup \
+ --cluster CLUSTERNAME \
+ --name NODEGROUPNAME \
+ --nodes 0 --nodes-max 1 --nodes-min 0
+
+
+eksctl delete nodegroup -f CONF.yaml --approve
+
+
+eksctl create fargateprofile \
+ --cluster CLUSTER_NAME \
+ --name NAME \
+ --namespace NAME
+
+
+eksctl get iamidentitymapping --cluster CLUSTER_NAME
+eksctl --profile PROFILE get iamidentitymapping --cluster CLUSTER_NAME
+
+# create the identity mapping within the cluster
+eksctl create iamidentitymapping \
+ --cluster CLUSTER \
+ --arn ROLE_ARN \
+ --group system:masters \
+ --username admin
+
+eksctl create iamidentitymapping \
+ --cluster CLUSTER_NAME \
+ --arn arn:aws:iam::ACCOUNT_ID:role/USER_NAME \
+ --username USER_NAME
+
+eksctl delete iamidentitymapping \
+ --cluster CLUSTER_NAME \
+ --arn arn:aws:iam::ACCOUNT_ID:role/USER_NAME \
+ --username USER_NAME
+
+
+eksctl create iamserviceaccount \
+ --name NAME \
+ --namespace default \
+ --cluster CLUSTER_NAME \
+ --attach-policy-arn arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess \
+ --approve \
+ --override-existing-serviceaccounts
+```
+
+## see also
+
+- [[aws]]
+- [[kubectl]]
+- [[helm]]
+- [[nerdctl]]
+- [[gcloud]]
+- [eksctl.io](https://eksctl.io/)
diff --git a/notes/elm.md b/notes/elm.md
new file mode 100644
index 00000000..d515a291
--- /dev/null
+++ b/notes/elm.md
@@ -0,0 +1,50 @@
+---
+tags: [compiler, javascript]
+title: elm
+created: '2023-05-23T11:55:31.765Z'
+modified: '2023-05-23T12:10:32.221Z'
+---
+
+# elm
+
+> functional language that compiles to [[javascript]]
+
+## install
+
+```sh
+brew install elm
+```
+
+## usage
+
+```sh
+elm repl --help
+elm init --help
+elm reactor --help
+elm make --help
+elm install --help
+elm bump --help
+elm diff --help
+elm publish --help
+```
+
+## repl
+
+```sh
+> 42 / 7.5
+5.6 : Float
+
+> pi
+3.141592653589793 : Float
+
+> List.reverse [ "Next", "Stop", "Pottersville" ]
+["Pottersville","Stop","Next"] : List String
+```
+
+## see also
+
+- [[typescript]]
+- [[node]], [[js]], [[deno]]
+- [[haskell]]
+- [elm-lang.org](https://elm-lang.org/)
+- [github.com/elm/compiler](https://github.com/elm/compiler)
diff --git a/notes/emcc.md b/notes/emcc.md
new file mode 100644
index 00000000..f9b0407d
--- /dev/null
+++ b/notes/emcc.md
@@ -0,0 +1,38 @@
+---
+tags: [compiler]
+title: emcc
+created: '2020-08-31T13:19:52.268Z'
+modified: '2023-03-22T08:25:30.577Z'
+---
+
+# emcc
+
+> emscripten
+
+## option
+
+```sh
+-Os # optimize for size: both for wasm and js
+-s EXPORTED_FUNCTIONS='[..]' #
+ "_someFunc" # export from wasm-module (underscore required !)
+ "_malloc", "_free" # functions will help us work with memory
+-s EXPORTED_RUNTIME_METHODS='[..]' #
+ "ccall" # export ccall-function that emscripten generates for us
+ MODULARIZE=1 # allows use of global module function that returns promise with an instance of wasm module
+```
+
+## usage
+
+```sh
+emcc FILE.c -Os -o FILE.js \
+ -s EXPORTED_FUNCTIONS='["_someFunc", "_malloc", "_free"]' \
+ -s EXPORTED_RUNTIME_METHODS='["ccall"]' \
+ -s MODULARIZE=1
+```
+
+## see also
+
+- [[wasm]]
+- [[rust]]
+- [[clang]]
+- [dassur.ma/things/c-to-webassembly](https://dassur.ma/things/c-to-webassembly/)
diff --git a/notes/entr.md b/notes/entr.md
new file mode 100644
index 00000000..61732ca0
--- /dev/null
+++ b/notes/entr.md
@@ -0,0 +1,59 @@
+---
+tags: [macos]
+title: entr
+created: '2022-04-27T12:10:47.470Z'
+modified: '2023-04-30T13:23:07.058Z'
+---
+
+# entr
+
+> run arbitrary commands when files change
+
+## install
+
+```sh
+brew install entr
+```
+
+## env
+
+```sh
+PAGER # Set to /bin/cat by default to prevent interactive utilities from waiting for keyboard input if output does not fit on the screen
+SHELL # Specify the shell to use with the -s flag. The default is /bin/sh
+EV_TRACE # Print file system event messages
+```
+
+## option
+
+```sh
+-a # respond to all events which occur while the utility is running. Without this option, entr consolidates events in order to avoid looping
+-c # clear the screen before invoking the utility specified on the command line. Specify twice to erase the scrollback buffer
+-d # track the directories of regular files provided as input and exit if a new file is added
+ # This option also enables directories to be specified explicitly
+ # If specified twice, all new entries to a directory are recognized, otherwise files with names beginning with โ.โ are ignored
+-n # run in non-interactive mode. In this mode entr does not attempt to read from the TTY or change its properties
+-p # postpone the first execution of the utility until a file is modified
+-r # reload a persistent child process
+-s # evaluate first argument using the interpreter specified by SHELL environment variable
+ # If standard output is a TTY, the name of the shell and exit code is printed after each invocation
+-z # exit after the utility completes. When combined with -r the utility will be restarted again only in response to commands or file system events
+```
+
+## usage
+
+```sh
+find . -type f -name "*.go" | entr -r go run .
+
+while :; do
+ ls -d src/*.py | entr -d ./setup.py
+done
+```
+
+## see also
+
+- [[find]]
+- [[watch]]
+- [[nodemon]]
+- [[go]]
+- [[make]]
+- [eradman.com/entrproject](http://eradman.com/entrproject/)
diff --git a/notes/env.md b/notes/env.md
new file mode 100644
index 00000000..54dfb7f4
--- /dev/null
+++ b/notes/env.md
@@ -0,0 +1,37 @@
+---
+tags: [shell]
+title: env
+created: '2020-01-17T07:48:51.293Z'
+modified: '2023-03-27T05:23:16.856Z'
+---
+
+# env
+
+> set environment and execute command, or print environment
+
+## option
+
+```sh
+-i # execute utility with only those environment variables specified by name=value options, the environment inherited by env is ignored completely
+-P ALTPATH # search the set of directories as specified by altpath to locate the specified utility program, instead of using the value of the PATH environment variable
+-S string # split apart the given string into multiple strings, and process each of the resulting strings as separate arguments to the env utility
+ # the -S option recognizes some special character escape sequences and also supports environment-variable substitution, as described below
+-u name # if environment variable name is in the environment, then remove it before processing the remaining options
+ # similar to unset command in sh(1). The value for name must not include the โ=โ character
+-v # print verbose information for each step of processing done by the env utility. Additional information will be printed if -v is specified multiple times
+```
+
+## usage
+
+```sh
+env # print environment
+```
+
+## see also
+
+- [[bash export]]
+- [[bash]]
+- [[bash shopt]]
+- [[bash set]]
+- [[envsubst]]
+- [[printenv]]
diff --git a/notes/envsubst.md b/notes/envsubst.md
new file mode 100644
index 00000000..3821b2d7
--- /dev/null
+++ b/notes/envsubst.md
@@ -0,0 +1,46 @@
+---
+tags: [linux]
+title: envsubst
+created: '2020-04-24T11:43:39.417Z'
+modified: '2023-03-27T05:40:05.921Z'
+---
+
+# envsubst
+
+> substitutes environment variables in shell format strings
+
+## install
+
+```sh
+brew install gettext
+apt install gettext-base
+yum install gettext
+```
+
+## option
+
+```sh
+-v, --variables # output the variables occurring in SHELL-FORMAT
+-h, --help # display this help and exit
+-V, --version # output version information and exit
+```
+
+## usage
+
+```sh
+envsubst \$FOO,$\BAR < config.file > config.dist
+
+echo '$HOME' | envsubst # replace env vars in STDIN and output to STDOUT
+
+envsubst < path/to/input # replace env vars in an input file and output to STDOUT
+
+envsubst < path/to/input > path/to/output # replace env vars in an input file and output to a file
+
+envsubst variables < path/to/input # replace env vars in input from a space-separated list
+```
+
+## see also
+
+- [[env]]
+- [[sed]]
+- [gnu.org/software/gettext/manual/gettext.html#envsubst-Invocation](https://www.gnu.org/software/gettext/manual/gettext.html#envsubst-Invocation)
diff --git a/notes/erlang.md b/notes/erlang.md
new file mode 100644
index 00000000..1045409d
--- /dev/null
+++ b/notes/erlang.md
@@ -0,0 +1,64 @@
+---
+tags: [erlang, runtime]
+title: erlang
+created: '2019-07-30T06:19:49.150Z'
+modified: '2023-05-25T11:41:57.285Z'
+---
+
+# erlang
+
+> based originally on [[prolog]], a logic programming language
+
+## env
+
+```sh
+ERL_CRASH_DUMP # filename of crash dump file. If not set crash dump file will be erl_crash.dump in the current directory
+ERL_CRASH_DUMP_NICE # set nice value for the process, thus lowering its priority, range is 1 through 39
+ERL_CRASH_DUMP_SECONDS # number of seconds that the emulator will be allowed to spend writing a crash dump
+ERL_AFLAGS # content of this environment variable will be added to the beginning of the command line for erl
+```
+
+## option
+
+```sh
+-eval EXP # init flag, makes init evaluate the expression EXP, which coordinates system startup
+-noshell # starts a runtime system with no shell, makes it possible to have the runtime system as a component in a series of Unix pipes
+```
+
+## usage
+
+```sh
+erlang
+
+# get version
+erl -eval \
+ '{ok, Version} = file:read_file(filename:join([code:root_dir(), "releases", erlang:system_info(otp_release), "OTP_VERSION"])), io:fwrite(Version), halt().'
+
+erl -eval -noshell -configfd 3 \
+ 'io:format("~p~n",[application:get_env(kernel, logger_level)]),erlang:halt()' 3< \
+ <(echo '[{kernel, [{logger_level, warning}]}].')
+```
+
+## repl
+
+- the shell evaluates expressions, function definitions are not expressions they are forms, erl-file defnies forms not expressions
+- has two levels of grammar: forms and expressions, shell is line-oriented and expression-oriented
+
+```erlang
+help(). -- shell internal commands
+
+f(). -- forget all variable bindings
+
+Foo = 123. -- Variable always start with uppercase
+```
+
+## see also
+
+- [[erlc]]
+- [[rabbitmqctl]]
+- [[haskell]]
+- [erlang.org/doc/man/erl](https://www.erlang.org/doc/man/erl.html)
+- [learnyousomeerlang.com/content](https://learnyousomeerlang.com/content)
+- [blog.stenmans.org/theBeamBook/](https://blog.stenmans.org/theBeamBook/)
+- [defining-erlang-functions-in-the-shell](https://stackoverflow.com/questions/2065990/defining-erlang-functions-in-the-shell)
+- [ulf.wiger.net/weblog/2007/11/20/extending-the-erlang-shell-part-1/](http://ulf.wiger.net/weblog/2007/11/20/extending-the-erlang-shell-part-1/)
diff --git a/notes/erlc.md b/notes/erlc.md
new file mode 100644
index 00000000..c9f23018
--- /dev/null
+++ b/notes/erlc.md
@@ -0,0 +1,12 @@
+---
+tags: [compiler, erlang]
+title: erlc
+created: '2023-05-25T11:42:04.541Z'
+modified: '2023-05-25T11:42:44.141Z'
+---
+
+# erlc
+
+## see also
+
+- [[erlang]]
diff --git a/notes/errno.md b/notes/errno.md
new file mode 100644
index 00000000..7cb59791
--- /dev/null
+++ b/notes/errno.md
@@ -0,0 +1,21 @@
+---
+tags: [moreutils]
+title: errno
+created: '2020-09-01T12:48:44.456Z'
+modified: '2023-03-22T08:27:54.468Z'
+---
+
+# errno
+
+> look up errno macro names, errno codes, and the corresponding descriptions
+
+## usage
+
+```sh
+errno -l # list
+```
+
+## see also
+
+- [[signal]]
+- [[c]]
diff --git a/notes/etcdctl.md b/notes/etcdctl.md
new file mode 100644
index 00000000..925a76c1
--- /dev/null
+++ b/notes/etcdctl.md
@@ -0,0 +1,68 @@
+---
+tags: [systemd]
+title: etcdctl
+created: '2019-09-24T04:24:49.035Z'
+modified: '2023-03-23T08:43:43.627Z'
+---
+
+# etcdctl
+
+> cli client for [[etcd]]
+
+## install
+
+```sh
+brew install etcd
+```
+
+## env
+
+```sh
+ETCDCTL_CACERT # tmp/ca.pem
+ETCDCTL_CERT # tmp/cert.pem
+ETCDCTL_KEY # tmp/key.pem
+ETCDCTL_ENDPOINTS #
+```
+
+## option
+
+```sh
+ --cacert="" # verify certificates of TLS-enabled secure servers using this CA bundle
+ --cert="" # identify secure client using this TLS certificate file
+ --command-timeout=5s # timeout for short running command (excluding dial timeout)
+ --debug[=false] # enable client-side debug logging
+ --dial-timeout=2s # dial timeout for client connections
+-d, --discovery-srv="" # domain name to query for SRV records describing cluster endpoints
+ --discovery-srv-name="" # service name to query when using DNS discovery
+ --endpoints=[127.0.0.1:2379] # gRPC endpoints
+-h, --help[=false] # help for etcdctl
+ --hex[=false] # print byte strings as hex encoded strings
+ --insecure-discovery[=true] # accept insecure SRV records describing cluster endpoints
+ --insecure-skip-tls-verify[=false] # skip server certificate verification
+ --insecure-transport[=true] # disable transport security for client connections
+ --keepalive-time=2s # keepalive time for client connections
+ --keepalive-timeout=6s # keepalive timeout for client connections
+ --key="" # identify secure client using this TLS key file
+ --password="" # password for authentication (if this option is used, --user option shouldn't include password)
+ --user="" # username[:password] for authentication (prompt if password is not supplied)
+-w, --write-out="simple" # output format: json, protobuf, simple, table
+```
+
+## usage
+
+```sh
+etcdctl member list
+
+etcdctl put foo "Hello World!"
+
+etcdctl get foo
+```
+
+## see also
+
+- [github.com/etcd-io/etcd/etcdctl](https://github.com/etcd-io/etcd/tree/main/etcdctl)
+- [[kubectl]]
+- [[consul]]
+- [[zookeeper-shell]]
+- [[redis-cli]]
+- [[raft consesus algorithm]]
diff --git a/notes/ethtool.md b/notes/ethtool.md
new file mode 100644
index 00000000..9929c41a
--- /dev/null
+++ b/notes/ethtool.md
@@ -0,0 +1,24 @@
+---
+tags: [linux, network]
+title: ethtool
+created: '2019-09-03T12:00:55.754Z'
+modified: '2022-03-04T07:47:47.539Z'
+---
+
+# ethtool
+
+> query or control network driver and hardware settings
+
+## usage
+
+```sh
+ethtool # Query or control network driver and hardware settings
+ethtool -g eth0 # Display ring buffer for eth0
+ethtool -i eth0 # Display driver information for eth0
+ethtool -p eth0 # Identify eth0 by sight, typically by causing LEDs to blink on the network port
+ethtool -S eth0 # Display network and driver statistics for eth0
+```
+
+## see also
+
+- [[ip]]
diff --git a/notes/exa.md b/notes/exa.md
new file mode 100644
index 00000000..a9b26d02
--- /dev/null
+++ b/notes/exa.md
@@ -0,0 +1,32 @@
+---
+tags: [rust]
+title: exa
+created: '2021-05-12T16:04:08.292Z'
+modified: '2023-03-22T10:21:27.168Z'
+---
+
+# exa
+
+> `exa` -- a modern replacement for [[ls]] writen in [[rust]]
+
+## install
+
+```sh
+cargo install exa
+brew install exa
+```
+
+## usage
+
+```sh
+exa -F --color=never
+
+exa -la
+```
+
+## see also
+
+- [[ls]]
+- [[procs]]
+- [[rust]]
+- [[cargo]]
diff --git a/notes/expr.md b/notes/expr.md
new file mode 100644
index 00000000..baca800a
--- /dev/null
+++ b/notes/expr.md
@@ -0,0 +1,28 @@
+---
+tags: [linux, shell]
+title: expr
+created: '2019-09-24T06:30:09.956Z'
+modified: '2021-05-12T08:47:10.190Z'
+---
+
+# expr
+
+> `evaluate expression` using only `integer` and tops out at `2^63 - 1`
+
+```sh
+expr 1 + 1 # = 2
+
+myvar=$(expr 1 + 1) # $myvar == 2
+
+expr $myvar + 1 # = 3
+
+expr $myvar / 3 # = 1
+
+expr $myvar \* 3 # = 9
+```
+
+## see also
+- [[bc]]
+- [[expr]]
+- [[bash let.md]]
+- [[bash arithmetic expansion]]
diff --git a/notes/eyeD3.md b/notes/eyeD3.md
new file mode 100644
index 00000000..82af5bed
--- /dev/null
+++ b/notes/eyeD3.md
@@ -0,0 +1,60 @@
+---
+tags: [linux, macos, python]
+title: eyed3
+created: '2019-08-23T14:52:21.967Z'
+modified: '2023-05-11T10:51:56.275Z'
+---
+
+# eyed3
+
+> tagging mp3
+
+## install
+
+```sh
+brew install eye-d3
+```
+
+## option
+
+```sh
+-h, --help # show this help message and exit
+ --version # Display version information and exit
+ --about # Display full version, release name, additional info, and exit
+-r, --recursive # Recurse into subdirectories
+ --exclude PATTERN # A regular expression for path exclusion. May be specified multiple times
+ --fs-encoding ENCODING # Use the specified file system encoding for filenames. Default as it was detected is 'utf-8' but this option is still useful when reading from mounted file systems
+-L, --plugins # List all available plugins
+-P NAME, --plugin NAME # Specify which plugin to use. The default is 'classic'
+-C FILE, --config FILE # Supply a configuration file. The default is '/Users/P00200478/.config/eyeD3/config.ini', although even that is optional
+ --backup # Plugins should honor this option such that a backup is made of any file modified. The backup is made in same directory with a '.orig' extension added
+-Q, --quiet # A hint to plugins to output less
+ --no-color # Suppress color codes in console output. This will happen automatically if the output is not a TTY (e.g. when redirecting to a file)
+ --no-config # do not load the default user config $HOME/.config/eyeD3/config.ini', -c/--config options are still honored if present
+
+-l LEVEL, --log-level LEVEL # Set a log level 'debug', 'verbose', 'info', 'warning', 'error', 'critical'
+--profile # Run using python profiler
+--pdb # Drop into 'pdb' when errors occur
+```
+
+## usage
+
+```sh
+eyed3 FILE.mp3 # list meta info
+
+eyed3 --artist "ARTIST" --album "ALBUM" --title "TITLE" --track "01" FILE # add meta
+
+eyed3 --add-image "cover.jpg:FRONT_COVER" FILE
+
+eyeD3 --remove-all-images FILE
+
+
+
+find . -type f -name "*.mp3" -exec eyed3 {} \; # read metadata form all mp3's
+```
+
+## see also
+
+- [[youtube-dl]]
+- [[python]]
+- [[ffmpeg]]
diff --git a/notes/fdisk.md b/notes/fdisk.md
new file mode 100644
index 00000000..4f525b38
--- /dev/null
+++ b/notes/fdisk.md
@@ -0,0 +1,26 @@
+---
+tags: [filesystem, linux]
+title: fdisk
+created: '2019-09-02T04:54:15.186Z'
+modified: '2020-08-21T08:57:23.995Z'
+---
+
+# fdisk
+
+> Partition table manipulator for Linux
+
+## usage
+```sh
+fdisk -l # lists the partitions on your system.
+
+fdisk -l /dev/sda # only list partitions on the first disk
+
+
+fdisk /dev/sda # enter command mode
+```
+
+## see also
+- [[mkfs]]
+- [[fsck]]
+- [[filesystem]]
+- [[cryptsetup]]
diff --git a/notes/ffmpeg.md b/notes/ffmpeg.md
new file mode 100644
index 00000000..77f11c8d
--- /dev/null
+++ b/notes/ffmpeg.md
@@ -0,0 +1,37 @@
+---
+tags: [linux, macos]
+title: ffmpeg
+created: '2021-03-10T11:11:18.975Z'
+modified: '2023-03-23T10:15:21.149Z'
+---
+
+# ffmpeg
+
+> video and audio converter
+
+## install
+
+```sh
+brew install ffmpeg
+```
+
+## usage
+
+```sh
+ffmpeg -i FILE.mp3 -ss 00:00:00 -to 00:00:20 -c copy COPY.mp3 # crop audio file's first 20sek
+
+
+ffmpeg -i FILE.webp FILE.png # convert .webp to .png
+ffmpeg -i FILE.mov -vcodec h264 -acodec mp2 FILE.mp4 # convert .mov to .mp4
+ffmpeg -i FILE.mov -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis FILE.webm # convert .mov to .webm
+ffmpeg -i FILE.mov -codec:v libtheora -qscale:v 7 -codec:a libvorbis -qscale:a 5 FILE.ogg # convert .mov to .ogg
+
+ffmpeg -i FILE.mov \ `# convert .mov to .gif`
+ -filter_complex "[0:v] fps=12,scale=2048:-1,split [a][b];[a] palettegen [p];[b][p] paletteuse" FILE.gif
+```
+
+## see also
+
+- [[ffplay]]
+- [[imagemagick]]
+- [[youtube-dl]]
diff --git a/notes/ffplay.md b/notes/ffplay.md
new file mode 100644
index 00000000..a8340806
--- /dev/null
+++ b/notes/ffplay.md
@@ -0,0 +1,26 @@
+---
+tags: [linux, macos]
+title: ffplay
+created: '2023-03-21T13:41:50.499Z'
+modified: '2023-03-23T10:15:21.127Z'
+---
+
+# ffplay
+
+> ffplay media player
+
+## install
+
+```sh
+brew install ffmpeg
+```
+
+## usage
+
+```sh
+ffplay FILE.mp4
+```
+
+## see also
+
+- [[ffmpeg]]
diff --git a/notes/file.md b/notes/file.md
new file mode 100644
index 00000000..e8a1dd09
--- /dev/null
+++ b/notes/file.md
@@ -0,0 +1,22 @@
+---
+tags: [linux]
+title: file
+created: '2019-07-30T06:19:49.051Z'
+modified: '2020-03-16T16:32:20.819Z'
+---
+
+# file
+
+> determine file type
+
+## usage
+```sh
+file -I FILE # get encoding
+```
+
+## see also
+- [[iconv]]
+- [[stat]]
+- [[head]]
+- [[which]]
+- [[bash type]]
diff --git a/notes/filesystem hierarchy standard.md b/notes/filesystem hierarchy standard.md
new file mode 100644
index 00000000..0cbf3d82
--- /dev/null
+++ b/notes/filesystem hierarchy standard.md
@@ -0,0 +1,59 @@
+---
+tags: [linux]
+title: filesystem hierarchy standard
+created: '2019-09-02T05:06:01.427Z'
+modified: '2023-05-05T06:54:01.629Z'
+---
+
+# filesystem hierarchy standard
+
+> `fhs - filesystem hierarchy standard` defines the directory structure and content in unix-like os
+> based on the older standard `FSSTND` (filesystem standard)
+
+## path
+
+```sh
+/ # all files and directories appear under the root directory
+
+/boot # contains files related to the initial booting of the computer
+
+/bin # contains binaries usable before /usr partition is mounted. binaries used in very early boot stage or ones that you need to have available in booting single-user mode e.g. cat, ls, mount
+
+/sbin # similar to /bin, but contains programs that are normally run only by the system administrator/ scripts with superuser (root) privileges required
+
+/usr # contains the majority of user utilities and applications
+/usr/bin # Same as first, but for general system-wide binaries.
+/usr/sbin # Same as above, but for scripts with superuser (root) privileges required.
+
+/dev # contains entries for the physical devices that may or may not be present in the hardware
+
+/dev/hda1 # hard drive partition containing the mounted filesystem
+
+/dev/loop0 # loopback devices - allows an ordinary file to be accessed as if it were a block device, enables mounting an entire filesystem within a single large file
+
+# pseudo-devices - like a device file, but instead of acting as a bridge between os and hardware, it's a device driver without an actual device
+/dev/null #
+/dev/zero # pseudo-device
+/dev/urandom # pseudo-device
+/dev/sda1 # pseudo-device
+/dev/shm # see also tmpfs, docker
+/dev/tty1
+/dev/udp # pseudo-device
+/dev/tcp # pseudo-device
+
+/etc # "et cetera" / "editables text config" - contains configuration files
+/lib # contains program libraries
+/media # mount point for removable media
+/var # contains variable files such as logs
+/tmp # contains temporary files
+/home # home directories of users
+```
+
+## see also
+
+- [[filesystem]]
+- [[procfs]]
+- [[sysfs]]
+- [[tmpfs]]
+- [[bash exec]]
+- [[syscall]]
diff --git a/notes/find.md b/notes/find.md
index edeccba1..7d741386 100644
--- a/notes/find.md
+++ b/notes/find.md
@@ -1,61 +1,68 @@
---
-tags: [bash, linux, regex]
+tags: [linux, regex]
title: find
created: '2019-07-30T06:19:49.054Z'
-modified: '2019-07-30T09:04:23.656Z'
+modified: '2023-03-22T08:46:06.920Z'
---
# find
-### exec
-```sh
-find -exec command {} \; # escape semicolon to prevent shell from interpreting it
+> walk a file hierarchy
-find -exec command {} + # each result is appended to command and executed afterwards
-```
+## option
```sh
-# argument _ is $0 in the shell; file-names are passed as the positional arguments
-find . -type f -exec sh -c 'for f; do echo "$f"; done' _ {} +
-
-# executes a separate shell for each file, which is equivalent but slightly slower
-find . -type f -exec sh -c 'echo "$0"' {} \;
+-type
+-exec
```
-[Manipulate file name piped from find command - Unix & Linux Stack Exchange](https://unix.stackexchange.com/a/60470/193945)
+## usage
```sh
-# the second -exec will only run if the first one returns successfully
-find . -exec echo {} \; -exec grep banana {} \;
+find . \( -name '*.txt' -o -name '*.md' \) \! -empty # .txt or .md files under the current directory that are not empty (> 0 bytes).
-# both commands to run regardless of their success or failure
-find . \( -exec echo {} \; -o -exec true \; \) -exec grep banana {} \;
+find . -iname '*expenses*' # case insensitive way to search for filenames
+find . -exec CMD {} \; # escape semicolon to prevent shell from interpreting it
-find . -type d -maxdepth 1 \
- -exec bash -c 'pushd $(pwd) >/dev/null; cd {}; git remote get-url origin; popd >/dev/null;' \;
-
+find . -exec CMD {} + # each result is appended to CMD and executed afterwards
find . -type f -exec chmod 664 '{}' \;
find . -type d -exec chmod ug=rwx,g+s,o=rx '{}' \;
-```
-- [Exclude hidden files when searching with Unix/Linux find? - Super User](https://superuser.com/a/999448)
-- [find -exec with multiple commands - Stack Overflow](https://stackoverflow.com/questions/5119946/find-exec-with-multiple-commands)
-- [Why does find -exec mv {} ./target/ + not work? - Stack Overflow](https://stackoverflow.com/a/5607677)
+find . -type f -exec sh -c 'for f; do echo "$f"; done' _ {} + # argument _ is $0 in the shell; file-names are passed as the positional arguments
+find . -type f -exec sh -c 'echo "$0"' {} \; # executes a separate shell for each file, which is equivalent but slightly slower
+find . -exec echo {} \; -exec grep banana {} \; # the second -exec will only run if the first one returns successfully
-### patterns / regex
-> `-name` uses pattern
-```sh
+find . \( -exec echo {} \; -o -exec true \; \) -exec grep banana {} \; # both CMDs to run regardless of their success or failure
+
+
+find . -type d -maxdepth 1 -exec bash -c 'pushd $(pwd) >/dev/null; cd {}; git remote get-url origin; popd >/dev/null;' \;
+
+
+
+# patterns / regex .. `-name` uses pattern
find . -type f -name "[!.]*" # ignore all dotfiles
find . -type f -name "*.txt" # only .txt files
-```
-> `-regex`
-```sh
+#`-regex`
find ...
+
+# -mtime
+find . -mtime +0 # find files modified greater than 24 hours ago
+find . -mtime 0 # find files modified between now and 1 day ago
+find . -mtime -1 # find files modified less than 1 day ago (SAME AS -mtime 0)
+find . -mtime 1 # find files modified between 24 and 48 hours ago
+find . -mtime +1 # find files modified more than 48 hours ago
```
+
+## see also
+
+- [unix.stackexchange.com/manipulate-file-name-piped-from-find-command](https://unix.stackexchange.com/a/60470/193945)
+- [Exclude hidden files when searching with Unix/Linux find? - Super User](https://superuser.com/a/999448)
+- [stackoverflow.com/find-exec-with-multiple-commands](https://stackoverflow.com/questions/5119946/find-exec-with-multiple-commands)
+- [Why does find -exec mv {} ./target/ + not work? - Stack Overflow](https://stackoverflow.com/a/5607677)
diff --git a/notes/findmnt.md b/notes/findmnt.md
new file mode 100644
index 00000000..3dc62dba
--- /dev/null
+++ b/notes/findmnt.md
@@ -0,0 +1,29 @@
+---
+tags: [linux]
+title: findmnt
+created: '2019-10-17T05:41:04.763Z'
+modified: '2020-03-03T08:44:19.555Z'
+---
+
+# findmnt
+
+> find a filesystem
+
+## usage
+```sh
+findmnt -l # list view
+
+findmnt -t nfs # list nfs mounts
+
+findmnt -it nfs,tmpfs,overlay,nsfs,cgroup,proc # invert search => no nfs, tmpfs, overlay ..
+
+ # -t, --types limit the set of filesystems by FS types
+
+findmnt -l -o target,source
+
+ # -o, --output the output columns to be shown
+```
+
+## see also
+- [[mount]]
+- [[showmount]]
diff --git a/notes/finger.md b/notes/finger.md
new file mode 100644
index 00000000..3d67d5c1
--- /dev/null
+++ b/notes/finger.md
@@ -0,0 +1,21 @@
+---
+tags: [linux]
+title: finger
+created: '2021-05-25T12:02:22.076Z'
+modified: '2023-03-22T11:06:10.887Z'
+---
+
+# finger
+
+> user information lookup program
+
+## usage
+
+```sh
+finger USER
+```
+
+## see also
+
+- [[id]]
+- [[ssh]]
diff --git a/notes/firefox.md b/notes/firefox.md
new file mode 100644
index 00000000..774acf82
--- /dev/null
+++ b/notes/firefox.md
@@ -0,0 +1,65 @@
+---
+tags: [javascript, Notebooks, rust]
+title: firefox
+created: '2019-07-30T06:19:49.054Z'
+modified: '2023-05-24T12:36:45.313Z'
+---
+
+# firefox
+
+> free and open-source web browser developed by mozilla
+
+```
+The Beast continued its studies with renewed Focus, building great Reference works and contemplating new Realities.
+The Beast brought forth its followers and acolytes to create a renewed smaller form of itself and,
+through Mischievous means, sent it out across the world.
+
+from The Book of Mozilla, 6:27
+```
+
+[en.wikipedia.org/wiki/The_Book_of_Mozilla](https://en.wikipedia.org/wiki/The_Book_of_Mozilla)
+
+## about
+
+> type into addr bar
+
+```
+about:about // get all about pages
+about:mozilla // get a easteregg / funny quote
+
+about:preferences#search // jump to seach in preferences
+
+about:telemetry
+
+about:performance // starts taskmanager
+
+about:config
+ dom.webnotifications.enabled = false !
+
+about:logins // lockwise password etc
+```
+
+
+## awesome bar
+
+> changing results on the fly
+
+looking for a specific type of result, like a bookmark or tag, speed up the process of finding it by typing in special characters after each search term in the address bar separated by spaces:
+
+```sh
+^ # search matches in browsing history
+* # search matches in bookmarks
++ # search matches in tagged pages
+~ # search matches in typed pages
+% # search matches in currently open tabs
+# # search matches in page titles
+@ # search matches in web addresses
+$ # search matches in suggestions
+```
+
+## see also
+
+- [[javascript]], [[rust]]
+- [[duckduckgo]]
+- [[macos keyboard shortcuts]]
+- [Awesome Bar - Search your Firefox bookmarks, history and tabs from the address bar](https://support.mozilla.org/en-US/kb/awesome-bar-search-firefox-bookmarks-history-tabs#w_changing-results-on-the-fly)
diff --git a/notes/firewall-cmd.md b/notes/firewall-cmd.md
new file mode 100644
index 00000000..b791e9dd
--- /dev/null
+++ b/notes/firewall-cmd.md
@@ -0,0 +1,104 @@
+---
+tags: [linux]
+title: firewall-cmd
+created: '2019-08-23T13:34:33.074Z'
+modified: '2023-03-17T07:19:08.417Z'
+---
+
+# firewall-cmd
+
+> `firewalld` command line client
+
+## usage
+
+- `firewall-cmd` commands apply to runtime configuration by default
+- using the `--permanent` flag will establish a persistent configuration.
+
+To add and activate a permanent rule, you can use one of two methods.
+
+```sh
+# Add the rule to both the permanent and runtime sets.
+firewall-cmd --zone=public --add-service=http --permanent
+firewall-cmd --zone=public --add-service=http
+
+# Add the rule to the permanent set and reload FirewallD.
+firewall-cmd --zone=public --add-service=http --permanent
+firewall-cmd --reload
+```
+
+```sh
+firewall-cmd --state
+
+systemctl status firewalld
+
+
+firewall-cmd --list-all # print the whole firewalld configuration
+firewall-cmd --list-services
+firewall-cmd --runtime-to-permanent # copy the running configuration to the permanent configuration
+
+# zones
+firewall-cmd --list-all-zones
+firewall-cmd --get-default-zone
+firewall-cmd --get-zones
+firewall-cmd --get-active-zone
+firewall-cmd --get-zone-of-interface=docker0
+
+
+# services
+firewall-cmd --set-default-zone=dmz
+firewall-cmd --zone=dmz --add-interface=eth0
+firewall-cmd --zone=dmz --add-service=http --permanent
+firewall-cmd --zone=dmz --add-service=https --permanent
+firewall-cmd --reload
+
+
+# add port
+firewall-cmd --zone=public --add-port=9002/tcp --permanent
+firewall-cmd --reload
+firewall-cmd --list-porst # list regular ports
+
+
+# list ports per service
+for s in $(firewall-cmd --list-services); do firewall-cmd --permanent --service "$s" --get-ports; done
+
+
+# rich rules
+firewall-cmd --add-rich-rule
+firewall-cmd --list-rich-rules
+firewall-cmd --remove-rich-rule
+
+
+# Allow all IPv4 traffic from host 192.0.2.0.
+firewall-cmd --zone=public --add-rich-rule \
+ 'rule family="ipv4" source address=192.0.2.0 accept'
+
+# Deny IPv4 traffic over TCP from host 192.0.2.0 to port 22.
+firewall-cmd --zone=public --add-rich-rule \
+ 'rule family="ipv4" source address="192.0.2.0" port port=22 protocol=tcp reject'
+
+# Allow IPv4 traffic over TCP from host 192.0.2.0 to port 80, and forward it locally to port 6532.
+firewall-cmd --zone=public --add-rich-rule \
+ 'rule family=ipv4 source address=192.0.2.0 forward-port port=80 protocol=tcp to-port=6532'
+
+# Forward all IPv4 traffic on port 80 to port 8080 on host 198.51.100.0 (masquerade should be active on the zone).
+firewall-cmd --zone=public --add-rich-rule \
+ 'rule family=ipv4 forward-port port=80 protocol=tcp to-port=8080 to-addr=198.51.100.0'
+
+# To list your current Rich Rules in the public zone:
+firewall-cmd --zone=public --list-rich-rules
+
+firewall-cmd --permanent --zone=public --add-rich-rule='rule family=ipv4 source address=10.32.254.1/24 accept' && firewall-cmd --reload
+firewall-cmd --permanent --zone=public --add-rich-rule='rule family=ipv4 source address=10.10.1.1/24 accept' && firewall-cmd --reload
+
+
+# iptables Direct InterfacePermalink
+firewall-cmd --direct --get-all-chains
+firewall-cmd --direct --get-all-rules
+```
+
+## see also
+
+ - [[ip]]
+ - [[firewalld]]
+ - [[iptables]]
+ - [[netstat]]
diff --git a/notes/firewalld.md b/notes/firewalld.md
new file mode 100644
index 00000000..8f900457
--- /dev/null
+++ b/notes/firewalld.md
@@ -0,0 +1,47 @@
+---
+tags: [linux, systemd]
+title: firewalld
+created: '2019-10-23T06:02:01.615Z'
+modified: '2023-03-23T08:40:34.364Z'
+---
+
+# firewalld
+
+> `firewalld` is frontend controller for `iptables` used to implement persistent network traffic rules
+
+- `firewalld` uses `zones` and `services` instead of `chain` and `rules`.
+- It manages rulesets dynamically, allowing updates without breaking existing sessions and connections.
+
+## usage
+
+```sh
+systemctl start firewalld
+systemctl enable firewalld
+
+systemctl stop firewalld
+systemctl disable firewalld
+
+systemctl status firewalld
+```
+
+## config
+
+- `firewalld` is configured with `xml` files
+- `firewalld` uses two configuration sets:
+ - `Runtime`: configuration changes are not retained on reboot or upon restarting FirewallD
+ - `Permanent`: changes are not applied to a running system.
+
+```sh
+/usr/lib/firewalld # holds default configurations like default zones and common services. will be overwritten by each firewalld package update.
+
+/etc/firewalld # holds system configuration files. These files will overwrite a default configuration.
+```
+
+## see also
+
+- [[firewall-cmd]]
+- [[iptables]]
+- https://firewalld.org/
+- https://www.linode.com/docs/security/firewalls/introduction-to-firewalld-on-centos/
+- [[systemd]]
+- [[systemctl]]
diff --git a/notes/flux.md b/notes/flux.md
new file mode 100644
index 00000000..685e3e1a
--- /dev/null
+++ b/notes/flux.md
@@ -0,0 +1,28 @@
+---
+tags: [container]
+title: flux
+created: '2022-01-17T13:49:51.051Z'
+modified: '2023-03-22T10:35:51.885Z'
+---
+
+# flux
+
+> tool for keeping Kubernetes clusters in sync with sources of configuration, and automating updates to configuration when there is new code to deploy
+
+## install
+
+```sh
+brew install fluxcd/tap/flux
+```
+
+## usage
+
+```sh
+flux check --pre
+```
+
+## see also
+
+- [[gitops]]
+- [[argocd]]
+- [fluxcd.io/docs](https://fluxcd.io/docs/)
diff --git a/notes/fmt.md b/notes/fmt.md
new file mode 100644
index 00000000..dbdb7041
--- /dev/null
+++ b/notes/fmt.md
@@ -0,0 +1,40 @@
+---
+tags: [macos]
+title: fmt
+created: '2023-04-12T11:57:47.449Z'
+modified: '2023-05-15T13:06:29.906Z'
+---
+
+# fmt
+
+> simple text formatter
+
+## option
+
+```sh
+-c # Center the text, line by line. In this case, most of the other options are ignored; no splitting or joining of lines is done
+-m # Try to format mail header lines contained in the input sensibly
+-n # Format lines beginning with a โ.โ (dot) character
+-p # Allow indented paragraphs. Without the -p flag, any change in the amount of whitespace at the start of a line results in a new paragraph being begun
+-s # Collapse whitespace inside lines, so that multiple whitespace characters are turned into a single space. (Or, at the end of a sentence, a double space.
+-d chars # Treat the chars (and no others) as sentence-ending characters. By default the sentence-ending characters are full stop (โ.โ), question mark (โ?โ) and exclamation mark (โ!โ)
+-l number # Replace multiple spaces with tabs at the start of each output line, if possible. Each number spaces will be replaced with one tab. The default is 8. If number is 0, spaces are preserved
+-t number # Assume that the input files' tabs assume number spaces per tab stop. The default is 8
+```
+
+## usage
+
+```sh
+# Center the text in standard input
+echo -e 'The merit of all things\nlies\nin their difficulty' | fmt -c
+
+
+# Format the text in standard input collapsing spaces
+echo -e 'Multiple spaces will be collapsed' | fmt -s
+```
+
+## see also
+
+- [[coreutils]]
+- [[go]]
+- [[bash echo]]
diff --git a/notes/fossil.md b/notes/fossil.md
new file mode 100644
index 00000000..bb170d87
--- /dev/null
+++ b/notes/fossil.md
@@ -0,0 +1,43 @@
+---
+tags: [linux]
+title: fossil
+created: '2020-07-02T06:23:57.933Z'
+modified: '2023-03-25T12:25:04.119Z'
+---
+
+# fossil
+
+> simple, high-reliability, distributed software configuration management system
+
+> integrated bug-tracking, wiki, forum, technotes and built-in web ui
+> single self-contained stand-alone executable
+> uses ordinary http, https or ssh
+> no server is required
+> supports "autosync" mode
+> stores content using an enduring file format in an SQLite database
+> free and Open-Source
+
+## install
+
+```sh
+brew install fossil
+```
+
+## usage
+
+```sh
+fossil init new-repository
+
+fossil open new-repository
+
+fossil add choices.xml
+
+fossil commit -m "added choices.xml"
+
+fossil ui
+```
+
+## see also
+
+- [[git]]
+- [[sqlite]]
diff --git a/notes/free.md b/notes/free.md
new file mode 100644
index 00000000..11fabbcd
--- /dev/null
+++ b/notes/free.md
@@ -0,0 +1,50 @@
+---
+tags: [linux]
+title: free
+created: '2019-07-30T06:19:49.055Z'
+modified: '2023-03-22T08:23:16.512Z'
+---
+
+# free
+
+## install
+
+```sh
+apt-get install procps
+```
+
+## usage
+
+```sh
+free -h # human readable
+
+# total used free shared buff/cache available
+# Mem: 7.8G 4.7G 152M 19M 3.0G 2.8G
+# Swap: 2.8G 413M 2.4G
+#
+# total Total installed memory (MemTotal and SwapTotal in /proc/meminfo)
+# used Used memory (calculated as total - free - buffers - cache)
+# free Unused memory (MemFree and SwapFree in /proc/meminfo)
+# shared Memory used (mostly) by tmpfs (Shmem in /proc/meminfo, on kernels 2.6.32, displayed as zero if not available)
+# buff/cache Sum of buffers and cache
+# buffers Memory used by kernel buffers (Buffers in /proc/meminfo)
+# cache Memory used by the page cache and slabs (Cached and Slab in /proc/meminfo)
+# available Estimation of how much memory is available for starting new applications, without swapping.
+# Unlike the data provided by the cache or free fields, this field takes into account page cache and also that not all reclaimable memory slabs will be reclaimed due to items being in use (MemAvailable in /proc/meminfo, available on kernels 3.14, emulated on kernels 2.6.27+, otherwise the same as free)
+```
+
+```sh
+cat /proc/meminfo
+
+sudo sync && sudo sh -c "echo 1 > /proc/sys/vm/drop_caches" # clear memory cache
+```
+
+## see also
+
+- [[procps]]
+- [[procfs]]
+- [[docker]]
+- [[numfmt]]
+- [[top]]
+- [How to Clear RAM Memory Cache, Buffer and Swap Space on Linux](https://www.tecmint.com/clear-ram-memory-cache-buffer-and-swap-space-on-linux/)
+
diff --git a/notes/freedesktop xdg.md b/notes/freedesktop xdg.md
new file mode 100644
index 00000000..3a26683c
--- /dev/null
+++ b/notes/freedesktop xdg.md
@@ -0,0 +1,43 @@
+---
+tags: [Notebooks]
+title: freedesktop xdg
+created: '2023-04-26T11:21:25.119Z'
+modified: '2023-04-26T11:37:42.670Z'
+---
+
+# freedesktop xdg
+
+> Cross-Desktop Group
+
+## desktop base directories `basedir`
+
+> defines location fo application configuration and data files
+
+### xdg environment vairables
+
+```sh
+XDG_CONFIG_HOME # user-specific config files default $HOME/.config
+XDG_DATA_HOME # user-specific data files default $HOME/.local/share
+XDG_STATE_HOME # user-specific state data default $HOME/.local/state
+XDG_CACHE_HOME # user-specific non-essential (cached) data default $HOME/.cache
+XDG_RUNTIME_DIR # runtime files bound to the login status of the user
+
+# XDG_CONFIG_DIRS and XDG_DATA_DIRS can be used to define an ordered set of directories to search for their respective files, rather than just a single directory
+
+# macos specific
+XDG_CONFIG_HOME # ~/Library/Preferences/ using reverse domain name notation: com.apple.AppStore.appname
+XDG_DATA_HOME # ~/Library/
+XDG_CACHE_HOME # ~/Library/Caches/
+```
+
+[specifications.freedesktop.org/basedir-spec](https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.html)
+
+## desktop entries `.desktop`
+
+> defines executable, applicaiton name, icon and description used by app launchers and desktop menus
+
+## see also
+
+- [[alacrity]]
+- [[tmux]]
+- [[nvim]]
diff --git a/notes/fsck.md b/notes/fsck.md
new file mode 100644
index 00000000..39e93ea7
--- /dev/null
+++ b/notes/fsck.md
@@ -0,0 +1,31 @@
+---
+tags: [linux]
+title: fsck
+created: '2020-05-06T13:18:59.979Z'
+modified: '2023-03-23T10:14:58.774Z'
+---
+
+# fsck
+
+> check and repair a linux filesystem
+
+## usage
+```sh
+umount /dev/sdb1
+fsck /dev/sdb1
+
+
+fsck -a /dev/sda1 # autorepair
+fsck -y /dev/sda1 # yes everything
+
+fsck -A # check all filesystems
+fsck -AR -y # fix all except root-fs
+
+fsck -M /dev/sdc1 # prevent checking mounted filesystem
+```
+
+## see also
+- [[fdisk]]
+- [[fstab]]
+- [[mount]]
+- [[yes]]
diff --git a/notes/fstab.md b/notes/fstab.md
new file mode 100644
index 00000000..1216eb1d
--- /dev/null
+++ b/notes/fstab.md
@@ -0,0 +1,26 @@
+---
+tags: [filesystem]
+title: fstab
+created: '2020-01-07T08:18:54.224Z'
+modified: '2020-09-02T17:34:28.006Z'
+---
+
+# fstab
+
+> can be used to define how disk partitions, various other block devices, or remote filesystems should be mounted into the filesystem
+
+## usage
+```sh
+cat /etc/fstab
+
+# If the line starts with UUID=xyz, this means it's a physical partition.
+# If the line starst with /dev/sdaX, it also means it's a physical partition.
+# The indicator for LVM would be something with /dev/mapper/xyz
+```
+
+## see also
+- [[fsck]]
+- [[fdisk]]
+- [[findmnt]]
+- [[lvdisplay]]
+- https://wiki.archlinux.org/index.php/fstab
diff --git a/notes/fswatch.md b/notes/fswatch.md
new file mode 100644
index 00000000..b6387f89
--- /dev/null
+++ b/notes/fswatch.md
@@ -0,0 +1,29 @@
+---
+tags: [macos]
+title: fswatch
+created: '2021-10-19T10:15:19.670Z'
+modified: '2023-03-25T12:32:53.495Z'
+---
+
+# fswatch
+
+> file change monitor that receives notifications when the contents of the specified files or directories are modified
+
+## install
+
+```sh
+brew install fswatch
+```
+
+## usage
+
+```sh
+fswatch . | xargs -n 1 -I {} echo {}
+```
+
+## see also
+
+- [[entr]]
+- [[watch]]
+- [[xargs]]
+- [emcrisostomo.github.io/fswatch](https://emcrisostomo.github.io/fswatch/)
diff --git a/notes/ftp.md b/notes/ftp.md
index 1554dfe9..f04cdb1c 100644
--- a/notes/ftp.md
+++ b/notes/ftp.md
@@ -1,26 +1,70 @@
---
-tags: [bash, linux]
+tags: [linux]
title: ftp
created: '2019-07-30T06:19:49.056Z'
-modified: '2019-07-30T09:04:31.251Z'
+modified: '2020-04-14T07:16:21.955Z'
---
# ftp
-[List of FTP Commands for Linux and UNIX \| Serv-U](https://www.serv-u.com/features/file-transfer-protocol-server-linux/commands)
+> ftp is the user interface to the `Internet standard File Transfer Protocol`, which transfers files to and from a remote network site
+- ftp sessions operate on a `command-/control-channel` and `data-channel` which are separate TCP connections
+- connection mode determines how a `data-connection` is established (`active`/`passive`)
+```sh
+# active mode: client establishes the command-channel but the server is responsible for establishing the data channel
+# client port:rand-1 ---1--> port:21 ftp-server
+# client port:rand-2 <--2--- port:20 ftp server
+
+# passive mode: client establishes both channels
+# client port:rand-1 ---1--> port:21 ftp-server
+# client port:rand-2 ---2--> port:rand ftp-server
+```
+## install
+`yum install ftp`
+## usage
```sh
-ftp 193.201.168.9
+ftp IP
+ftp HOST
+ftp ftp://user:pass@HOST:PORT
-ftp> help # list commands
-ftp> ls
-ftp> cd
+? # request help or information about the FTP commands
+help # request a list of all available FTP commands
+! # escape shell; run command on local e.g. `!ls`
+cup
+pass # go into passive mode
+stat # returns information on the server status, including the status of the current connection
+type # return current transfer mode
+ascii # set the mode of file transfer to ASCII (transmits 7 bits per character)
+binary # set the mode of file transfer to binary (transmits 8 bits per byte; less chance of a transmission error)
-ftp> cup
+open # open a connection with another computer
+open HOST PORT # opens a new FTP connection with HOST and PORT; if no username and password are entered it is a anonymous connection
+bye # exit the FTP environment
+quit # exit the FTP environment
+close # terminate a connection with another computer
+close HOST # closes the current FTP connection with HOST, but still leaves you within the FTP environment.
-ftp> pwd
+pwd # print working dir on the remote machine
+ls # list files in the current remote dir
+cd # change dir on the remote machine
+lcd # change dir on your local machine
+mkdir # make a new dir within the current remote dir
+get # copy one file from the remote machine to the local machine
+get FOO BAR # copies file FOO in current remote dir to file named BAR in your current local dir
+get FOO # copies file FOO in current remote dir to your current local dir
+mget # copy multiple files from the remote machine to the local machine
+mget * # copies all the files in the current remote dir to your current local dir, using the same filenames. Notice the use of the wild card character, *.
+mput # copy multiple files from the local machine to the remote machine
+put # copy one file from the local machine to the remote machine
+delete # delete file in the current remote dir
+rmdir # remove dir in the current remote directory
```
+
+## see also
+- [List of FTP Commands for Linux and UNIX \| Serv-U](https://www.serv-u.com/features/file-transfer-protocol-server-linux/commands)
+- [[vsftpd]]
diff --git a/notes/functional paradigm.md b/notes/functional paradigm.md
new file mode 100644
index 00000000..b5b511e4
--- /dev/null
+++ b/notes/functional paradigm.md
@@ -0,0 +1,25 @@
+---
+tags: [Notebooks]
+title: functional paradigm
+created: '2020-06-22T07:38:19.899Z'
+modified: '2020-09-02T17:49:28.234Z'
+---
+
+# functional paradigm
+
+functional programming models computation as the evaluation of expressions
+
+- programs execute by evaluate expressions
+- funcions are first-class
+ - functions are treated as values
+ - functions are passed as arguments
+ - function are returned as results
+- HOF - Higher Order Functions (passed as arguments e.g. map Fn->List)
+- Immutable Data
+- Referential transparency (pure computation, yield same result each time invoked)
+- lazy evaluation (avoid unnecessary computation)
+- recursion
+
+
+## see also
+- [[oo paradigm]]
diff --git a/notes/fuser.md b/notes/fuser.md
new file mode 100644
index 00000000..7e5d04df
--- /dev/null
+++ b/notes/fuser.md
@@ -0,0 +1,21 @@
+---
+tags: [linux]
+title: fuser
+created: '2020-03-09T10:22:00.327Z'
+modified: '2020-09-02T17:52:01.714Z'
+---
+
+# fuser
+> fuser - identify processes using files or sockets
+
+## usage
+```sh
+fuser /mnt/data # find processes using a filesystem
+
+fuser -k /mnt/data # kill all processes using a filesystem
+fuser -k -9 /mnt/data
+```
+## see also
+- [[mount]]
+- [[lsof]]
+- [force-linux-unmount-filesystem-reporting-device-busy/](https://www.systutorials.com/force-linux-unmount-filesystem-reporting-device-busy/)
diff --git a/notes/fx.md b/notes/fx.md
new file mode 100644
index 00000000..e6c73c1e
--- /dev/null
+++ b/notes/fx.md
@@ -0,0 +1,35 @@
+---
+tags: [json]
+title: fx
+created: '2021-02-15T08:54:44.797Z'
+modified: '2023-03-22T10:27:21.635Z'
+---
+
+# fx
+
+> `Function eXecution` - cli json processing tool
+
+## install
+
+```sh
+npm install -g fx
+```
+
+## usage
+
+```sh
+curl API |ย fx
+
+curl ... | fx '.filter(x => x.startsWith("a"))'
+
+echo '{"count": 0}' | fx '{...this, count: 1}'
+
+fx commits.json | fx .[].author.name
+```
+
+## see also
+
+- [[jq]]
+- [[jless]]
+- [[npm]]
+- [github.com/antonmedv/fx](https://github.com/antonmedv/fx)
diff --git a/notes/fzf.md b/notes/fzf.md
new file mode 100644
index 00000000..22c9fd84
--- /dev/null
+++ b/notes/fzf.md
@@ -0,0 +1,60 @@
+---
+tags: [linux, macos]
+title: fzf
+created: '2019-07-30T06:19:49.058Z'
+modified: '2023-04-21T12:26:49.837Z'
+---
+
+# fzf
+
+> command-line fuzzy finder
+
+## installation
+
+```sh
+brew install fzf
+```
+
+## env
+
+```sh
+FZF_DEFAULT_COMMAND # default command to use when input is tty
+ # โ ๏ธ variable is not used by shell extensions due to the slight difference in requirements
+ # e.g. CTRL-T runs $FZF_CTRL_T_COMMAND instead,
+ # vim ** runs _fzf_compgen_path(),
+ # and cd ** runs _fzf_compgen_dir()
+FZF_DEFAULT_COMMAND='fd --type f'
+
+
+FZF_DEFAULT_OPTS # default options
+FZF_DEFAULT_OPTS="--layout=reverse --inline-info"
+```
+
+## option
+
+```sh
+
+```
+
+## key bindings
+
+```sh
+^-T # Paste the selected files and directories onto the command-line
+ # Set FZF_CTRL_T_COMMAND to override the default command
+ # Set FZF_CTRL_T_OPTS to pass additional options
+
+^-R # Paste the selected command from history onto the command-line
+ # If you want to see the commands in chronological order, press CTRL-R again which toggles sorting by relevance
+ # Set FZF_CTRL_R_OPTS to pass additional options
+
+โฅ-C # cd into the selected directory
+ # Set FZF_ALT_C_COMMAND to override the default command
+ # Set FZF_ALT_C_OPTS to pass additional options
+```
+
+## see also
+
+- [[tmux]]
+- [[bash history]]
+- [[macos keyboard shortcuts]]
+- [github.com/junegunn/fzf#using-homebrew-or-linuxbrew](https://github.com/junegunn/fzf#using-homebrew-or-linuxbrew)
diff --git a/notes/g++.md b/notes/g++.md
new file mode 100644
index 00000000..50c5a889
--- /dev/null
+++ b/notes/g++.md
@@ -0,0 +1,21 @@
+---
+tags: [c, compiler]
+title: g++
+created: '2019-08-21T14:40:44.446Z'
+modified: '2023-05-08T18:12:34.420Z'
+---
+
+# g++
+
+> g++ is a script to call gcc with options to recognize c++
+
+## usage
+
+```sh
+g++ -std=c++11 file.cpp -o file
+```
+
+## see also
+
+- [[gcc]], [[c]], [[c++]], [[clang++]]
+- [what-is-the-difference-between-g-and-gcc](https://stackoverflow.com/questions/172587/what-is-the-difference-between-g-and-gcc)
diff --git a/notes/gcc and g++.md b/notes/gcc and g++.md
deleted file mode 100644
index be3c0c92..00000000
--- a/notes/gcc and g++.md
+++ /dev/null
@@ -1,26 +0,0 @@
----
-tags: [lang]
-title: gcc and g++
-created: '2019-07-30T06:19:49.029Z'
-modified: '2019-07-30T07:58:35.164Z'
----
-
-# gcc and g++
-```
-1. pre-processing => 2. compiling => 3. assembly => 4. linking
- output: file.i => output: file.s => output:file.o => output: file
-```
-
-## gcc
-
-```sh
-gcc -o file_sum file_sum.c
-
-gcc -Wall -g -O0 -o file_sum file_sum.c
-```
-
-## g++
-
-```sh
-g++ -std=c++11 vector-out-of-bounds.cpp -o vector-out-of-bounds
-```
diff --git a/notes/gcc.md b/notes/gcc.md
new file mode 100644
index 00000000..4a0ce387
--- /dev/null
+++ b/notes/gcc.md
@@ -0,0 +1,70 @@
+---
+tags: [c, compiler, linux, macos]
+title: gcc
+created: '2019-07-30T06:19:49.029Z'
+modified: '2023-05-09T06:57:06.105Z'
+---
+
+# gcc
+
+> `gnu compiler collection` includes front ends for `c`, `c++`, `objective-C`, Fortran, Ada, [[go]], and D, as well as libraries for these languages (libstdc++,...).
+> `gcc` was originally written as the compiler for the GNU operating system.
+
+```
+step: pre-processing => compiling => assembly => linking
+output: file.i => file.s => ile.o => file
+```
+
+## install
+
+```sh
+yum -y install gcc
+```
+
+## option
+
+```sh
+-o FILE # output file
+-WTYPE # warning
+-g FILE # add debugging symbols for gdb
+```
+
+## usage
+
+```sh
+gcc -o file file.c # creates dynamically linked binary
+
+gcc -o file file.c -static # creates static binary
+
+gcc -c file.c # generates "object file": `file.o`; only run preprocess, compile, and assemble steps
+gcc file.o # generates "assembler output": `a.out`
+ld file.o -lc # link to `libc`
+
+gcc -Wall -g -O0 -o file file.c
+
+
+gcc -xc++ -lstdc++ -shared-libgcc # equivalent to g++
+
+gcc -dM -E - < /dev/null # dump preprocessor defines / macros
+gcc -E -dM -include sys/socket.h - < /dev/null # dump preprocessor defines of header file
+
+$(gcc -print-prog-name=cpp) -v " > t.c; gcc -v t.c; rm t.c
+LC_ALL=C gcc -v -E -xc - < /dev/null 2>&1 | LC_ALL=C sed -ne '/starts here/,/End of/p'
+
+echo | gcc -E -xc -include 'stddef.h' - | grep size_t # lookup type of size_t
+# typedef long unsigned int size_t;
+```
+
+## see also
+
+- [[as]]
+- [[cc]]
+- [[g++]]
+- [[ld]]
+- [[ldd]]
+- [[go]]
+- [[rustc]]
+- [[nm]]
+- [[make]]
+- [[gdb]]
diff --git a/notes/gcloud.md b/notes/gcloud.md
new file mode 100644
index 00000000..fcd6d51d
--- /dev/null
+++ b/notes/gcloud.md
@@ -0,0 +1,62 @@
+---
+tags: [container]
+title: gcloud
+created: '2019-07-30T06:19:49.144Z'
+modified: '2023-03-22T10:09:58.402Z'
+---
+
+# gcloud
+
+> manage google cloud platform resources and developer workflow
+
+## install
+
+```sh
+brew ?
+```
+
+## usage
+
+```sh
+gcloud init
+
+gcloud projects list
+
+gcloud projects list --format='value(projectId)'
+ --format='value(name)'
+ --format='value(project_number)'
+ --format='value(project_id)'
+ --format='value(project_id)' --filter='project_id ~ principal'
+ --format='value(project_id)' --filter='project_id ~ foo'
+ --format='value(project_id)' --filter='project_id ~ ^printcipal'
+ --format='value(project_id)' --filter='project_id ~ ^print'
+ --format='value(project_id)' --filter='project_id ~ ^princ'
+ --format='value(project_id)' --filter='project_id ~ ^principal'
+
+
+gcloud iam service-accounts list --project="$(gcloud projects list --format='value(project_id)')"
+
+gcloud compute instances list --project="$(gcloud projects list --format='value(project_id)')"
+
+gcloud --verbosity=debug compute ssh gke-kubia-default-pool-12345678-12ab
+
+
+gcloud container clusters list
+
+gcloud container clusters get-credentials [kubia]
+
+ssh -t -i /Users/user/.ssh/google_compute_engine \
+ -o CheckHostIP=no \
+ -o HostKeyAlias=compute.140709..0101147 \
+ -o IdentitiesOnly=yes \
+ -o StrictHostKeyChecking=no \
+ -o UserKnownHostsFile=/Users/user/.ssh/google_compute_known_hosts \
+ USER@HOST
+```
+
+## see also
+
+- [[kubectl]]
+- [[eksctl]]
+- [[aws]]
+- [[ssh]]
diff --git a/notes/gdb.md b/notes/gdb.md
new file mode 100644
index 00000000..1972262f
--- /dev/null
+++ b/notes/gdb.md
@@ -0,0 +1,36 @@
+---
+tags: [c, linux, macos]
+title: gdb
+created: '2020-04-23T11:34:04.413Z'
+modified: '2023-05-04T15:35:28.596Z'
+---
+
+# gdb
+
+> gnu debugger
+
+## install
+
+```sh
+apt install gdb
+brew install gdb # x86_64 architecture is require !
+```
+
+## option
+
+```sh
+-q, --quiet, --silent # won't print warranty etc.
+```
+
+## usage
+
+```sh
+gdb --version
+
+gdb -q BINARY
+```
+
+## see also
+
+- [[gcc]]
+- [[lldb]]
diff --git a/notes/gem.md b/notes/gem.md
new file mode 100644
index 00000000..6655e61a
--- /dev/null
+++ b/notes/gem.md
@@ -0,0 +1,36 @@
+---
+tags: [packagemanager, ruby]
+title: gem
+created: '2019-07-30T06:19:49.225Z'
+modified: '2023-03-22T08:46:59.770Z'
+---
+
+# gem
+
+> download, install, and use ruby software packages on your system.
+> a package is called a `gem` which contains a packaged Ruby application or library.
+
+## env
+
+```sh
+GEM_PATH # $HOME/.gem
+GEM_HOME # $HOME/.gem
+```
+
+## usage
+
+```sh
+gem search ^rails
+
+gem list # list installed gems
+
+gem install drip # install gem
+
+gem uninstall drip # uninstall gem
+```
+
+## see also
+
+- [rubygems.org](https://rubygems.org/)
+- [[ruby]]
+- [[pip]]
diff --git a/notes/getcap.md b/notes/getcap.md
new file mode 100644
index 00000000..804d9286
--- /dev/null
+++ b/notes/getcap.md
@@ -0,0 +1,17 @@
+---
+tags: [container]
+title: getcap
+created: '2020-01-15T09:25:10.201Z'
+modified: '2020-09-02T17:26:55.853Z'
+---
+
+# getcap
+
+## usage
+```sh
+capsh --print
+```
+
+## see also
+- [[capabilities]]
+- [[capsh]]
diff --git a/notes/getopt.md b/notes/getopt.md
new file mode 100644
index 00000000..7e190cf1
--- /dev/null
+++ b/notes/getopt.md
@@ -0,0 +1,51 @@
+---
+tags: [shell]
+title: getopt
+created: '2020-03-16T18:01:43.018Z'
+modified: '2022-11-29T08:22:11.256Z'
+---
+
+# getopt
+
+> parse option arguments - is not a [[bash]] builtin !
+
+## usage
+
+```sh
+set -o errexit -o noclobber -o nounset -o pipefail
+params="$(getopt -o ab:c -l alpha,bravo:,charlie --name "$0" -- "$@")"
+#printf 'params: %q\n' $params
+eval set -- "$params"
+#printf '\nargs:%q\n' $*
+while :; do
+ case "$1" in
+ -a|--alpha)
+ echo alpha
+ shift
+ ;;
+ -b|--bravo)
+ echo "bravo=$2"
+ shift 2
+ ;;
+ -c|--charlie)
+ echo charlie
+ shift
+ ;;
+ --)
+ shift
+ break
+ ;;
+ *)
+ echo "Not implemented: $1" >&2
+ exit 1
+ ;;
+ esac
+done
+```
+
+## see also
+
+- [[bash getopts]]
+- [[bash while]]
+- [[bash case]]
+- [[bash eval]]
diff --git a/notes/gh.md b/notes/gh.md
new file mode 100644
index 00000000..9385c5d2
--- /dev/null
+++ b/notes/gh.md
@@ -0,0 +1,71 @@
+---
+tags: [linux, macos]
+title: gh
+created: '2020-11-20T23:44:36.008Z'
+modified: '2023-03-23T10:15:21.157Z'
+---
+
+# gh
+
+> github cli
+
+## install
+
+```sh
+brew install gh
+```
+
+## env
+
+```sh
+GH_TOKEN, GITHUB_TOKEN # an authentication token for github.com API requests. Setting this avoids being prompted to authenticate and takes precedence over previously stored credentials (in order of precedence)
+GH_ENTERPRISE_TOKEN # an authentication token for API requests to GitHub Enterprise
+GITHUB_ENTERPRISE_TOKEN # (in order of precedence)
+GH_REPO # specify the GitHub repository in the "[HOST/]OWNER/REPO" format for commands that otherwise operate on a local repository
+GH_HOST # specify the GitHub hostname for commands that would otherwise assume the "github.com" host when not in a context of an existing repository
+GH_EDITOR # the editor tool to use for authoring text
+GIT_EDITOR,VISUAL,EDITOR # (in order of precedence)
+BROWSER # web browser to use
+DEBUG # set to any value to enable verbose output to standard error. Include values "api" or "oauth" to print detailed information about HTTP requests or authentication flow
+GH_PAGER, PAGER # a terminal paging program to send standard output to, e.g. "less" (in order of precedence)
+GLAMOUR_STYLE # the style to use for rendering Markdown. See https /# /github.com/charmbracelet/glamour#styles
+NO_COLOR # set to any value to avoid printing ANSI escape sequences for color output
+CLICOLOR # set to "0" to disable printing ANSI colors in output
+CLICOLOR_FORCE # set to a value other than "0" to keep ANSI colors in output even when the output is piped
+GH_NO_UPDATE_NOTIFIER # set to any value to disable update notifications. By default, gh checks for new releases once every 24 hours and displays an upgrade notice on standard error if a newer version was found
+GH_CONFIG_DIR, XDG_CONFIG_HOME # directory where gh will store configuration files (in order of precedence)
+XDG_STATE_HOME # directory where gh will store state files
+XDG_DATA_HOME # directory where gh will store data files
+```
+
+## usage
+
+```sh
+gh help environment # list supported environment variables
+
+gh repo list [OWNER|ORG] --limit 1000
+
+gh repo create REPOSITORY
+
+gh repo view --web
+
+
+
+gh pr view --web
+
+gh pr list --all
+
+gh pr create \
+ --base "$(git name-rev $(git rev-parse @{-1}) --name-only)" \
+ --title "$(git rev-parse --abbrev-ref HEAD)" --body ""
+
+
+gh api repos/{owner}/{repo}/releases --jq '.[] | .url, .tag_name'
+```
+
+## see also
+
+- [[glab]]
+- [[git]]
+- [[api github]]
+- [github.com/cli/cli](https://github.com/cli/cli)
diff --git a/notes/ghci.md b/notes/ghci.md
new file mode 100644
index 00000000..a24f51a3
--- /dev/null
+++ b/notes/ghci.md
@@ -0,0 +1,79 @@
+---
+tags: [compiler, linux, macos]
+title: ghci
+created: '2021-02-03T12:56:01.739Z'
+modified: '2023-05-25T16:13:23.467Z'
+---
+
+# ghci
+
+> `g`lasgow `h`askell `c`ompiler `i`nteractive
+
+## install
+
+```sh
+brew install ghc cabal-install
+```
+
+## usage
+
+```sh
+ghci # starts haskell repl
+
+ghc -O2 --make FILE.hs -threaded -rtsopts # compiling with -threaded and optimizations on
+```
+
+## repl
+
+```sh
+:l functions # loads functions.hs from same folder
+:r # reloads current script, same as loading file
+
+:set prompt "ghci> " # change prompt
+
+
+> 5 * 2 -- * is a infix-function
+> succ 8 -- succ is a prefix-function
+9 -- succ takes anything that as a defined "sucessor" and returns it
+
+> FUNCTION_NAME PARAMETER1 PARAMETER2 ..
+
+> succ 9 + max 5 4 + 1
+16
+> (succ 9) + (max 5 4) + 1
+16
+
+> 92 `div` 10 -- functions that take two params, can be called infix by sourrounding backticks
+
+> foo x = x * 3 -- functions are defined using =
+
+> [1,2,3,4] ++ [9,10,11,12] -- ++ operator puts two lists together
+
+> 'A':" SMALL CAT" -- "cons operator" puts something at beginngin of list
+> 1:2:3:[] -- [1,2,3] is actually just syntactic sugar for the same
+
+> "Steve Buscemi" !! 6 -- returns sixth element
+
+> length [5,4,3,2,1]
+
+> 4 `elem` [3,4,5,6] -- returns True if 4 is an element inside list
+
+> [2,4..] -- infinite list
+> take 5 [13,26..] -- lazy eval ! haskel takes first 5 elements from list
+> take 12 (cycle "LOL ") -- infinite list
+> take 10 (repeat 5) -- infinite list
+
+> [x*2 | x <- [1..10]] -- list comprehension
+> [x*2 | x <- [1..10], x*2 >= 12] -- using predicate returns only if x*2 >= 12
+> [ x | x <- [50..100], x `mod` 7 == 3] -- Note: weeding out lists by predicates is also called "filtering"
+```
+
+## see also
+
+- [[haskell]]
+- [[elm]]
+- [[cabal]]
+- [[erlang]]
+- [[shellcheck]]
+- [[python comprehensions]]
+- [learnyouahaskell.com/starting-out](http://learnyouahaskell.com/starting-out)
diff --git a/notes/git extras.md b/notes/git extras.md
new file mode 100644
index 00000000..37b55200
--- /dev/null
+++ b/notes/git extras.md
@@ -0,0 +1,45 @@
+---
+tags: [linux, macos]
+title: git extras
+created: '2019-07-30T06:19:49.062Z'
+modified: '2023-03-24T08:25:52.756Z'
+---
+
+# git extras
+
+> bunch of extras ..
+
+## install
+
+```sh
+brew install git-extras
+```
+
+## usage
+
+```sh
+git info # show information about the repository
+
+git effort # number of commits per file
+
+git summary
+
+git bulk
+
+git repl # read evaluate print loop ....FTW !!!
+```
+
+## bulk
+
+```sh
+git bulk --addcurrent $(pwd)
+
+git bulk --listall
+
+git bulk pull
+```
+
+## see also
+
+- [[git]]
+- [github.com/tj/git-extras](https://github.com/tj/git-extras/blob/master/Commands.md)
diff --git a/notes/git flow.md b/notes/git flow.md
new file mode 100644
index 00000000..131b0bdf
--- /dev/null
+++ b/notes/git flow.md
@@ -0,0 +1,49 @@
+---
+tags: [linux, macos]
+title: git flow
+created: '2021-03-25T08:00:57.686Z'
+modified: '2023-03-24T08:25:52.768Z'
+---
+
+# git flow
+
+> collection of git extensions providing high-level repository operations for Vincent Driessen's branching model
+
+## isntall
+
+```sh
+brew install git-flow
+```
+
+## usage
+
+```sh
+git flow init -d # accept all defaults
+
+
+git flow feature
+git flow feature start NAME [BASE]
+git flow feature finish NAME
+
+git flow feature publish NAME
+git flow feature pull REMOTE NAME
+
+git flow release
+git flow release start RELEASE [BASE]
+git flow release finish RELEASE
+
+git flow hotfix
+git flow hotfix start RELEASE [BASE]
+git flow hotfix finish RELEASE
+
+git flow support
+git flow support start RELEASE BASE
+```
+
+## see also
+
+- [[git]]
+- [[git-chglog]]
+- [[semtag]]
+- [github.com/nvie/gitflow](https://github.com/nvie/gitflow)
+- [nvie.com/posts/a-successful-git-branching-model](https://nvie.com/posts/a-successful-git-branching-model/)
diff --git a/notes/git secrets.md b/notes/git secrets.md
new file mode 100644
index 00000000..d926f8be
--- /dev/null
+++ b/notes/git secrets.md
@@ -0,0 +1,26 @@
+---
+tags: [linux, macos]
+title: git secrets
+created: '2020-11-27T08:03:15.064Z'
+modified: '2023-03-24T08:25:52.776Z'
+---
+
+# git secrets
+
+> prevents committing passwords and other sensitive information to repository
+
+## install
+
+```sh
+brew install git-secrets
+```
+
+## usage
+
+```sh
+
+```
+
+## see also
+- [[git]]
+- [[git extrs]]
diff --git a/notes/git-chglog.md b/notes/git-chglog.md
new file mode 100644
index 00000000..d2bdf89f
--- /dev/null
+++ b/notes/git-chglog.md
@@ -0,0 +1,35 @@
+---
+tags: [linux, macos]
+title: git-chglog
+created: '2021-03-25T07:53:28.102Z'
+modified: '2023-03-24T08:25:52.792Z'
+---
+
+# git-chglog
+
+> CHANGELOG generator implemented in [[go]]
+
+## install
+
+```sh
+brew tap git-chglog/git-chglog
+brew install git-chglog
+```
+
+## usage
+
+```sh
+git-chglog --version
+
+git-chglog --init # create config files and templates to generate a CHANGELOG interactively
+
+git-chglog -o CHANGELOG.md
+```
+
+## see also
+
+- [[git]]
+- [github.com/git-chglog/git-chglog](https://github.com/git-chglog/git-chglog)
+- [[semtag]]
+- [[git flow]]
+- [[git-cliff]]
diff --git a/notes/git-cliff.md b/notes/git-cliff.md
new file mode 100644
index 00000000..ce3ef00b
--- /dev/null
+++ b/notes/git-cliff.md
@@ -0,0 +1,37 @@
+---
+tags: [rust]
+title: git-cliff
+created: '2021-10-08T11:16:16.864Z'
+modified: '2023-03-22T10:36:29.677Z'
+---
+
+# git-cliff
+
+> generate changelog files from the git history by utilizing conventional commits as well as regex-powered custom parsers
+
+## install
+
+```sh
+cargo install git-cliff
+```
+
+## usage
+
+```sh
+git cliff --init # create cliff.toml
+
+
+git cliff
+git-cliff --config cliff.toml --repository .
+git-cliff --workdir .
+
+
+git cliff --tag 1.0.0 # set tag for the "unreleased" changes
+```
+
+## see also
+
+- [github.com/orhun/git-cliff](https://github.com/orhun/git-cliff)
+- [[git]]
+- [[cargo]]
+- [[git-chglog]]
diff --git a/notes/git-config.md b/notes/git-config.md
deleted file mode 100644
index 8bfddf58..00000000
--- a/notes/git-config.md
+++ /dev/null
@@ -1,32 +0,0 @@
----
-tags: [git, heredoc]
-title: git-config
-created: '2019-08-01T07:03:58.247Z'
-modified: '2019-08-01T07:05:57.912Z'
----
-
-# git-config
-
-```sh
-cat > ~/.gitconfig
-[core]
- editor = vim
-
-[includeIf "gitdir:~/gitlab.com/"]
- path = ~/.gitconfig-gitlab
-
-[includeIf "gitdir:~/github.com/"]
- path = ~/.gitconfig-github
-EOF
-```
-
-```sh
-cat > ~/.gitconfig-github
-[user]
- name = invad0r
- email = invad0r@gmx.net
-
-[push]
- default = simple
-EOF
-```
diff --git a/notes/git-extras.md b/notes/git-extras.md
deleted file mode 100644
index adfff51d..00000000
--- a/notes/git-extras.md
+++ /dev/null
@@ -1,28 +0,0 @@
----
-tags: [git]
-title: git-extras
-created: '2019-07-30T06:19:49.062Z'
-modified: '2019-07-30T06:34:05.992Z'
----
-
-# git-extras
-
-
-### install
-`brew install git-extras`
-
-
-### commands
-```sh
-git info # show information about the repository
-
-git effort # number of commits per file
-
-git summary
-
-git bulk
-
-git repl # read evaluate print loop ....FTW !!!
-```
-
-[git-extras/Commands.md at master ยท tj/git-extras ยท GitHub](https://github.com/tj/git-extras/blob/master/Commands.md)
diff --git a/notes/git-lfs.md b/notes/git-lfs.md
new file mode 100644
index 00000000..d5bffa7e
--- /dev/null
+++ b/notes/git-lfs.md
@@ -0,0 +1,31 @@
+---
+tags: [linux, macos]
+title: git-lfs
+created: '2020-02-25T14:57:00.028Z'
+modified: '2023-03-24T08:25:52.799Z'
+---
+
+# git-lfs
+
+> git large file system - using large files in git
+
+## install
+
+```sh
+brew install git-lfs
+```
+
+## usage
+
+```sh
+git lfs install
+
+git lfs track "*.iso"
+
+git add .gitattributes
+```
+
+## see also
+
+- [[git]]
+- [gitlab lfs](https://docs.gitlab.com/ee/administration/lfs/manage_large_binaries_with_git_lfs.html)
diff --git a/notes/git-svn.md b/notes/git-svn.md
deleted file mode 100644
index 323a7fee..00000000
--- a/notes/git-svn.md
+++ /dev/null
@@ -1,38 +0,0 @@
----
-tags: [git]
-title: git-svn
-created: '2019-07-30T06:19:49.249Z'
-modified: '2019-07-30T08:49:04.072Z'
----
-
-# git-svn
-
-`subversion`
-
-## get author names
-```sh
-svn log --xml https://repo/svn/general | grep author | sort -u | perl -pe 's/.*>(.*?)<.*/$1 = /' > users.txt
-
-svn log --xml https://repo/svn/general/joomla_portalv3/com_portal | grep author | sort -u | perl -pe 's/.*>(.*?)<.*/$1 = /'
-```
-
-## svn to git migraiton
-```sh
-git svn clone \
- --stdlayout \
- --no-metadata \
- --authors-file=users.txt svn://hostname/path dest_dir-tmp
-
-git svn clone \
- --stdlayout \
- --no-metadata \
- --authors-file=users.txt \
- --prefix=origin/ https://repo/svn/general/joomla_portalv3/com_portal dest_dir-tmp
-
-git svn clone \
- --authors-file=users.txt \
- --prefix=origin/ \
- --trunk=joomla_portalv3/com_portal https://repo/svn/general dest_dir-tmp
-```
-
-[how-to-migrate-svn-repository](http://stackoverflow.com/questions/79165/how-to-migrate-svn-repository-with-history-to-a-new-git-repository)
diff --git a/notes/git.md b/notes/git.md
index e93d3873..4c0a3b0c 100644
--- a/notes/git.md
+++ b/notes/git.md
@@ -1,183 +1,505 @@
---
-tags: [git]
+tags: [linux, macos]
title: git
created: '2019-07-30T06:19:49.063Z'
-modified: '2019-07-30T06:34:05.985Z'
+modified: '2023-06-01T05:23:12.654Z'
---
# git
-### GIT CONFIGURATION
+> distributed version-control system for tracking changes in source code during software development.
+
+## install
+
```sh
-git config --global user.name "Your Name" # Set the name that will be attached to your commits and tags.
+brew install git
+```
-git config --global user.email "you@example.com" # Set the e-mail address that will be attached to your commits and tags.
+## environment
+
+```sh
+EDITOR # see commit
+```
-git config --global color.ui auto # Enable some colorization of Git output.
+## add
-git config --list [--local|--global] # list local/global configuration
+```sh
+git add FILE # add FILE to the staging area
+
+git add . # add all changes files from current directory down into directory tree
+
+git add --patch FILE # add specific lines to commit
+
+git add --all "$(git diff --diff-filter=D --name-only)" # add deleted files, ! watchout for spaces !
```
-### IGNORING FILES
+## alias
+
```sh
-cat .gitignore
+git alias # list aliases
+```
+
+## branch
-/logs/* # all files in logs directory
-!logs/.gitkeep # (excluding the .gitkeep file)
-/tmp # whole tmp directory
-*.swp # all files *.swp
+```sh
+-a, --all # list all branches, local and remote
+-d # remove selected branch
+-D # forces deletion
+-l, --list # list local branches
+-r, --remotes # list remote
+
+-v # verbose
+-vv # more verbose e.g. show gone branches `[origin/refactoring: gone]`
```
-### day-to-day
```sh
-git status # See the status of your work. New, staged, modified files. Current branch.
+git branch BRANCH_NAME # create new branch, referencing the current HEAD
-git diff [file] # Show changes between working directory and staging area.
+git branch -d NAME # remove selected branch, if it is already merged into any other
-git diff --staged [file] # Shows changes in the staging area that haven't been commited.
+git branch --no-merged | xargs git branch -d
+```
-git checkout -- [file] # Discard changes in working directory. This operation is unrecoverable !
+## checkout
-git add [file] # Add a file to the staging area. Use . instead of full file path, to add all changes files from current directory down into directory tree.
+```sh
+-b NAME # will create specified branch if it does not exist
+git checkout -- FILE # discard changes in working directory. Operation is unrecoverable !
-git reset [file] # Get file back from staging area to working directory.
+git checkout - # checkout prevous branch
-git reset HEAD -- FILE # undo git add FILE
+git checkout . # reset all current changes
+```
+## clean
-git commit -m "message" # Create commit from changes added to the staging area. You can provide -m otherways $EDITOR will be opened.
+```sh
+git clean -d -f -x # remove all files not under source control
```
-#### add --patch
+## commit
+
```sh
-git add --patch file
+git commit -v # using $EDITOR
+git commit -m "title" -m "message"
+git commit -am ..
+git commit --allow-empty # empty commit without changes -> for retriggers !
+
+# amend to already pushed commit
+git add FILE-A FILE-B # !!! only if nobody has pulled in the mean time !!!
+git commit --amend
+git push --force-with-lease
+```
+## config
+
+```sh
+git config --local --list # list local configuration
+git config --global --list # list global configuration
+
+git config --global user.name "USER.NAME" # set name that will be attached to your commits and tags
+git config --global user.email "USER@EMAIL" # set mail that will be attached to your commits and tags
+git config --global color.ui auto # enable some colorization output
+git config --global pull.ff only # always override individual pull invocation with "git pull --rebase" or "git pull --no-ff", making it a conscious choice when a fast-forward pull is not possible
+git config --global http.sslCert CERT
+git config --global http.sslKey KEY
+git config --global credential.helper osxkeychain
+git config --global credential.helper 'store --file FILE'
+git config --global credential.https://HOST USER
```
+## .gitconfig
-### stashing
```sh
-git stash # Put your current changes into stash.
+[alias]
+ cpl = !git checkout - && git pull
+ cbd = !git checkout -b "update-$(date +%F_%H%M)"
+
+[core]
+ editor = vim
+ hooksPath = .husky
-git stash pop # Apply stored stash content into working directory, and clear stash.
+[init]
+ defaultBranch = main
-git status # Clear stash without applying it into working directory
+[user]
+ name = Some Name
+ email = name@mail.com
+
+[remote "origin"]
+ gh-resolved = base
+
+[pull]
+ ff = only
+
+[bulkworkspaces]
+ WORKSPACE_NAME = PATH
```
+```sh
+# seperate configs per remote
+
+cat < ~/.gitconfig
+[includeIf "gitdir:~/gitlab.com/"]
+ path = ~/.gitconfig-gitlab
+
+[includeIf "gitdir:~/github.com/"]
+ path = ~/.gitconfig-github
+EOF
+
+cat < ~/.gitconfig-github
+[user]
+ name = user
+ email = user@mail.com
+
+[push]
+ default = simple
+EOF
+```
+
+## column
-### BRANCHING MODEL
```sh
-git branch [-l|-r|-a] # List branches -l: local, -r: remote, -a: local and remote
+seq 1 100 | git column --mode=column
+```
+
+[[column]]
-git branch [name] # Create new branch, referencing the current HEAD
-git checkout [-b] [name] # Switch working directory to the specified branch. With -b: Git will create he specified branch if it does not exist
+## diff
-git merge [from name] # Join specified [from name] branch into your current branch (the one you are on currenlty).
+```sh
+git diff FILE # diff between working directory and staging area
+git diff *.txt
-git branch -d [name] # Remove selected branch, if it is already merged into any other. -D instead of -d forces deletion.
+git diff --staged FILE # diff files in the staging area that haven't been commited
+
+git diff HEAD~2 HEAD~1 # diff between the previous commit and the second ancestor commit
+git diff HEAD@{1} .env # diff wir previouse version
+
+git diff --name-only --diff-filter=D | sed 's| |\\ |g' | xargs git add # add only deleted file to workspace
```
-### log - review work
+## help
+
```sh
-git log --oneline --graph --decorate # An overview with references labels and history graph. One commit er line.
+git help CMD
+git help -g # guides
+git help GUIDE
+```
-git log [-n count] # List commit history of current branch. -n count limits list to last n commits.
+## log
-git log ref.. # List commits that are present on current branch and not merged into ref.A ref can be e.g. a branch name or a tag name.
+```sh
+-n COUNT # limits list to last n commits
+```
-git log ..ref # List commit, that are present on ref and not merged into current branch.
+```sh
+git log ref.. # list commits that are present on current branch and not merged into ref.A ref can be e.g. a branch name or a tag name.
-git reflog # List operations (like checkouts, commits etc.) made on local repository.
+git log ..ref # list commit, that are present on ref and not merged into current branch.
+
+git reflog # list operations (like checkouts, commits etc.) made on local repository.
git log --follow -p -- file # follow file history
+
+
+git log HEAD..origin/master # see where origin/master branch has diverged
+ # "git and have 1 and 1 different commits each, respectively"
+
+git log --oneline --author="John Smith"
+
+git log --format="%Cgreen%h%Creset %an"
+
+git log --graph --oneline --decorate --color # overview with references labels and history graph. One commit er line
+
+git log --graph --abbrev-commit --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset"
+
+git log -L::file # git log of a specific function in a file
+
+git log --graph \
+ --pretty=format:"%Cred%h%Creset \
+ -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset" \
+ --abbrev-commit
```
-### tagging
+[[bash alias]]
+
+## ls-files
+
```sh
-git tag # List all tags.
+git ls-files -o --exclude-standard # show new files
-git tag [name] [commit sha] # Create a tag reference named name for current commit. Add commit sha to tag a specific commit instead of current one.
+git ls-files --deleted | xargs -d "\n" git add --all # add deleted files
+git ls-files -z --deleted | xargs -0 git add # add deleted files
+```
-git tag -a [name] [commit sha] # Create a tag object named name for current commit.
+## merge
-git tag -d [name] # Remove a tag from a local repository.
+```sh
+git merge --abort # cancel merge conflict
-git push --tags
+git merge FROM_NAME # join specified FROM_NAME branch into your current branch
```
-### reverting changes
+## notes
+
```sh
-git reset [--hard] [target reference] # Switch current branch to the target reference, and leaves a ifference as anuncommited changes. When --hard is used, all changes are discarded.
+git notes add -m "this is a test note.."
+
+git notes list
-git revert [commit sha] # Create a new commit, reverting changes from the speci fied commit. Itgenerates n inversion of changes.
+git notes show
+
+git push origin refs/notes/* # push notes
+git fetch origin refs/notes/*:refs/notes/* # fetch all notes
```
-### HELP
+## remote
```sh
-git help CMD
+ssh -Tv git@example.com # test-ssh-connection
-git help -g # guides
+git remote -v
-git help GUIDE
+git remote show origin
-git diff HEAD@{1} .env # diff wir previouse version
+git remote add pb https://github.com/paulboone/ticgit # add remote
+
+git remote -v
+origin https://github.com/schacon/ticgit (fetch)
+origin https://github.com/schacon/ticgit (push)
+pb https://github.com/paulboone/ticgit (fetch)
+pb https://github.com/paulboone/ticgit (push)
+
+git fetch pb
+
+git remote rename pb paul # change a remoteโs shortname
+
+git remote remove paul # removing remotes
+
+
+git remote set-url origin https://github.com/USERNAME/REPOSITORY.git # change remote url ssh -> https
+
+git remote set-url origin git@github.com:USERNAME/REPOSITORY.git # change remote url https -> ssh
```
-[Git tips and tricks | GitLab](https://about.gitlab.com/2016/12/08/git-tips-and-tricks/)
-[switching-remote-urls-from-ssh-to-https](https://help.github.com/articles/changing-a-remote-s-url/#switching-remote-urls-from-ssh-to-https)
+## reset
-### test remote ssh connection
```sh
-ssh -Tv git@example.com # test-ssh-connection
+git reset FILE # Get file back from staging area to working directory
+
+git reset HEAD -- FILE # undo git add FILE
+
+git reset --hard HEAD^ # delete last commit
+```
+
+## rev-list
+
+```sh
+# search for file in history
+git rev-list --all registrator.go | ( while read revision; do git grep -F 'swarm' $revision registrator.go done )
+```
+
+## push
+
+```sh
+git push origin -f
+
+git push --set-upstream origin BRANCH_NAME
+```
+
+## pull
+
+> fetch from and integrate with another repository or local branch
+
+```sh
+git pull
+
+git fetch && git merge # or git rebase
+```
+
+## shortlog
+
+> `git-shortlog` - summarize `git log` output
+
+```sh
+-n, --numbered # sort output according to the number of commits per author instead of author alphabetic order
+-s, --summary # suppress commit description and provide a commit count summary only
+-e, --email # show email address of each author
+
+git shortlog -sn # rank contributors
+git shortlog -sn --grep="^fix" --no-merges # filter commit message and don't count merge commits
+```
+
+## show
+
+```sh
+git show COMMIT # show changes of commit
+```
+
+## submodule
+
+```sh
+git submodule status # list submodules
+git submodule status --recursive # list nested submodules
+
+git submodule update --init --recursive #
+
+
+git submodule add https://github.com/chaconinc/DbConnector
+
+git submodule foreach git status
+git submodule foreach git pull origin master
+```
+
+[git-scm.com/book/en/v2/Git-Tools-Submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules)
+
+## stash
+
+```sh
+git stash # put current changes into stash
+
+git stash pop # apply stored stash content into working directory, and clear stash
+
+git status # clear stash without applying it into working directory
```
-## setup repository
+## status
+
```sh
-## From empty repository
+git status # See the status of your work. New, staged, modified files. Current branch
+
+git status -s # show short-format output
+
+git status -s | grep -Z "^ D" | awk '{ $1=""; print $0}' | xargs -0 -I% git add -u % # add deleted files to stage
+```
+
+## tag
+
+```sh
+git tag -l # list all tags
+
+git tag TAG_NAME COMMIT_SHA # Create a tag reference named name for current commit. Add commit sha to tag a specific commit instead of current one.
+
+
+git tag -a TAG_NAME COMMIT_SHA # create a tag object named name for current commit
+git tag -a TAG_NAME -m "MESSAGE" # aka annotated tag
+
+# get tag types
+# "lightweight" tag is a name in refs/tags that refers to a commit object
+# "annotated" tag is a name in refs/tags that refers to a tag object
+git for-each-ref
+git for-each-ref refs/tags
+# object-hash object-type name in refs/tags that refers to the object
+# 902fa933e4aa130338b47b8 commit refs/tags/v1.0-light
+# 1f486472cca96a3a7fbd78b tag refs/tags/v1.1-annot
+# fd3cf147ac63122b919a036 commit refs/tags/v1.2-light
+
+git tag -d TAG_NAME # remove a tag from a local repository
+
+git push --tags
+```
+
+[stackoverflow.com/how-can-i-tell-if-a-given-git-tag-is-annotated-or-lightweight](https://stackoverflow.com/a/40499437/14523221)
+
+---
+
+### git setup repository
+
+```sh
+# setup from empty repository
git clone git@git.domain.net:user/foo.git
git add README.md
git commit -m "add README"
git push -u origin master
-## Existing folder
+# setup existing folder
git init
git remote add origin git@git.domain.net:user/foo.git
git add --all
git commit
git push -u origin master
-## Existing Git repository
+# setup existing Git repository
git remote add origin git@git.domain.net:user/foo.git
-
git remote set-url origin https://github.com/USERNAME/REPOSITORY.git # switch remote url fomr ssh to https
git push -u origin --all
git push -u origin --tags
```
+[Git-Basics-Working-with-Remotes](https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes)
-### git restore deleted file
-```sh
-git log --diff-filter=D --summary | grep delete | grep filename # find deleted file
-git log --all -- path/file.sh # get hash to file; exec from git-root-dir !!
+### reverting changes
-git checkout e7s..37^ -- path/file.sh # note ^ after SHA !
+```sh
+git reset --hard TARGET_REF # switch current branch to the target reference, and leaves a ifference as anuncommited changes
+ # when --hard is used, all changes are discarded
+git revert COMMIT_SHA # create new commit, reverting changes from the speci fied commit. Itgenerates n inversion of changes
```
-### ammend to already pushed commit
+### restore deleted file
+
```sh
-git add FILE-A FILE-B # !!! only if nobody has pulled in the mean time !!!
+git log --diff-filter=D --summary | grep delete | grep filename # find deleted file
+git log --all -- path/file.sh # get hash to file; exec from git-root-dir !!
+git checkout e7s..37^ -- path/file.sh # note ^ after SHA !
+```
-git commit --amend
+### pruge file from repository's history
-git push --force-with-lease
+```sh
+# Force Git to process, but not check out, the entire history of every branch and tag
+# Remove the specified file, as well as any empty commits generated as a result
+# Overwrite your existing tags
+git filter-branch --force --index-filter \
+ "git rm --cached --ignore-unmatch PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA" \
+ --prune-empty --tag-name-filter cat -- --all
+git push origin --force --all # overwrite repository, as well as all branches you've pushed up
+git push origin --force --tags # remove the sensitive file from your tagged releases
```
-### search for file in history
+## svn
+
```sh
-git rev-list --all registrator.go | ( while read revision; do git grep -F 'swarm' $revision registrator.go done )
+# svn to git migraiton
+git svn clone \
+ --stdlayout \
+ --no-metadata \
+ --authors-file=FILE \ `# see: svn log --xml`
+ svn://HOST/PATH DEST
+
+git svn clone \
+ --stdlayout \
+ --no-metadata \
+ --authors-file=FILE \
+ --prefix=origin/ \
+ https://repo/svn/PATH/TRUNK DEST
+
+git svn clone \
+ --authors-file=FILE \
+ --prefix=origin/ \
+ --trunk=PATH/TRUNK \
+ https://repo/svn/general \
+ DEST
```
-[Git search for string in a single files history - Stack Overflow](https://stackoverflow.com/a/10223136)
+
+[how-to-migrate-svn-repository](http://stackoverflow.com/questions/79165/how-to-migrate-svn-repository-with-history-to-a-new-git-repository)
+
+
+## see also
+
+- [[ssh]]
+- [[bfg]]
+- [[git-chglog]]
+- [[snv]]
+- [[fossil]]
+- [[gource]]
+- [ohshitgit.com/](https://ohshitgit.com/)
+- [git-scm.com/docs](https://git-scm.com/docs)
+- [gitlab.com/2016/12/08/git-tips-and-tricks](https://about.gitlab.com/2016/12/08/git-tips-and-tricks/)
+- [stackoverflow.com/search-for-string-in-a-single-files-history](https://stackoverflow.com/a/10223136)
+- [docs.github.com/removing-sensitive-data-from-a-repository](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/removing-sensitive-data-from-a-repository)
+
diff --git a/notes/gitignore.md b/notes/gitignore.md
new file mode 100644
index 00000000..e09953b7
--- /dev/null
+++ b/notes/gitignore.md
@@ -0,0 +1,24 @@
+---
+tags: [linux, macos]
+title: gitignore
+created: '2019-08-19T13:48:58.623Z'
+modified: '2023-03-24T08:25:52.806Z'
+---
+
+# gitignore
+
+### .gitignore
+```sh
+
+/logs/* # all files in logs directory
+
+!logs/.gitkeep # (excluding the .gitkeep file)
+
+/tmp # whole tmp directory
+
+*.swp # all files *.swp
+```
+
+## see also
+- [[git]]
+- [[docker]]
diff --git a/notes/gitlab-backup.md b/notes/gitlab-backup.md
new file mode 100644
index 00000000..7327da37
--- /dev/null
+++ b/notes/gitlab-backup.md
@@ -0,0 +1,28 @@
+---
+tags: [cloud]
+title: gitlab-backup
+created: '2020-01-03T14:20:17.882Z'
+modified: '2023-05-24T08:43:18.804Z'
+---
+
+# gitlab-backup
+
+> gitlab backup wrapper
+
+## usage
+```sh
+gitlab-backup create
+
+gitlab-backup create SKIP=uploads,artifacts,builds
+
+gitlab-rake gitlab:backup:create SKIP=uploads,artifacts,builds
+
+
+gitlab-backup restore BACKUP=1578046258_2020_01_03_12.5.5
+
+gitlab-rake gitlab:backup:restore BACKUP=TIMESTAMP_NUMBER
+```
+
+## see also
+- [[gitlab-rake]]
+- [[gitlab-ctl]]
diff --git a/notes/gitlab-ctl.md b/notes/gitlab-ctl.md
new file mode 100644
index 00000000..2e753846
--- /dev/null
+++ b/notes/gitlab-ctl.md
@@ -0,0 +1,27 @@
+---
+tags: [cloud]
+title: gitlab-ctl
+created: '2019-12-30T14:01:10.332Z'
+modified: '2023-05-24T08:43:18.777Z'
+---
+
+# gitlab-ctl
+
+## usage
+
+```sh
+gitlab-ctl show-config
+
+gitlab-ctl reconfigure
+
+gitlab-ctl restart
+
+gitlab-ctl stop unicorn
+gitlab-ctl stop sidekiq
+```
+
+## see also
+
+- [docs.gitlab.com/12.5/ee/raketasks/backup_restore](https://docs.gitlab.com/12.5/ee/raketasks/backup_restore.html#restore-prerequisites)
+- [[gitlab-rake]]
+- [[ldapsearch]]
diff --git a/notes/gitlab-rails.md b/notes/gitlab-rails.md
new file mode 100644
index 00000000..a9196f62
--- /dev/null
+++ b/notes/gitlab-rails.md
@@ -0,0 +1,92 @@
+---
+tags: [ruby]
+title: gitlab-rails
+created: '2019-12-30T13:15:51.142Z'
+modified: '2023-03-16T09:11:52.887Z'
+---
+
+# gitlab-rails
+
+## usage
+
+```sh
+gitlab-rails generate # alias: "g", generate new code
+gitlab-rails console # alias: "c", start the Rails console
+gitlab-rails server # alias: "s", start the Rails server
+gitlab-rails test # alias: "t", run tests except system tests
+gitlab-rails test:system # run system tests
+gitlab-rails new APP_NAME # create new Rails app
+```
+
+## console
+
+```sh
+gitlab-rails console
+
+gitlab-rails console -e production
+```
+
+```ruby
+# Reset root/admin password
+
+# find the user
+user = User.find_by(email: "admin@example.com")
+user = User.find_by(username: "root")
+user = User.find_by(name: "Administrator")
+user = User.find_by(admin: true)
+user = User.find_by(username: "root")
+
+user.password = 'secret_pass'
+user.password_confirmation = 'secret_pass'
+user.save!
+
+# re-enable standard login
+appsettings = ApplicationSetting.find_by(password_authentication_enabled_for_web: false) # locate application settings
+appsettings.password_authentication_enabled_for_web = true
+appsettings.save!
+
+Gitlab::LDAP::Config.providers
+```
+
+### dbconsole
+
+> Start a console for the database specified in config/database.yml
+
+```sh
+gitlab-rails dbconsole
+gitlab-rails db # short-cut alias
+```
+
+```sql
+SELECT * FROM pg_stat_ssl; /* check whether clients are using SSL, you can issue this SQL query */
+
+/* Show all unique JiraService properties */
+SELECT DISTINCT properties FROM services WHERE type LIKE '%JiraService%';
+
+/* View the first 5 Lines */
+SELECT id,properties FROM services WHERE type LIKE '%JiraService%' LIMIT 5;
+
+/* Replace an old URL */
+UPDATE services
+SET properties = replace(properties, 'https://oldproject.atlassian.net', 'https://newproject.atlassian.net')
+WHERE type LIKE '%JiraService%';
+
+/* Replace an old authentication token */
+UPDATE services
+SET properties = replace(properties, 'oldtoken', 'newtoken')
+WHERE type LIKE '%JiraService%';
+
+/* Set the whole config string */
+UPDATE services
+SET properties = '{"api_url":"","jira_issue_transition_id":"","password":"newapitoken","url":"https://someproject.atlassian.net","username":"yourusername"}'
+WHERE type LIKE '%JiraService%';
+```
+
+## see also
+
+- [[ruby]]
+- [[ldapsearch]]
+- [docs.gitlab.com/ee/security/reset_root_password](https://docs.gitlab.com/ee/security/reset_root_password.html)
+- [gist.github.com/dnozay/188f256839d4739ca3e4](https://gist.github.com/dnozay/188f256839d4739ca3e4)
+- [docs.gitlab.com/12.5/ee/api/settings](https://docs.gitlab.com/12.5/ee/api/settings.html)
+- [gitlab.com/gitlab-org/omnibus-gitlab/issues/561](https://gitlab.com/gitlab-org/omnibus-gitlab/issues/561)
diff --git a/notes/gitlab-rake.md b/notes/gitlab-rake.md
new file mode 100644
index 00000000..786877d7
--- /dev/null
+++ b/notes/gitlab-rake.md
@@ -0,0 +1,20 @@
+---
+tags: [ruby]
+title: gitlab-rake
+created: '2020-01-03T14:25:36.220Z'
+modified: '2020-09-02T17:48:42.752Z'
+---
+
+# gitlab-rake
+
+## usage
+```sh
+gitlab-rake gitlab:check SANITIZE=true
+
+bundle exec rake gitlab:backup:create RAILS_ENV=production
+
+gitlab-rake gitlab:backup:restore BACKUP=TIMESTAMP_NUMBER
+```
+## see also
+- [[gitlab-ctl]]
+- [[bundle rake]]
diff --git a/notes/gitlab-runner.md b/notes/gitlab-runner.md
new file mode 100644
index 00000000..43cce029
--- /dev/null
+++ b/notes/gitlab-runner.md
@@ -0,0 +1,19 @@
+---
+tags: [cloud]
+title: gitlab-runner
+created: '2019-11-18T13:12:49.564Z'
+modified: '2023-05-24T08:43:18.793Z'
+---
+
+# gitlab-runner
+
+> cli for gitlab-runner
+
+## usage
+```sh
+gitlab-runner verify
+```
+
+## see also
+- [[gitlab api]]
+- [[gitlab-ctl]]
diff --git a/notes/gitlab.md b/notes/gitlab.md
deleted file mode 100644
index b069916d..00000000
--- a/notes/gitlab.md
+++ /dev/null
@@ -1,140 +0,0 @@
----
-tags: [api]
-title: gitlab
-created: '2019-07-30T06:19:49.064Z'
-modified: '2019-08-02T07:59:17.161Z'
----
-
-# gitlab
-
-[GitLab API | GitLab](https://docs.gitlab.com/ee/api/README.html#basic-usage)
-
-```sh
-curl -L --url 'http://git.domain.net/api/v4/projects/?private_token=PR!V4T3_T0K3N&per_page=2&page=1'
-```
-
-## pagination
-```sh
-# use -I / --head to see:
-
-# X-Total The total number of items
-# X-Total-Pages The total number of pages
-# X-Per-Page The number of items per page
-# X-Page The index of the current page (starting at 1)
-# X-Next-Page The index of the next page
-# X-Prev-Page The index of the previous page
-```
-
-```sh
-curl \
- --head \
- --header 'private-token: PR!V4T3_T0K3N' \
- --request GET \
- --url http://git.domain.net/api/v3/projects/all?page=1&per_page=100
-
-curl \
- --request PUT \
- --header "PRIVATE-TOKEN: PR!V4T3_T0K3N"
- --url 'https://gitlab.example.com/api/v4/namespaces?per_page=50'
-
-curl \
- --head \
- --header "PRIVATE-TOKEN: 1234" \
- --url 'https://gitlab.example.com/api/v4/projects/8/issues/8/notes?per_page=3&page=2'
-```
-
-```sh
-# printf "%q" "${pages}"
-# $'15\r'
-pages=$(
- curl \
- --silent \
- --head \
- --header 'private-token: PR!V4T3_T0K3N' \
- --request GET \
- --url 'http://git.domain.net/api/v3/projects/all' | grep 'X-Total-Pages' | awk '{print $2}'
-)
-
-pages="${pages%%[[:cntrl:]]}" # remove carriage-return symbol \r
-
-for((p=0; p<$pages; p++)); do \
- curl \
- --silent \
- --header 'private-token: PR!V4T3_T0K3N' \
- --request GET \
- --url "http://git.domain.net/api/v3/projects/all?page=$p" \
- | jq '.[].id';
-done >> gitlab-project-id
-```
-[Remove "\r" from echoing out in bash script - Super User](https://superuser.com/a/1215968)
-
-```sh
-cat gitlab-project-id | while read; do
- curl \
- --silent \
- --header 'private-token: PR!V4T3_T0K3N' \
- --request GET \
- --url "http://git.domain.net/api/v3/projects/$REPLY" \
- | jq -M --raw-output '.ssh_url_to_repo'
-done | tee -a gitlab-ssh-url
- # | jq '.path_with_namespace, .description, .ssh_url_to_repo'
-```
-
-```sh
-curl --request GET --url http://git.domain.net/api/v3/projects/all?per_page=-1 --header 'private-token: PR!V4T3_T0K3N'
-
-http POST $GITLAB_API_HOST/oauth/token grant_type=password username=$GITLAB_USERNAME password=$GITLAB_PASSWORD
-
-pages="$(
- curl \
- --silent \
- --head \
- --header 'private-token: PR!V4T3_T0K3N' \
- --request GET \
- --url 'http://git.domain.net/api/v3/projects/all' | grep 'X-Total-Pages' | awk '{print $2}')"; do
-
-pages=15;
-for((p=0; p<$pages; p++)); do
- echo curl \
- --silent --head --header 'private-token: PR!V4T3_T0K3N' --request GET --url "http://git.domain.net/api/v3/projects/all?page=$p&per_page=100";
-done
-```
-
-## runners
-```sh
-curl --header "PRIVATE-TOKEN: PR!V4T3_T0K3N" "https://git.domain.net/api/v4/runners"
-
-curl \
- --silent \
- --header "PRIVATE-TOKEN: PR!V4T3_T0K3N" \
- --url "http://git.domain.net/api/v4/runners/all?status=active" | jq
-
-curl \
- --silent \
- --header "PRIVATE-TOKEN: PR!V4T3_T0K3N" \
- --url "http://git.domain.net/api/v4/runners/161" | jq
-
-curl \
- --silent \
- --header "PRIVATE-TOKEN: PR!V4T3_T0K3N"\
- --request DELETE \
- --url "https://gitlab.example.com/api/v4/runners/161"
-
-curl --request DELETE --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v4/runners/6"
-```
-
-### get projects with a schedule
-```sh
-for pages in $(
- curl \
- --head \
- --silent \
- --header "PRIVATE-TOKEN: PR!V4T3_T0K3N" \
- --url "http://git.domain.net/api/v4/projects?simple=true&per_page=100" | awk 'BEGIN {FS=": "}/^X-Total-Pages/{print $2}'
- ); do
- for id in $( curl --silent --header "PRIVATE-TOKEN: PR!V4T3_T0K3N" --url "http://git.domain.net/api/v4/projects?simple=true&per_page=100&page=${page}" | jq '.[].id';); do
- curl --no-buffer --silent --header "PRIVATE-TOKEN: PR!V4T3_T0K3N" --url "http://git.domain.net/api/v4/projects/${id}" | jq '.name'
- curl --no-buffer --silent --header "PRIVATE-TOKEN: PR!V4T3_T0K3N" --url "http://git.domain.net/api/v4/projects/${id}/pipeline_schedules" | jq '.'
- done
-done
-```
diff --git a/notes/gitops.md b/notes/gitops.md
new file mode 100644
index 00000000..5c44c6e3
--- /dev/null
+++ b/notes/gitops.md
@@ -0,0 +1,23 @@
+---
+tags: [Notebooks]
+title: gitops
+created: '2020-06-23T07:09:33.298Z'
+modified: '2022-10-17T10:55:27.028Z'
+---
+
+# gitops
+
+implementation of CI/CD for cloud native
+git repo contains declarative description of infrastructure
+update in repo leads to update in infra
+
+[gitops.tech/#what-is-gitops](https://www.gitops.tech/#what-is-gitops)
+
+## see also
+
+- [[devops]]
+- [[argocd]]
+- [[flux]]
+- [[kubectl]]
+- [[iac]]
+
diff --git a/notes/gnu readline.md b/notes/gnu readline.md
new file mode 100644
index 00000000..a7d7f1f9
--- /dev/null
+++ b/notes/gnu readline.md
@@ -0,0 +1,52 @@
+---
+tags: [shell]
+title: gnu readline
+created: '2019-07-30T06:19:49.019Z'
+modified: '2021-11-05T10:06:19.331Z'
+---
+
+# gnu readline
+
+> `bash emacs shortcuts`
+
+## usage
+
+```sh
+CTRL + A # move to beginning of line
+CTRL + B # moves backward one character
+CTRL + E # moves to end of line
+CTRL + F # moves forward one character
+
+CTRL + C # halts the current command
+CTRL + G # aborts the current editing command and ring the terminal bell
+CTRL + D # deletes one character backward or logs out of current session, similar to exit
+CTRL + U # kills backward from point to the beginning of line
+CTRL + W # kills the word behind the cursor
+CTRL + Y # retrieves (yank) last item killed
+CTRL + J # same as RETURN
+CTRL + K # deletes forward to end of line
+CTRL + L # clears screen and redisplay the line
+CTRL + M # same as RETURN
+CTRL + O # same as RETURN, then displays next line in history file
+CTRL + T # transposes two characters
+CTRL + V # makes the next character typed verbatim
+CTRL + X # lists the possible filename completefions of the current word
+CTRL + Z # stops the current command, resume with fg in the foreground or bg in the background
+CTRL + N # next line in command history
+CTRL + P # previous line in command history
+CTRL + R # searches backward
+CTRL + S # searches forward
+
+
+# create canned macros by mapping key sequences to input strings
+cat < ~/.inputrc
+Control-o: "> output.txt"
+Control-j: "\C-a$(\C-e)" # macro moves to the beginning of the line with Ctrl-A,
+ # adds `$(` then moves to the end of the line with Ctrl-E and adds `)`
+EOT
+```
+
+## see also
+- [[bash bind]]
+- [Is there a way to make alt-f and alt-b jump word forward on Mac? - Stack Overflow](https://stackoverflow.com/questions/20146972/is-there-a-way-to-make-alt-f-and-alt-b-jump-word-forward-and-backward-instead-of)
+- [readline - twobithistory.org](https://twobithistory.org/2019/08/22/readline.html)
diff --git a/notes/go channels.md b/notes/go channels.md
new file mode 100644
index 00000000..cc98f55a
--- /dev/null
+++ b/notes/go channels.md
@@ -0,0 +1,48 @@
+---
+tags: [go]
+title: go channels
+created: '2020-02-13T07:11:57.806Z'
+modified: '2023-05-10T12:12:00.457Z'
+---
+
+# go channels
+
+## guarantee of delivery
+
+- Unbuffered is guaranteed
+- Buffered not guaranteed
+
+## state
+
+a channel can have 3 states: `nil`, `open` or `closed`
+
+```go
+var ch chan string // is nil-state when it is declared to its zero value
+
+ch = nil // is placed in nil-state by explicilty setting to nil
+
+ch := make(chan string) // is open-state when using built-in function: make
+
+close(ch) // closed-state, when closed using built-in function: close
+
+/*
+- | `nil` | `open` | `closed`
+-- |-- |-- |--
+send | Blocked | Allowed | Panic
+receive | Blocked | Allowed | Allowed
+*/
+```
+
+## with and without data
+
+```go
+ch<- "data" // signals with data
+
+close(ch) // signaling without by closing channel
+```
+
+## see also
+
+- [ardanlabs.com/blog/the-behavior-of-channels](https://www.ardanlabs.com/blog/2017/10/the-behavior-of-channels.html)
+- [[go make]]
+
diff --git a/notes/go cli tooling.md b/notes/go cli tooling.md
deleted file mode 100644
index 246a6f6f..00000000
--- a/notes/go cli tooling.md
+++ /dev/null
@@ -1,45 +0,0 @@
----
-tags: [lang/go]
-title: go cli tooling
-created: '2019-07-30T06:19:49.064Z'
-modified: '2019-07-30T08:02:09.507Z'
----
-
-# go cli tooling
-
-```sh
-go help
-
-go build
-
-go install
-
-go test
-
-go run
-```
-```sh
-go env # show current env vars go uses
-
- # GOPATH - go-workspace and places to look for Go code/packages
- # must be set to get, build and install packges !!
- # GOROOT - only
-
-go env GOCACHE
-```
-
-### go get
-
-> `go get` downloads the packages named by the import paths, along with their dependencies.
-> Then installs the package, using `go install`, which uses go build and go build caches recent build results in `$GOPATH/pkg`
-
-[go get - Does go get command do cache? - Stack Overflow](https://stackoverflow.com/a/52813009/2087704)
-
-```sh
-go get -v github.com/yada/yad # verbose
-
- -v
- -u # update ?!
-
-go get ./... # install all dependencies of project recursively
-```
diff --git a/notes/go datastructures.md b/notes/go datastructures.md
new file mode 100644
index 00000000..8c3c4fab
--- /dev/null
+++ b/notes/go datastructures.md
@@ -0,0 +1,116 @@
+---
+tags: [go]
+title: go datastructures
+created: '2019-07-30T06:19:49.068Z'
+modified: '2023-05-10T12:14:55.554Z'
+---
+
+# go datastructures
+
+
+## enum
+
+> user definded type consisting of set of name constants called `enumerators`
+
+```go
+enum rainbowColors {
+ red = 1
+ orange = 2
+ ..
+}
+
+const ( // results in:
+ StatusOpen Status = iota // StatusOpen = 0
+ StatusClose // StatusClosed = 1
+ StatusUnkown // StatusUnknown = 2
+)
+```
+
+[[ruby symbol]]
+
+## slice
+
+```go
+// slicing an array
+s[m:n] // 0 โฅ m โฅ n โฅ len(s), elements m thorugh n-1
+
+os.Args[1:len(os.Args)] // if "m" || "n" is ommited it defaults to 0 or len(s)
+os.Args[1:] // abrev. for:
+
+
+// initialize
+// slice implements a `growth stategy` - is no space is available a new array is created and the items are copied over
+var bars []Bar
+bars := make([]Bar, 0)
+
+
+bars := make([]Bar, len(foo)) // predfined length
+
+bars := make([]Bar, 0, len(foo)) //init with 0-length and predefine capacity
+```
+
+## maps
+
+```go
+val a m[string]string
+
+b := map[string]string // initializes values
+
+c := make(map[string]string) // initializses capasity
+
+// initalize
+make ( map[string]int )
+// โโโโโฌโโโ
+// must be comparable wiht `==`
+```
+
+
+## struct
+
+> a struct is a typed collection of fields, usefull for grouping data into records
+
+```go
+// initializing structs
+type Student struct {
+ Name string
+ Age int
+}
+var a Student // a == Student{"", 0}
+a.Name = "Alice" // a == Student{"Alice", 0}
+
+
+//`new` keyword returns pointer to newly created struct
+var pa *Student // pa == nil
+pa = new(Student) // pa == &Student{"",0}
+pa.Name = "Alice" // pa == &Student{"Alice",0}
+
+
+// You can also create and initialize a struct with a `struct literal`
+b := Student{ // b == Student{"Bob", 0}
+ Name: "Bob",
+}
+
+pb := &Student { // pb == &Student{"Bob", 8}
+ Name: "Bob",
+ Age: 8,
+}
+
+c := Student{"Cecilia", 5} // c == &Student{"Cecilia", 5}
+d := Student{} // d == &Student{"", 0}
+```
+
+## compare structs
+
+> ompare struct values with the comparison operators `==` and `!=`
+
+```go
+d1 := Student{"David", 1}
+d2 := Student{"David", 2}
+fmt.Println(d1 == d2) // false
+```
+
+- [Create, initialize and compare structs ยท YourBasic Go](https://yourbasic.org/golang/structs-explained/)
+
+## see also
+
+- [[go]]
diff --git a/notes/go enum iota.md b/notes/go enum iota.md
deleted file mode 100644
index bc3f4cd7..00000000
--- a/notes/go enum iota.md
+++ /dev/null
@@ -1,35 +0,0 @@
----
-tags: [lang/go]
-title: go enum iota
-created: '2019-07-30T06:19:49.065Z'
-modified: '2019-07-30T08:02:09.508Z'
----
-
-# go enum iota
-> user definded type consisting of set of name constants called `enumerators`
-
-```go
-enum rainbowColors {
- red = 1
- orange = 2
- ..
-}
-```
-
-```go
-
-const (
- StatusOpen Status = iota
- StatusClose
- StatusUnkown
-)
-
-/*
-results in:
-
- StatusOpen = 0
- StatusClosed = 1
- StatusUnknown = 2
-*/
-
-```
diff --git a/notes/go fmt.md b/notes/go fmt.md
deleted file mode 100644
index 00ffaaf2..00000000
--- a/notes/go fmt.md
+++ /dev/null
@@ -1,27 +0,0 @@
----
-tags: [lang/go]
-title: go fmt
-created: '2019-07-30T06:19:49.066Z'
-modified: '2019-07-30T08:02:09.509Z'
----
-
-# go fmt
-
-
-## printf
-
-```go
- %v // the value in a default format
-
- %+v // add field names, when printing structs
-
- %#v // a Go-syntax representation of the value
-
- %T // a Go-syntax representation of the type of the value
-
- %% // a literal percent sign; consumes no value
-```
-
-
-
-[fmt - The Go Programming Language](https://golang.org/pkg/fmt/#hdr-Printing)
diff --git a/notes/go for.md b/notes/go for.md
index e950062e..b7bce0b5 100644
--- a/notes/go for.md
+++ b/notes/go for.md
@@ -1,8 +1,8 @@
---
-tags: [lang/go]
+tags: [go]
title: go for
created: '2019-07-30T06:19:49.066Z'
-modified: '2019-07-30T08:02:09.513Z'
+modified: '2019-08-20T07:22:54.437Z'
---
# go for
diff --git a/notes/go func.md b/notes/go func.md
index bd345604..151f4b12 100644
--- a/notes/go func.md
+++ b/notes/go func.md
@@ -1,13 +1,13 @@
---
-tags: [lang/go]
+tags: [go]
title: go func
created: '2019-07-30T06:19:49.067Z'
-modified: '2019-07-30T08:02:09.516Z'
+modified: '2020-09-01T13:04:13.554Z'
---
# go func
-> Functions in Go are first class citizens. Function types and function values can be used and passed around just like other values.
+> functions in go are first-class-citizens - function types and function values can be used and passed around just like other values
### anonymous functions
```go
@@ -36,8 +36,6 @@ newInts := intSeq()
fmt.Println(newInts()) // 1
```
-[Go by Example: Closures](https://gobyexample.com/closures)
-
### functions parameterized by type e.g.
```go
func Print (type T) (s []T) {
@@ -75,4 +73,7 @@ func main() {
fmt.Println(c) // [10, 20]
}
```
-[Go: Function types and values \| Programming.Guide](https://programming.guide/go/function-pointer-type-declaration.html)
+## see also
+- [[go init]]
+- [Go by Example: Closures](https://gobyexample.com/closures)
+- [Function types and values - Programming.Guide](https://programming.guide/go/function-pointer-type-declaration.html)
diff --git a/notes/go init.md b/notes/go init.md
new file mode 100644
index 00000000..31c59392
--- /dev/null
+++ b/notes/go init.md
@@ -0,0 +1,29 @@
+---
+tags: [go]
+title: go init
+created: '2020-09-01T13:00:26.717Z'
+modified: '2020-09-01T13:03:46.822Z'
+---
+
+# go init
+
+> init is called after all the variable declarations in the package have evaluated their initializers, and those are evaluated only after all the imported packages have been initialized
+
+## usage
+
+```go
+package main
+
+var X int
+
+func init() { X = 1 }
+
+var x2 = 2 * X
+
+func main() { println(x2) } // prints 0
+```
+
+## see also
+
+- [golang.org/doc/effective_go.html#init](https://golang.org/doc/effective_go.html#init)
+- [[go func]]
diff --git a/notes/go maps.md b/notes/go maps.md
deleted file mode 100644
index 9a4c5575..00000000
--- a/notes/go maps.md
+++ /dev/null
@@ -1,25 +0,0 @@
----
-tags: [lang/go]
-title: go maps
-created: '2019-07-30T06:19:49.068Z'
-modified: '2019-07-30T08:02:09.520Z'
----
-
-# go maps
-
-
-### initializing
-
-```go
-val a m[string]string
-
-b := map[string]string // initializes values
-
-c := make(map[string]string) // initializses capasity
-```
-
-```go
-make ( map[string]int )
-// โโโโโฌโโโ
-// must be comparable wiht `==`
-```
diff --git a/notes/go methods.md b/notes/go methods.md
index c4aec279..5008c5a4 100644
--- a/notes/go methods.md
+++ b/notes/go methods.md
@@ -1,8 +1,8 @@
---
-tags: [lang/go]
+tags: [go]
title: go methods
created: '2019-07-30T06:19:49.068Z'
-modified: '2019-07-30T08:02:09.525Z'
+modified: '2023-05-10T12:06:39.108Z'
---
# go methods
@@ -10,6 +10,8 @@ modified: '2019-07-30T08:02:09.525Z'
> Go does not have `classes`. However, you can define `methods` on types.
> A method is a `function` with a special receiver argument.
+## usage
+
```go
type Vertex struct {
X, Y float64
@@ -34,3 +36,7 @@ func (h handler) ServeHttp () {} // method on value
func (h *handler) ServeHttp () {} // method on pointer; pointer modifies reciever
```
+
+## see also
+
+- [[go]]
diff --git a/notes/go package.md b/notes/go package.md
index 0a651e73..625dceae 100644
--- a/notes/go package.md
+++ b/notes/go package.md
@@ -1,10 +1,32 @@
---
-tags: [lang/go]
+tags: [go]
title: go package
created: '2019-07-30T06:19:49.071Z'
-modified: '2019-07-30T08:02:09.529Z'
+modified: '2023-05-10T12:10:21.620Z'
---
# go package
"[Dependency hygiene trumps code reuse](https://talks.golang.org/2012/splash.slide#28)" e.g. net package has own int-to-decimal
+
+
+
+## fmt
+
+```go
+fmt.printf("output: %v", o)
+
+//%v the value in a default format
+
+//%+v add field names, when printing structs
+
+//%#v a Go-syntax representation of the value
+
+//%T a Go-syntax representation of the type of the value
+
+//%% a literal percent sign; consumes no value
+```
+
+## see also
+
+- [fmt - The Go Programming Language](https://golang.org/pkg/fmt/#hdr-Printing)
diff --git a/notes/go reflection.md b/notes/go reflection.md
deleted file mode 100644
index bc5289c4..00000000
--- a/notes/go reflection.md
+++ /dev/null
@@ -1,10 +0,0 @@
----
-tags: [lang/go]
-title: go reflection
-created: '2019-07-30T06:19:49.072Z'
-modified: '2019-07-30T08:02:09.537Z'
----
-
-# go reflection
-
--`reflections` โ runtime-type checking
diff --git a/notes/go runes atoi itoa.md b/notes/go runes atoi itoa.md
deleted file mode 100644
index d4870932..00000000
--- a/notes/go runes atoi itoa.md
+++ /dev/null
@@ -1,17 +0,0 @@
----
-tags: [lang/go]
-title: go runes atoi itoa
-created: '2019-07-30T06:19:49.072Z'
-modified: '2019-07-30T08:02:09.544Z'
----
-
-# go runes atoi itoa
-
-> `runes` are unicode codepoints
-
-## strinconversion Atoi / Itoa
-
-```go
-n := strconv.Atoi(os.Args[1]) # converst a string to integer
-n := strconv.ParseInt(os.Args[1], 10, 0)
-```
diff --git a/notes/go slice.md b/notes/go slice.md
deleted file mode 100644
index ac8a04cd..00000000
--- a/notes/go slice.md
+++ /dev/null
@@ -1,30 +0,0 @@
----
-tags: [lang/go]
-title: go slice
-created: '2019-07-30T06:19:49.073Z'
-modified: '2019-07-30T08:02:09.544Z'
----
-
-# go slice
-
-```go
-s[m:n] // 0 โฅ m โฅ n โฅ len(s)
- // elements m thorugh n-1
-
-// if "m" || "n" is ommited it defaults to 0 or len(s)
-os.Args[1:len(os.Args)]
-// abrev. for:
-os.Args[1:]
-```
-
-## initialize
-> slice implements a `growth stategy` - is no space is available a new array is created and the items are copied over
-```go
-var bars []Bar
-bars := make([]Bar, 0)
-
-
-bars := make([]Bar, len(foo)) // predfined length
-
-bars := make([]Bar, 0, len(foo)) //init with 0-length and predefine capacity
-```
diff --git a/notes/go struct.md b/notes/go struct.md
deleted file mode 100644
index 96614e6d..00000000
--- a/notes/go struct.md
+++ /dev/null
@@ -1,54 +0,0 @@
----
-tags: [lang/go]
-title: go struct
-created: '2019-07-30T06:19:49.074Z'
-modified: '2019-07-30T08:02:09.545Z'
----
-
-# go struct
-
-> a struct is a typed collection of fields, usefull for grouping data into records
-
-## initializeing structs
-
-```go
-type Student struct {
- Name string
- Age int
-}
-
-var a Student // a == Student{"", 0}
-a.Name = "Alice" // a == Student{"Alice", 0}
-```
-
-> `new` keyword returns pointer to newly created struct
-```go
-var pa *Student // pa == nil
-pa = new(Student) // pa == &Student{"",0}
-pa.Name = "Alice" // pa == &Student{"Alice",0}
-```
-
-> You can also create and initialize a struct with a `struct literal`
-```go
-b := Student{ // b == Student{"Bob", 0}
- Name: "Bob",
-}
-
-pb := &Student { // pb == &Student{"Bob", 8}
- Name: "Bob",
- Age: 8,
-}
-
-c := Student{"Cecilia", 5} // c == &Student{"Cecilia", 5}
-d := Student{} // d == &Student{"", 0}
-```
-
-## compare structs
-> ompare struct values with the comparison operators `==` and `!=`
-```go
-d1 := Student{"David", 1}
-d2 := Student{"David", 2}
-fmt.Println(d1 == d2) // false
-```
-
-[Create, initialize and compare structs ยท YourBasic Go](https://yourbasic.org/golang/structs-explained/)
diff --git a/notes/go template (docker).md b/notes/go template (docker).md
deleted file mode 100644
index faaafa9f..00000000
--- a/notes/go template (docker).md
+++ /dev/null
@@ -1,117 +0,0 @@
----
-tags: [container/docker, lang/go]
-title: go template (docker)
-created: '2019-07-30T06:19:49.074Z'
-modified: '2019-07-30T08:15:16.461Z'
----
-
-# go template (docker)
-
-[Docker Inspect Template Magic - Container Solutions](http://container-solutions.com/docker-inspect-template-magic/)
-[template - The Go Programming Language](https://golang.org/pkg/text/template/)
-[Docker - How do I change the docker gwbridge address?](https://success.docker.com/article/how-do-i-change-the-docker-gwbridge-address)
-
-```sh
-directive: "{{ }}"
-
-current-context: "." e.g. .Container
-
-root-context: $
-```
-### control structures
-```sh
- if
-
- with
-
- range
-```
-### functions
-```sh
- join # concatenates a list of strings to create a single string
- # '{{join .Args " , "}}'
-
- json # encodes an element as a json string.
-
- lower # transforms a string into its lowercase
-
- split # lices a string into a list of strings separated by a separator
- # {{split .Image ":"}}
-
- title # capitalizes the first character of a string
-
- upper # transforms a string into its uppercase
-
- println # prints each value on a new line
- # '{{range $k,$v := .Args}} {{println $v $k}} {{end}}'
-
- index # function: can lookup arbitrary strings in the map
-```
-
-https://golang.org/pkg/text/template/#example_Template_share
-
-
-```sh
-docker network inspect
-
- --format '{{ range $c, $n := .Containers }} => {{$c}} {{$n.Name}} {{end}}'
-
-docker image inspect
-
- --format '{{ range $k, $v := .ContainerConfig.Labels -}} {{ $k }}={{ $v }} {{ end -}}'
-
-docker container inspect
-
- --format '{{ .Config.Env}}'
-
- --format '{{ .HostConfig.LogConfig.Type}}'
-
- --format '{{ if eq 0.0 .State.ExitCode }} {{.Name }} {{.State.ExitCode}} {{end }}'
-
- --format '{{ range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{(index $conf 0).HostPort}} {{end}}'
-
- --format '{{ range $conf := .Config.Env}}{{$conf}}{{end}}'
-
- --format '{{ range $i,$j:= .Spec.Labels}}{{$i}}: {{$j}} {{end}}'
-
- --format '{{ index .Config.Labels "com.wherever.foo" }}'
-
- --format '{{ if (.Parent) }}{{.Id}} {{.Parent}}{{end}}' # if has parent e.g. docker image inspect $(docker image ls -q)
-
-docker inspect monitoring_exporter_1
-
- --format '{{ range $k, $v := .Config.Labels}}{{if eq $k "SERVICE_9100_NAME"}} {{$v}} {{end}} {{end}}'
-
-docker network inspect docker_gwbridge
-
- --format '{{.Containers}}'
-
- --format '{{ range $k, $v := index .IPAM.Config 0}}{{.| printf "%s: %s " $k}}{{end}}'
-
- --format '{{ range $key, $val := .Containers}} {{$key}} {{end}}'
-
- --format '{{ .Name}}
- {{ range $k,$v:= .Containers }}
- {{ printf "%s\n" $k}}
- {{ range $x,$y := $v }}
- {{ printf "%s: %s\n" $x $y}}
- {{end}}
- {{end}}'
-
-
-
-# extract laysers from container
-docker inspect
- --format '
- {{ range $e := .Config.Env}} ENV {{$e}} {{end}}
-
- {{ range $e,$v := .Config.ExposedPorts}} EXPOSE {{$e}} {{end}}
-
- {{ range $e,$v := .Config.Volumes}} VOLUME {{$e}} {{end}}
-
- {{ with .Config.User}}USER {{.}} {{end}}
- {{ with .Config.WorkingDir}}WORKDIR {{.}} {{end}}
- {{ with .Config.Entrypoint}}ENTRYPOINT {{json .}} {{end}}
- {{ with .Config.Cmd}}CMD {{json .}} {{end}}
- {{ with .Config.OnBuild}}ONBUILD {{json .}} {{end}}'
-```
diff --git a/notes/go-cron.md b/notes/go-cron.md
new file mode 100644
index 00000000..3c5fe7de
--- /dev/null
+++ b/notes/go-cron.md
@@ -0,0 +1,30 @@
+---
+tags: [go]
+title: go-cron
+created: '2020-03-26T15:24:17.413Z'
+modified: '2020-09-02T18:10:03.927Z'
+---
+
+# go-cron
+
+## usage
+```sh
+exec go-cron -s "${SCHEDULE}" -- /usr/local/bin/backup
+exec go-cron -s "0 */10 * * * *" -- /bin/bash -c 'backup.sh'
+exec go-cron -s "0 0 3 * *" -- "backup.sh"
+
+# Field name | Mandatory? | Allowed values | Allowed special characters
+# ---------- | ---------- | -------------- | --------------------------
+# Seconds | Yes | 0-59 | * / , -
+# Minutes | Yes | 0-59 | * / , -
+# Hours | Yes | 0-23 | * / , -
+# Day of month | Yes | 1-31 | * / , - ?
+# Month | Yes | 1-12 or JAN-DEC | * / , -
+# Day of week | Yes | 0-6 or SUN-SAT | * / , - ?
+```
+
+## see also
+- [[crontab]]
+- [[go]]
+- [cron - GoDoc](https://godoc.org/github.com/robfig/cron)
+- [`odise/go-cron` golang wrapper over `robfig/cron` and `os/exec` as a cron](https://github.com/odise/go-cron)
diff --git a/notes/go-template.md b/notes/go-template.md
new file mode 100644
index 00000000..7a4b0758
--- /dev/null
+++ b/notes/go-template.md
@@ -0,0 +1,105 @@
+---
+tags: [container, go]
+title: go-template
+created: '2019-07-30T06:19:49.074Z'
+modified: '2023-03-22T10:10:46.222Z'
+---
+
+# go-template
+
+## usage
+
+```sh
+# context
+"{{ }}" # directive
+"." # current-context e.g. ".Container"
+$ # root-context
+
+# control structures
+if
+with
+range
+
+# functions
+join # concatenates a list of strings to create a single string
+ # '{{join .Args " , "}}'
+json # encodes an element as a json string.
+lower # transforms a string into its lowercase
+split # lices a string into a list of strings separated by a separator
+ # {{split .Image ":"}}
+title # capitalizes the first character of a string
+upper # transforms a string into its uppercase
+println # prints each value on a new line
+ # '{{range $k,$v := .Args}} {{println $v $k}} {{end}}'
+index # function: can lookup arbitrary strings in the map
+```
+
+## kubectl
+
+```sh
+kubectl get events --sort-by='.metadata.creationTimestamp' \
+ -o 'go-template={{range .items}}{{.involvedObject.name}}{{"\t"}}{{.involvedObject.kind}}{{"\t"}}{{.message}}{{"\t"}}{{.reason}}{{"\t"}}{{.type}}{{"\t"}}{{.firstTimestamp}}{{"\n"}}{{end}}'
+
+kubectl get nodes `# get taints of nodes` \
+ -o go-template='{{printf "%-50s %-12s\n" "Node" "Taint"}}{{- range .items}}{{- if $taint := (index .spec "taints") }}{{- .metadata.name }}{{ "\t" }}{{- range $taint }}{{- .key }}={{ .value }}:{{ .effect }}{{ "\t" }}{{- end }}{{- "\n" }}{{- end}}{{- end}}'
+```
+
+## docker
+
+```sh
+# docker ps
+--format "table {{.ID}}\t{{.Image}}\t{{.Names}}" | awk '{ if( $2 !~ /^docker-registry/) print}'
+
+# docker info
+--format="{{json .LiveRestoreEnabled}}"
+--format "{{json .Swarm}}" | jq '.Cluster.Spec.Orchestration.TaskHistoryRetentionLimit'
+
+# docker network network
+--format '{{ range $c, $n := .Containers }} => {{$c}} {{$n.Name}} {{end}}'
+--format '{{.Containers}}' # docker network inspect docker_gwbridge
+--format '{{ range $k, $v := index .IPAM.Config 0}}{{.| printf "%s: %s " $k}}{{end}}'
+--format '{{ range $key, $val := .Containers}} {{$key}} {{end}}'
+--format '{{ .Name}}
+ {{ range $k,$v:= .Containers }}
+ {{ printf "%s\n" $k}}
+ {{ range $x,$y := $v }}
+ {{ printf "%s: %s\n" $x $y}}
+ {{end}}
+ {{end}}'
+
+# docker image inspect
+--format '{{ range $k, $v := .ContainerConfig.Labels -}} {{ $k }}={{ $v }} {{ end -}}'
+
+# docker container inspect
+--format '{{ .Config.Env}}'
+--format '{{ .HostConfig.LogConfig.Type}}'
+--format '{{ if eq 0.0 .State.ExitCode }} {{.Name }} {{.State.ExitCode}} {{end }}'
+--format '{{ range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{(index $conf 0).HostPort}} {{end}}'
+--format '{{ range $conf := .Config.Env}}{{$conf}}{{end}}'
+--format '{{ range $i,$j:= .Spec.Labels}}{{$i}}: {{$j}} {{end}}'
+--format '{{ index .Config.Labels "com.wherever.foo" }}'
+--format '{{ if (.Parent) }}{{.Id}} {{.Parent}}{{end}}' # if has parent e.g. docker image inspect $(docker image ls -q)
+--format '{{ range $k, $v := .Config.Labels}}{{if eq $k "SERVICE_9100_NAME"}} {{$v}} {{end}} {{end}}'
+
+# extract laysers from container
+--format '
+ {{ range $e := .Config.Env}} ENV {{$e}} {{end}}
+ {{ range $e,$v := .Config.ExposedPorts}} EXPOSE {{$e}} {{end}}
+ {{ range $e,$v := .Config.Volumes}} VOLUME {{$e}} {{end}}
+ {{ with .Config.User}}USER {{.}} {{end}}
+ {{ with .Config.WorkingDir}}WORKDIR {{.}} {{end}}
+ {{ with .Config.Entrypoint}}ENTRYPOINT {{json .}} {{end}}
+ {{ with .Config.Cmd}}CMD {{json .}} {{end}}
+ {{ with .Config.OnBuild}}ONBUILD {{json .}} {{end}}'
+```
+
+## see also
+
+- [[go]]
+- [[kubectl]]
+- [[jsonpath]]
+- [[docker]]
+- [container-solutions.com/docker-inspect-template-magic](http://container-solutions.com/docker-inspect-template-magic/)
+- [docker.com/article/how-do-i-change-the-docker-gwbridge-address](https://success.docker.com/article/how-do-i-change-the-docker-gwbridge-address)
+- [golang.org/pkg/text/template](https://golang.org/pkg/text/template/)
+- [golang.org/pkg/text/template/#example_Template_share](https://golang.org/pkg/text/template/#example_Template_share)
diff --git a/notes/go.md b/notes/go.md
index bf2bea6e..c6607b68 100644
--- a/notes/go.md
+++ b/notes/go.md
@@ -1,13 +1,116 @@
---
-tags: [lang/go]
+tags: [go]
title: go
created: '2019-07-30T06:19:49.075Z'
-modified: '2019-07-30T08:02:09.500Z'
+modified: '2023-05-10T12:15:24.340Z'
---
# go
-- it's `staticallly typed` and `garbage collected`
+> tool for managing `go` source code
+
+## install
+
+```sh
+curl -O https://dl.google.com/go/go1.13.7.linux-amd64.tar.gz
+tar xvzf go1.13.7.linux-amd64.tar.gz && mv go /usr/local/
+```
+
+## option
+
+```sh
+```
+
+
+## environment
+
+```sh
+GOROOT # /usr/local/opt/go/libexec
+GOTOOLDIR # /usr/local/opt/go/libexec/pkg/tool/darwin_amd64
+GOPATH # go-workspace, places to look for code/packages; must be set to `go get`, `go build` and `go install`, `go env GOPATH`
+GOBIN # -
+PKG_CONFIG # pkg-config
+GOCACHE # /path/Caches/go-build
+GOTMPDIR # -
+GOARCH # amd64
+GOOS # darwin
+GOHOSTARCH # amd64
+GOHOSTOS # darwin
+GCCGO # gccgo
+CC # clang
+CXX # clang++
+CGO_ENABLED # -
+GOMOD # -
+GO11MODULE
+```
+
+## usage
+
+```sh
+go help env # more information about a command
+go env # show current env vars go uses
+go env GOCACHE # print specific value
+go env -json # print in json format
+go env -w GO111MODULE=auto # ..
+```
+
+## mod
+
+```sh
+go mod init REPO/hello # creates a new module, initializing the `go.mod` that describes it
+ # `go build`, `go test` and other package-building commands add new dependencies to `go.mod`
+
+go mod edit -replace example.com/greetings=../greetings # rewrite path for local development
+
+go mod tidy # remove unused dependencies
+```
+
+## list
+
+```sh
+go list -m all # lists the current module and all its dependencies
+go list -m -versions rsc.io/sampler # list available tagged versions of module
+go list -m rsc.io/... # list current versions
+
+go doc -all rsc.io/quote/v3 # get documentation
+go doc io.Copy # print doc to Copy method of io package
+go doc github.com/gorilla/mux ServeHTTP # print doc from dependency
+
+go clean -cache -modcache -i -r # clear cache
+
+
+go run
+
+go test -json # Convert test output to JSON suitable for automated processing
+
+go clean -i github.com/motemen/gore... # remove installed package
+```
+
+### get
+
+> downloads the packages named by import paths, along with dependencies. Then installs named packages like `go install`
+> โ ๏ธ has been deprecated for installing binaries since `1.17`
+
+#### option
+
+```sh
+-d # stop after downloading the packages; that is, to not install packages
+-fix # run fix tool on the downloaded packages before resolving dependencies or building the code
+-t # also download packages required to build the tests for the specified packages
+-u # use network to update named packages and dependencies
+-f # forces -u not to verify that each package has been checked out from the source control repository implied by its import path. useful if source is local fork
+-v # enables verbose progress and debug output
+```
+
+```sh
+go get -v github.com/user/repo # install specific package
+
+go get rsc.io/sampler@v1.3.1 # install with specific version, defaults to `@latest`
+
+go get ./... # install all dependencies of project recursively
+```
+
+## language
```
has doesn't have
@@ -17,34 +120,46 @@ modified: '2019-07-30T08:02:09.500Z'
+ lexical-scope - operator overloading
+ system call interface - default parameter values
+ immutable string in utf-8 - inheritance (type-based inheritance โ subclasses)
- - generics `parametrics polimorphism` โ `generics`
- - exceptions
++ struct ~ class - generics `parametrics polimorphism` โ `generics`
++ concurrency support (CSP) - exceptions
- macros
- - function annotations
- - thread local storag
++ `garbage collected` - function annotations
++ it's `staticallly typed` - thread local storage
+ - inheritance but composition of type
+ - explicit declaration, interface-implementation required
```
----
+## semicolon rule
-+ type system
-+ concurrency support (concurrency based on CSP)
+> `;` terminates statements
-types expected if upperase
-struct ~ class
+if last token before new line:
+- is an `identifiere` -> `int`, `float64`
+- is an `basic literal` -> `number`, `string`
+- is a `token` -> `break`, `continues`, `fallthrough`, `return`, `++`, `--`, `)`, `}`
-no inheritance but composition of type
+if the new line comes after a `token` that could end the statement => insert `;`
-no explicit declaration interface-implementation required
+## runes atoi itoa
----
+> `runes` are unicode codepoints
-# semicolon rule
+## strinconversion Atoi / Itoa
-`;` terminates statements
+```go
+n := strconv.Atoi(os.Args[1]) # converst a string to integer
+n := strconv.ParseInt(os.Args[1], 10, 0)
+```
-if last token before new line:
-- is an `identifiere` -> int float64
-- is an `basic literal` -> number, string
-- or a `token` -> break, continues, fallthrough, retrun, ++, --, ), }
+## see also
-if the new line comes after a `token` that could end the statemtn => insert a `;`
+- [[go-template]]
+- [[go datastructures]]
+- [[c]], [[gcc]], [[make]]
+- [[java]], [[javac]], [[mvn]]
+- [[wasm]]
+- [[rust]]
+- [[fmt]]
+- [go-install-vs-go-build/](https://pocketgophers.com/go-install-vs-go-build/)
+- [Does go get command do cache?](https://stackoverflow.com/a/52813009/2087704)
+- [lecstor.com/go-clear-cache](https://lecstor.com/go-clear-cache/)
diff --git a/notes/gource.md b/notes/gource.md
new file mode 100644
index 00000000..4298b87d
--- /dev/null
+++ b/notes/gource.md
@@ -0,0 +1,146 @@
+---
+tags: [c, vcs]
+title: gource
+created: '2023-06-01T05:23:19.923Z'
+modified: '2023-06-01T05:50:50.553Z'
+---
+
+# gource
+
+## install
+
+```sh
+brew install gource
+```
+
+## option
+
+```sh
+-h, --help # help, '-H' for extended help
+-WIDTHxHEIGHT, --viewport WxH # set the viewport size. If -f is also supplied, will attempt to set the video mode to this also. Add ! to make the window non-resizable
+ --screen SCREEN # set the number of the screen to display on
+ --high-dpi # request a high DPI display when creating the window
+ --window-position XxY # Initial window position on your desktop which may be made up of multiple monitors
+ --frameless # frameless window
+-f, --fullscreen # Fullscreen
+-w, --windowed # Windowed
+ --transparent # Make the background transparent. Only really useful for screenshots
+ --start-date FORMAT # start with the first entry after the supplied date and optional time, If a time zone offset isn't specified the local time zone is used
+ --stop-date FORMAT # Stop after the last entry prior to the supplied date and optional time
+-p, --start-position POSITION # Begin at some position in the log (between 0.0 and 1.0 or 'random')
+ --stop-position POSITION # Stop (exit) at some position in the log (does not work with STDIN)
+-t, --stop-at-time SECONDS # Stop (exit) after a specified number of seconds
+ --stop-at-end # Stop (exit) at the end of the log / stream
+ --loop # Loop back to the start of the log when the end is reached
+ --loop-delay-seconds # Seconds to delay before looping
+-a, --auto-skip-seconds SECONDS # Skip to next entry if nothing happens for a number of seconds
+-s, --seconds-per-day SECONDS # Speed of simulation in seconds per day
+ --realtime # Realtime playback speed
+ --no-time-travel # Use the time of the last commit if the time of a commit is in the past
+-c, --time-scale SCALE # Change simulation time scale. E.g. 0.5 for half speed, 2 for double speed
+-i, --file-idle-time SECONDS # Time in seconds files remain idle before they are removed or 0 for no limit
+ --file-idle-time-at-end SECONDS # Time in seconds files remain idle at the end before they are removed
+-e, --elasticity FLOAT # Elasticity of nodes
+-b, --background-colour FFFFFF # Background colour in hex
+ --background-image IMAGE # Set a background image
+ --logo IMAGE # Logo to display in the foreground
+ --logo-offset XxY # Offset position of the logo
+ --title TITLE # Set a title
+ --font-file FILE # Specify the font. Should work with most font file formats supported by FreeType, such as TTF and OTF, among others
+ --font-scale SCALE # Scale the size of all fonts
+ --font-size SIZE # Font size used by the date and title
+ --file-font-size SIZE # Font size of filenames
+ --dir-font-size SIZE # Font size of directory names
+ --user-font-size SIZE # Font size of user names
+ --font-colour FFFFFF # Font colour used by the date and title in hex
+ --key # Show file extension key
+ --date-format FORMAT # Specify display date string (strftime format)
+ --log-command VCS # Show the VCS log command used by gource (git,svn,hg,bzr,cvs2cl)
+ --log-format VCS # Specify the log format (git,svn,hg,bzr,cvs2cl,custom), Required when reading from STDIN
+ --git-branch # Get the git log of a branch other than the current one
+ --follow-user USER # Have the camera automatically follow a particular user
+ --highlight-dirs # Highlight the names of all directories
+ --highlight-user USER # Highlight the names of a particular user
+ --highlight-users # Highlight the names of all users
+ --highlight-colour FFFFFF # Font colour for highlighted users in hex
+ --selection-colour FFFFFF # Font colour for selected users and files
+ --filename-colour FFFFFF # Font colour for filenames
+ --dir-colour FFFFFF # Font colour for directories
+ --dir-name-depth DEPTH # draw names of directories down to a specific depth in the tree.
+ --dir-name-position FLOAT # Position along edge of the directory name (between 0.1 and 1.0, default is 0.5)
+ --filename-time SECONDS # Duration to keep filenames on screen (>= 2.0)
+ --file-extensions # Show filename extensions only
+ --file-extension-fallback # Use filename as extension if the extension is missing or empty
+ --file-filter REGEX # Filter out file paths matching the specified regular expression
+ --file-show-filter REGEX # Show only file paths matching the specified regular expression
+ --user-filter REGEX # Filter usernames matching the specified regular expression
+ --user-show-filter REGEX # Show only usernames matching the specified regular expression
+ --user-image-dir DIRECTORY # Directory containing .jpg or .png images of users (eg "Full Name.png") to use as avatars
+ --default-user-image IMAGE # Path of .jpg or .png to use as the default user image
+ --fixed-user-size # Forces the size of the user image to remain fixed throughout
+ --colour-images # Colourize user images
+ --crop AXIS # Crop view on an axis (vertical,horizontal)
+ --padding FLOAT # Camera view padding
+ --multi-sampling # Enable multi-sampling
+ --no-vsync # Disable vsync
+ --bloom-multiplier FLOAT # Adjust the amount of bloom
+ --bloom-intensity FLOAT # Adjust the intensity of the bloom
+ --max-files NUMBER # Set the maximum number of files or 0 for no limit. Excess files will be discarded
+ --max-file-lag SECONDS # Max time files of a commit can take to appear, Use -1 for no limit
+ --max-user-speed UNITS # Max speed users can travel per second
+ --user-friction SECONDS # Time users take to come to a halt
+ --user-scale SCALE # Change scale of user avatars
+ --camera-mode MODE # Camera mode (overview,track)
+ --disable-auto-rotate # Disable automatic camera rotation
+ --disable-input # Disable keyboard and mouse input
+ --hide DISPLAY_ELEMENT # hide one or more display elements: bloom, date, dirnames, files, filenames, mouse, progress, root, tree, users, usernames
+ --hash-seed SEED # Change the seed of hash function
+ --caption-file FILE # Caption file (see Caption Log Format)
+ --caption-size SIZE # Caption size
+ --caption-colour FFFFFF # Caption colour in hex
+ --caption-duration SECONDS # Caption duration
+ --caption-offset X # Caption horizontal offset (0 to centre captions)
+-o, --output-ppm-stream FILE # Output a PPM image stream to a file ('-' for STDOUT). This will automatically hide the progress bar initially and enable 'stop-at-end'
+-r, --output-framerate FPS # Framerate of output (25,30,60). Used with --output-ppm-stream
+ --output-custom-log FILE # Output a custom format log file ('-' for STDOUT)
+ --load-config CONFIG_FILE # Load a gource conf file
+ --save-config CONFIG_FILE # Save a gource conf file with the current options
+ --path PATH # vcs directory, a pre-generated log file, a Gource conf file or '-' to read STDIN, if omitted, will attempt to read a log from the current DIR
+```
+
+## usage
+
+```sh
+gource
+```
+
+## interactive keyboard commands
+
+```sh
+V # Toggle camera mode
+C # Displays Gource logo
+K # Toggle file extension key
+M # Toggle mouse visibility
+N # Jump forward in time to next log entry
+S # Randomize colours
+D # Toggle directory name display mode
+F # Toggle file name display mode
+U # Toggle user name display mode
+G # Toggle display of users
+T # Toggle display of directory tree edges
+R # Toggle display of root directory edges
++- # Adjust simulation speed
+<> # Adjust time scale
+TAB # Cycle through visible users
+F12 # screenshot
+Alt+Enter # fullscreen toggle
+ESC # quit
+```
+
+## see also
+
+- [[git]]
+- [[ffmpeg]]
+- [[macos keyboard shortcuts]]
+- [github.com/acaudwell/Gource](https://github.com/acaudwell/Gource)
+
diff --git a/notes/govc.md b/notes/govc.md
index 19fe5846..3097690f 100644
--- a/notes/govc.md
+++ b/notes/govc.md
@@ -1,79 +1,18 @@
---
-tags: [cli, vmware]
+tags: [go]
title: govc
created: '2019-07-30T06:19:49.075Z'
-modified: '2019-07-30T08:03:20.234Z'
+modified: '2023-03-22T11:02:08.670Z'
---
# govc
+> govc is an vSphere CLI built on govmomi, the vSphere Go SDK. It has a robust inventory browser command.
+## usage
-govc is an vSphere CLI built on govmomi, the vSphere Go SDK. It has a robust inventory browser command.
-
-[Automate your vCenter interactions from the Linux commandline with govmomi and govc | Velenux Home Page](https://velenux.wordpress.com/2016/09/19/automate-your-vcenter-interactions-from-the-linux-commandline-with-govmomi-and-govc/)
-
-## vm
-```sh
-govc vm.info -json ${vm} | jq '.VirtualMachines[].Guest.Net[] | .IpConfig | .IpAddress'
-
-govc vm.info -json ${vm} | jq '.VirtualMachines[]' | grep -o -E '10\.32\.[0-9]{1,3}\.[0-9]{1,3}';
-```
-
-## find
-
-```sh
-govc find --help
-
-govc find -type p
-# -type
-# a VirtualApp
-# c ClusterComputeResource
-# d Datacenter
-# f Folder
-# g DistributedVirtualPortgroup
-# h HostSystem
-# m VirtualMachine
-# n Network
-# o OpaqueNetwork
-# p ResourcePool
-# r ComputeResource
-# s Datastore
-# w DistributedVirtualSwitch
-
-govc find -type m -name "*packer*" # find machines which contain packer
-```
-
-### find host by IP
-```sh
-govc find . -type m -guest.ipAddress "10.32.22.8" -runtime.powerState poweredOn
-```
-[govc find with -guest.ipAddress argument returns more than one result ยท Issue #1089 ยท vmware/govmomi ยท GitHub](https://github.com/vmware/govmomi/issues/1089)
-
-### find all network and get object-names
-```sh
-govc find -type n | gxargs -d '\n' -I% govc object.collect -s % name
-```
-[Network info ยท Issue #742 ยท vmware/govmomi ยท GitHub](https://github.com/vmware/govmomi/issues/742)
-
-### find hosts that have the datastore mounted using
-```sh
-# -host can be the HostSystem name or inventory path.
-govc find . -type h -datastore $(govc find -i ./datastore -name iso_images)
-```
-[datastore.upload broken pipe ยท Issue #832 ยท vmware/govmomi ยท GitHub](https://github.com/vmware/govmomi/issues/832)
-
-### find all vms running linux
-```sh
-govc find . -type m -runtime.powerState poweredOn -guest.guestFamily linuxGuest
-
-govc find . -type m -runtime.powerState poweredOn -guest.guestId '*Linux*'
-
-govc find . -type m -runtime.powerState poweredOn -guest.guestId '*[ubuntu][Linux]*'
-```
-
-## ls
```sh
+# ls
govc ls -h
govc ls -l '*'
@@ -94,11 +33,9 @@ govc ls -i -l -L "Network:network-42742"
govc ls -l 'host/*' | grep ResourcePool | awk '{print $1}' # | xargs -n1 -t govc pool.info
govc pool.info "/na Hamburg/host/naCluster02/Resources"
-```
-[pool.info command appears broken ยท Issue #203 ยท vmware/govmomi ยท GitHub](https://github.com/vmware/govmomi/issues/203#issuecomment-70699130)
-### host
-```sh
+
+# host
govc host.info -host='/na Hamburg/host/naCluster02/vhost01.domain.net'
govc host.service.ls -host='/na Hamburg/host/naCluster02/vhost06.domain.net'
@@ -119,35 +56,36 @@ govc host.info -host='/na Hamburg/host/naCluster02/vhost01.domain.net'
govc datacenter.info
govc host.info -host='/na Hamburg/host/naCluster02/vhost01.domain.net'
govc host.service.ls -host='/na Hamburg/host/naCluster02/vhost06.domain.net'
-```
-## datastore
-```sh
+
+# datastore
govc datastore.ls -ds=datastore2 -l
govc find vm -type m -datastore $(govc find -i datastore -name datastore3)
-```
-```sh
for i in $(govc find vm -type m | grep -i "node" | cut -d/ -f2); do
- DATASTORE=$(govc vm.info -json "$i" | jq --raw-output '.VirtualMachines[].Config.Hardware.Device[] | select(.DeviceInfo.Label=="CD/DVD drive 1" ) | .Backing.FileName');
+ DATASTORE="$( govc vm.info -json "$i" \
+ | jq --raw-output '.VirtualMachines[].Config.Hardware.Device[] | select(.DeviceInfo.Label=="CD/DVD drive 1" ) | .Backing.FileName')";
printf "%s: %s" "$i" "$DATASTORE";
done
-```
-## restart vm
-```sh
+
+# vm - virtualmachine
+govc vm.info -json ${vm} | jq '.VirtualMachines[].Guest.Net[] | .IpConfig | .IpAddress'
+
+govc vm.info -json ${vm} | jq '.VirtualMachines[]' | grep -o -E '10\.32\.[0-9]{1,3}\.[0-9]{1,3}';
+
+govc vm.info -json $REPLY | jq '.VirtualMachines[].Config.Hardware.Device[] | select(.Key== 2000) | .CapacityInBytes';
+
+# restart vm
for vm in $(govc find -type m -name "swarm-*.ddev.domain.net"); do
UUID=$(govc vm.info -json "$vm" | jq -r '.VirtualMachines[].Summary.Config.Uuid');
- echo $vm
+ echo "$vm"
echo govc vm.power -off=true -vm.uuid=$UUID \&\& govc vm.power -on=true -vm.uuid=$UUID;
done
-```
-
-## tags
-```sh
+# tags
govc tags.ls
govc tags.attached.ls -r vm/stats-db.node.dint.domain.net
@@ -155,23 +93,74 @@ govc tags.attached.ls -r vm/stats-db.node.dint.domain.net
govc tags.attached.ls backup_daily2230_noQuiese
govc object.collect -json VirtualMachine:vm-365
-```
-## tasks
-show current vsphere tasks
-```sh
-govc tasks -n=20 -f
-```
-## metrics
-```sh
+# tasks
+govc tasks -n=20 -f # show current vsphere tasks
+
+
+# metrics
govc metric.ls ./vm/mq-1.node.dint.domain.net
govc metric.sample ./vm/mq-1.node.dint.domain.net cpu.usage.average
-```
-## snapshot
-```sh
+
+# snapshot
govc snapshot.tree -vm ./vm/mq-1.node.dint.domain.net -D -i -d
govc snapshot.create -vm ./vm/gitlab.node.dint.domain.net pre-gitlab-v12-upgrade
```
+
+## find
+
+```sh
+govc find --help
+
+govc find -type p
+# -type
+# a VirtualApp
+# c ClusterComputeResource
+# d Datacenter
+# f Folder
+# g DistributedVirtualPortgroup
+# h HostSystem
+# m VirtualMachine
+# n Network
+# o OpaqueNetwork
+# p ResourcePool
+# r ComputeResource
+# s Datastore
+# w DistributedVirtualSwitch
+
+govc find -type m -name "*packer*" # find vms which contain packer
+
+govc find . -type m -guest.ipAddress "10.32.22.8" -runtime.powerState poweredOn # find host by IP
+
+govc find -type n | gxargs -d '\n' -I% govc object.collect -s % name # find all network and get object-names
+
+govc find -i -type h -name vhost11.foo.bar # get managed-object-reference: "HostSystem:host-29240"
+
+govc find -type m -host $(govc find -i -type h -name vhost11.foo.bar)
+
+# -host can be the HostSystem name or inventory path.
+govc find . -type h -datastore $(govc find -i ./datastore -name iso_images) # find hosts that have the datastore mounted using
+
+# find all vms running linux
+govc find . -type m -runtime.powerState poweredOn -guest.guestFamily linuxGuest
+
+govc find . -type m -runtime.powerState poweredOn -guest.guestId '*Linux*'
+
+govc find . -type m -runtime.powerState poweredOn -guest.guestId '*[ubuntu][Linux]*'
+
+
+govc vm.info -json ./vm/foo | jq '.VirtualMachines[].Guest.Net[] | .IpAddress[0]' # find vm and its ip
+```
+
+- [find with -guest.ipAddress argument returns more than one result](https://github.com/vmware/govmomi/issues/1089)
+
+## see also
+
+- [[jq]]
+- [velenux.wordpress.com/automate-your-vcenter-interactions-from-the-linux-commandline-with-govmomi-and-govc](https://velenux.wordpress.com/2016/09/19/automate-your-vcenter-interactions-from-the-linux-commandline-with-govmomi-and-govc/)
+- [Network info ยท Issue #742 ยท vmware/govmomi ยท GitHub](https://github.com/vmware/govmomi/issues/742)
+- [datastore.upload broken pipe ยท Issue #832 ยท vmware/govmomi ยท GitHub](https://github.com/vmware/govmomi/issues/832)
+- [pool.info command appears broken ยท Issue #203 ยท vmware/govmomi ยท GitHub](https://github.com/vmware/govmomi/issues/203#issuecomment-70699130)
diff --git a/notes/gpg-connect-agent.md b/notes/gpg-connect-agent.md
new file mode 100644
index 00000000..b83f8b4b
--- /dev/null
+++ b/notes/gpg-connect-agent.md
@@ -0,0 +1,24 @@
+---
+tags: [linux]
+title: gpg-connect-agent
+created: '2019-08-28T21:55:26.962Z'
+modified: '2023-07-25T06:44:57.433Z'
+---
+
+# gpg-connect-agent
+
+> connect to a running agent and send commands, runs via `pinentry` interactively or by passing options
+
+## usage
+
+```sh
+gpg-connect-agent reloadagent /bye # reload agent on macos to reenter passphrase for gpg
+
+gpg-connect-agent 'getinfo std_env_names' /bye | awk '$1=="D" {print $2}' # list var name passed from gpg
+```
+
+## see also
+
+- [[gpg]]
+- [[pass]]
+- [services - How can I restart gpg-agent? - Super User](https://superuser.com/a/1183544/341187)
diff --git a/notes/gpg.md b/notes/gpg.md
new file mode 100644
index 00000000..bb3cdccd
--- /dev/null
+++ b/notes/gpg.md
@@ -0,0 +1,241 @@
+---
+tags: [crypto]
+title: gpg
+created: '2019-07-30T06:19:49.076Z'
+modified: '2023-07-31T07:43:06.086Z'
+---
+
+# gpg
+
+> `gnu privacy guard` - openPGP encryption and signing tool
+
+> In `public key cryptography`, a key is actually a pair: a `public key`, and a `private key`
+> You use the `private key` to digitally sign files, and others use the public key to verify the signature
+> or others use the `public key` to encrypt something, and you use the `private key` to decrypt it
+[wiki.debian.org/Subkeys](https://wiki.debian.org/Subkeys)
+
+## install
+
+```sh
+brew install gpg # version 1: for embedded and server usage, as it brings less dependencies and smaller binaries
+brew install gpg2 # version 2: targeted to desktop; requires several other modules to be installed
+apt-get install gpg2
+```
+
+## environment
+
+```sh
+HOME # to locate the default home directory
+GNUPGHOME # If set directory used instead of "~/.gnupg"
+GPG_AGENT_INFO # is obsolete; it was used by GnuPG versions before 2.1
+PINENTRY_USER_DATA # is passed via gpg-agent to pinentry. It is useful to convey extra information to a custom pinentry
+COLUMNS
+LINES # to size some displays to the full size of the screen
+LANGUAGE
+GNUPG_BUILD_ROOT # used by regression test suite as a helper under operating systems without proper support
+GNUPG_EXEC_DEBUG_FLAGS # allows to enable diagnostics for process management. Bit 0 enables general diagnostics
+```
+
+## option
+
+```sh
+# not specific to the function
+-h, --help # print a usage message summarizing the most useful command-line options
+
+-k, --list-keys, --list-public-keys # list public keys - if no keys are specified, all keys from configured public keyrings are listed
+
+-K, --list-secret-keys # list secret keys - if no keys are specified, all known secret keys are listed
+ # `#` after the initial tags sec or ssb means that the secret key or subkey is currently not usable
+ # `>` after these tags indicate that the key is stored on a smartcard
+```
+
+### COMMANDS
+
+```sh
+# select the type of operation
+-e, --encrypt # encrypt data to one or more public keys
+ # command may be combined with --sign (to sign and encrypt a message),
+ # --symmetric (to encrypt a message that can be decrypted using a secret key or a passphrase),
+ # or --sign and --symmetric together (for a signed message that can be decrypted using a secret key or a passphrase).
+ # --recipient and related options specify which public keys to use for encryption
+
+-d, --decrypt FILE # decrypt FILE (or STDIN if no file is specified) and write to STDOUT (or --output FILE)
+ # if the decrypted file is signed, the signature is also verified. This command differs from the default operation, as it never writes to the filename which is included in the file and it rejects files that don't begin with an encrypted message
+
+
+-k, --list-keys, --list-public-keys # list specified keys. If no keys are specified, then all keys from the configured public keyrings are listed
+ # Never use the output of this command in scripts or other programs.
+ # output is intended only for humans and its format is likely to change.
+ # The --with-colons option emits the output in a stable, machine-parseable format, which is intended for use by scripts and other programs
+
+
+# manage your keys
+--gen-key, --generate-key # generate new key pair using current default parameters and create a revocation-certificate in `~/.gnupg/openpgp-revocs.d`
+--full-gen-key, --full-generate-key # generate new key pair with dialogs for all options - extended version of --generate-key
+
+
+# input and output
+-a, --armor # create ASCII armored output. The default is to create the binary OpenPGP format
+````
+
+### OPTIONS
+
+```sh
+# config change related
+
+--auto-key-locate MECHANISMUS # GnuPG can automatically locate and retrieve keys as needed using this option.
+--no-auto-key-locate # happens when encrypting to an email address, and there is no matchin email-key on the local keyring
+ # mechanisms listed below, in the order they are to be tried. defaults: "local,wkd"
+ # cert locate a key using DNS CERT, as specified in RFC-4398
+ # dane locate a key using DANE, as specified in draft-ietf-dane-openpgpkey-05.txt
+ # wkd locate a key using the Web Key Directory protocol
+ # ldap Using DNS Service Discovery, check the domain in question for any LDAP keyservers to use
+ # ntds locate the key using the Active Directory (Windows only)
+ # keyserver locate a key using a keyserver.
+ # keyserver-URL in addition, a keyserver URL as used in the dirmngr configuration may be used here to query that particular keyserver
+ # local locate the key using the local keyrings: allows the user to select the order in which local key lookup is done
+ # using `--auto-key-locate local' is identical to --no-auto-key-locate
+ # nodefault disables the standard local key lookup, done before any of the mechanisms defined by the --auto-key-locate are tried
+ # clear clear all defined mechanisms - useful to override mechanisms given in a config file.
+ # Note that a nodefault in mechanisms will also be cleared unless it is given after the clear
+ # option --no-auto-key-locate or the mechanism "clear" resets the list.
+
+
+# key related options
+-r, --recipient RECIPIENT # encrypt for user id name. If this option or --hidden-recipient is not specified, GnuPG asks for the user-id unless --default-recipient is given
+```
+
+```sh
+ABCD EFGH 12BD 7897 7B37 1234 4E1F 799A A4FF 2279 # Fingerprint
+ 4E1F 799A A4FF 2279 # Long key ID: lowest 64 bits
+ A4FF 2279 # Short key ID: lowest 32 bits
+ # abbreviation:
+pub # public primary key
+sub # public sub-key
+sec # secret primary key
+ssb # secret sub-key
+
+pgp # pretty good privacy
+dsa # Digital Signature Algorithm (signing/verification)
+rsa # Rivest Shamir and Adleman (encryption/decrypt)
+
+.sig # detached signatures using the binary OpenPGP format
+.asc # ASCII-armored
+```
+
+## info
+
+```sh
+gpg --version
+gpg --help
+gpg --dump-options # print a list of all available options and commands
+```
+
+```sh
+gpg -a --export "KEY ID" | gpg --list-packets --verbose
+```
+
+[davesteele.github.io//anatomy-of-a-gpg-key/](https://davesteele.github.io/gpg/2014/09/20/anatomy-of-a-gpg-key/)
+
+## generate keypair
+
+```sh
+gpg --generate-key
+gpg --gen-key
+
+gpg --quick-generate-key
+gpg --quick-gen-key
+
+gpg --full-generate-key
+gpg --full-gen-key
+
+cat <genkey.txt
+Key-Type: 1
+Key-Length: 4096
+Subkey-Type: 1
+Subkey-Length: 4096
+Name-Real: FOOBAR
+Name-Email: foo@bar.com
+Expire-Date: 0
+Passphrase: "somepassphrase"
+EOF
+
+gpg --gen-key --batch genkey.txt
+
+gpg --batch --passphrase '' --quick-gen-key USER_ID default default
+```
+
+## usage
+
+```sh
+gpg -k --with-colons # outputs colon seperated fields for parsing with `awk`
+gpg -k --with-colons KEY_ID | awk -F: '/^pub:/ { print $5 }'
+
+
+gpg --fingerprint KEY_ID
+gpg -k --with-subkey-fingerprint
+gpg -K --with-subkey-fingerprint
+
+
+gpg --gen-key # generate key pair using defaults
+gpg --full-generate-key # set encryption, key-length and expiration date !
+
+
+gpg --keyserver hkp://KEYSERVER --send-key YOURPRIMARYKEYID # upload pubkey
+gpg --keyserver KEYSERVER --send-keys KEY_ID
+
+gpg --export IDENTITY | curl -T - https://keys.openpgp.org # export public key in binary-format to key-server
+gpg --armor --export KEY_ID > FILE.asc # export public key in ASCII-Format
+gpg -a --export Key_ID -o FILE.asc # export public key in ASCII-Format using --output
+
+gpg -a --export-secret-keys KEY_ID -o FILE.key.asc # export private key in ASCII-FORMAT to FILE
+
+
+
+gpg --keyserver hkp://KEYSERVER --search-key user@mail.net
+gpg --auto-key-locate "keyserver" --locate-keys user@mail.net
+
+
+gpg --import FILE.asc # import from file
+gpg --keyserver KEYSERVER --recv KEY_ID # import public key by ID
+gpg --keyserver hkp://KEYSERVER --recv-keys KEY_ID_1 KEY_ID_2 # import mutliple; example from `rvm` installation
+
+
+
+gpg --delete-keys ID
+gpg --delete-key user@mail.com
+gpg --delete-secret-keys ID
+
+
+# encrypt and decrypt files
+gpg -a -q --batch --no-tty --yes -r RECIPIENT -o OUTFILE -e INFILE
+gpg -q --batch --no-tty --yes --use-agent -o OUTFILE -d INFILE
+
+gpg --recipient RECIPIENT --encrypt FILE
+gpg --decrypt FILE
+
+
+
+gpg --verify FILE_SHA256SUMS.sig FILE_SHA256SUMS # verify file signature
+```
+
+## see also
+
+- [[rvm]]
+- [[apt-key]]
+- [[paperkey]]
+- [[gpgconf]]
+- [[keybase]]
+- [[openssl]]
+- [[gpg-connect-agent]]
+- [[sha256sum]]
+- [[nc]]
+- [keys.openpgp.org/about/usage](https://keys.openpgp.org/about/usage)
+- [GPG Quick Start](https://www.madboa.com/geek/gpg-quickstart/)
+- [The GNU Privacy Handbook](https://www.gnupg.org/gph/en/manual.html)
+- [GnuPrivacyGuardHowto - Community Help Wiki](https://help.ubuntu.com/community/GnuPrivacyGuardHowto)
+- [Using gpg-agent on OS X ยท wincent.com](https://wincent.com/wiki/Using_gpg-agent_on_OS_X)
+- [How to make GnuPG display full 8-byte/64-bit key ID? - Super User](https://superuser.com/a/619153/341187)
+- [services - How can I restart gpg-agent? - Super User](https://superuser.com/a/1183544/341187)
+- [superuser.com/are-gnupg-1-and-gnupg-2-compatible-with-each-other](https://superuser.com/a/655250)
+- [pgp - What is a OpenPGP/GnuPG key ID? - Super User](https://superuser.com/a/769488/341187)
diff --git a/notes/gpgconf.md b/notes/gpgconf.md
new file mode 100644
index 00000000..bd6306fd
--- /dev/null
+++ b/notes/gpgconf.md
@@ -0,0 +1,24 @@
+---
+tags: [crypto]
+title: gpgconf
+created: '2021-06-14T09:26:07.290Z'
+modified: '2023-03-24T08:19:14.005Z'
+---
+
+# gpgconf
+
+> gpgconf - Modify .gnupg home directories
+
+## usage
+
+```sh
+gpgconf --list-components # list all components
+
+gpgconf --kill COMPONENT # kill a component i.e. gpgconf --kill dirmngr
+
+gpgconf --kill all # kill all components
+```
+
+## see also
+
+- [[gpg]]
diff --git a/notes/graalvm.md b/notes/graalvm.md
new file mode 100644
index 00000000..eb0d6021
--- /dev/null
+++ b/notes/graalvm.md
@@ -0,0 +1,32 @@
+---
+tags: [java]
+title: graalvm
+created: '2023-05-11T06:46:24.033Z'
+modified: '2023-06-09T12:16:39.434Z'
+---
+
+# graalvm
+
+> general recursive applicative and algorithmic vm - aot compilation
+
+## install
+
+```sh
+sdk use java 22.3.r19-grl
+```
+
+## frameworks
+
+- [[quarkus]] by RedHat
+- Micronaut by The Micronaut Foundation
+- Helidon by Oracle
+- Spring Native by Spring
+
+
+## see also
+
+- [[java]]
+- [[gu]]
+- [[native-image]]
+- [[quarkus]]
+- [[jit vs aot]]
diff --git a/notes/gradle.md b/notes/gradle.md
new file mode 100644
index 00000000..953ff3e1
--- /dev/null
+++ b/notes/gradle.md
@@ -0,0 +1,52 @@
+---
+tags: [buildsystem, java]
+title: gradle
+created: '2019-08-20T07:46:19.821Z'
+modified: '2022-02-01T14:40:40.568Z'
+---
+
+# gradle
+
+> `gradle` is an advanced general purpose build management system based on `groovy` and `kotlin`
+
+- `gradle` supports multi-project and multi-artifact builds
+- `gradle` has the notion of `projects` and `tasks`
+
+
+## install
+```sh
+sdk install gradle # install the latest Gradle
+
+sdk install gradle 3.0 # install a spefic gradle version
+```
+
+## option
+
+```sh
+-v, --version # display version
+```
+
+## usage
+
+```sh
+gradle
+
+gradle wrapper # create wrapper script: ./gradlew
+gradle wrapper --gradle-version 4.9
+
+
+gradle dependencies # show dependencies of project
+./gradlew dependencies > dependencies.txt
+
+
+installDist
+
+./gradlw tasks
+```
+
+## see also
+
+- [[java]]
+- [[mvn]]
+- [[sdkman]]
+- [nikgrozev.com/2017/02/10/gradle-quickstart](https://nikgrozev.com/2017/02/10/gradle-quickstart/)
diff --git a/notes/grep.md b/notes/grep.md
new file mode 100644
index 00000000..6980a27a
--- /dev/null
+++ b/notes/grep.md
@@ -0,0 +1,114 @@
+---
+tags: [linux]
+title: grep
+created: '2019-07-30T06:19:49.077Z'
+modified: '2022-11-29T08:07:27.584Z'
+---
+
+# grep
+
+> file pattern searcher - derived from [[ed]] operation `g/re/p`
+
+## option
+
+```sh
+-s, --no-messages # suppress error messages
+-v, --invert-match # select non-matching lines
+```
+### output control
+
+```sh
+-m, --max-count=NUM # stop after NUM selected lines
+-n, --line-number # print line number with output lines
+ --line-buffered # flush output on every line
+-H, --with-filename # print file name with output lines
+-h, --no-filename # suppress the file name prefix on output
+ --label=LABEL # use LABEL as the standard input file name prefix
+-o, --only-matching # show only nonempty parts of lines that match
+-q, --quiet, --silent # suppress all normal output
+ --binary-files=TYPE # assume that binary files are TYPE: 'binary', 'text', or 'without-match'
+-a, --text # equivalent to --binary-files=text
+-I # equivalent to --binary-files=without-match
+-d, --directories=ACTION # how to handle directories; ACTION: 'read', 'recurse', or 'skip'
+-D, --devices=ACTION # how to handle devices, FIFOs and sockets; ACTION: 'read' or 'skip'
+-r, --recursive # like --directories=recurse
+-R, --dereference-recursive # likewise, but follow all symlinks
+ --include=GLOB # search only files that match GLOB (a file pattern)
+ --exclude=GLOB # skip files and directories matching GLOB
+ --exclude-from=FILE # skip files matching any file pattern from FILE
+ --exclude-dir=GLOB # skip directories that match GLOB
+-L, --files-without-match # print only names of FILEs with no selected lines
+-l, --files-with-matches # print only names of FILEs with selected lines
+-c, --count # print only a count of selected lines per FILE
+-T, --initial-tab # make tabs line up (if needed)
+-Z, --null # print 0 byte after FILE name
+```
+
+### Pattern selection and interpretation
+
+```sh
+-E, --extended-regexp # PATTERNS are extended regular expressions
+-F, --fixed-strings # PATTERNS are strings
+-G, --basic-regexp # PATTERNS are basic regular expressions
+-P, --perl-regexp # PATTERNS are Perl regular expressions
+-e, --regexp=PATTERNS # use PATTERNS for matching
+-f, --file=FILE # take PATTERNS from FILE
+-i, --ignore-case # ignore case distinctions
+-w, --word-regexp # match only whole words
+-x, --line-regexp # match only whole lines
+-z, --null-data # a data line ends in 0 byte, not newline
+```
+
+### basic regex
+
+```sh
+^ (Caret) # match expression at the start of a line, as in `^A`
+$ (Question) # match expression at the end of a line, as in `A$`
+\ (Back Slash) # turn off the special meaning of the next character, as in `\^`.
+[ ] (Brackets) # match any one of the enclosed characters, as in [aeiou]. Use Hyphen "-" for a range, as in `[0-9]`
+[^ ] # match any one character except those enclosed in `[ ]`, as in `[^0-9]`
+. (Period) # match a single character of any value, except end of line.
+* (Asterisk) # match zero or more of the preceding character or expression.
+\{x,y\} # match x to y occurrences of the preceding.
+\{x\} # match exactly x occurrences of the preceding.
+\{x,\} # match x or more occurrences of the preceding.
+```
+
+## usage
+
+```sh
+find | grep 'pattern' FILE /dev/null # show filename with find !
+
+grep -l 'pattern' FILE # show only matching filename
+
+grep "^[^#;]" smb.conf # filter-out-comments - http://unix.stackexchange.com/a/60995
+
+ls -l | grep "^d" # list directories
+
+ps aux | grep "[d]ockerd" # avoid grep in output via regex: find character 'd' followed by 'ockerd'
+
+grep -E '192.168.(230.0|231.128)' # regular expression
+
+grep -E "^[[:alpha:]]*:" Makefile # get tasks frome makefile
+
+env | grep -E "VAULT_.+=.+" # get set env variables
+
+
+echo "http://foo.net/path/repo.git" | \
+ grep -o -P '(?<=https:\/\/|http:\/\/|@).*?(?=(\/|:))' # pcre
+
+
+echo "${CF_STACKS[*]}" | \
+ grep -f <(printf '%s\n' "${CDK_STACKS[@]}") -c # check array against pattern from file and return count
+```
+
+## see also
+
+- [[grepcidr]]
+- [[wc]]
+- [[pkill]]
+- [[regex]]
+- [REGEX Cheat Sheet](https://staff.washington.edu/weller/grep.html)
+- [Regular Expressions in grep](http://www.robelle.com/smugbook/regexpr.html)
+- [ntu.edu.sg/home/ehchua/programming/howto/Regexe](https://www.ntu.edu.sg/home/ehchua/programming/howto/Regexe.html)
+- [zwischenzugs.com/2022/02/02/grep-flags-the-good-stuff/](https://zwischenzugs.com/2022/02/02/grep-flags-the-good-stuff/)
diff --git a/notes/grepcidr.md b/notes/grepcidr.md
new file mode 100644
index 00000000..fd339e60
--- /dev/null
+++ b/notes/grepcidr.md
@@ -0,0 +1,53 @@
+---
+tags: [linux]
+title: grepcidr
+created: '2020-09-02T17:09:18.874Z'
+modified: '2022-11-29T08:07:04.572Z'
+---
+
+# grepcidr
+
+> filter ipv4 and ipv6 addresses matching cidr patterns
+
+## install
+
+```sh
+curl -LO http://www.pc-tools.net/files/unix/grepcidr-2.0.tar.gz
+tar xvzf grepcidr-2.0.tar.gz && cd grepcidr-2.0
+make && make install
+```
+
+## option
+
+```sh
+-V # show version
+-c # show count of matching lines, instead lines
+-i # inverse match, include lines without an IP, implies -v
+-s # enforce strict alignment of CIDR mask; host portion must be all zero
+-v # invert the sense of matching, output lines with IPs that don't match
+-x # strict matching, only look at start of line
+-e # specify individual IP or CIDR pattern(s) on command-line
+-f # load individual IP or CIDR pattern(s) from file
+```
+
+## usage
+
+```sh
+grepcidr -f FILE LOG > abuse.log # find cidr-anges from FILE that appear in LOG
+
+grepcidr 2001:db8::/32 LOG_1 LOG_2 # Search for this IPv6 network inside two files
+
+grepcidr 127.0.0.0/8 iplog # Searches for any localnet IP addresses inside the iplog file
+
+grepcidr "192.168.0.1-192.168.10.13" iplog # Searches for IPs matching indicated range in the iplog file
+
+script | grepcidr -vf whitelist > blacklist # Create a blacklist, with whitelisted networks removed (inverse)
+
+grepcidr -f list1 list2 # Cross-reference two lists, outputs IPs common to both lists
+```
+
+## see also
+
+- [[grep]]
+- [pc-tools.net/unix/grepcidr/](http://www.pc-tools.net/unix/grepcidr/)
+- [manpages.ubuntu.com/manpages/xenial/man1/grepcidr](http://manpages.ubuntu.com/manpages/xenial/man1/grepcidr.1.html)
diff --git a/notes/groovy.md b/notes/groovy.md
new file mode 100644
index 00000000..09cc6617
--- /dev/null
+++ b/notes/groovy.md
@@ -0,0 +1,35 @@
+---
+tags: [java]
+title: groovy
+created: '2020-09-02T12:46:29.664Z'
+modified: '2023-03-22T09:29:16.602Z'
+---
+
+# groovy
+
+> apache groovy a optionally typed and dynamic language, with static-typing and static compilation capabilities
+> for the java platform, which integrates smoothly with any java program
+> scripting capabilities, `domain specific language` authoring, runtime and compile-time meta-programming and functional programming
+
+## install
+
+```sh
+sdk install groovy
+```
+
+## usage
+
+```sh
+groovysh # create an interactive groovy shell, repl
+
+groovyConsole # run the Swing interactive console
+
+groovy SCRIPT # run a specific groovy script
+```
+
+## see also
+
+- [[java]]
+- [[sdk]]
+- [[awk]]
+- [[lua]]
diff --git a/notes/groupadd.md b/notes/groupadd.md
new file mode 100644
index 00000000..9fa77115
--- /dev/null
+++ b/notes/groupadd.md
@@ -0,0 +1,18 @@
+---
+tags: [linux]
+title: groupadd
+created: '2019-11-22T19:18:03.650Z'
+modified: '2019-12-30T07:37:13.990Z'
+---
+
+# groupadd
+
+## usage
+```sh
+groupmod -g NEWGID GROUP
+
+groupadd GROUP
+```
+
+## see also
+- [[usermod]]
diff --git a/notes/growpart.md b/notes/growpart.md
new file mode 100644
index 00000000..8d2783d7
--- /dev/null
+++ b/notes/growpart.md
@@ -0,0 +1,24 @@
+---
+tags: [filesystem]
+title: growpart
+created: '2020-06-11T11:52:45.675Z'
+modified: '2023-03-22T09:14:05.326Z'
+---
+
+# growpart
+
+## install
+
+```sh
+yum install cloud-utils-growpart
+```
+
+## usage
+
+```sh
+growpart /dev/sda 1
+```
+
+## see also
+
+- [[xfs_growfs]]
diff --git a/notes/gs.md b/notes/gs.md
new file mode 100644
index 00000000..5068f45d
--- /dev/null
+++ b/notes/gs.md
@@ -0,0 +1,45 @@
+---
+tags: [linux, macos]
+title: gs
+created: '2021-04-14T13:59:38.784Z'
+modified: '2023-03-24T08:21:15.715Z'
+---
+
+# gs
+
+> ghostscript - postscript and pdf language interpreter and previewer
+
+## install
+
+```sh
+brew install ghostscript
+```
+
+## usage
+
+```sh
+gs -dSAFER -dBATCH document.pdf # open in viewer
+
+gs -sDEVICE=pdfwrite -o empty.pdf -c showpage # generate empty pdf file
+
+gs `# merge two pdfs into one` \
+ -dNOPAUSE \
+ -sDEVICE=pdfwrite \
+ -sOUTPUTFILE=OUTPUTFILE.pdf \
+ -dBATCH FILE_1.pdf FILE_2.pdf
+
+# reduce pdf size
+gs -dNOPAUSE -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dQUIET -sOutputFile=OUTPUTFILE.pdf -dBATCH big.pdf
+# -dPDFSETTINGS=
+# /screen screen-view-only quality, 72 dpi images
+# /ebook low quality, 150 dpi images
+# /printer high quality, 300 dpi images
+# /prepress high quality, color preserving, 300 dpi imgs
+# /default almost identical to /screen
+```
+
+## see also
+
+- [ghostscript.com/doc/current/Devices](https://www.ghostscript.com/doc/current/Devices.htm)
+- [tex.stackexchange.com/pdftex-reduce-pdf-size-reduce-image-quality](https://tex.stackexchange.com/a/41273)
+- [[imagemagick]]
diff --git a/notes/gu.md b/notes/gu.md
new file mode 100644
index 00000000..b25645df
--- /dev/null
+++ b/notes/gu.md
@@ -0,0 +1,64 @@
+---
+tags: [java]
+title: gu
+created: '2023-03-15T09:15:23.659Z'
+modified: '2023-05-11T10:44:16.310Z'
+---
+
+# gu
+
+> graalvm updater
+
+## install
+
+```sh
+sdk install java 22.3.r19-grl
+sdk use java 22.3.r19-grl
+```
+
+## env
+
+```sh
+GRAALVM_HOME=$HOME/Development/graalvm/Contents/Home/
+```
+
+## option
+
+```sh
+-A, --auto-yes # respond YES or ACCEPT to all questions
+-c, --catalog # treat parameters as component IDs from a catalog of GraalVM components. This is the default
+-C, --custom-catalog # use user-supplied catalog at URL
+-e, --debug # debugging. Prints stacktraces, ..
+-E, --no-catalog-errors # do not stop if at least one catalog is working
+-h, --help # print help
+-L, --local-file, --file # treat parameters as local filenames of packaged components
+-N, --non-interactive # noninteractive mode. Fail when input is required
+ --show-version # print version information and continue
+-u, --url # interpret parameters as URLs of packaged components
+-v, --verbose # be verbose. Print versions and dependency information
+ --version # print version
+```
+
+## usage
+
+```sh
+gu install native-image
+
+gu install nodejs # supports running Node.js applications
+
+gu install llvm-toolchain
+
+gu install wasm
+
+native-image -cp bcprov-jdk15on-164.jar:. -H:ReflectionConfigurationFiles=reflection-config.json test
+```
+
+## see also
+
+- [[sdk]]
+- [[java]]
+- [[mvn]]
+- [[quarkus]]
+- [[native-image]]
+- [[graalvm]]
+- [graalvm.org/22.0/docs/getting-started/](https://www.graalvm.org/22.0/docs/getting-started/)
diff --git a/notes/gzip.md b/notes/gzip.md
new file mode 100644
index 00000000..d3362ec3
--- /dev/null
+++ b/notes/gzip.md
@@ -0,0 +1,31 @@
+---
+tags: [linux, macos]
+title: gzip
+created: '2019-10-08T06:01:59.458Z'
+modified: '2022-02-02T09:37:45.483Z'
+---
+
+# gzip
+
+> used gzcat on macos !
+
+## usage
+
+```sh
+gzip -d # decompress
+```
+
+## gunzip
+
+```sh
+gunzip FILE
+```
+
+## see also
+
+- [[zrun]]
+- [[zcat]]
+- [[tar]]
+- [[zip]]
+- [[pigz]]
+- [serverfault.com/zcat-gzcat-works-in-linux-not-on-osx](https://serverfault.com/a/570026/200496)
diff --git a/notes/haskell.md b/notes/haskell.md
new file mode 100644
index 00000000..2ab6237d
--- /dev/null
+++ b/notes/haskell.md
@@ -0,0 +1,43 @@
+---
+tags: [haskell]
+title: haskell
+created: '2023-05-23T12:13:07.017Z'
+modified: '2023-05-24T08:42:05.506Z'
+---
+
+# haskell
+
+> general purpose, purely functional programming language
+
+## usage
+
+```hs
+import Control.Parallel
+
+main = a `par` b `par` c `pseq` print (a + b + c)
+ where
+ a = ack 3 10
+ b = fac 42
+ c = fib 34
+
+fac 0 = 1
+fac n = n * fac (n-1)
+
+ack 0 n = n+1
+ack m 0 = ack (m-1) 1
+ack m n = ack (m-1) (ack m (n-1))
+
+fib 0 = 0
+fib 1 = 1
+fib n = fib (n-1) + fib (n-2)
+```
+
+```sh
+ghc -O2 --make A.hs -threaded -rtsopts # compiling with -threaded and optimizations on
+```
+
+## see also
+
+- [[ghci]]
+- [[erlang]]
+- [learnyouahaskell.com](http://learnyouahaskell.com)
diff --git a/notes/hdiutil.md b/notes/hdiutil.md
new file mode 100644
index 00000000..5b7a49b1
--- /dev/null
+++ b/notes/hdiutil.md
@@ -0,0 +1,34 @@
+---
+tags: [macos]
+title: hdiutil
+created: '2023-05-30T08:54:56.544Z'
+modified: '2023-05-30T09:07:26.826Z'
+---
+
+# hdiutil
+
+> manipulate disk images (attach, verify, create, etc)
+
+## usage
+
+```sh
+hdiutil attach IMAGE.dmg # attach a disk image as a device
+
+hdiutil detach /Volumes/DEVICE_NAME # detach a disk image and terminate any associated process
+
+hdiutil info -plist # display info about DiskImages.framework, disk image driver, and any images that are currently attached
+
+hdiutil verify IMAGE.dmg # compute checksum of "read-only" or "compressed" image and verify it against value stored in image
+
+hdiutil checksum IMAGE -type TYPE # Calculate the specified checksum on the image data, regardless of image type
+ # options: -shadow and related, -encryption, -stdinpass, -srcimagekey, -puppetstrings, and -plist.
+ # TYPE: UDIF-CRC32 , UDIF-MD5 , CRC32 , MD5 , SHA , SHA1 , SHA256 , SHA384 , SHA512
+```
+
+## see also
+
+- [[brew]]
+- [[mount]]
+- [[diskutil]]
+- [[docker]]
+- [[sha256sum]]
diff --git a/notes/head.md b/notes/head.md
new file mode 100644
index 00000000..6967ba7a
--- /dev/null
+++ b/notes/head.md
@@ -0,0 +1,25 @@
+---
+tags: [coreutils]
+title: head
+created: '2019-08-21T06:25:10.878Z'
+modified: '2022-02-01T15:14:32.515Z'
+---
+
+# head
+
+> print first 10 lines of each FILE (or stdin) to stdout. With more than one FILE, precede each with a filename header.
+
+## usage
+
+```sh
+head -1
+
+head -q -n2 *.properties # print first 2 line and not filename-header
+```
+
+## see also
+
+- [[tail]]
+- [[less]]
+- [[file]]
+- [[stat]]
diff --git a/notes/helm.md b/notes/helm.md
new file mode 100644
index 00000000..25483066
--- /dev/null
+++ b/notes/helm.md
@@ -0,0 +1,108 @@
+---
+tags: [container]
+title: helm
+created: '2021-06-04T08:40:48.010Z'
+modified: '2023-05-02T07:09:43.180Z'
+---
+
+# helm
+
+> package manager for `k8s`
+
+## install
+
+```sh
+brew install helm
+
+curl -sSL https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
+```
+
+## environment vairables
+
+```sh
+HELM_CACHE_HOME # alt location for storing cached files
+HELM_CONFIG_HOME # alt location for storing Helm configuration
+HELM_DATA_HOME # alt location for storing Helm data
+HELM_DEBUG # indicate whether or not Helm is running in Debug mode
+HELM_DRIVER # backend storage driver: configmap, secret, memory, postgres
+HELM_DRIVER_SQL_CONNECTION_STRING # connection string the SQL storage driver should use
+HELM_MAX_HISTORY # maximum number of helm release history
+HELM_NAMESPACE # namespace used for the helm operations
+HELM_NO_PLUGINS # ble plugins. Set HELM_NO_PLUGINS=1 to disable plugins
+HELM_PLUGINS # path to plugins dir
+HELM_REGISTRY_CONFIG # path to registry config file
+HELM_REPOSITORY_CACHE # path to repository cache dir
+HELM_REPOSITORY_CONFIG # path to repositories file
+KUBECONFIG # alt k8s config - default `.kube/config`
+HELM_KUBEAPISERVER # k8s API Server Endpoint for auth
+HELM_KUBECAFILE # k8s certificate authority file
+HELM_KUBEASGROUPS # set groups to use for impersonation using a comma-separated list
+HELM_KUBEASUSER # Username to impersonate for the operation
+HELM_KUBECONTEXT # name of the kubeconfig context
+HELM_KUBETOKEN # bearer kube-token used for auth
+```
+
+## usage
+
+```sh
+helm help # learn more about the available Helm commands
+helm get -h # or type a command followed by -h flag
+
+helm list # lists all of the releases for a specified namespace
+helm ls
+
+helm status RELEASE_NAME
+helm history RELEASE_NAME
+helm rollback RELEASE_NAME [REVISION]
+
+helm env
+
+helm search # search for charts
+helm search repo [REPONAME]
+
+helm pull # download chart to local dir
+helm pull stable/CHART --untar # optionally untar chart
+
+helm install # upload chart to k8s
+helm install bitnami/mysql --generate-name
+helm install --debug --dry-run CHART ./PATH # test the template rendering, but not actually install anything
+
+helm repo add stable https://charts.helm.sh/stable # add as "stable" -> prepends "stable/REPO"
+helm repo add datadog https://helm.datadoghq.com
+helm repo add bitnami https://charts.bitnami.com/bitnami
+
+helm repo update
+
+helm show all CHART
+helm show chart datadog --repo https://helm.datadoghq.com --version 2.6.11
+helm show chart bitnami/mysql
+helm show all bitnami/mysql
+
+
+helm uninstall mysql-1612624192 # uninstall release
+
+
+helm template CHART # render chart templates locally and display the output
+helm template CHART -x templates/deployment.yaml # render just one template in a chart
+```
+
+## plugin
+
+```sh
+helm plugin install https://github.com/databus23/helm-diff
+
+helm diff revision RELEASE 100 55
+```
+
+## helmfile
+
+```yaml
+ {{/* if dig "monitoring" "enabled" false .Values.mrz */}}
+ {{if (((.Values.mrz).monitoring).enabled) }}
+```
+
+## see also
+
+- [[kubectl]]
+- [[kustomize]]
+- [helm.sh/docs/intro/quickstart](https://helm.sh/docs/intro/quickstart/)
diff --git a/notes/heredoc.md b/notes/heredoc.md
index ae1825b0..4bc9c02b 100644
--- a/notes/heredoc.md
+++ b/notes/heredoc.md
@@ -1,26 +1,35 @@
---
-tags: [bash, heredoc, linux]
+tags: [linux]
title: heredoc
created: '2019-07-30T06:19:49.079Z'
-modified: '2019-08-01T07:13:52.955Z'
+modified: '2023-03-22T09:55:35.568Z'
---
# heredoc
-> "here document is a special-purpose code block. It uses a form of I/O redirection to feed a command list to an interactive program or a command
+> here-document is a special-purpose code block. It uses a form of I/O redirection to feed a command list to an interactive program or a command
-## promt
-```sh
-export PS2='> ' # used in multiline commands
-```
+## usage
-## ignore the leading tab characters
-hyphen just after the << is enough to tell bash to ignore the leading tab characters.
-```sh
-<<- # dash ignores only tab indentation
-'EOF' # single-quotes avoid shell-substitution
-```
```sh
+# ignore the leading tab characters
+# hyphen just after the << is enough to tell bash to ignore the leading tab characters
+<<- # dash ignores only tab indentation
+'EOF' # single-quotes avoid shell-substitution
+
+cat <<-EOF
+ echo $HOME
+ echo $$
+ cat < .pre-commit-config.yaml
@@ -45,24 +51,25 @@ cat < .pre-commit-config.yaml
- id: terraform_fmt
EOF
```
-[Here Documents](http://www.tldp.org/LDP/abs/html/here-docs.html)
-### sudo redirect cat
+## sudo redirect cat
+
```sh
sudo ash -c "cat >> /var/config.file" < test
> test1
@@ -125,5 +125,11 @@ cat < done
```
-https://docs.gitlab.com/ee/development/changelog.html
-[Changelog entries \| GitLab](https://docs.gitlab.com/ee/development/changelog.html)
+## see also
+
+- [[bash redirects]]
+- [[cat]]
+- [[yml]]
+- [HereDocument - Greg's Wiki](https://mywiki.wooledge.org/HereDocument)
+- [Here Documents](http://www.tldp.org/LDP/abs/html/here-docs.html)
+- [Nice here document feature I have found recently - ycombinator.com](https://news.ycombinator.com/item?id=7596375)
diff --git a/notes/hexagonal architecture.md b/notes/hexagonal architecture.md
new file mode 100644
index 00000000..a69eb99a
--- /dev/null
+++ b/notes/hexagonal architecture.md
@@ -0,0 +1,19 @@
+---
+tags: [Notebooks]
+title: hexagonal architecture
+created: '2020-03-12T09:04:01.445Z'
+modified: '2020-09-02T17:34:42.198Z'
+---
+
+# hexagonal architecture
+
+> architectural pattern used in software design - aims at creating loosely coupled application components that can be easily connected to their software environment by means of ports and adapters
+
+> The idea of Hexagonal Architecture is to put inputs and outputs at the edges of our design.
+> Business logic should not depend on whether we expose a REST or a GraphQL API,
+> and it should not depend on where we get data from โ a database, a microservice API exposed via gRPC or REST, or just a simple CSV file.
+
+## see also
+- [[architectural pattern]]
+- [wikipedia.org/wiki/Hexagonal_architecture](https://en.wikipedia.org/wiki/Hexagonal_architecture_(software))
+- [netflixtechblog.com/ready-for-changes-with-hexagonal-architecture](https://netflixtechblog.com/ready-for-changes-with-hexagonal-architecture-b315ec967749)
diff --git a/notes/hexdump.md b/notes/hexdump.md
new file mode 100644
index 00000000..ee9fc284
--- /dev/null
+++ b/notes/hexdump.md
@@ -0,0 +1,47 @@
+---
+tags: [bsdmainutils]
+title: hexdump
+created: '2020-09-03T09:04:56.444Z'
+modified: '2022-11-25T11:35:37.692Z'
+---
+
+# hexdump
+
+> `hexdump` utility is a filter which displays specified files, or the STDIN, if no files are specified, in a user specified format
+
+## option
+
+```sh
+-b # display one-byte octal
+-c # display One-byte character
+-C # display Canonical hex+ASCII
+-d # display Two-byte decimal
+-e FORMAT_STRING # format string to be used for displaying data
+-f FORMAT_FILE # formatfile that contains one or more newline separated format strings
+-n LENGTH # Interpret only length bytes of input.
+-o # display Two-byte octal
+-s offset # skip offset bytes from the beginning of the input
+-v # cause hexdump to display all input data
+-x # display Two-byte hexadecimal
+```
+
+# usage
+
+```sh
+echo hello | hexdump -v -e '/1 "%02X "' ; # hex bytes: "68 65 6C 6C 6F 0A"
+
+echo hello | hexdump -e '8/1 "%02X ""\t"" "' -e '8/1 "%c""\n"' # same, with ASCII section
+
+echo hello | hexdump -v -e '"x" 1/1 "%02X" " "' ; # preceding x: x68 x65 x6C x6C x6F x0A
+
+echo hello | hexdump -v -e '/1 "%02X\n"' # one hex byte per line
+
+printf โ | hexdump
+```
+
+## see also
+
+- [[xxd]]
+- [[od]]
+- [[bash echo]]
+- [[bash printf]]
diff --git a/notes/host.md b/notes/host.md
new file mode 100644
index 00000000..450a6572
--- /dev/null
+++ b/notes/host.md
@@ -0,0 +1,38 @@
+---
+tags: [dns]
+title: host
+created: '2019-07-30T06:19:49.080Z'
+modified: '2023-03-20T08:52:12.648Z'
+---
+
+# host
+
+> lookup utility
+
+## install
+
+```sh
+brew install bind
+```
+
+## option
+
+```sh
+-t # is used to select the query type (CNAME, NS, SOA, SIG, KEY, AXFR,..)
+```
+
+## usage
+
+```sh
+host localhost # reverse lookup
+
+host -t ns twitter.com # verify NS
+```
+
+## see also
+
+- [[dns]]
+- [[dig]]
+- [[whois]]
+- [[hostnamectl]]
+- [[hostname]]
diff --git a/notes/hostname.md b/notes/hostname.md
new file mode 100644
index 00000000..2186332c
--- /dev/null
+++ b/notes/hostname.md
@@ -0,0 +1,37 @@
+---
+tags: [coreutils, net-tools]
+title: hostname
+created: '2019-09-26T09:09:44.806Z'
+modified: '2023-05-15T13:23:36.951Z'
+---
+
+# hostname
+
+> show or set the system's host name
+
+## option
+
+```sh
+-f # Include domain information, default behavior
+-s # trim off any domain information
+-d # only print domain information
+```
+
+## usage
+
+```sh
+hostname NEW_HOSTNAME # change server hostname without a system restart
+
+hostname -s # print without fqdn
+
+
+cat /etc/hostname
+
+cat /etc/hosts
+```
+
+## see also
+
+- [[hostnamectl]]
+- [[host]]
+
diff --git a/notes/hostnamectl.md b/notes/hostnamectl.md
new file mode 100644
index 00000000..10fcefbf
--- /dev/null
+++ b/notes/hostnamectl.md
@@ -0,0 +1,22 @@
+---
+tags: [systemd]
+title: hostnamectl
+created: '2019-09-24T17:07:05.719Z'
+modified: '2023-03-23T08:40:23.040Z'
+---
+
+# hostnamectl
+
+## usage
+
+```sh
+hostnamectl # display hostname information
+
+hostnamectl set-hostname foo-node # change hostname
+```
+
+## see also
+
+- [[hostname]]
+- [[host]]
+- [[systemd]]
diff --git a/notes/htpasswd.md b/notes/htpasswd.md
new file mode 100644
index 00000000..42553b25
--- /dev/null
+++ b/notes/htpasswd.md
@@ -0,0 +1,31 @@
+---
+tags: [crypto]
+title: htpasswd
+created: '2020-01-10T07:57:18.726Z'
+modified: '2023-03-24T08:19:14.013Z'
+---
+
+# htpasswd
+
+> used to create and update the flat-files used to store usernames and password for basic authentication of HTTP users
+
+## option
+
+```sh
+-n # display results on standard output rather than updating a file
+-b # use batch mode; i.e., get the password from the command line rather than prompting for it
+-B # use bcrypt encryption for passwords
+```
+
+## usage
+
+```sh
+htpasswd -nb -B admin | cut -d ":" -f 2
+```
+
+## see also
+
+- [httpd.apache.org/docs](https://httpd.apache.org/docs/2.4/programs/htpasswd.html)
+- [[mkpasswd]]
+- [[openssl passwd]]
+- [[passwd]]
diff --git a/notes/http-server.md b/notes/http-server.md
new file mode 100644
index 00000000..fc6ce0fb
--- /dev/null
+++ b/notes/http-server.md
@@ -0,0 +1,28 @@
+---
+tags: [javascript]
+title: http-server
+created: '2021-02-15T07:35:16.996Z'
+modified: '2023-03-22T11:02:22.402Z'
+---
+
+# http-server
+
+> simple http server
+
+## install
+
+```sh
+npm install -g http-server
+```
+
+## usage
+
+```sh
+http-server
+```
+
+## see also
+
+- [[node]]
+- [[npm]]
+- [[python]]
diff --git a/notes/http.md b/notes/http.md
new file mode 100644
index 00000000..20cfb10a
--- /dev/null
+++ b/notes/http.md
@@ -0,0 +1,40 @@
+---
+tags: [python]
+title: http
+created: '2023-03-23T08:51:29.253Z'
+modified: '2023-03-23T08:55:59.995Z'
+---
+
+# http
+
+> `HTTPie` - client, aims to be easier to use than [[curl]]
+
+## install
+
+```sh
+brew install httpie
+apt-get install httpie
+```
+
+## usage
+
+```sh
+http --download URL # download URL
+
+http URL name='bob' # Send JSON object
+
+http METHOD URL # Specify a METHOD: "HEAD", "GET",..
+
+http URL X-MyHeader:123 # Include an extra header
+
+http --auth username:password URL # Pass a username and password for server authentication
+
+cat data.txt | http PUT URL # Specify raw request body via stdin
+
+http --form example.org name='bob' profile_picture@'bob.png' # Send form-encoded data
+```
+
+## see also
+
+- [[hyper text transfer protocol]]
+- [httpie.org](https://httpie.org)
diff --git a/notes/hugo.md b/notes/hugo.md
new file mode 100644
index 00000000..e7183e0a
--- /dev/null
+++ b/notes/hugo.md
@@ -0,0 +1,90 @@
+---
+tags: [go]
+title: hugo
+created: '2022-04-08T21:02:53.354Z'
+modified: '2023-03-22T11:06:37.375Z'
+---
+
+# hugo
+
+> static site generator
+
+## install
+
+```sh
+brew install hugo
+```
+
+## option
+
+```sh
+-b, --baseURL string # hostname (and path) to the root, e.g. https://spf13.com/
+-D, --buildDrafts # include content marked as draft
+-E, --buildExpired # include expired content
+-F, --buildFuture # include content with publishdate in the future
+ --cacheDir string # filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
+ --cleanDestinationDir # remove files from destination not found in static directories
+ --config string # config file (default is path/config.yaml|json|toml)
+ --configDir string # config dir (default "config")
+-c, --contentDir string # filesystem path to content directory
+ --debug # debug output
+-d, --destination string # filesystem path to write files to
+ --disableKinds strings # disable different kind of pages (home, RSS etc.)
+ --enableGitInfo # add Git revision, date and author info to the pages
+-e, --environment string # build environment
+ --forceSyncStatic # copy all files when static is changed.
+ --gc # enable to run some cleanup tasks (remove unused cache files) after the build
+-h, --help # help for hugo
+ --i18n-warnings # print missing translations
+ --ignoreCache # ignores the cache directory
+-l, --layoutDir string # filesystem path to layout directory
+ --log # enable Logging
+ --logFile string # log File path (if set, logging enabled automatically)
+ --minify # minify any supported output format (HTML, XML etc.)
+ --noChmod # don't sync permission mode of files
+ --noTimes # don't sync modification time of files
+ --path-warnings # print warnings on duplicate target paths etc.
+ --quiet # build in quiet mode
+ --renderToMemory # render to memory (only useful for benchmark testing)
+-s, --source string # filesystem path to read files relative from
+ --templateMetrics # display metrics about template executions
+ --templateMetricsHints # calculate some improvement hints when combined with --templateMetrics
+-t, --theme strings # themes to use (located in /themes/THEMENAME/)
+ --themesDir string # filesystem path to themes directory
+ --trace file # write trace to file (not useful in general)
+-v, --verbose # verbose output
+ --verboseLog # verbose logging
+-w, --watch # watch filesystem for changes and recreate as needed
+```
+
+## usage
+
+```sh
+hugo -D # build static pages
+
+
+hugo check # Contains some verification checks
+hugo config # Print the site configuration
+hugo convert # Convert your content to different formats
+hugo env # Print Hugo version and environment info
+hugo gen # A collection of several useful generators.
+hugo help # Help about any command
+hugo import # Import your site from others.
+hugo list # Listing out various types of content
+
+hugo new # Create new content for your site
+hugo new posts/my-first-post.md
+hugo new site quickstart
+
+hugo server # A high performance webserver
+hugo server -D # start the Hugo server with drafts enabled
+
+hugo version # Print the version number of Hugo
+```
+
+## see als
+
+- [[jam stack]]
+- [[go]]
+- [gohugo.io](https://gohugo.io/)
+- [[jekyll]]
diff --git a/notes/hwclock.md b/notes/hwclock.md
new file mode 100644
index 00000000..85736e56
--- /dev/null
+++ b/notes/hwclock.md
@@ -0,0 +1,23 @@
+---
+tags: [linux]
+title: hwclock
+created: '2019-12-05T07:04:33.069Z'
+modified: '2019-12-30T07:36:17.392Z'
+---
+
+# hwclock
+
+> hwclock - query and set the hardware clock (RTC)
+
+## usage
+```sh
+hwclock
+
+hwclock --systohc --debug # what it does when we copy system time to hardware time.
+
+hwclock -hctosys --debug # what it does when we copy hardware time to system time.
+```
+
+## see also
+- [[date]]
+- [[chronyc]]
diff --git a/notes/hyper text transfer protocol.md b/notes/hyper text transfer protocol.md
new file mode 100644
index 00000000..feca6516
--- /dev/null
+++ b/notes/hyper text transfer protocol.md
@@ -0,0 +1,173 @@
+---
+tags: [Notebooks]
+title: hyper text transfer protocol
+created: '2022-02-02T12:54:22.385Z'
+modified: '2023-03-23T10:16:13.340Z'
+---
+
+# hyper text transfer protocol
+
+> hyper text transfer protocol
+
+## tcp
+
+- tcp is transport over ip
+- established a "connection"
+- 3-way handshake
+- resend lost packages
+- a reliable byte stream
+
+## tls
+
+- tls is done over tcp for `http/1` or `http/`
+- transport layer security
+- additional handshake +4
+- privacy and security
+
+## classic https stack
+
+```
++------------------------------------------+
+| https |
++------------------------------------------+
+| tls |
++------------------------------------------+
+| tcp |
++------------------------------------------+
+| ip |
++------------------------------------------+
+```
+
+## `http/1.1`
+
+- many parallel tcp connections
+- better but ineffective tpc use
+- http head-of-line-blocking
+
+## `http/2`
+
+- uses single connection per host
+- many parallel streams
+- tcp head-of-line-blocking (waiting for single packet)
+
+## "ossification"
+
+- internet full of boxes -> routers, firewalls, LB -> boxes handle network data
+- upgrade much slower than edges (browsers)
+- casualties:
+ - `http/2` in clear text
+ - tcp improvements like tfo (tcp-fast-open) -> os yes, boxes no
+ - tcp/udp won't be replaced -> boxes only know tcp/udp
+ - http brotli -> boxes only know gzip
+
+## QUIC a transport protocol
+
+- is a name not an acronym
+- new transport protocol
+- google deployed "`http/2` over UDP"-QUIC
+
+## QUIC improvements
+
+- tcp head-of-line-blocking
+- faster handshakes
+- earlier data
+- connection-id, transition between network-ifaces
+- more encryption, always
+
+## build on top of udp
+
+- tcp and udp remain "the ones"
+- use udp instead of ip (move up one layer)
+- "reliable transport protocol" - in user-space
+- like reinventing tcp + tls in one layer
+
+## udp isn't reliable, quic is
+
+```
+udp quic
+--- ---
+connectionless used udp like tcp uses ip
+no resends add connections
+no flow control reliability
+no ordering flow control
+ security
+```
+
+## quic has streams
+
+- many logical flows within single connection
+- similar to `http/2` but in the transport layer
+- client or server initiated
+- bidirectional or unidirectional
+- independent streams
+
+## application protocols over quic
+
+- streams for free
+- could be "any protocol"
+
+## http - same but different
+
+> http will stay the same
+
+```
+ Request
+ - method + path --- --- \
+ - headers --- --- / server
+client - body
+ Response
+ / --- --- - response code
+ \ --- --- - headers
+ - body
+```
+
+- `http/2` - in [[ascii]] over tcp
+- `http/2` - binary multiplexec over tcp
+- `http/3` - binary multiplexec over quic
+
+
+## https stack: old vs new
+
+```
++--------+ +---------+ +-----------------+
+| http/1 | | http/2 *| | http/3 | * streams
++--------------------+ +-----------------+
+| tls | | quic (tls 1.3) *|
++--------------------+ +-----------------+
+| tcp | | udp |
++----------------------------------------------+
+| ip |
++----------------------------------------------+
+```
+
+```
+feature http/2 . http/3
+--- --- . ---
+transport tcp . quic
+streams http/2 . quic
+clear-text version yes . no
+independent streams no . yes
+header compression hpack . qpack
+server push yes . yes
+early data in theory . yes
+0-rtt handhsake no . yes
+prioritization messy . changes
+```
+
+## https:// is tcp ?
+
+- `https://` urls are everywhere
+- tcp and tls on tpc port `:443`
+
+->
+
+## see also
+
+- [[ascii]]
+- [[http]]
+- [[12 factor app]]
+- [[osi model]]
+- [[tcp-ip model]]
+- [[curl]]
+- [daniel.haxx.se/blog/2020/02/02/http-3-for-everyone/](https://daniel.haxx.se/blog/2020/02/02/http-3-for-everyone/)
+- [blog.cloudflare.com/even-faster-connection-establishment-with-quic-0-rtt-resumption](https://blog.cloudflare.com/even-faster-connection-establishment-with-quic-0-rtt-resumption/)
diff --git a/notes/hyperkit.md b/notes/hyperkit.md
new file mode 100644
index 00000000..3258fab0
--- /dev/null
+++ b/notes/hyperkit.md
@@ -0,0 +1,32 @@
+---
+tags: [macos, virtualization]
+title: hyperkit
+created: '2020-03-13T13:07:03.833Z'
+modified: '2023-05-31T07:29:40.178Z'
+---
+
+# hyperkit
+
+> toolkit for embedding hypervisor capabilities in applications, includes a hypervisor derived from xhyve, which in turn was derived from bhyve
+
+## install
+
+```sh
+brew install hyperkit # x86_64 architecture is required
+```
+
+## usage
+
+```sh
+hyperkit -h
+```
+
+## see also
+
+- [[xhyve]], [[qemu]], [[lima]]
+- [[minikube]]
+- [[vboxmanage]]
+- [[vagrant]]
+- [[dockerd]]
+- [[dtrace]]
+- [github.com/moby/hyperkit](https://github.com/moby/hyperkit)
diff --git a/notes/iac.md b/notes/iac.md
new file mode 100644
index 00000000..37b7d21d
--- /dev/null
+++ b/notes/iac.md
@@ -0,0 +1,35 @@
+---
+tags: [Notebooks]
+title: iac
+created: '2019-07-30T06:19:49.081Z'
+modified: '2022-10-17T10:55:16.675Z'
+---
+
+# iac
+
+> infrastructure as code
+
+## pets vs cattle
+
+> If you view a server (whether metal, virtualized, or containerized) as inherently something that can be `destroyed and replaced at any time`, then itโs a member of the `herd`.
+> If, however, you view a server (or a pair of servers attempting to appear as a single unit) as `indispensable`, then itโs a `pet`.
+
+
+## providers
+
+| | chef | puppet | ansible | saltstack | cloudformation | terraform |
+|:-- |:-- |:-- |:-- |:-- |:-- |:-- |
+| code | opensource | opensource | opensource | opensource | opensource | opensource |
+| type | config mgmt | config mgmt | config mgmt | config mgmt | orchestration | orchestration |
+| infra | mutable | mutable | mutable | mutable | immutable | immutable |
+| lang | procedural | declarative | procedural | declarative | declarative | declarative |
+| arch | Client/Server | Client/Server | Client/Server | Client/Server | Client-Only | Client-Only |
+
+## see also
+
+- [[12 factor app]]
+- [[gitops]]
+- [[terraform]]
+- [[aws cloudformation]]
+- [cloudscaling.com/the-history-of-pets-vs-cattle/](http://cloudscaling.com/blog/cloud-computing/the-history-of-pets-vs-cattle/)
+- [why-we-use-terraform-and-not-chef-puppet-ansible-saltstack-or-cloudformation](https://blog.gruntwork.io/why-we-use-terraform-and-not-chef-puppet-ansible-saltstack-or-cloudformation-7989dad2865c)
diff --git a/notes/iam-policy-json-to-terraform.md b/notes/iam-policy-json-to-terraform.md
new file mode 100644
index 00000000..d887c1d0
--- /dev/null
+++ b/notes/iam-policy-json-to-terraform.md
@@ -0,0 +1,38 @@
+---
+tags: [iac]
+title: iam-policy-json-to-terraform
+created: '2022-03-29T16:06:00.334Z'
+modified: '2023-03-23T08:48:25.701Z'
+---
+
+# iam-policy-json-to-terraform
+
+## install
+
+```sh
+brew install iam-policy-json-to-terraform
+```
+
+## option
+
+```sh
+-name string # name of the policy in generated hcl (default "policy")
+-version # prints the version
+```
+
+## usage
+
+```sh
+echo '{"Statement":[{"Effect":"Allow","Action":["ec2:Describe*"],"Resource":"*"}]}' | iam-policy-json-to-terraform
+
+iam-policy-json-to-terraform < some-policy.json
+
+# use `terraform console` and then jsonencode() on object which can then be copy-paste-piped
+```
+
+## see also
+
+- [[terraform]]
+- [[tfk8s]]
+- [[go]]
+- [github.com/flosell/iam-policy-json-to-terraform](https://github.com/flosell/iam-policy-json-to-terraform)
diff --git a/notes/iconv.md b/notes/iconv.md
new file mode 100644
index 00000000..4a3552aa
--- /dev/null
+++ b/notes/iconv.md
@@ -0,0 +1,35 @@
+---
+tags: [linux]
+title: iconv
+created: '2020-03-16T16:29:57.096Z'
+modified: '2023-03-25T12:15:23.899Z'
+---
+
+# iconv
+
+> convert some text in one encoding into another encoding
+
+## option
+
+```sh
+-f FROM, โfrom-code=FROM # use FROM encoding for input characters
+-t TO, โto-code=TO # use TO encoding for output characters
+-l, โlist # list all known character set encodings
+-c # silently discard characters that cannot be converted instead of terminating when encountering such characters
+-o OUT, โoutput=OUT # use outputfile for output
+ -verbose # print progress information on standard error when processing multiple files
+```
+
+## usage
+
+```sh
+iconv -f encoding -t encoding FILE -o OUTPUTFILE
+
+echo abc ร ? โฌ ร ?รง | iconv -f UTF-8 -t ASCII//TRANSLIT
+```
+
+## see also
+
+- [[file]]
+- [[ffmpeg]]
+- [[ascii]]
diff --git a/notes/id.md b/notes/id.md
new file mode 100644
index 00000000..7f399566
--- /dev/null
+++ b/notes/id.md
@@ -0,0 +1,23 @@
+---
+tags: [coreutils]
+title: id
+created: '2020-02-14T08:20:21.205Z'
+modified: '2022-02-01T15:09:57.682Z'
+---
+
+# id
+
+> return user identity
+
+## usage
+
+```sh
+id -u $USER # Display the effective user ID as a number
+```
+
+## see also
+
+- [[finger]]
+- [[ssh]]
+- [[chmod]]
+- [[groups]]
diff --git a/notes/idea.md b/notes/idea.md
new file mode 100644
index 00000000..d51e16ad
--- /dev/null
+++ b/notes/idea.md
@@ -0,0 +1,48 @@
+---
+tags: [editor]
+title: idea
+created: '2020-08-26T06:33:22.925Z'
+modified: '2023-04-11T20:16:27.116Z'
+---
+
+# idea
+
+> python scrip starting up intellij
+
+## install
+
+```sh
+# Tools->Create Command-Line Launcher...
+```
+
+## option
+
+```sh
+-h, --help # -
+-w, --wait # -
+```
+
+## usage
+
+```sh
+idea DIR
+
+idea diff LEFT RIGHT # launch diff tool
+
+idea merge LOCAL REMOTE
+```
+
+โ ctrl
+โฅ alt/option
+โ cmd
+โง shift
+shift + shift search everywhere
+Ctrl + Shift + A # Find Action command
+Ctrl + G # Select next occurrence
+Shift + Ctrl + G # unselect next occurrence
+
+## see also
+
+- [[atom]]
+- [[code]]
+- [emmanuelbernard.com/blog/start-intellij-idea-command-line](https://emmanuelbernard.com/blog/2017/02/27/start-intellij-idea-command-line/)
diff --git a/notes/ifconfig.md b/notes/ifconfig.md
new file mode 100644
index 00000000..e71d4d2d
--- /dev/null
+++ b/notes/ifconfig.md
@@ -0,0 +1,32 @@
+---
+tags: [net-tools, network]
+title: ifconfig
+created: '2020-01-16T07:17:37.287Z'
+modified: '2023-03-23T09:27:52.186Z'
+---
+
+# ifconfig
+
+> configure a network interface
+
+## install
+
+```sh
+apt install net-tools
+```
+
+## usage
+
+```sh
+ifconfig eth1 up # activate interface eth1
+
+ifconfig wlan0 down # disable an active network interface
+
+ifconfig wlan0 69.72.169.1 # assign static ip
+```
+
+## see also
+
+- [[nslookup]]
+- [[ip]]
+- [[netstat]] `netstat -i`
diff --git a/notes/imagemagick.md b/notes/imagemagick.md
new file mode 100644
index 00000000..bce6d980
--- /dev/null
+++ b/notes/imagemagick.md
@@ -0,0 +1,48 @@
+---
+tags: [linux, macos]
+title: imagemagick
+created: '2020-12-28T21:19:42.860Z'
+modified: '2023-03-24T08:26:48.898Z'
+---
+
+# imagemagick
+
+> create, edit, compose, or convert bitmap images, can read and write images in a variety of formats
+
+## install
+
+```sh
+brew install imagemagick
+```
+
+## convert
+
+```sh
+convert IMAGE.png -resize 128x128 IMAGE_resized.png # resize image
+
+# generate pdf file
+convert xc:none -page Letter FILE.pdf
+convert xc:none -page A4 FILE.pdf
+convert xc:none -page 842x595 FILE.pdf
+
+convert FILE.txt -page Letter FILE.pdf
+
+# make an impact image
+convert \
+ -size 1000x600 \
+ -define gradient:radii=1000,500 radial-gradient:#884b88-#010101 \
+ -font Impact \
+ -pointsize 72 \
+ -fill white \
+ -gravity center \
+ -interline-spacing 50 \
+ -annotate 0,0 "Now with more arguments!" now-with-more-arguments.png
+```
+
+## see also
+
+- [imagemagick.org/script/convert](https://imagemagick.org/script/convert.php)
+- [legacy.imagemagick.org/Usage/resize](https://legacy.imagemagick.org/Usage/resize/)
+- [[ffmpeg]]
+- [[gs]]
+- [[youtube-dl]]
diff --git a/notes/infocmp.md b/notes/infocmp.md
new file mode 100644
index 00000000..9efc2e66
--- /dev/null
+++ b/notes/infocmp.md
@@ -0,0 +1,22 @@
+---
+tags: [linux]
+title: infocmp
+created: '2020-04-15T06:27:41.210Z'
+modified: '2020-09-02T17:55:35.935Z'
+---
+
+# infocmp
+
+> compare or print out terminfo descriptions
+
+## usage
+```sh
+infocmp # prints terminal info
+
+infocmp screen
+
+infocmp xterm
+```
+
+## see also
+- [[tput]]
diff --git a/notes/initsystem.md b/notes/initsystem.md
new file mode 100644
index 00000000..38bd7969
--- /dev/null
+++ b/notes/initsystem.md
@@ -0,0 +1,27 @@
+---
+tags: [initsystem, linux]
+title: initsystem
+created: '2019-07-30T06:19:49.250Z'
+modified: '2022-11-29T08:23:10.156Z'
+---
+
+# initsystem
+
+> central responsibility of an init system is to bring up userspace
+
+## find out which initsystem is running
+
+```sh
+pstree # see what is running on PID1
+
+systemd-cgls # fedora systemd cgroup tree
+```
+
+## see also
+
+- [[pstree]]
+- [[systemd]]
+- [[sysvinit]]
+- [[upstart]]
+- [[launchd]]
+- [[service]]
diff --git a/notes/install.md b/notes/install.md
new file mode 100644
index 00000000..c85006c1
--- /dev/null
+++ b/notes/install.md
@@ -0,0 +1,40 @@
+---
+tags: [linux, macos]
+title: install
+created: '2019-09-25T07:09:47.701Z'
+modified: '2022-04-06T08:37:58.499Z'
+---
+
+# install
+
+> copy files and set attributes, but also change ownership/permissions and remove debugging symbols from executables
+
+## option
+
+```sh
+-g, --group=GROUP # set group ownership, instead of process' current group
+-m, --mode=MODE # set permission mode (as in chmod), instead of rwxr-xr-x
+-o, --owner=OWNER # set ownership (super-user only)
+-p, --preserve-timestamps # apply access/modification times of SOURCE to corresponding DEST files
+```
+
+## usage
+
+```sh
+install -D /SOURCE/DIR/*.py /DESTINATION/DIR
+
+install -d /DESTINATION/DIR
+
+install -m 0755 -d DIR
+install -m 0755 FILE DIR/FILE
+
+install -m 0755 -d DIR/man1
+install -m 0644 FILE.1 DIR/man1/FILE.1
+```
+
+## see also
+
+- [[chmod]]
+- [[mv]]
+- [[make]]
+- [ss64.com/bash/install.html](https://ss64.com/bash/install.html)
diff --git a/notes/installer.md b/notes/installer.md
new file mode 100644
index 00000000..7ad6fa6f
--- /dev/null
+++ b/notes/installer.md
@@ -0,0 +1,67 @@
+---
+tags: [macos]
+title: installer
+created: '2020-06-10T09:03:37.546Z'
+modified: '2023-05-17T07:48:59.347Z'
+---
+
+# installer
+
+> system software and package installer tool
+
+## option
+
+```sh
+-dominfo # displays list of domains into which a package can be installed e.g. LocalSystem or CurrentUserHomeDirectory
+-volinfo # displays list of volumes onto which a package can be installed
+-pkginfo # displays list of packages that can be installed onto the target volume
+-query flag # queries package for information about the metadata
+-allowUntrusted # allow install of a package signed by an untrusted/expired certificate
+-dumplog # detailed log information is always sent to syslog using the LOG_INSTALL facility (/var/log/install.log) additionally writes stderr
+-help # displays the help screen describing the list of parameters
+-verbose # displays more descriptive information than the default output. Use in conjunction with -pkginfo and -volinfo information requests to see more readable output
+-verboseR # displays same information as -verbose except output is formatted for easy parsing
+-vers # displays the version of this command
+-config # formats installation arguments for later use. sent to stdout, no actuall installation performed
+-plist # formats the installer output into an XML file, which is sent by default to stdout. Use this parameter for -dominfo, -volinfo, and -pkginfo
+-file pathToFile # specifies path to the XML file containing parameter information in the key/value dictionary
+-lang ISOLanguageCode # default language of installed system (ISO format)
+-listiso # display the list of valid ISO language codes the installer recognizes
+-showChoiceChangesXML # prints to stdout the install choices for the package (specified with -pkg) in an XML format
+-showChoicesXML # prints to stdout the install choices for the package (specified with -pkg) in a hierarchical XML format. This is not the same format as used with -applyChoiceChangesXML
+-store # install the product archive specified by -package, in the same way that it would be installed through the Mac App Store
+```
+
+## usage
+
+```sh
+installer -pkg ./AWSCLIV2.pkg -target /
+
+installer -pkg ~/Documents/Foo.pkg -target / -config > /tmp/configfile.plist
+
+installer -file /tmp/configfile.plist
+
+installer -dominfo -pkg InstallMe.pkg
+
+installer -volinfo -pkg InstallMe.pkg
+
+installer -pkginfo -pkg DeveloperTools.mpkg
+
+installer -pkg OSInstall.mpkg -target LocalSystem
+
+installer -pkg OSInstall.mpkg -target / -lang en
+
+installer -pkg DeveloperTools.mpkg -target /
+
+installer -pkg InstallMe.pkg -target "/Volumes/Macintosh HD2"
+
+installer -pkg InstallMe.pkg -file /tmp/InstallConfigFile
+
+installer -pkg InstallMe.pkg -target /dev/disk0s5
+```
+
+## see also
+
+- [[aws]]
+- [[crc]]
+- [[xar]]
diff --git a/notes/ip.md b/notes/ip.md
new file mode 100644
index 00000000..d9da61eb
--- /dev/null
+++ b/notes/ip.md
@@ -0,0 +1,150 @@
+---
+tags: [iproute, network]
+title: ip
+created: '2019-09-03T11:51:54.855Z'
+modified: '2023-04-11T20:13:58.411Z'
+---
+
+# ip
+
+> edits and displays the configuration of network interfaces, routing, and tunnels
+
+## install
+
+```SH
+apt install iproute2
+yum install iproute
+```
+
+## option
+
+```sh
+-s, -stats, -statistics # Output more information. -s -s => more verbose
+-f, -family # inet, inet6, bridge, ipx, dnet, link
+-4 # shortcut for -family inet.
+-6 # shortcut for -family inet6.
+-B # shortcut for -family bridge.
+-0 # shortcut for -family link.
+-o, -oneline # output each record on a single line, replacing line feeds with the '\' character
+```
+
+### objects
+
+```sh
+address # protocol (IP or IPv6) address on a device.
+addrlabel # label configuration for protocol address selection.
+l2tp # tunnel Ethernet over IP (L2TPv3).
+link # network device.
+maddress # multicast address.
+monitor # watch for netlink messages.
+mroute # multicast routing cache entry.
+mrule # rule in multicast routing policy database.
+neighbour # manage ARP or NDISC cache entries.
+netns # manage network namespaces.
+ntable # manage the neighbor cache's operation.
+route # routing table entry.
+rule # rule in routing policy database.
+tcp_metrics, tcpmetrics # manage TCP Metrics.
+tunnel # tunnel over IP.
+tuntap # manage TUN/TAP devices.
+xfrm # manage IPSec policies.
+```
+
+## usage
+
+```sh
+ip [OPTS] OBJECT {CMD|HELP}
+
+# show queries
+addr # display IP Addresses and property information (abbreviation of address)
+
+ip addr # Show information for all addresses
+ip addr show en0 # show info to interface en0
+
+ip -4 addr show eth0 | grep -oP "(?<=inet ).*(?=/)"
+
+ip addr show dev em1 # display information only for device em1
+ip -brief -color address show
+ip -br -c a s
+
+link # Manage and display the state of all network interfaces
+ip link # Show information for all interfaces
+ip link show dev em1 # display information only for device em1
+ip -s link # display interface statistics
+
+route # display and alter the routing table
+ip route # List all of the route entries in the kernel
+ip ro # show IP-pakets route via default bridge
+ip route show cache table all
+
+maddr # Manage and display multicast IP addresses
+ip maddr # display multicast information for all devices
+ip maddr show dev em1 # display multicast information for device em1
+
+neigh # Show neighbour objects; also known as the ARP table for IPv4
+ip neigh # display neighbour objects
+ip neigh show # arp cache
+ip neigh show dev em1 # Show the ARP cache for device em1
+
+
+help # display a list of commands and arguments for each subcommand
+ip help # display ip commands and arguments
+ip addr help # display address commands and arguments
+ip link help # display link commands and arguments
+ip neigh help # display neighbour commands and arguments
+
+# multicast addressing
+maddr add # add a static link-layer multicast address
+ip maddr add 33:33:00:00:00:01 dev em1 # add mutlicast address 33:33:00:00:00:01 to em1
+ip maddr del 33:33:00:00:00:01 dev em1 # delete multicast address: 33:33:00:00:00:01 from em1
+
+# modifying address andlink properties
+ip addr add 192.168.1.1/24 dev em1 # Add address 192.168.1.1 with netmask 24 to device em1
+ip addr del 192.168.1.1/24 dev em1 # Remove address 192.168.1.1/24 from device em1
+
+link set # Alter the status of the interface
+ip link set em1 up # Bring em1 online
+ip link set em1 down # Bring em1 offline
+ip link set em1 mtu 9000 # Set the MTU on em1 to 9000
+ip link set em1 promisc on # Enable promiscuous mode for em1
+
+# adjust and view routes
+route add # Add an entry to the routing table
+ip route add default via 192.168.1.1 dev em1 # Add a default route (for all addresses) via the local gateway 192.168.1.1 that can be reached on device em1
+ip route add 192.168.1.0/24 via 192.168.1.1 # Add a route to 192.168.1.0/24 via the gateway at 192.168.1.1
+ip route add 192.168.1.0/24 dev em1 # Add a route to 192.168.1.0/24 that can be reached on device em1
+
+route delete # Delete a routing table entry
+ip route delete 192.168.1.0/24 via 192.168.1.1 # Delete the route for 192.168.1.0/24 via the gateway at 192.168.1.1
+
+route replace # Replace, or add if not defined, a route
+ip route replace 192.168.1.0/24 dev em1 # Replace the defined route for 192.168.1.0/24 to use device em1
+
+route get # display the route an address will take
+ip route get 192.168.1.5 # display the route taken for IP 192.168.1.5
+
+# manage arp table
+neigh add # Add an entry to the ARP Table
+ip neigh add 192.168.1.1 lladdr 1:2:3:4:5:6 dev em1 # Add address 192.168.1.1 with MAC 1:2:3:4:5:6 to em1
+
+neigh del # Invalidate an entry
+ip neigh del 192.168.1.1 dev em1 # Invalidate the entry for 192.168.1.1 on em1
+
+neigh replace # Replace, or adds if not defined, an entry to the ARP table
+ip neigh replace 192.168.1.1 lladdr 1:2:3:4:5:6 dev em1 # Replace the entry for address 192.168.1.1 to use MAC 1:2:3:4:5:6 on em1
+```
+
+## see also
+
+- [[netstat]]
+- [[vagrant]]
+- [[arp]]
+- [[ipv4]]
+- [[net-tools]]
+- [[iproute]]
+- [[net-tools vs iproute]]
+- [[ethtool]]
+- [[iptables]]
+- [[firewall-cmd]]
+- [computerhope.com/unix/ip.htm](https://www.computerhope.com/unix/ip.htm)
+- [man7.org/../man8/ip.8.html](http://man7.org/linux/man-pages/man8/ip.8.html)
diff --git a/notes/iproute.md b/notes/iproute.md
new file mode 100644
index 00000000..cd0423e7
--- /dev/null
+++ b/notes/iproute.md
@@ -0,0 +1,39 @@
+---
+tags: [iproute, network]
+title: iproute
+created: '2020-09-03T06:34:08.653Z'
+modified: '2020-09-03T06:45:11.895Z'
+---
+
+# iproute
+
+> advanced IP routing and network device configuration tools
+
+## install
+`apt install iproute2`, `yum install iproute`
+
+## usage
+- [[bridge]] - show / manipulate bridge addresses and devices
+- [[ctstat]] - alias for lnstat
+- [[devlink]] - Devlink tool
+- [[genl]] - generic netlink utility frontend
+- [[ifcfg]] - simplistic script which replaces ifconfig IP management
+- [[ifstat]] - handy utility to read network interface statistics
+- [[ip]] - show / manipulate routing, network devices, interfaces and tunnels
+- [[lnstat]] - unified linux network statistics
+- [[nstat]] - alias for rtacct
+- [[rdma]] - RDMA tool, device configuration, link configuration
+- [[routef]] - alias for routel
+- [[routel]] - These programs are a set of helper scripts you can use instead of raw iproute2 commands.
+- [[rtacct]] - network statistics tools.
+- [[rtmon]] - route monitoring utility
+- [[rtpr]] - replace backslashes with newlines.
+- [[rtstat]] - alias for lnstat
+- [[ss]] - investigate sockets and shows active connections similar to [[netstat]]
+- [[tc]] - show / manipulate traffic control settings
+- [[tipc]] - a TIPC configuration and management tool
+
+## see also
+- [[net-tools]]
+- [[net-tools vs iproute]]
+- [kernel.org/pub/linux/utils/net/iproute2/](http://kernel.org/pub/linux/utils/net/iproute2/)
diff --git a/notes/iptables-extensions.md b/notes/iptables-extensions.md
new file mode 100644
index 00000000..e95e9a9a
--- /dev/null
+++ b/notes/iptables-extensions.md
@@ -0,0 +1,26 @@
+---
+tags: [linux]
+title: iptables-extensions
+created: '2019-10-30T09:17:47.113Z'
+modified: '2019-12-30T07:56:42.674Z'
+---
+
+# iptables-extensions
+
+> list of extensions in the standard iptables distribution
+
+## usage
+```sh
+-m
+
+-m tcp
+-m conntrack
+-m state --state RELATED,ESTABLISHED
+-m conntrack --ctstate RELATED,ESTABLISHED
+-m conntrack --ctstate INVALID
+
+-m addrtype --dst-type
+```
+
+## see also
+- [[iptables]]
diff --git a/notes/iptables.md b/notes/iptables.md
new file mode 100644
index 00000000..f722cb34
--- /dev/null
+++ b/notes/iptables.md
@@ -0,0 +1,131 @@
+---
+tags: [linux, network]
+title: iptables
+created: '2019-07-30T06:19:49.083Z'
+modified: '2022-03-04T07:51:32.001Z'
+---
+
+# iptables
+
+> administration tool for IPv4 packet filtering and NAT
+
+## basic iptables options
+
+```sh
+-A, --append chain # Add one or more rules to the end of the selected chain
+-C, --check chain # Check for a rule matching the specifications in the selected chain
+-D, --delete chain # Delete one or more rules from the selected chain
+-F, --flush # Delete all the rules one-by-one
+-I, --insert chain # Insert one or more rules into the selected chain as the given rule number
+-L, --list # Display the rules in the selected chain
+-n, --numeric # Display the IP address or hostname and post number in numeric format
+-N, --new-chain name # Create a new user-defined chain
+-v, --verbose # Provide more information when used with the list option
+-X, --delete-chain name # Delete the user-defined chain
+
+-p, --protocol # The protocol, such as TCP, UDP, etc.
+-s, --source # Can be an address, network name, hostname, etc.
+-d, --destination # An address, hostname, network name, etc.
+-j, --jump # Specifies the target of the rule; i.e. what to do if the packet matches.
+-g, --goto chain # Specifies that the processing will continue in a user-specified chain.
+-i, --in-interface # Names the interface from where packets are received.
+-o, --out-interface # Name of the interface by which a packet is being sent.
+-f, --fragment # The rule will only be applied to the second and subsequent fragments of fragmented packets.
+-c, --set-counters # Enables the admin to initialize the packet and byte counters of a rule.
+
+--ctstate state # Define the list of states for the rule to match on.
+ # NEW - connection has not yet been seen.
+ # RELATED - connection is new, but is related to another connection already permitted.
+ # ESTABLISHED - connection is already established.
+ # INVALID - traffic couldn't be identified for some reason
+--match, -m match #
+```
+
+## usage
+
+```sh
+iptables -F # flush/remove all rules
+
+iptables --list # list all active rules by specification
+iptables -L
+iptables -L DOCKER-INGRESS # list only DOCKER-INGRESS chain
+
+
+iptables -S, -list-rules -S # Print the rules in a chain or all chains
+
+iptables -S TCP # show all of the rule specifications in the TCP chain
+iptables -S DOCKER
+
+iptables -t nat -L POSTROUTING # list chain:POSTROUTING in table:nat
+
+iptables -S DOCKER-USER
+```
+
+## backup restore
+```sh
+iptables-save > iptables_bckp
+
+iptables-restore < iptables_bckp
+```
+
+## rules
+```sh
+iptables -I INPUT -s 198.51.100.0 -j DROP
+ # -I - insert will add it to the beginning of a chain and will be applied first
+ # to indicate a specific placement in the chain, you may also use a number with the -I option.
+ # -s - source
+ # -j - jump, target of the rule and what action will be performed if the packet is a match
+
+
+iptables -A POSTROUTING -s 10.32.254.0/24 ! -o docker0 -j MASQUERADE # docker nat rule
+
+ # append to chain POSTROUTING which allows modifying routed packets
+ # applies to packets coming from the subnet `-s 10.32.254.0/24`
+ # that are not going to be sent via the interface `! -o docker0`
+ # where the latter is Dockers default bridge-interface and the former is its IPv4-subnet
+ # instructs to jump to MASQUERADE which assigns the corresponding IP of the outgoing interface to matching packets.
+
+
+iptables -A DOCKER -d 172.17.0.2/32 ! -i docker0 -o docker0 -p tcp -m tcp โ dport 443 -j ACCEPT # docker
+```
+
+
+## netfilter tables
+> tables are made up of `built-in` chains and may also contain `user-defined` chains
+> built-in tables will depend on the kernel configuration and the installed modules
+```sh
+iptables -vL -t nat
+```
+
+`Filter` - This is the default table. Its built-in chains are:
+- `Input`: packets going to local sockets
+- `Forward`: packets routed through the server
+- `Output`: locally generated packets
+
+`Nat` - When a packet creates a new connection, this table is used. Its built-in chains are:
+- `Prerouting`: designating packets when they come in
+- `Output`: locally generated packets before routing takes place
+- `Postrouting`: altering packets on the way out
+
+`Mangle` - Used for special altering of packets. Its chains are:
+- `Prerouting`: incoming packets
+- `Postrouting`: outgoing packets
+- `Output`: locally generated packets that are being altered
+- `Input`: packets coming directly into the server
+- `Forward`: packets being routed through the server
+
+`Raw` - Primarily used for configuring exemptions from connection tracking. The built-in chains are:
+- `Prerouting`: packets that arrive by the network interface
+- `Output`: processes that are locally generated
+
+`Security` - Used for MAC rules. After the `filter` table, the security table is accessed next. The built-in chains are:
+- `Input`: packets entering the server
+- `Output`: locally generated packets
+- `Forward`: packets passing through the server
+
+
+## see also
+- [[iptables-extensions]]
+- [[firewall-cmd]]
+- [[nat]]
+- https://www.linode.com/docs/security/firewalls/control-network-traffic-with-iptables/
diff --git a/notes/ipv4.md b/notes/ipv4.md
new file mode 100644
index 00000000..92872621
--- /dev/null
+++ b/notes/ipv4.md
@@ -0,0 +1,40 @@
+---
+tags: [network]
+title: ipv4
+created: '2019-09-03T11:30:01.345Z'
+modified: '2020-09-11T06:55:39.034Z'
+---
+
+# ipv4
+
+`CIDR` Classless Inter-Domain Routing `rfc-4632`
+
+```
+10.10.15.10/16
+
+ 0000 1010 . 00000 1010 . 0000 1111 . 0000 1010
+AND 1111 1111 . 11111 1111 . 0000 0000 . 0000 0000
+ ----------------------------------------------
+ 0000 1010 . 00000 1010 . 0000 0000 . 0000 0000
+
+ 10.10.0.0 to 10.255.255.255 is part of network
+
+
+0000 1010 . 0010 1111 . 00 | 00 0000 . 0000 0000 10.47.0.0 /18
+0000 1010 . 0010 1111 . 00 | 11 1111 . 1111 1111 10.47.63.255 /18
+
+0000 1010 . 0010 1111 . 01 | 00 0000 . 0000 0000 10.47.64.0 /18
+0000 1010 . 0010 1111 . 01 | 11 1111 . 1111 1111 10.47.127.255 /18
+
+0000 1010 . 0010 1111 . 10 | 00 0000 . 0000 0000 10.47.128.0 /18
+0000 1010 . 0010 1111 . 10 | 00 1111 . 1111 1111 10.47.191.255 /18
+
+0000 1010 . 0010 1111 . 11 | 00 0000 . 0000 0000 10.47.192.0 /18
+0000 1010 . 0010 1111 . 11 | 11 1111 . 1111 1111 10.47.255.255 /18
+```
+
+
+## see also
+- [[ip]]
+- [[iptables]]
+- [[osi model]]
diff --git a/notes/irb.md b/notes/irb.md
new file mode 100644
index 00000000..6dc77a9b
--- /dev/null
+++ b/notes/irb.md
@@ -0,0 +1,22 @@
+---
+tags: [ruby]
+title: irb
+created: '2020-01-02T12:47:07.521Z'
+modified: '2020-09-02T17:43:08.280Z'
+---
+
+# irb
+
+> stands for Interactive Ruby
+
+## usage
+```sh
+irb # starts repl
+
+# flags
+# -m Bc mode (load mathn, fraction or matrix are available)
+# -d Set $DEBUG to true (same as `ruby -d')
+```
+## see also
+- [[ruby]]
+- [[python]]
diff --git a/notes/istioctl.md b/notes/istioctl.md
new file mode 100644
index 00000000..23dc7599
--- /dev/null
+++ b/notes/istioctl.md
@@ -0,0 +1,36 @@
+---
+tags: [container]
+title: istioctl
+created: '2023-04-24T08:21:24.730Z'
+modified: '2023-05-23T08:16:33.750Z'
+---
+
+# istioctl
+
+> config cli utility for service operators to debug and diagnose istio [[servicemesh]]
+
+## install
+
+```sh
+brew install istioctl
+
+# download istoctl and example conf to current dir
+curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.17.2 TARGET_ARCH=x86_64 sh -
+```
+
+## usage
+
+```sh
+istioctl install --set profile=demo -y
+
+istioctl analyze
+
+istioctl dashboard envoy deployment/productpage-v1
+istioctl dash envoy productpage-123-456.default
+istioctl d envoy productpage-123-456.default
+```
+
+## see also
+
+- [[crc]]
+- [[minikube]]
diff --git a/notes/jam stack.md b/notes/jam stack.md
new file mode 100644
index 00000000..b851063d
--- /dev/null
+++ b/notes/jam stack.md
@@ -0,0 +1,58 @@
+---
+tags: [Notebooks]
+title: jam stack
+created: '2022-04-08T10:29:14.554Z'
+modified: '2023-03-23T10:20:22.090Z'
+---
+
+# jam stack
+
+> `javascript api markup` - community collection of best practices and workflows that result in high-speed websites
+
+## jam stack sites are
+
+- globally distributed and resilient to heavy traffic
+- centred around developer friendly git-based workflow
+- designed modularily, consuming other services via apis
+- prebuild and optimized before being served
+
+
+
+##
+
+```
+ server-side client-side static-site-generation
+
+ /product/widget /product/widget /product/widget
+
+ โโโโโโโโโโโโโ โโโโโโโโโโโโโ โโโโโโโโโโโโโ
+ โ client โ โ client โ โ client โ
+ โโโโโโโฒโโโโโโ โโฒโโโโโโโโโฒโโ โโโโโโโฒโโโโโโ
+ โ โ โ โ
+Rendered Response โ โ โ
+ โ โ โ โ
+ โโโโโโโดโโโโโโโ Blank Page โ โโโโโดโโโโโ
+ โ Web Server โ + โ โ S3 โ
+ โโโโโโโฒโโโโโโโ JavaScript โ โโโโโฒโโโโโ
+ โ โ โ โ
+ data โโโโโโโโโดโโโโโ data โโโโโโโโดโโโโโโโโ
+ โ โ Web Server โ โ โ Build Server โ
+ โโโโโโโดโโโโโโโ โโโโโโโโโโโโโโ โ โโโโโโโโฒโโโโโโโโ
+ โ API Server โ โ โ
+ โโโโโโโโโโโโโโ โโโโโโโโโดโโโโโ โโโโโโโผโโโโโโโ
+ โ API Server โ โ API Server โ
+ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ
+
+```
+
+
+platforms: [[hugo]], [[jekyll]], [[gatsby]]
+services: netlify, now.sh, zeit
+apis: aws-amplify, firebase
+
+
+
+## see also
+
+- [[micro frontend]]
+- [[edge side include]]
diff --git a/notes/jar.md b/notes/jar.md
new file mode 100644
index 00000000..44a72377
--- /dev/null
+++ b/notes/jar.md
@@ -0,0 +1,24 @@
+---
+tags: [java]
+title: jar
+created: '2020-03-24T12:53:00.287Z'
+modified: '2023-04-13T07:29:39.419Z'
+---
+
+# jar
+
+> `.jar` - `Java ARchive` is a package file format used to aggregate java classes, metadata and resources
+> built on the `zip` format
+
+## usage
+
+```sh
+jar tvf file.jar # viewing the contents of a JAR-file; see also `unzip -l jar`
+```
+
+## see also
+
+- [[java]]
+- [[javac]]
+- [[mvn]] `package`
+- [[zip]]
diff --git a/notes/java access modifiers.md b/notes/java access modifiers.md
new file mode 100644
index 00000000..3d947a9f
--- /dev/null
+++ b/notes/java access modifiers.md
@@ -0,0 +1,19 @@
+---
+tags: [java]
+title: java access modifiers
+created: '2019-08-13T11:26:57.432Z'
+modified: '2019-09-24T14:19:19.574Z'
+---
+
+# java access modifiers
+
+desc | class | package | subclass(same pkg) | subclass (diff pkg)| world
+-- | -- | -- | -- | -- | --
+ `public` | โ | โ | โ | โ | โ
+ `protected` | โ | โ | โ | โ | โ
+ `no modifier`| โ | โ | โ | โ | โ
+ `private` | โ | โ | โ | โ | โ
+
+## see also
+- [differences - stackoverflow](https://stackoverflow.com/questions/215497/what-is-the-difference-between-public-protected-package-private-and-private-in)
+
diff --git a/notes/java datatypes.md b/notes/java datatypes.md
new file mode 100644
index 00000000..b7da34ed
--- /dev/null
+++ b/notes/java datatypes.md
@@ -0,0 +1,12 @@
+---
+tags: [java]
+title: java datatypes
+created: '2019-07-30T06:19:49.149Z'
+modified: '2019-08-20T07:24:24.718Z'
+---
+
+# java datatypes
+
+8 primitive types:
+
+ byte, short, int, long, char, float, double, boolean
diff --git a/notes/java operator.md b/notes/java operator.md
new file mode 100644
index 00000000..9c799e57
--- /dev/null
+++ b/notes/java operator.md
@@ -0,0 +1,31 @@
+---
+tags: [java]
+title: java operator
+created: '2020-06-25T10:46:37.541Z'
+modified: '2020-09-02T17:36:31.719Z'
+---
+
+# java operator
+
+## usage
+Larger number means higher precedence.
+Precedence |ย Operator | Type |ย Associativity
+-- |-- |-- |--
+15 | `()`, `[]`, `.` | Parentheses, Array subscript, Member selection | Left to Right
+14 | `++`, `--` | Unary post-increment, Unary post-decrement | Right to left
+13 | `++`, `--`, `+`, `-`, `!`, `~`, `(type)` | Unary pre-increment, Unary pre-decrement, Unary plus, Unary minus, Unary logical negation, Unary bitwise complement, Unary type cast | Right to left
+12 | `*`, `/`, `%` | Multiplication, Division, Modulus | Left to right
+11 | `+`, `-` | Addition Subtraction | Left to right
+10 | `<<`, `>>`, `>>>` | Bitwise left shift, Bitwise right shift with sign extension, Bitwise right shift with zero extension | Left to right
+9 | `<`, `<=`, `>`, `>=`, `instanceof` | Relational less than, Relational less than or equal, Relational greater than, Relational greater than or equal, Type comparison (objects only) | Left to right
+8 | `==`, `!=` | Relational is equal to, Relational is not equal to | Left to right
+7 | `&` | Bitwise AND | Left to right
+6 | `^` | Bitwise exclusive OR | Left to right
+5 | `|` | Bitwise inclusive OR | Left to right
+4 | `&&` | Logical AND | Left to right
+3 | `||` | Logical OR | Left to right
+2 | `?`, `:` | Ternary conditional | Right to left
+1 | `=`, `+=`, `-=`, `*=`, `/=`, `%=` | Assignment, Addition assignment, Subtraction assignment, Multiplication assignment, Division assignment, Modulus assignment | Right to left
+
+## see also
+- [cs.bilkent.edu.tr/.../CS101/op_precedence.html](http://www.cs.bilkent.edu.tr/~guvenir/courses/CS101/op_precedence.html)
diff --git a/notes/java.md b/notes/java.md
new file mode 100644
index 00000000..77d9da0e
--- /dev/null
+++ b/notes/java.md
@@ -0,0 +1,101 @@
+---
+tags: [java]
+title: java
+created: '2019-07-30T06:19:49.143Z'
+modified: '2023-05-15T07:28:48.598Z'
+---
+
+# java
+
+> `java virtual machine` - java application launcher
+
+## option
+
+```sh
+-version # current version
+-cp # class path
+-Dblog=RebelLabs # Sets a โblogโ system property to โRebelLabsโ. `System.getProperty("blog");`
+-javaagent:/path/to/agent.jar # Loads the java agent in agent.jar
+-agentpath:pathname # Loads the native agent library specified by the absolute path name
+-verbose:[class/gc/jni] # Displays information about each loaded class/gc event/JNI activity
+-X # List all non-standard options
+-Xint # Runs the application in interpreted-only mode
+-Xbootclasspath:path # Path and archive list of boot class files
+-Xloggc:filename # Log verbose GC events to filename
+-Xms1g # initial size of heap
+-Xmx8g # max size of heap
+-Xnoclassgc # disables class gc
+-Xprof # profiles running program
+
+# advanced opts - behavior
+-XX:+UseConcMarkSweepGC # enables CMS gc
+-XX:+UseParallelGC # enables parallel gc
+-XX:+UseSerialGC # enables serial gc
+-XX:+UseG1GC # enables G1GC gc
+-XX:+FlightRecorder # requires UnlockCommercialFeatures
+-XX:+UnlockCommercialFeatures # enables the use of the Java Flight Recorder
+
+# advanced opts - debugging
+-XX:ErrorFile=file.log # Save the error data to file.log
+-XX:+HeapDumpOnOutOfMemory # enables heap dump when OutOfMemoryError is thrown
+-XX:+PrintGC # enables printing messages during gc
+-XX:+TraceClassLoading # enables Trace loading of classes
+-XX:+PrintClassHistogram # enables printing of a class instance histogram after a Control+C event (SIGTERM)
+
+# advanced opts - performance
+-XX:MaxPermSize=128m # Sets the max perm space size (bytes) (Java 7 or earlier)
+-XX:ThreadStackSize=256k # Sets Thread Stack Size (bytes) (same as -Xss256k)
+-XX:+UseStringCache # enables caching of commonly allocated strings
+-XX:G1HeapRegionSize=4m # Sets the sub-division size of G1 heap (bytes)
+-XX:MaxGCPauseMillis=n # Sets a target for the maximum GC pause time
+-XX:MaxNewSize=256m # Max size of new generation (bytes)
+-XX:+AggressiveOpts # enables the use of aggressive performance optimization features
+-XX:OnError="cmd args" # Run user-defined commands on fatal error
+```
+
+[developers.redhat.com/blog/2017/04/04/openjdk-and-containers](https://developers.redhat.com/blog/2017/04/04/openjdk-and-containers)
+
+## usage
+
+```sh
+java # lists all standard options
+
+java \
+ -Dlogging.level.root=DEBUG \
+ -Dlogging.level.org.springframework.web=DEBUG \
+ -Dlogging.level.org.hibernate=ERROR \
+ -Djavax.net.ssl.trustStorePassword=PASS \
+ -jar -Xmx6144m file.jar
+
+mvn spring-boot:run \
+ -Dspring-boot.run.arguments=--spring.main.banner-mode=off,--customArgument=custom
+```
+
+## runtime info
+
+```java
+public class A {
+ public static void main(String[] args) throws Exception {
+ System.out.println( Runtime.getRuntime().totalMemory());
+ }
+}
+```
+
+```sh
+javac A.java && java -Xms256m -Xmx256m A | numfmt --to=iec-i
+```
+
+## see also
+
+- [[jshell]]
+- [[javac]]
+- [[jps]]
+- [[jar]]
+- [[javac]]
+- [[sdk]]
+- [[mvn]]
+- [[gradle]]
+- [[scala]]
+- [[kafka]]
+- [[python]]
+- [[ulimit]]
diff --git a/notes/javac.md b/notes/javac.md
new file mode 100644
index 00000000..7fc150d1
--- /dev/null
+++ b/notes/javac.md
@@ -0,0 +1,63 @@
+---
+tags: [compiler, java]
+title: javac
+created: '2019-08-21T14:45:10.678Z'
+modified: '2023-05-10T09:49:20.653Z'
+---
+
+# javac
+
+> read Java declarations and compile them into class files
+
+- primary java compiler included in the `jdk` from oracle. Martin Odersky implemented the GJ compiler, and his implementation became the basis for javac[2]
+- `javac` accepts source code conforming to the [[java]] language specification (JLS) and produces Java bytecode conforming to the Java Virtual Machine Specification (JVMS)
+- `javac` is itself written in [[java]]. The compiler can also be invoked programmatically
+
+
+only translates Java source code into bytecode
+does not perform any optimization or compilation at runtime.
+used as a one-time compilation step to generate bytecode, which can then be executed by the jvm
+
+## env
+
+```sh
+CLASSPATH # recommended should not be set, use instead --class-path
+JDK_JAVAC_OPTIONS
+```
+
+## option
+
+```sh
+--help, -help, -? # print this help message
+--help-extra, -X # print help on extra options
+
+--boot-class-path PATH, -bootclasspath PATH # override location of bootstrap class files
+
+
+--class-path PATH, -classpath PATH, -cp PATH # specify where to find user class files and annotation processors
+--target RELEASE, -target RELEASE # generate class files suitable for the specified java SE release
+ -deprecation # output source locations where deprecated APIs are used
+--enable-preview # enable preview language features. used in conjunction with either -source or --release
+--source RELEASE, -source RELEASE # provide source compatibility with the specified Java SE release
+--release RELEASE # compile for the specified Java SE release
+ -g # Generate all debugging info
+ -d DIR # specify where to place generated class files
+ -verbose # output messages about what the compiler is doing
+--version, -version # version information
+ -Werror # terminate compilation if warnings occur
+```
+
+## usage
+
+```sh
+javac -d . Foo.java # -d specify directory for package, then call via `java foo.Foo`
+```
+
+## see also
+
+- [[java]]
+- [[javap]]
+- [[ocamlc]]
+- [[mvn]]
+- [[make]]
+- [docs.oracle.com/en/java/javase/17/docs/specs/man/javac](https://docs.oracle.com/en/java/javase/17/docs/specs/man/javac.html)
diff --git a/notes/javap.md b/notes/javap.md
new file mode 100644
index 00000000..578b7917
--- /dev/null
+++ b/notes/javap.md
@@ -0,0 +1,21 @@
+---
+tags: [java]
+title: javap
+created: '2020-06-04T08:25:50.801Z'
+modified: '2023-03-27T07:41:25.851Z'
+---
+
+# javap
+
+> java class file disassembler
+
+## usage
+
+```sh
+javap -c Class
+```
+
+## see also
+
+- [[java]]
+- [[javac]]
diff --git a/notes/javascript object notation.md b/notes/javascript object notation.md
new file mode 100644
index 00000000..91135606
--- /dev/null
+++ b/notes/javascript object notation.md
@@ -0,0 +1,125 @@
+---
+tags: [javascript]
+title: javascript object notation
+created: '2023-05-24T11:44:11.052Z'
+modified: '2023-05-24T14:14:53.137Z'
+---
+
+# javascript object notation
+
+> `json`
+
+## json grammar in McKeeman Form
+
+```json
+json
+ element
+
+value
+ object
+ array
+ string
+ number
+ "true"
+ "false"
+ "null"
+
+object
+ '{' ws '}'
+ '{' members '}'
+
+members
+ member
+ member ',' members
+
+member
+ ws string ws ':' element
+
+array
+ '[' ws ']'
+ '[' elements ']'
+
+elements
+ element
+ element ',' elements
+
+element
+ ws value ws
+
+string
+'"' characters '"'
+
+characters
+ ""
+ character characters
+
+character
+ '0020' . '10FFFF' - '"' - '\'
+'\' escape
+
+escape
+ '"'
+ '\'
+ '/'
+ 'b'
+ 'f'
+ 'n'
+ 'r'
+ 't'
+ 'u' hex hex hex hex
+
+hex
+ digit
+ 'A' . 'F'
+ 'a' . 'f'
+
+number
+ integer fraction exponent
+
+integer
+ digit
+ onenine digits
+ '-' digit
+ '-' onenine digits
+
+digits
+ digit
+ digit digits
+
+digit
+ '0'
+ onenine
+
+onenine
+ '1' . '9'
+
+fraction
+ ""
+ '.' digits
+
+exponent
+ ""
+ 'E' sign digits
+ 'e' sign digits
+
+sign
+ ""
+ '+'
+ '-'
+
+ws
+ ""
+ '0020' ws
+ '000A' ws
+ '000D' ws
+ '0009' ws
+```
+
+[crockford.com/mckeeman](https://www.crockford.com/mckeeman.html)
+
+## see also
+
+- [[yaml]], [[jq]], [[yq]]
+- [json.org/json-en](https://www.json.org/json-en.html)
+- [crockford.com/mckeeman](https://www.crockford.com/mckeeman.html)
+- [infoq.com/presentations/Heretical-Open-Source/](https://www.infoq.com/presentations/Heretical-Open-Source/)
diff --git a/notes/javascript.md b/notes/javascript.md
new file mode 100644
index 00000000..d87e7167
--- /dev/null
+++ b/notes/javascript.md
@@ -0,0 +1,175 @@
+---
+tags: [javascript]
+title: javascript
+created: '2019-08-19T12:09:44.017Z'
+modified: '2023-05-23T16:49:55.443Z'
+---
+
+# javascript
+
+> interpreted, or jit-compiled programming language with first-class functions
+
+> has more in common with functional languages like [[lisp]] or [[scheme]] than with [[c]] or [[java]].
+> It has arrays instead of lists and objects instead of property lists.
+> Functions are first class. It has closures. You get lambdas without having to balance all those parens.
+> [crockford.com/javascript/javascript](https://crockford.com/javascript/javascript.html)
+
+## runtimes
+
+| | |
+| --- | --- |
+| [[node]].js | open-source, cross-platform, JavaScript runtime built on Chrome's V8 JavaScript engine |
+| [[deno]] | secure runtime for [[javascript]] and [[typescript]] built on V8 engine, and designed to improve on Node.js |
+| Rhino | engine written in [[java]], which allows [[javascript]] to be run on jvm |
+| JerryScript | engine used on devices with limited resources, such as microcontrollers |
+| SpiderMonkey | engine used in Mozilla [[firefox]], [[js]] |
+| JavaScriptCore | engine used in Apple's Safari browser |
+| Chakra | engine used in Microsoft Edge and Internet Explorer |
+| Nashorn | engine for the JVM, introduced in [[java]] 8 and deprecated on version 15 |
+| QuickJS | small and embeddable engine with a focus on performance and compliance |
+| V8 | engine used in chrome and Chromium-based browsers |
+| MuJS | lightweight interpreter that supports ES5 and a subset of ES6 |
+| Jint | .NET-based interpreter that allows you to run JavaScript code within a .NET application |
+
+```
+ โโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโ
+ โ Source โโโโโโโโบ parser โโโโโโบ AST โ
+ โโโโโโโโโโ โโโโโโโโโโโ โโโโโฌโโโโ
+ โโโโ โโโ โโโ โโโ โโ โโโ โโโ โโโ
+ โโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
+ โ โโโโโโผโโโโโโโโโโ โโโโโโโโโโโโโโโ d โ
+ โ โ interpreter โ โ bytecode โ e โ
+ โ o โโโโโค โโโโโโโโโโโบ โโโโโ o โ
+ โ p โ โโโโโโโโโโโโโโโโ โโโโโโโโฌโโโโโโโ โ p โ
+ โ t profiling data โ t โ
+ โ i โ โโโโ โโโ โโโ โโโ โโโ โโโ โ i โ
+ โ m โโโโโโโโโผโโโโโโโ โโโโโโโโโโโโโโโ m โ
+ โ i โ โ optimizing โ โ optimized โ โ i โ
+ โ z โโโโโบ compiler โโโโโโโโโโโบ code โโโโโ z โ
+ โ e โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ e โ
+ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
+```
+
+[mathiasbynens.be/notes/prototypes](https://mathiasbynens.be/notes/prototypes)
+
+
+## install
+
+[[node]], [[js]], [[deno]], [[bun]]
+
+## datatypes
+
+```js
+//[7] data types
+object
+
+//[6] primitive types
+boolean
+null
+undefined
+number
+string
+symbol // (ecma6)
+
+// array
+
+// slice() method returns a shallow copy of a portion of an array into a new array object selected from start to end
+const items = [1,2,3,4,5];
+const slice = items.splice(1,3);
+console.log(items); // [ 1, 5 ]
+console.log(slice); // [ 2, 3, 4 ]
+```
+
+## object patterns
+
+> `private` and `privileged` members can only be made when an object is constructed. Public members can be added at any time.
+
+```js
+function Container(param) {
+ // var dec = function dec(...) {...};
+ // shorthand:
+ function dec() { // private method
+ if (secret > 0) {
+ secret -= 1;
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ this.member = param; // public
+ var secret = 3; // private
+ var that = this; // private, convention used to make the object available to private methods
+
+ this.service = function () { // protected method
+ return dec() ? that.member : null; // 3 calls allowed
+ };
+}
+
+Container.prototype.memberName = value; // public
+
+c = new Container("foo");
+```
+
+[crockford.com/javascript/private](https://crockford.com/javascript/private.html)
+
+## implement "react hooks"
+
+```js
+function useState(initVal) {
+ _val = initVal;
+ const state = () => _val; // add `() =>` turns it into setter function
+ const setState = newVal => {
+ _val = newVal;
+ }
+ return [state, setState]
+}
+
+const [count, setCount] = useState(1)
+console.log(count())
+setCount(2)
+console.log(count())
+```
+
+[react.dev/reference/react](https://react.dev/reference/react)
+[Can Swyx recreate React Hooks and useState in under 30 min? - JSConf.Asia](https://www.youtube.com/watch?v=KJP1E-Y-xyo)
+
+## closure
+
+```js
+function getAdd() {
+ let foo = 1;
+ return function() { // anonymous function which is the closure, "encloses" foo value
+ foo = foo + 1;
+ return foo;
+ }
+}
+const add = getAdd();
+
+/*
+ * "module pattern" / "IIFE" (=immediately-invoked function expression)
+ */
+const add = (getAdd() {
+ let foo = 1;
+ return function() { // anonymous function which is the closure, "encloses" foo value
+ foo = foo + 1;
+ return foo;
+ }
+})();
+
+// change internal state
+console.log(add());
+console.log(add());
+// foo = 23 // can't change internal val foo !
+console.log(add());
+console.log(add());
+```
+
+## see also
+
+- [[nvm]]
+- [[tsc]], [[coffee]]
+- [[mongo]]
+- [[go]], [[rust]], [[java]]
+- [developer.mozilla.org/en-US/docs/Web/JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
+
diff --git a/notes/jekyll.md b/notes/jekyll.md
new file mode 100644
index 00000000..48089ccb
--- /dev/null
+++ b/notes/jekyll.md
@@ -0,0 +1,18 @@
+---
+tags: [ruby]
+title: jekyll
+created: '2022-04-08T21:03:45.559Z'
+modified: '2023-03-22T11:06:47.654Z'
+---
+
+# jekyll
+
+>
+
+## usage
+
+## see als
+
+- [[jam stack]]
+- [[hugo]]
+- [[ruby]]
diff --git a/notes/jfrog.md b/notes/jfrog.md
new file mode 100644
index 00000000..421a2ebc
--- /dev/null
+++ b/notes/jfrog.md
@@ -0,0 +1,27 @@
+---
+tags: [cloud]
+title: jfrog
+created: '2023-04-17T10:50:40.281Z'
+modified: '2023-05-24T08:43:02.376Z'
+---
+
+# jfrog
+
+> client that provides simple interface that automates access to jfrog products
+
+## install
+
+```sh
+brew install jfrog-cli
+```
+
+## usage
+
+```sh
+jf intro
+```
+
+## see also
+
+- [[mvn]]
+- [[glab]]
diff --git a/notes/jira jql.md b/notes/jira jql.md
new file mode 100644
index 00000000..2d095a62
--- /dev/null
+++ b/notes/jira jql.md
@@ -0,0 +1,26 @@
+---
+tags: [Notebooks]
+title: jira jql
+created: '2019-09-19T06:12:55.493Z'
+modified: '2023-03-27T07:50:40.585Z'
+---
+
+# jira jql
+
+> `jql` - `jira query language` (not `java query language`)
+
+## usage
+
+```
+project = CB and status not in ("Done", "Accepted", "Merged", "Finished") and text ~ "nexus"
+
+
+and status not in ("Done", "Accepted", "Merged", "Finished")
+
+
+project = CB AND text ~ "elastic" ORDER BY id DESC
+```
+
+## see also
+
+- [confluence.atlassian.com/blog/search-jira-like-a-boss-with-jql](https://confluence.atlassian.com/jiracore/blog/2015/07/search-jira-like-a-boss-with-jql)
diff --git a/notes/jit vs aot.md b/notes/jit vs aot.md
new file mode 100644
index 00000000..6b3e0442
--- /dev/null
+++ b/notes/jit vs aot.md
@@ -0,0 +1,19 @@
+---
+tags: [Notebooks]
+title: jit vs aot
+created: '2023-05-11T06:49:21.963Z'
+modified: '2023-05-24T08:38:39.285Z'
+---
+
+# jit vs aot
+
+> both are compilation strategies
+
+JIT -> Java HotSpot VM -> translate bytecode to machine code at runtime
+AOT -> GraavlVM -> statically compiles bytecode directly into machine code at build time
+
+
+## see also
+
+- [[java]], [[graalvm]]
+- [cesarsotovalero.net/blog/aot-vs-jit-compilation-in-java](https://www.cesarsotovalero.net/blog/aot-vs-jit-compilation-in-java.htm)
diff --git a/notes/jless.md b/notes/jless.md
new file mode 100644
index 00000000..2dec2667
--- /dev/null
+++ b/notes/jless.md
@@ -0,0 +1,48 @@
+---
+tags: [json, rust]
+title: jless
+created: '2022-05-17T19:12:45.216Z'
+modified: '2023-05-10T14:13:31.135Z'
+---
+
+# jless
+
+> json viewer for reading, exploring, and searching through json data
+
+## install
+
+```sh
+brew install jless
+
+cargo install jless
+```
+
+## option
+
+```sh
+-h, --help # print help information
+-m, --mode MODE # initial viewing mode.
+ # --mode line opening and closing curly and square brackets are shown and all Object keys are quoted
+ # --mode data (default), closing braces, commas, and quotes around Object keys are elided.
+ # active mode can be toggled by pressing 'm' [default: data]
+ --scrolloff SCROLLOFF # number of lines to maintain as padding between the currently focused row and the top or bottom of the screen. Setting this to a large value will keep the focused in the middle of the screen (except at the start or end of a file) [default: 3]
+-V, --version # print version information
+ --json # parse input as JSON, regardless of file extension
+ --yaml # parse input as YAML, regardless of file extension
+```
+
+## usage
+
+```sh
+alias yless="jless --yaml"
+
+cat file.json | jless
+```
+
+## see also
+
+- [[less]]
+- [[jq]]
+- [[fx]]
+- [[cargo]]
+- [jless.io](https://jless.io/)
diff --git a/notes/jmeter.md b/notes/jmeter.md
new file mode 100644
index 00000000..13d2ed3a
--- /dev/null
+++ b/notes/jmeter.md
@@ -0,0 +1,60 @@
+---
+tags: [java]
+title: jmeter
+created: '2023-03-17T06:55:48.163Z'
+modified: '2023-03-22T10:22:44.545Z'
+---
+
+# jmeter
+
+## install
+
+```sh
+skd install jmeter
+```
+
+## option
+
+```sh
+-?, --? # print command line options and exit
+-h, --help # print usage information and exit
+-v, --version # print the version information and exit
+-p, --propfile ARG # the jmeter property file to use
+-q, --addprop ARG # additional JMeter property file(s)
+-t, --testfile ARG # the jmeter test(.jmx) file to run. "-t LAST" will load last used file
+-l, --logfile ARG # the file to log samples to
+-i, --jmeterlogconf ARG # jmeter logging configuration file (log4j2.xml)
+-j, --jmeterlogfile ARG # jmeter run log file (jmeter.log)
+-n, --nongui # run JMeter in nongui mode
+-s, --server # run the JMeter server
+-E, --proxyScheme ARG # set a proxy scheme to use for the proxy server
+-H, --proxyHost ARG # set a proxy server for JMeter to use
+-P, --proxyPort ARG # set proxy server port for JMeter to use
+-N, --nonProxyHosts ARG # set nonproxy host list (e.g. *.apache.org|localhost)
+-u, --username ARG # set username for proxy server that JMeter is to use
+-a, --password ARG # set password for proxy server that JMeter is to use
+-J, --jmeterproperty ARG=VAL # define additional JMeter properties
+-G, --globalproperty ARG=VAL # define Global properties (sent to servers) e.g. -Gport=123 or -Gglobal.properties
+-D, --systemproperty ARG=VAL # define additional system properties
+-S, --systemPropertyFile ARG # additional system property file(s)
+-f, --forceDeleteResultFile # force delete existing results files and web report folder if present before starting the test
+-L, --loglevel ARG=VAL # [category=]level e.g. jorphan=INFO, jmeter.util=DEBUG or com.example.foo=WARN
+-r, --runremote # Start remote servers (as defined in remote_hosts)
+-R, --remotestart ARG # Start these remote servers (overrides remote_hosts)
+-d, --homedir ARG # the jmeter home directory to use
+-X, --remoteexit # Exit the remote servers at end of test (non-GUI)
+-g, --reportonly ARG # generate report dashboard only, from a test results file
+-e, --reportatendofloadtests # generate report dashboard after load test
+-o, --reportoutputfolder ARG # output folder for report dashboard
+```
+
+## usage
+
+```sh
+jmeter -n -t FILE.jmx -l FILE.log -e -o ./REPORT/OUT_DIR -Jpropertie=${VAL}
+```
+
+## see also
+
+- [[sdk]]
+- [[java]]
diff --git a/notes/jo.md b/notes/jo.md
new file mode 100644
index 00000000..4a25e36a
--- /dev/null
+++ b/notes/jo.md
@@ -0,0 +1,33 @@
+---
+tags: [json]
+title: jo
+created: '2019-07-30T06:19:49.120Z'
+modified: '2023-03-22T10:41:34.223Z'
+---
+
+# jo
+
+> small utility to create JSON objects
+
+## usage
+
+```sh
+ARRAY[1]=foo
+ARRAY[2]=bar
+
+jo -p -a ${ARRAY[@]}
+```
+
+```json
+[
+ "foo",
+ "bar"
+]
+```
+
+## see also
+
+- [[jq]]
+- [[jsonnet]]
+- [[yq]]
+- [github.com/jpmens/jo](https://github.com/jpmens/jo)
diff --git a/notes/journalctl.md b/notes/journalctl.md
new file mode 100644
index 00000000..46720b91
--- /dev/null
+++ b/notes/journalctl.md
@@ -0,0 +1,32 @@
+---
+tags: [linux, systemd]
+title: journalctl
+created: '2019-08-19T09:11:28.583Z'
+modified: '2023-03-23T08:40:13.237Z'
+---
+
+# journalctl
+
+## usage
+
+```sh
+journalctl -f # follow
+
+journalctl -u ssh # Show Logs for a systemd ServicePermalink
+
+journalctl -k # View Kernel MessagesPermalink
+
+journalctl -o json-pretty # Change the Log Output FormatPermalink
+
+journalctl --vacuum-size=2G # Manually Clean Up Archived LogsPermalink
+
+
+journalctl -xefu SERVICE
+```
+
+## see also
+
+- [[systemctl]]
+- [[syslog]]
+- [Use journalctl to View Your System's Logs](https://www.linode.com/docs/quick-answers/linux/how-to-use-journalctl/)
+- [systemd/man/journalctl](https://www.freedesktop.org/software/systemd/man/journalctl#-o)
diff --git a/notes/jps.md b/notes/jps.md
new file mode 100644
index 00000000..8cbc27d1
--- /dev/null
+++ b/notes/jps.md
@@ -0,0 +1,28 @@
+---
+tags: [java]
+title: jps
+created: '2020-08-27T08:49:45.295Z'
+modified: '2023-03-23T09:28:43.955Z'
+---
+
+# jps
+
+> jvm process status tool
+
+## usage
+
+```sh
+jps # lists JVMs on localhost
+
+jps -l remote.domain # lists JVMs on remote host
+
+jps -m remote.domain:2002 # lists JVMs on a remote host with a non-default port for the RMI registry
+```
+
+## see also
+
+- [docs.oracle.com/javase/7/docs/.../jps.html](https://docs.oracle.com/javase/7/docs/technotes/tools/share/jps.html)
+- [[jstat]]
+- [[jstatd]]
+- [[rmiregistry]]
+
diff --git a/notes/jq.md b/notes/jq.md
index c7d64bf3..7c069d2e 100644
--- a/notes/jq.md
+++ b/notes/jq.md
@@ -1,93 +1,96 @@
---
-tags: [bash, cli, json]
+tags: [json, linux]
title: jq
created: '2019-07-30T06:19:49.141Z'
-modified: '2019-08-01T08:23:27.698Z'
+modified: '2023-03-22T10:27:29.820Z'
---
# jq
-```sh
- --raw-output / -r # output no quotes
+> cli json processor - transforms json, by selecting, iterating, reducing and otherwise mangling json documents
- --unbuffered # if you're piping a slow data source into jq and piping jq's output elsewhere
-```
+## install
```sh
-cat .docker/config.json | jq -r '.auths | keys[]' # get only keys from auths{} object
+brew install jq
```
+## option
```sh
-# Add field
-echo '{"hello": "world"}' | jq --arg foo bar '. + {foo: $foo}'
-# {
-# "hello": "world",
-# "foo": "bar"
-# }
-
-
-# Override field value
-echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: $foo}'
-# {
-# "hello": "bar"
-# }
-
-
-# Concat and add
-echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: ("not" + $foo)}'
-# {
-# "hello": "world",
-# "foo": "notbar"
-# }
+-c, --compact-output # compact to single line,1 no pretty print
+-r, --raw-output # output no quotes
+-R, --raw-input # don't parse the input as json. Instead, each line of text is passed to the filter as a string
+--unbuffered # if you're piping a slow data source into jq and piping jq's output elsewhere
+-n, --null-input # Don't read any input at all! useful when using jq as a simple calculator or to construct json data from scratch
+-S, --sort-keys # output fields of each object with the keys in sorted order
```
-### filter values
+## usage
+
```sh
-# removes from .[], ..map for array
-| jq --unbuffered 'map(del(.database, .id, .isDefault, .jsonData, .orgId, .password, .typeLogoUrl, .user))'
+echo '[1, "foo", ["foo"]]' | jq '. | tostring' # `tojson` `fromjson`
-# keeps whitelisted from .[]
-| jq --unbuffered 'map({access, basicAuth, name, type, url})'
-```
+echo '[1, "foo", ["foo"]]' | jq '. | tojson'
-### pint in same line
-```sh
-docker exec -t consul consul watch -type=service -service=swarm-a \
+echo '"[1,\"foo\",[\"foo\"]]"' | jq '. | fromjson'
- | jq -r '.[] | [.Node.Node, .Service.Service] | @tsv' # input must be an array, and it is rendered as TSV (tab-separated values).
+diff <(jq -S . FILE_A.json) <(jq -S . FILE_A.json) # diff by sorting first
- | jq -r '.[] | "\(.Node.Node) \(.Service.Service)"' # String interpolation
-```
-[json - Printing multiple values on the same line - Stack Overflow](https://stackoverflow.com/a/46131963)
+# string interpolation
+STDOUT | jq '.[]| "\(.id) \(.name)"' # print in one line
-### get value of dynamic object names
-```sh
-# {
-# "traefik-metrics-192-csHt9CK1Pq5ATmZ-i-8km0dPkoU": {
-# "url": "http://10.32.23.150:7070",
-# "weight": 1
-# },
-# "traefik-metrics-193-zHtiw3Y4-N-RYUIP7DxczqBU3ZE": {
-# "url": "http://10.32.23.151:7070",
-# "weight": 1
-# },
-# ...
-
-curl --silent --request GET --url http://swarm-a.service.ddev.domain.net:7070/api/providers/consul_catalog/backends/backend-traefik-metrics \
- | jq -r '.servers | keys[] as $k | "\(.[$k] | .url)"'
-
-# http://10.32.23.150:7070
-# http://10.32.23.151:7070
-# ..
-```
-[json - jq print key and value for all in sub-object - Unix & Linux Stack Exchange](https://unix.stackexchange.com/a/406425)
+jq -n -r '["abc","def"] | "\(.[0]) \(.[1])"'
-## compare
-```sh
-jq -S . fileA.json > fileA_fmt.json
-jq -S . fileB.json > fileB_fmt.json
+STDOUT | jq -r '.auths | keys[]' # get only keys from auths{} object
+
+
+# select - get a object based on object's value
+jq '.VirtualMachines[].Config.Hardware.Device[] | select(.Key== 2000) | .CapacityInBytes'
+
+jq '.QueueUrls[] | select(endswith("STRING"))' # get array-elemnts ending with "STRING"
+
+jq '.fields | select(.some | tonumber > 0) | .some)' # convert string from .some `tonumber` then get if greater zero
+
-diff fileA_fmt.json fileB_fmt.json
+# filter values
+STDOUT | jq --unbuffered 'map(del(.database, .id, .isDefault, .jsonData, .orgId, .password, .typeLogoUrl, .user))' # removes from .[], ..map for array
+
+STDOUT | jq --unbuffered 'map({access, basicAuth, name, type, url})' # keeps whitelisted from .[]
+
+STDOUT | jq 'map(.price) | add' # will take an array of JSON objects as input and return the sum of their "price" fields
+
+
+# edit
+echo '{"hello": "world"}' | jq --arg foo bar '. + {foo: $foo}' # add field: { "hello": "world", "foo": "bar" }
+
+echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: $foo}' # override field value: { "hello": "bar" }
+
+echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: ("not" + $foo)}' # concat and add: { "hello": "world", "foo": "notbar" }
+
+
+
+STDOUT | jq -r '.[] | [.Node.Node, .Service.Service] | @tsv' # print in same line; input must be an array, and it is rendered as TSV (tab-separated values)
+
+STDOUT | jq -r '.servers | keys[] as $k | "\(.[$k] | .url)"' # get value of dynamic object names
+
+json | jq -r '.data | .MINIO_SECRET_KEY | @base64d ' # base64-decode string
+
+jq -R 'split(".") | .[1] | @base64d | fromjson' <<< "$TOKEN" # decode jwt-token
+
+jq -n -c '[{"foo": 1, "bar": 2}, {"foo": 3, "quux": 4}] | map(select( .bar ))' # get element containing bar-field
```
+
+## see also
+
+- [[fx]]
+- [[jsonpath]]
+- [[yq]]
+- [[jwt]]
+- [[govc]]
+- [[aws]]
+- [[kubectl]]
+- [remysharp.com/drafts/jq-recipes](https://remysharp.com/drafts/jq-recipes)
+- [unix.stackexchange.com/jq-print-key-and-value-for-all-in-sub-object](https://unix.stackexchange.com/a/406425)
+- [stackoverflow.com/printing-multiple-values-on-the-same-line](https://stackoverflow.com/a/46131963)
diff --git a/notes/js.md b/notes/js.md
new file mode 100644
index 00000000..1a77b054
--- /dev/null
+++ b/notes/js.md
@@ -0,0 +1,69 @@
+---
+tags: [c, javascript, runtime]
+title: js
+created: '2023-05-13T11:31:48.624Z'
+modified: '2023-05-23T06:55:42.141Z'
+---
+
+# js
+
+> [[spidermonkey]] shell provides a cli to javascript-c engine
+
+## install
+
+```sh
+brew install spidermonkey
+```
+
+## option
+
+```sh
+-f --file=PATH # File path to run, parsing file contents as UTF-8
+-u --utf16-file=PATH # File path to run, inflating the file's UTF-8 contents to UTF-16 and then parsing that
+-m --module=PATH # Module path to run
+-e --execute=CODE # Inline code to run
+-i --shell # Enter prompt after running code
+-c --compileonly # Only compile, don't run (syntax checking mode)
+-w --warnings # Emit warnings
+-W --nowarnings # Don't emit warnings
+-D --dump-bytecode # Dump bytecode with exec count for all scripts
+-b --print-timing # Print sub-ms runtime for each file that's run
+...
+```
+
+## usage
+
+```sh
+js SCRIPT.js
+
+js OPTS [[SCRIPT] SCRIPT_ARGS*]
+```
+
+## console
+
+```sh
+
+>js help()
+
+>js os.getenv("HOME")
+
+js> load("FILE.js")
+
+js> (function() {
+ for (let prop in this) {
+ console.log(prop + ': ' + global[prop]);
+ }
+})()
+
+js> for (let prop in globalThis) {
+ console.log(prop + ': ' + globalThis[prop]);
+}
+```
+
+## see also
+
+- [[javascript]]
+- [[node]], [[deno]], [[bun]]
+- [spidermonkey.dev/](https://spidermonkey.dev/)
+- [udn.realityripple.com/docs/Mozilla/Projects/SpiderMonkey/Introduction_to_the_JavaScript_shell](https://udn.realityripple.com/docs/Mozilla/Projects/SpiderMonkey/Introduction_to_the_JavaScript_shell)
+- [udn.realityripple.com/docs/Mozilla/Projects/SpiderMonkey/Hacking_Tips](https://udn.realityripple.com/docs/Mozilla/Projects/SpiderMonkey/Hacking_Tips)
diff --git a/notes/jshell.md b/notes/jshell.md
new file mode 100644
index 00000000..eaaa00fa
--- /dev/null
+++ b/notes/jshell.md
@@ -0,0 +1,64 @@
+---
+tags: [java, repl]
+title: jshell
+created: '2023-05-15T07:28:53.482Z'
+modified: '2023-05-24T08:42:49.265Z'
+---
+
+# jshell
+
+> java repl, introdcues in jdk 9, executes constructs like class, interface, enum, object, statements, etc.
+
+## option
+
+```sh
+--class-path PATH # specify where to find user class files
+--module-path PATH # specify where to find application modules
+--add-modules MODULE[,MODULE..] # Specify modules to resolve, or all modules on the module path if is ALL-MODULE-PATHs
+--enable-preview # allow code to depend on preview features of this release
+--startup FILE # one run replacement for the startup definitions
+--no-startup # do not run the startup definitions
+--feedback MODE # specify the initial feedback mode. The mode may be predefined (silent, concise, normal, or verbose) or previously user-defined
+-q # quiet feedback. Same as: --feedback concise
+-s # really quiet feedback. Same as: --feedback silent
+-v # verbose feedback. Same as: --feedback verbose
+-JFLAG # pass FLAG directly to the runtime system. Use one -J for each runtime flag or flag argument
+-RFLAG # pass FLAG to the remote runtime system. Use one -R for each remote flag or flag argument
+-CFLAG # pass FLAG to the compiler. Use one -C for each compiler flag or flag argument
+--version # print version information and exit
+--show-version # print version information and continue
+--help, -?, -h # print this synopsis of standard options and exit
+--help-extra, -X # print help on non-standard options and exit
+```
+
+## usage
+
+```sh
+jehell # start repl
+```
+
+## console
+
+```java
+jshell> /help // display help
+jshell> /? env // get info on env command
+jshell> /! // rerun last snippet
+jshell> /exit // exit
+
+jshell> int i = 123
+i ==> 123
+
+jshell> i + 456
+$2 ==> 579
+
+jshell> System.out.println("hello")
+hello
+
+jshell> for (var i = 0; i < 3; ++i)
+ ...> System.out.println(i*i)
+```
+
+## see also
+
+- [[java]]
+- [[node]]
diff --git a/notes/json.md b/notes/json.md
new file mode 100644
index 00000000..16a45c29
--- /dev/null
+++ b/notes/json.md
@@ -0,0 +1,47 @@
+---
+tags: [javascript, json]
+title: json
+created: '2022-12-02T10:57:31.255Z'
+modified: '2023-05-24T11:44:03.727Z'
+---
+
+# json
+
+> `json` - something-generating-JSON-on-stdout
+
+## install
+
+```sh
+npm install -g json
+```
+
+## option
+
+```sh
+-f FILE # specify input FILE instead of STDIN
+-I, --in-place # edit FILE given with -f FILE in-place
+-i # shortcut for -o inspect
+-H # drop any http header block from `curl -i`
+```
+
+## usage
+
+```sh
+json OPTIONS LOOKUPS
+
+json -I -f FILE # inplace format FILE
+json -I -f FILE -e 'this.port=8080' # inplace add port field
+
+curl -is HOST | json -H forks # drop headers
+```
+
+## see also
+
+- [[jq]], [[yq]]
+- [[npm]]
+- [[curl]]
+- [[yaml]]
+- [trentm.com/json/#EXAMPLES](http://trentm.com/json/#EXAMPLES)
+- [[javascript object notation]]
+- [json.org/json-en](https://www.json.org/json-en.html)
+- [infoq.com/presentations/Heretical-Open-Source/](https://www.infoq.com/presentations/Heretical-Open-Source/)
diff --git a/notes/jsonnet.md b/notes/jsonnet.md
new file mode 100644
index 00000000..1179ab4b
--- /dev/null
+++ b/notes/jsonnet.md
@@ -0,0 +1,29 @@
+---
+tags: [json]
+title: jsonnet
+created: '2021-11-13T09:43:01.973Z'
+modified: '2023-03-22T10:34:05.233Z'
+---
+
+# jsonnet
+
+## install
+
+```sh
+brew install jsonnet
+```
+
+## usage
+
+```sh
+jsonnet -e '{ x: 1 , y: self.x + 1 } { x: 10 }' # eval a snippet
+```
+
+## see also
+
+- [[jq]]
+- [[jo]]
+- [[kustomize]]
+- [[helm]]
+- [jsonnet.org](https://jsonnet.org/)
+
diff --git a/notes/jsonpath.md b/notes/jsonpath.md
new file mode 100644
index 00000000..7276366e
--- /dev/null
+++ b/notes/jsonpath.md
@@ -0,0 +1,93 @@
+---
+tags: [json]
+title: jsonpath
+created: '2020-10-09T11:50:35.973Z'
+modified: '2023-03-22T10:27:39.363Z'
+---
+
+# jsonpath
+
+> defines expressions to traverse through a json
+
+## usage
+
+```sh
+$ # root object/element
+@ # current object/element
+. or [] # child operator
+.. # recursive descent (borrowed from E4X)
+* # wildcard all objects/elements regardless names
+[] # subscript operator
+[,] # union operator allows alternate names or array indices as a set
+[start:end:step] # array slice operator (borrowed from E4X)
+?() # applies a filter (script) expression.
+() # script expression, using the underlying script engine.
+
+$.store.book[0].title # expressions can use the dotโnotation
+$['store']['book'][0]['title'] # or the bracketโnotation
+```
+
+## functions
+
+```sh
+min() # (double) provides min value of an array of numbers
+max() # (double) provides max value of an array of numbers
+avg() # (double) provides average value of an array of numbers
+stddev() # (double) provides standard deviation value of an array of numbers
+length() # (integer) provides length of an array
+sum() # (double) provides sum value of an array of numbers
+```
+
+## filters
+
+```sh
+== # left is equal to right (note that 1 is not equal to '1')
+!= # left is not equal to right
+< # left is less than right
+<= # left is less or equal to right
+> # left is greater than right
+>= # left is greater than or equal to right
+=~ # left matches regular expression [?(@.name =~ /foo.*?/i)]
+in # left exists in right [?(@.size in ['S', 'M'])]
+nin # left does not exists in right
+subsetof # left is a subset of right [?(@.sizes subsetof ['S', 'M', 'L'])]
+anyof # left has an intersection with right [?(@.sizes anyof ['M', 'L'])]
+noneof # left has no intersection with right [?(@.sizes noneof ['M', 'L'])]
+size # size of left (array or string) should match right
+empty # left (array or string) should be empty
+```
+
+## usage
+
+```sh
+kubectl get deployments -o jsonpath='{range .items[*]}
+{"---"}
+{"name: "}{@.metadata.name}
+{"env.secretKeyRef: "}
+ {range @.spec.template.spec.containers[*].env[*]}{"- "}{@.valueFrom.secretKeyRef.name}
+ {end}
+{"envFrom.configMapRef: "}
+ {range @.spec.template.spec.containers[*].envFrom[*]}{"- "}{@.configMapRef.name}
+ {end}
+{"envFrom.secretRef: "}
+ {range @.spec.template.spec.containers[*].envFrom[*]}{"- "}{@.secretRef.name}
+ {end}
+{end}' | yq e -P 'del(.. | select(length == 0))' - | yq e -P 'del(.. | select(length == 0))'
+
+kubectl get svc SERVICE -o jsonpath='{.spec.clusterIP}'
+ {.items[*].status.addresses[?(@.type=="ExternalIP")].address}
+kubectl get nodes -o jsonpath='{.items[*].status.addresses[?(@.type=="InternalDNS")].address}'
+kubectl get pods -l run=my-nginx -o jsonpath='{.items[0].metadata.name}'
+kubectl get pods -o jsonpath='{range .items[*]}{@.metadata.name}{" "}{@.spec.containers[*].image}{"\n"}{end}'
+```
+
+## see also
+
+- [[go-template]]
+- [[kubectl]]
+- [[xpath]]
+- [[jq]]
+- [[yq]]
+- [goessner.net/articles/JsonPath/](https://goessner.net/articles/JsonPath/)
+- [github.com/json-path/JsonPath](https://github.com/json-path/JsonPath)
+- [cburgmer.github.io/json-path-comparison/](https://cburgmer.github.io/json-path-comparison/)
diff --git a/notes/jstat.md b/notes/jstat.md
new file mode 100644
index 00000000..5dc077f7
--- /dev/null
+++ b/notes/jstat.md
@@ -0,0 +1,25 @@
+---
+tags: [java]
+title: jstat
+created: '2020-08-27T09:00:19.267Z'
+modified: '2023-03-23T09:29:01.167Z'
+---
+
+# jstat
+
+> java virtual machine Statistics Monitoring Tool
+
+## usge
+
+```sh
+jstat -options # list available options
+
+jstat -class VMID # vmid == pid; use `ps` or `jps`
+```
+
+## see also
+
+- [docs.oracle.com/javase/7/docs/.../jstat.html](https://docs.oracle.com/javase/7/docs/technotes/tools/share/jstat.html)
+- [[java]]
+- [[jps]]
+- [[jmeter]]
diff --git a/notes/jwt.md b/notes/jwt.md
new file mode 100644
index 00000000..403eb9d5
--- /dev/null
+++ b/notes/jwt.md
@@ -0,0 +1,28 @@
+---
+tags: [crypto]
+title: jwt
+created: '2020-01-27T08:04:24.079Z'
+modified: '2023-03-24T08:19:14.020Z'
+---
+
+# jwt
+
+> `json web tokens` - standard `RFC 7519` method for representing claims securely between two parties
+
+`jwt`'s consist of three parts separated by dots: `HEADER.PAYLOAD.SIGNATURE`
+
+## usage
+
+```sh
+jq -R 'split(".") | .[1] | @base64d | fromjson' <<< "$TOKEN" # decode to json
+```
+
+## see also
+
+- [[jq]]
+- [jwt.io/introduction](https://jwt.io/introduction/)
+- [github.com/emcrisostomo/jwt-cli](https://github.com/emcrisostomo/jwt-cli)
+- [willhaley.com/blog/generate-jwt-with-bash](https://willhaley.com/blog/generate-jwt-with-bash/)
+- [jvt.me/posts/2019/06/13/pretty-printing-jwt-openssl](https://www.jvt.me/posts/2019/06/13/pretty-printing-jwt-openssl/)
+- [gist.github.com/rolandyoung/176dd310a6948e094be6](https://gist.github.com/rolandyoung/176dd310a6948e094be6)
+- [github.com/Moodstocks/moodstocks-api-clients/blob/master/bash/base64url.sh](https://github.com/Moodstocks/moodstocks-api-clients/blob/master/bash/base64url.sh)
diff --git a/notes/k0s.md b/notes/k0s.md
new file mode 100644
index 00000000..06312b2e
--- /dev/null
+++ b/notes/k0s.md
@@ -0,0 +1,43 @@
+---
+tags: [container]
+title: k0s
+created: '2022-01-27T09:47:59.070Z'
+modified: '2023-04-11T20:17:59.474Z'
+---
+
+# k0s
+
+> single binary, no host OS dependencies besides the host OS kernel, all-inclusive Kubernetes distribution
+
+## install
+
+```sh
+curl -sSLf https://get.k0s.sh | sudo sh
+```
+
+## option
+
+```sh
+--help
+```
+
+## usage
+
+```sh
+k0s install controller --single
+
+k0s start
+
+k0s kubectl get nodes
+
+k0s stop
+
+k0s reset
+```
+
+## see also
+
+- [[k3s]]
+- [[k9s]]
+- [[k3d]]
+- [docs.k0sproject.io/v1.23.1+k0s.1/](https://docs.k0sproject.io/v1.23.1+k0s.1/)
diff --git a/notes/k3d.md b/notes/k3d.md
new file mode 100644
index 00000000..ec8b2735
--- /dev/null
+++ b/notes/k3d.md
@@ -0,0 +1,24 @@
+---
+tags: [container]
+title: k3d
+created: '2022-01-27T09:48:45.201Z'
+modified: '2023-03-22T10:19:58.577Z'
+---
+
+# k3d
+
+> lightweight wrapper to run [[k3s]] in [[docker]]
+
+## install
+
+## usage
+
+```sh
+k3d cluster create CLUSTER_NAME
+```
+
+## see also
+
+- [[k0s]]
+- [[k3s]]
+- [k3d.io/v5.2.2/](https://k3d.io/v5.2.2/)
diff --git a/notes/k3s.md b/notes/k3s.md
new file mode 100644
index 00000000..2359c01c
--- /dev/null
+++ b/notes/k3s.md
@@ -0,0 +1,49 @@
+---
+tags: [container]
+title: k3s
+created: '2021-10-15T07:36:40.840Z'
+modified: '2023-04-11T20:18:20.808Z'
+---
+
+# k3s
+
+> lightweight kubernetes distro aimed for developers & IoT devices
+
+## install
+
+```sh
+```
+
+## option
+
+```sh
+```
+
+## usage
+
+```sh
+k3s server \
+ --cluster-reset \
+ --cluster-reset-restore-path=/var/lib/rancher/k3s/server/db/snapshots/etcd-snapshot-k3s-server-1-1643738640 \
+ --node-external-ip 192.168.56.11 \
+ --node-ip 192.168.56.11
+
+systemctl start k3s
+systemctl stop k3s
+
+systemctl daemon-reload && systemctl restart k3s
+```
+
+## see also
+
+- [[k3sup]]
+- [[kubectl]]
+- [[k3d]]
+- [[k0s]]
+- [[k9s]]
+- [[kind]]
+- [[vagrant]]
+- [[microk8s]]
+- [[minikube]]
+- [github.com/k3s-io/k3s](https://github.com/k3s-io/k3s)
+- [[command-not-found]]
diff --git a/notes/k3sup.md b/notes/k3sup.md
new file mode 100644
index 00000000..131b5ff7
--- /dev/null
+++ b/notes/k3sup.md
@@ -0,0 +1,63 @@
+---
+tags: [container]
+title: k3sup
+created: '2022-01-12T16:50:10.912Z'
+modified: '2023-03-22T10:19:58.543Z'
+---
+
+# k3sup
+
+## install
+
+```sh
+curl -sLS https://get.k3sup.dev | sh && sudo install k3sup /usr/local/bin/
+```
+
+## usage
+
+```sh
+k3sup install \
+ --ssh-key ~/.ssh/id_ed25519 \
+ --ip=192.168.56.11 \
+ --user=root \
+ --k3s-channel=stable \
+ --local-path=k3s-server-1.yaml \
+ --context k3s-server-1 \
+ --k3s-extra-args="--node-external-ip 192.168.56.11 --node-ip 192.168.56.11"
+
+k3sup join \
+ --ssh-key ~/.ssh/id_ed25519 \
+ --ip=192.168.56.12 \
+ --server-user=root \
+ --server-ip=192.168.56.11 \
+ --user=root \
+ --k3s-channel=stable \
+ --k3s-extra-args="--node-external-ip 192.168.56.12 --node-ip 192.168.56.12"
+
+
+k3sup install \
+ --ssh-key ~/.ssh/id_ed25519 \
+ --ip=192.168.56.11 \
+ --user=root \
+ --k3s-channel=stable \
+ --cluster `# init etcd-backend` \
+ --local-path=k3s-server-1.yaml \
+ --context k3s-server-1 \
+ --k3s-extra-args="--node-external-ip 192.168.56.11 --node-ip 192.168.56.11"
+
+k3sup join \
+ --ssh-key ~/.ssh/id_ed25519 \
+ --ip=192.168.56.12 \
+ --server-user=root \
+ --server-ip=192.168.56.11 \
+ --user=root \
+ --k3s-channel=stable \
+ --server `# join etcd via server`\
+ --k3s-extra-args="--node-external-ip 192.168.56.12 --node-ip 192.168.56.12"
+```
+
+## see also
+
+- [[k3s]]
+- [[kubectl]]
+- [[vagrant]]
diff --git a/notes/k9s.md b/notes/k9s.md
new file mode 100644
index 00000000..8568ca37
--- /dev/null
+++ b/notes/k9s.md
@@ -0,0 +1,63 @@
+---
+tags: [container]
+title: k9s
+created: '2022-02-02T11:10:11.308Z'
+modified: '2023-04-11T20:18:36.288Z'
+---
+
+# k9s
+
+> terminal based ui to interact with your kubernetes clusters
+
+## install
+
+```sh
+brew install derailed/k9s/k9s
+```
+
+## option
+
+```sh
+```
+
+## usage
+
+```sh
+k9s help # list all available options
+k9s info # get info about k9s runtime (logs, configs, etc..)
+k9s -n mycoolns # run k9s in a given namespace
+k9s -c pod # run k9s and launch in pod view via the pod command
+k9s --context coolCtx # start k9s in a non default KubeConfig context
+k9s --readonly # start k9s in readonly mode - with all modification commands disabled
+```
+
+## key bindings
+
+```sh
+ ? # show active keyboard mnemonics and help
+:alias, ctrl-a # show all available aliases and resources on the cluster
+:q, ctrl-c # to bail out of K9s
+:po, :pod # view k8s resource using singular/plarl shortname
+
+/filterโ # Filter out a resource view given a filter
+ # Regex2 supported ie fred|blee to filter resources named fred or blee
+
+/! filterโ # Inverse regex filer
+ # Keep everything that doesnโt match. Not implemented for logs
+
+ctrl-d # To delete a resource (TAB and ENTER to confirm)
+ctrl-k # To kill a resource (no confirmation dialog!)
+ctrl-w # Toggle Wide Columns sames as kubectl ... -o wide
+ctrl-z # Toggle Error State View resources in error condition
+
+:pulse, :pu # pluses view
+:xray RESOURCE # xray view, RESOURCE: po, svc, dp, rs..
+:popeye, :po # popeye view
+```
+
+## see also
+
+- [[kubectl]]
+- [[k0s]]
+- [[k3s]]
+- [k9scli.io/](https://k9scli.io/)
diff --git a/notes/kafka.md b/notes/kafka.md
new file mode 100644
index 00000000..55b30a2a
--- /dev/null
+++ b/notes/kafka.md
@@ -0,0 +1,114 @@
+---
+tags: [cloud]
+title: kafka
+created: '2019-07-30T06:19:49.147Z'
+modified: '2023-05-24T08:42:56.213Z'
+---
+
+# kafka
+
+> distributed event streaming platform
+
+## env
+
+```sh
+KAFKA_GC_LOG_OPTS # ..
+KAFKA_HEAP_OPTS # increase heapt memory e.g. "-Xms2g -Xmx5g"
+KAFKA_JVM_PERFORMANCE_OPTS # jvm opts e.g. "-XX:+UseG1GC "
+KAFKA_JMX_OPTS # e.g. "-Dcom.sun.management.jmxremote"
+KAFKA_LOG4J_OPTS # ..
+KAFKA_OPTS # unset if deployed with -javaagent, e.g. "-javaagent:/jmx_prometheus_javaagent-0.12.0.jar=1234:/kafka-2_0_0.yml"
+```
+
+## kafka-acls
+
+```sh
+kafka-acls \
+ --authorizer-properties zookeeper.connect=ZOOKEEPER:2181 \
+ --add \
+ --allow-principal User:CN=$FQDN \
+ --operation All \
+ --topic '*' \
+ --group '*' \
+ --transactional-id '*'
+
+kafka-acls --authorizer-properties zookeeper.connect=ZOOKEEPER:2181 --list
+```
+
+## kafka-topics
+
+```sh
+kafka-topics --zookeeper ZOOKEEPER:2181 --list # list topics see also`tree /kafka`
+
+kafka-topics --zookeeper ZOOKEEPER:2181 --describe --topic TOPIC
+
+kafka-topics --zookeeper ZOOKEEPER:2181 --create --topic TOPIC --partitions 1 --replication-factor 1
+```
+
+## kafka-console-producer
+
+```sh
+kafka-console-producer --broker-list BROKER:9094 --topic TOPIC # produce messages
+
+kafka-console-producer --producer.config CONF --broker-list BROKER:9092 --topic TOPIC # then start typing
+```
+
+## kafka-console-consumer
+
+```sh
+kafka-run-class kafka.tools.ConsoleConsumer "$@"
+
+kafka-console-consumer --bootstrap-server BROKER:9092 --topic TOPIC --from-beginning # consume messages
+
+kafka-console-consumer --bootstrap-server BROKER:9092 --topic TOPIC --partition 0 --offset 2 # get offset
+
+kafka-console-consumer --consumer.config CONF --bootstrap-server BROKER:9092 --topic TOPIC --from-beginning
+
+# get offset information
+kafka-console-consumer --consumer.config CONF --bootstrap-server BROKER:9094 --topic __consumer_offsets \
+ --formatter "kafka.coordinator.group.GroupMetadataManager\$OffsetsMessageFormatter"
+```
+
+## kafka-delete-records
+
+```sh
+kafka-delete-records --command-config CONF --bootstrap-server BROKER:9092 --offset-json-file offset-json.json
+```
+
+## kafka-consumer-groups
+
+```sh
+kafka-run-class kafka.admin.ConsumerGroupCommand
+
+kafka-consumer-groups --command-config CONF --bootstrap-server BROKER:9092 --list # list consumer groups
+
+kafka-consumer-groups --command-config CONF --bootstrap-server BROKER:9092 --describe --group GROUP
+
+kafka-consumer-groups \
+ --consumer.config CONF \
+ --bootstrap-server BROKER:9092 \
+ --group GROUP \
+ --reset-offsets \
+ --to-earliest \
+ --all-topics \
+ --execute
+```
+
+## kafka-run-class
+
+```sh
+kafka-run-class kafka.tools.GetOffsetShell --command-config CONF --broker-list BROKER:9092 --topic TOPIC # get offset
+
+kafka-run-class kafka.tools.GetOffsetShell --broker-list BROKER:9092 --topic de.story --time -1 --offsets 1 # topic size
+```
+
+## kafka-broker-api-versions
+
+```sh
+kafka-broker-api-versions --bootstrap-server BROKER:9092 --command-config CONF
+```
+
+## see also
+
+- [[java]]
+- [[zookeeper-shell]]
diff --git a/notes/kbst.md b/notes/kbst.md
new file mode 100644
index 00000000..d893eb02
--- /dev/null
+++ b/notes/kbst.md
@@ -0,0 +1,38 @@
+---
+tags: [iac]
+title: kbst
+created: '2022-03-23T06:54:40.598Z'
+modified: '2023-03-22T10:45:11.640Z'
+---
+
+# kbst
+
+> [[terraform]] framework for managed Kubernetes on AKS, EKS and GKE
+
+## install
+
+```sh
+curl -LO "https://github.com/kbst/kbst/releases/download/$(curl -s https://www.kubestack.com/cli-latest.txt)/kbst_darwin_amd64.zip"
+sudo unzip -d /usr/local/bin/ kbst_darwin_amd64.zip kbst
+```
+
+## usage
+
+```sh
+kbst help # get help about any command
+
+kbst local # start localhost development env
+kbst local apply # bring up local development environment and start watching for changes
+kbst local destroy
+
+kbst manifest # add, update and remove services from the catalog
+
+kbst repository # create and change Kubestack repositories
+kbst repo init eks # scaffold your repository using the EKS starter
+```
+
+## see also
+
+- [[terraform]]
+- [[localstack]]
+- [[aws]]
diff --git a/notes/kcadm.sh.md b/notes/kcadm.sh.md
new file mode 100644
index 00000000..42afc5f7
--- /dev/null
+++ b/notes/kcadm.sh.md
@@ -0,0 +1,77 @@
+---
+tags: [cloud]
+title: kcadm.sh
+created: '2020-02-03T09:34:38.160Z'
+modified: '2023-05-24T08:43:18.813Z'
+---
+
+# kcadm.sh
+
+> admin cli works by making http requests to admin REST endpoints - access to them is protected and requires auth
+
+## install
+
+```sh
+curl -O https://downloads.jboss.org/keycloak/8.0.1/keycloak-8.0.1.tar.gz
+tar xzf keycloak-8.0.1.tar.gz && mv keycloak-8.0.1 ~/bin
+export PATH="$PATH:$HOME/bin/keycloak-8.0.1/bin"
+```
+
+## option
+
+```sh
+-r, --target-realm REALM # Target realm to issue requests against if not the one authenticated against
+-q, --query NAME=VALUE # Add to request URI a NAME query parameter with value VALUE
+-h, --header NAME=VALUE # Set request header NAME to VALUE
+-o, --offset OFFSET # Set paging offset - adds a query parameter 'first' which some endpoints recognize
+-l, --limit LIMIT # Set limit to number of items in result - adds a query parameter 'max' which some endpoints recognize
+-H, --print-headers # Print response headers
+-F, --fields FILTER # A filter pattern to specify which fields of a JSON response to output
+-c, --compressed # Don't pretty print the output
+ --format FORMAT # Set output format to comma-separated-values by using 'csv'. Default format is 'json'
+ --noquotes # Don't quote strings when output format is 'csv'
+-a, --admin-root URL # URL of Admin REST endpoint root if not default - e.g. http://localhost:8080/auth/admin
+```
+
+## usage
+
+```sh
+kcadm.sh config credentials --server http://keycloak/auth --realm master --user admin # .keycloak/kcadm.config
+
+kcadm.sh get ENDPOINT [ARGUMENTS]
+
+kcadm.sh get serverinfo
+
+kcadm.sh get realms
+
+
+kcadm.sh get realms/REALM
+
+kcadm.sh get clients -r REALM --fields id,clientId
+
+kcadm.sh get clients/CLIENT_ID -r REALM
+
+kcadm.sh get clients/CLIENT_ID/roles -r REALM
+
+kcadm.sh get clients/CLIENT_ID/client-secret -r REALM
+
+kcadm.sh get clients/CLIENT_ID/installation/providers/keycloak-oidc-keycloak-json -r REALM # also contains credentials/secret !
+
+
+./kcadm.sh create realms -s realm=foo -s enabled=true # Create Realm foo
+
+# Create a REST API client
+./kcadm.sh create clients \
+ -r foo -s clientId=foo-api -s enabled=true \
+ -s clientAuthenticatorType=client-secret \
+ -s 'redirectUris=["http://localhost:8001/*"]' \
+ -s serviceAccountsEnabled=true # Creates new client with id '64daa1f8-3859-4b1a-a5ee-c1ae54d1ab69'
+
+# Create User role
+./kcadm.sh create clients/CLIENT_ID/roles -r corbee -s name=user -s 'description=User role'
+```
+
+## see also
+
+- [[java]]
+- [keycloak.org/docs/8.0/server_admin/#the-admin-cli](https://www.keycloak.org/docs/8.0/server_admin/#the-admin-cli)
diff --git a/notes/keybase.md b/notes/keybase.md
new file mode 100644
index 00000000..6e16e80d
--- /dev/null
+++ b/notes/keybase.md
@@ -0,0 +1,23 @@
+---
+tags: [crypto]
+title: keybase
+created: '2019-09-21T16:23:11.728Z'
+modified: '2023-03-24T08:19:14.029Z'
+---
+
+# keybase
+
+> cli for keybase
+
+## usage
+
+```sh
+keybase pgp pull USER # get pgp pub key
+
+keybase pgp encrypt -m "top secret message: hey !" USER
+```
+
+
+## see also
+
+- [[gpg]]
diff --git a/notes/keychain.md b/notes/keychain.md
new file mode 100644
index 00000000..b4b1f012
--- /dev/null
+++ b/notes/keychain.md
@@ -0,0 +1,20 @@
+---
+tags: [ssh]
+title: keychain
+created: '2019-07-30T06:19:49.148Z'
+modified: '2023-07-19T11:16:16.391Z'
+---
+
+# keychain
+
+> manages [[ssh]] and [[gpg]] keys in a convenient and secure manner, acts as a frontend to [[ssh-agent]] and [[ssh-add]], but allows one long running process per system, rather than one per login session
+
+## usage
+
+```sh
+eval $($keychain --eval id_rsa) # avoid retyping passphrases
+```
+
+## see also
+
+- [[ssh]]
diff --git a/notes/keytool.md b/notes/keytool.md
new file mode 100644
index 00000000..a504ff5f
--- /dev/null
+++ b/notes/keytool.md
@@ -0,0 +1,92 @@
+---
+tags: [crypto, java]
+title: keytool
+created: '2019-10-23T08:27:46.438Z'
+modified: '2023-03-24T08:19:14.035Z'
+---
+
+# keytool
+
+> manages keystore (database) of cryptographic keys, X.509 certificate chains, and trusted certificates
+
+## install
+
+`part of the standard java distribution`
+
+```sh
+apk --no-cache add openjdk11 --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community
+```
+
+## usage
+
+```sh
+keytool -list -v -keystore keystore.jks # list contents of store
+
+
+# generating a keypair and certificate signing request for a certificate
+keytool -genkey -alias mydomain -keyalg RSA -keystore keystore.jks -keysize 2048 # generate keystore and keypair
+
+keytool -certreq -alias mydomain -keystore keystore.jks -file mydomain.csr # generate CSR for an existing keystore
+
+keytool -import -trustcacerts -alias root -file Thawte.crt -keystore keystore.jks # import root/intermediate cert to existing keystore
+
+keytool -import -trustcacerts -alias mydomain -file mydomain.crt -keystore keystore.jks # import signed primary cert to an existing keystore
+
+# generate a keystore and a self-signed certificate
+keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks -storepass password -validity 360 -keysize 2048
+
+
+# validate the generation process for certificates and CSRs.
+keytool -printcert -v -file mydomain.crt # for checking a standalone certificate
+
+keytool -list -v -keystore keystore.jks # for checking which certificates are in a Java keystore
+
+keytool -list -v -keystore keystore.jks -alias mydomain # for checking a particular keystore entry using an alias
+
+keytool -delete -alias mydomain -keystore keystore.jks # for deleting a certificate from a Java Keytool keystore
+
+keytool -storepasswd -new new_storepass -keystore keystore.jks # for changing a Java keystore password
+
+keytool -export -alias mydomain -file mydomain.crt -keystore keystore.jks # for exporting a certificate from a keystore
+
+keytool -list -v -keystore $JAVA_HOME/jre/lib/security/cacerts # to view a list of trusted CA certs
+
+# for importing new CAs into your trusted certs
+keytool -import -trustcacerts -file /path/to/ca/ca.pem -alias CA_ALIAS -keystore $JAVA_HOME/jre/lib/security/cacerts
+
+
+# convert pem to jks
+# keystore
+openssl pkcs12 -inkey key.pem -in bundle.pem -export -out key.p12 -passout pass:PASSWORD
+
+# this seems not really needed as java supports pkcs12 natively nowadays, so we could use key.p12 as keystore.jks directly
+keytool -importkeystore -srcstoretype KEYSTORETYPE -srckeystore key.p12 -keyalg RSA -srcstorepass STOREPASS \
+ -destkeystore keystore.jks -deststoretype KEYSTORETYPE -deststorepass STOREPASS
+
+# truststore
+keytool -importcert -alias IntermediateCA -file na-root.pem -keyalg RSA -noprompt -trustcacerts \
+ -storepass STOREPASS -keystore truststore.jks -storetype KEYSTORETYPE
+
+keytool -importkeystore -srckeystore keystore.jks -srcstorepass changeme -destkeystore identity.p12 \
+ -deststoretype PKCS12 -deststorepass password -destkeypass password
+
+# -srckeypass changeme \
+# -srcalias IntermediateCA \
+# -destalias IntermediateCA \
+
+
+openssl pkcs12 -in identity.p12 -nodes -nocerts -out private_key.pem
+openssl pkcs12 -in identity.p12 -clcerts -nokeys -out publicCert.pem
+
+keytool -export -alias IntermediateCA -file ca-chain.p12 -keystore truststore.jks
+openssl pkcs12 -in ca-chain.p12 -clcerts -nokeys -out ca-chain.pem
+
+
+openssl s_client -connect host:9094 -CAfile rootCA.PEM.crt -cert cert.pem -key key.pem
+```
+
+## see also
+
+- [[openssl]]
+- [docs.oracle.com/javase/8/docs/technotes/tools/unix/keytool](https://docs.oracle.com/javase/8/docs/technotes/tools/unix/keytool.html)
+- [dzone.com/articles/understand-java-keytool-keystore-commands](https://dzone.com/articles/understand-java-keytool-keystore-commands)
diff --git a/notes/kickstart.md b/notes/kickstart.md
new file mode 100644
index 00000000..49a6a30e
--- /dev/null
+++ b/notes/kickstart.md
@@ -0,0 +1,25 @@
+---
+tags: [linux, virtualization]
+title: kickstart
+created: '2019-07-30T06:19:49.148Z'
+modified: '2020-01-14T04:53:40.914Z'
+---
+
+# kickstart
+
+> used primarily by RHEL/centos to automatically perform unattended operating system installation and configuration
+
+## usage
+```sh
+timeout 1
+noescape 1
+totaltimeout 1
+```
+
+## see also
+- [Redย Hat Enterpriseย Linux 7 3.ย Customizing the Boot Menu - Red Hat Customer Portal](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/anaconda_customization_guide/sect-boot-menu-customization)
+- [MENU AUTOBOOT - Syslinux Wiki](http://www.syslinux.org/wiki/index.php?title=Menu#MENU_AUTOBOOT)
+- [Complete Kickstart: How to Save Time Installing Linux \| Linux Magazine](http://www.linux-mag.com/id/6747/)
+- [Kickstart Documentation โ Pykickstart 3.18 documentation](http://pykickstart.readthedocs.io/en/latest/kickstart-docs.html#chapter-1-introduction)
+- [Redย Hat Enterpriseย Linux 7 26.3.ย Kickstart Syntax Reference - Red Hat Customer Portal](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/installation_guide/sect-kickstart-syntax)
+- [Kickstart LVM Partitioning Configuration](http://landoflinux.com/linux_kickstart_partition.html)
diff --git a/notes/kill.md b/notes/kill.md
new file mode 100644
index 00000000..de0b9759
--- /dev/null
+++ b/notes/kill.md
@@ -0,0 +1,35 @@
+---
+tags: [linux]
+title: kill
+created: '2020-01-21T09:41:17.492Z'
+modified: '2023-03-22T08:01:47.102Z'
+---
+
+# kill
+
+> send signal to a only process - contrast to [[bash kill]] which also kills [[bash jobs]]
+
+## usage
+
+```sh
+/bin/kill -l # list signal-name and signal-code
+HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM URG
+STOP TSTP CONT CHLD TTIN TTOU IO XCPU XFSZ VTALRM PROF WINCH INFO USR1 USR2
+
+/bin/kill -l 15 # prints: TERM
+/bin/kill -l TERM # prints: 15
+
+/bin/kill -signal_name PID
+
+/bin/kill -signal_number PID
+```
+
+## see also
+
+- [[procps]]
+- [[bash kill]]
+- [[signal]]
+- [[pkill]]
+- [[ps]]
+- [linux.die.net/man/2/kill](https://linux.die.net/man/2/kill)
+
diff --git a/notes/kim.md b/notes/kim.md
new file mode 100644
index 00000000..2210852f
--- /dev/null
+++ b/notes/kim.md
@@ -0,0 +1,26 @@
+---
+tags: [container]
+title: kim
+created: '2021-10-15T07:34:49.791Z'
+modified: '2022-01-27T09:46:55.988Z'
+---
+
+# kim
+
+> `kubernetes image manager`
+
+## install
+
+## usage
+
+```sh
+kim --help
+```
+
+## see also
+
+- [[containerd]]
+- [[kubectl]]
+- [[k3s]]
+- [[nerdctl]]
+- [github.com/rancher/kim](https://github.com/rancher/kim)
diff --git a/notes/kind.md b/notes/kind.md
new file mode 100644
index 00000000..e8010704
--- /dev/null
+++ b/notes/kind.md
@@ -0,0 +1,36 @@
+---
+tags: [container]
+title: kind
+created: '2021-11-29T09:47:11.585Z'
+modified: '2023-03-22T10:19:58.596Z'
+---
+
+# kind
+
+> run local kubernetes clusters using [[docker]] container "nodes"
+
+## install
+
+```sh
+brew install kind
+```
+
+## usage
+
+```sh
+kind create cluster --image=kindest/node:v1.22.4 --config CONFIG.yaml
+
+kind get clusters
+
+kind delete cluster --name NAME
+
+kind load docker-image my-custom-image-0 my-custom-image-1 --name NAME # images can be loaded into your cluster nodes
+```
+
+## see also
+
+- [[k3s]]
+- [[kubectl]]
+- [[minikube]]
+- [[docker]]
+- [kind.sigs.k8s.io/](https://kind.sigs.k8s.io/)
diff --git a/notes/kops.md b/notes/kops.md
new file mode 100644
index 00000000..11fc5886
--- /dev/null
+++ b/notes/kops.md
@@ -0,0 +1,35 @@
+---
+tags: [container]
+title: kops
+created: '2021-10-15T07:28:44.092Z'
+modified: '2021-10-29T12:39:49.096Z'
+---
+
+# kops
+
+> a way to get a production grade Kubernetes cluster up and running
+
+## install
+
+`brew install kops`
+
+## usage
+
+```sh
+kops create cluster --zones=ZONE NAME
+
+kops edit cluster NAME
+
+kops update cluster NAME --yes
+
+kops validate cluster --wait 10m
+
+kops delete cluster --name
+```
+
+## see also
+
+- [[kubectl]]
+- [[gcloud]]
+- [[minikube]]
+- [kops.sigs.k8s.io](https://kops.sigs.k8s.io/)
diff --git a/notes/ksh.md b/notes/ksh.md
new file mode 100644
index 00000000..53f6590c
--- /dev/null
+++ b/notes/ksh.md
@@ -0,0 +1,31 @@
+---
+tags: [shell]
+title: ksh
+created: '2022-03-03T15:41:17.110Z'
+modified: '2023-03-22T10:04:17.277Z'
+---
+
+# ksh
+
+> korn shell
+
+## option
+
+```sh
+-c COMMAND # command string
+-i # interactive mode
+-l # login shell
+-s # shell reads commands from STDIN; all non-option arguments are positional parameters
+-r # restricted mode
+```
+
+## usage
+
+```sh
+ksh # start korn shell
+```
+
+## see also
+
+- [[bash]], [[zsh]]
+- [linux.die.net/man/1/ksh](https://linux.die.net/man/1/ksh)
diff --git a/notes/kubebuilder.md b/notes/kubebuilder.md
new file mode 100644
index 00000000..bbda9520
--- /dev/null
+++ b/notes/kubebuilder.md
@@ -0,0 +1,31 @@
+---
+tags: [container]
+title: kubebuilder
+created: '2021-10-19T09:45:28.946Z'
+modified: '2023-03-22T10:10:46.231Z'
+---
+
+# kubebuilder
+
+>
+
+## install
+
+```sh
+curl -L -o kubebuilder https://go.kubebuilder.io/dl/latest/$(go env GOOS)/$(go env GOARCH)
+chmod +x kubebuilder && mv kubebuilder /usr/local/bin/
+```
+
+## usage
+
+```sh
+kubebuilder create api --group webapp --version v1 --kind Guestbook
+```
+
+## see also
+
+- [book.kubebuilder.io](https://book.kubebuilder.io/)
+- [[operator-sdk]]
+- [[kubectl]]
+- [[kustomize]]
+- [[helm]]
diff --git a/notes/kubeconform.md b/notes/kubeconform.md
new file mode 100644
index 00000000..697a0c21
--- /dev/null
+++ b/notes/kubeconform.md
@@ -0,0 +1,32 @@
+---
+tags: [container]
+title: kubeconform
+created: '2023-04-20T07:33:37.232Z'
+modified: '2023-05-05T06:56:55.719Z'
+---
+
+# kubeconform
+
+> manifest validation tool for CI or local validation of k8s configuration
+
+## install
+
+```sh
+brew install kubeconform
+```
+
+## usage
+
+```sh
+helm template . |ย kubeconform
+
+kubeconform \
+ -kubernetes-version 3.8.0 \
+ -schema-location 'https://raw.githubusercontent.com/garethr/openshift-json-schema/master/{{ .NormalizedKubernetesVersion }}-standalone{{ .StrictSuffix }}/{{ .ResourceKind }}.json' \
+ -summary fixtures/valid.yaml
+```
+
+## see also
+
+- [[helm]]
+- [[kubectl]]
diff --git a/notes/kubectl krew.md b/notes/kubectl krew.md
new file mode 100644
index 00000000..4145341d
--- /dev/null
+++ b/notes/kubectl krew.md
@@ -0,0 +1,66 @@
+---
+tags: [container]
+title: kubectl krew
+created: '2022-06-27T06:44:31.241Z'
+modified: '2023-03-22T10:19:58.605Z'
+---
+
+# 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/)
diff --git a/notes/kubectl.md b/notes/kubectl.md
new file mode 100644
index 00000000..23003270
--- /dev/null
+++ b/notes/kubectl.md
@@ -0,0 +1,368 @@
+---
+tags: [container]
+title: kubectl
+created: '2019-07-30T06:19:49.145Z'
+modified: '2023-05-25T15:52:23.863Z'
+---
+
+# kubectl
+
+> kubectl controls the Kubernetes cluster manager
+
+## installation
+
+```sh
+brew install kubectl
+kubectl completion bash >$(brew --prefix)/etc/bash_completion.d/kubectl`
+```
+
+## environment
+
+```sh
+KUBECONFIG # alternative kube config
+KUBE_EDITOR # -
+```
+
+## option
+
+```sh
+-v
+--v=0 # generally useful for this to always be visible to a cluster operator
+--v=1 # reasonable default log level if you don't want verbosity
+--v=2 # useful steady state information about the service and important log messages that may correlate to significant changes in the system. recommended default log level for most systems
+--v=3 # extended information about changes
+--v=4 # debug level verbosity
+--v=5 # trace level verbosity
+--v=6 # display requested resources
+--v=7 # display HTTP request headers
+--v=8 # display HTTP request contents
+--v=9 # display HTTP request contents without truncation of contents
+
+-o=json # output a JSON formatted API object
+-o=yaml # output a YAML formatted API object
+-o=name # print only the resource name and nothing else
+-o=wide # output in the plain-text format with any additional information, and for pods, the node name is included
+-o=custom-columns=SPEC # Print a table using a comma separated list of custom columns
+-o=custom-columns-file=FILE # print a table using the custom columns template in the FILE file
+-o=jsonpath=TEMPLATE # print the fields defined in a jsonpath expression
+-o=jsonpath-file=FILE # print the fields defined by the jsonpath expression in the FILE file
+
+-A # all namespaces
+-n, --namespace NS # namespace scope for cli equest
+
+--as="" # Username to impersonate for the operation. User could be a regular user or a service account in a namespace.
+--as-group=[] # Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
+--as-uid="" # UID to impersonate for the operation.
+
+--certificate-authority="" # path to a cert file for the certificate authority
+--client-certificate="" # path to a client certificate file for TLS
+--client-key="" # path to a client key file for TLS
+
+--cluster CLUSTER # name of the kubeconfig cluster to use
+--context CONTEXT # name of the kubeconfig context to use
+--kubeconfig CONFIG # path to the kubeconfig file to use for CLI requests.
+-s, --server SERVER # address and port of the Kubernetes API server
+--token TOKEN # bearer token for authentication to the API server
+--user USER # name of the kubeconfig user to use
+--username USER # Username for basic authentication to the API server
+--password PASS # password for basic authentication to the API server
+
+--insecure-skip-tls-verify=false # true: don't check server's certificate for validity, makes https connections insecure
+--match-server-version=false # Require server version to match client version
+
+--profile="none" # name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex)
+--profile-output="profile.pprof" # name of the file to write the profile to
+
+--request-timeout="0" # time to wait before giving up on a single request; time unit (1s, 2m, 3h); zero means don't timeout requests
+--tls-server-name="" # server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used
+--warnings-as-errors=false # treat warnings received from the server as errors and exit with a non-zero exit code
+--version=false # print version information and quit
+```
+
+
+### imperative commands / object configuration
+
+```sh
+kubectl diff # object configuration
+kubectl apply # object configuration
+``````
+
+### declarative commands / object configuration
+
+```sh
+kubectl create # object configuration
+kubectl replace # object configuration
+kubectl delete # object configuration
+kubectl edit
+kubectl scale
+```
+
+## usage
+
+```sh
+# merge config
+KUBECONFIG="$HOME/.kube/config:file2:file3" kubectl config view --merge --flatten > ~/.kube/merged_kubeconfig \
+ && mv ~/.kube/merged_kubeconfig ~/.kube/config
+
+kubectl version -o yaml | yq e # get client and server version
+kubectl cluster-info # get addresses of the control plane and services
+kubectl api-versions # get all supported api version
+
+kubectl api-resources --sort-by=name -o wide # get all objects
+kubectl api-resources | awk '{if ( $2 ~ /^[a-z]{2,7}$/) {print $0}}' # get only aliased objects
+kubectl api-resources --namespaced=true # all namespaced resources
+kubectl api-resources --namespaced=false # all non-namespaced resources
+kubectl api-resources -o name # all resources with simple output (only the resource name)
+kubectl api-resources -o wide # all resources with expanded (aka "wide") output
+kubectl api-resources --verbs=list,get # all resources that support the "list" and "get" request verbs
+kubectl api-resources --verbs=list --namespaced -o name
+kubectl api-resources --api-group=extensions # all resources in the "extensions" API group
+
+kubectl explain po
+kubectl explain --help
+kubectl explain --api-version=apps/v1 replicaset
+kubectl explain deployment.metadata
+kubectl explain deployment.spec
+kubectl explain deployment.spec.template.spec.containers --recursive # ๐คฉ recursive: get a hierarchical view of the various fields.
+
+
+kubectl config view [--flatten|--raw]
+kubectl config current-context
+kubectl config get-contexts
+kubectl config use-context CONTEXT
+kubectl config get-clusters
+kubectl config set-context CONTEXT --user minikube --cluster minikube --namespace NAMESPACE
+kubectl config use-context CONTEXT
+
+
+kubectl api-resources # get all resource-names, alias and kinds
+
+kubectl get all # get alle resoruce of current namespace
+```
+
+## node
+
+```sh
+kubectl get nodes
+
+kubectl get node NODE_NAME -o name
+
+kubectl get node NODE_NAME -o json | jq -r '.status.capacity.memory' | numfmt --from=iec-i --to=iec # get avail memory
+
+
+kubectl get nodes --selector='!node-role.kubernetes.io/master' --no-headers -o custom-columns=":metadata.name"
+
+kubectl label node --all 'vpc.amazonaws.com/has-trunk-attached'- # remove all labels 'vpc.ama..'
+
+
+kubectl get node NODE_NAME -o yaml | yq -C e '.metadata.finalizers' - # check for finalizers
+kubectl patch NODE_NAME -p '{"metadata":{"finalizers":[]}}' --type=merge # remove finalizers
+
+kubectl drain NODE_NAME --force --ignore-daemonsets --delete-local-data
+kubectl cordon NODE_NAME
+kubectl delete node NODE_NAME
+
+
+kubectl get nodes -o go-template='{{printf "%-50s %-12s\n" "Node" "Taint"}}{{- range .items}}{{- if $taint := (index .spec "taints") }}{{- .metadata.name }}{{ "\t" }}{{- range $taint }}{{- .key }}={{ .value }}:{{ .effect }}{{ "\t" }}{{- end }}{{- "\n" }}{{- end}}{{- end}}'
+```
+
+## daemonset
+
+```sh
+kubectl rollout restart daemonset/DAEMONSET
+
+kubectl -n kube-system patch daemonset aws-node \
+ -p '{"spec": {"template": {"spec": {"nodeSelector": {"non-existing": "true"}}}}}' # "scale down" daemonset
+kubectl -n kube-system patch daemonset aws-node \
+ --type json -p='[{"op": "remove", "path": "/spec/template/spec/nodeSelector/non-existing"}]' # "scale up" daemonset
+```
+
+## pod
+
+```sh
+kubectl get po POD_NAME -o yaml
+kubectl get pod
+kubectl get pods --show-labels | awk '{print $6}' | column -s, -t
+kubectl get pods -L
+
+kubectl exec -it POD -- curl -s http://10.1.0.3 # double dash `--` signals end of command options, if not set -s would be interpreted as kubectl flag
+```
+
+## service
+
+> routes internal traffic
+
+```sh
+kubectl get svc SERVICE -o jsonpath="{.status.loadBalancer.ingress[*].hostname}"
+
+
+kubectl apply # makes incremental changes to an existing object
+STDOUT | kubectl apply -f -
+kubectl apply -f https://HOST/DEPLOYMENT.yaml
+
+kubectl create # creates a whole new object (previously non-existing / deleted)
+kubectl create -f kubia-manual.yaml
+
+kubectl create whatever --dry-run=true -o yaml | kubectl apply -f - # applying (declarative pattern) output of imperative command
+
+kubectl delete deployment DEPLOYMENT
+
+
+kubectl scale --replicas=1 kubia
+kubectl scale replicationcontroller kubia --replicas=1
+
+kubectl patch svc SERVICE -p '{"spec": {"type": "LoadBalancer"}}'
+
+
+# edit a resource from the default editor
+KUBE_EDITOR="nano" kubectl edit svc/SERVICE # use alternative editor
+kubectl edit svc/SERVICE # edit the service named 'docker-registry'
+kubectl edit job.v1.batch/myjob -o json # edit the job 'myjob' in JSON using the v1 API format
+kubectl edit deployment/mydeployment -o yaml --save-config # edit the deployment 'mydeployment' in YAML and save the modified config in its annotation
+```
+
+## ingress
+
+> manages external access to services, may provide load balancing, SSL termination and name-based virtual hosting
+
+```sh
+kubectl patch ingress INGRESS_NAME -p '{"metadata":{"finalizers":[]}}' --type=merge
+```
+
+## deployment
+
+```sh
+kubectl expose deployment DEPLOYMENT --type=NodePort
+
+kubectl rollout restart deployment/nginx
+
+kubectl rollout status deployment aws-load-balancer-controller
+
+kubectl autoscale deployment DEPLOYMENT \
+ --cpu-percent=50 `# target average CPU utilization` \
+ --min=1 `# lower limit for the number of pods that can be set by the autoscaler` \
+ --max=10 `# upper limit for the number of pods that can be set by the autoscaler`
+
+kubectl patch deployment NAME --type=json -p='[{"op": "add", "path": "/spec/template/metadata/labels/this", "value": "that"}]'
+```
+
+## run
+
+> running adhoc pod without yaml-manifest / create and run a particular image in a pod
+
+```sh
+kubectl run # same as `kubectl create deployment`
+
+kubectl run curl --image=radial/busyboxplus:curl -i --tty # then run: nslookup my-nginx
+
+kubectl run echoserver --image=gcr.io/google_containers/echoserver:1.4 --port=8080
+
+kubectl run dnsutils --image=tutum/dnsutils --generator=run-pod/v1 --command -- sleep infinity
+
+kubectl run hello-minikube --image=k8s.gcr.io/echoserver:1.4 --port=8080
+
+kubectl run POD_NAME --image=mongo:4.0 `# run pod on specific node `\
+ --overrides='{"apiVersion": "v1", "spec": {
+ "affinity": {
+ "nodeAffinity": {
+ "requiredDuringSchedulingIgnoredDuringExecution": {
+ "nodeSelectorTerms": [{
+ "matchFields": [{
+ "key": "metadata.name",
+ "operator": "In",
+ "values": ["NODE_NAME"]
+ }]
+ }]
+ }}}}}' \
+ --command -- sleep infinity
+```
+
+## events
+
+```sh
+kubectl get events --sort-by='.lastTimestamp'
+
+kubectl get events --sort-by=.metadata.creationTimestamp
+
+kubectl get events --sort-by='.metadata.creationTimestamp' \
+ -o 'go-template={{range .items}}{{.involvedObject.name}}{{"\t"}}{{.involvedObject.kind}}{{"\t"}}{{.message}}{{"\t"}}{{.reason}}{{"\t"}}{{.type}}{{"\t"}}{{.firstTimestamp}}{{"\n"}}{{end}}'
+```
+
+## label
+
+```sh
+kubectl label pods foo unhealthy=true # Update pod 'foo' with the label 'unhealthy' and the value 'true'
+kubectl label --overwrite pods foo status=unhealthy # Update pod 'foo' with the label 'status' and the value 'unhealthy', overwriting any existing value
+kubectl label pods --all status=unhealthy # Update all pods in the namespace
+kubectl label -f pod.json status=unhealthy # Update a pod identified by the type and name in "pod.json"
+kubectl label pods foo status=unhealthy --resource-version=1 # Update pod 'foo' only if the resource is unchanged from version 1
+kubectl label pods foo bar- # Update pod 'foo' by removing a label named 'bar' if it exists; Does not require the --overwrite flag
+```
+
+## logs
+
+```sh
+kubectl logs POD
+
+kubectl logs POD -c CONTAINER
+
+kubectl logs INGRESS_CONTROLLER -c controller \
+ | jq -r '. | select(.nginx.status != "200") | .nginx | "\(.status): \(.remote_addr) \(.request) \(.proxy_upstream_name)"'
+```
+
+## port-forward
+
+> forward one or more local ports to a pod (requires node to have `socat` installed)
+
+```sh
+kubectl port-forward pod/mypod 5000 6000 # listen on ports 5000 and 6000 locally, forwarding data to/from ports 5000 and 6000 in the pod
+kubectl port-forward deployment/mydeployment 5000 6000 # listen on ports 5000 and 6000 locally, forwarding data to/from ports 5000 and 6000 in a pod selected by the deployment
+kubectl port-forward service/myservice 8443:https # listen on port 8443 locally, forwarding to the targetPort of the service's port named "https" in a pod selected by the service
+
+kubectl port-forward pod/mypod 8888:5000 # listen on port 8888 locally, forwarding to 5000 in the pod
+kubectl port-forward kubia-manual 8888:8080
+kubectl port-forward pod/mypod :5000 # listen on a random port locally, forwarding to 5000 in the pod
+
+kubectl port-forward --address 0.0.0.0 pod/mypod 8888:5000 # listen on port 8888 on all addresses, forwarding to 5000 in the pod
+kubectl port-forward --address localhost,10.19.21.23 pod/mypod 8888:5000 # listen on port 8888 on localhost and selected IP, forwarding to 5000 in the pod
+```
+
+## secrets
+
+```sh
+kubectl get secrets --field-selector type=kubernetes.io/tls # list only certificate secrets
+
+kubectl get secrets SECRET -o json | jq -r '.data | to_entries[] | "\(.key): \(.value | @base64d)"'; # print secrets base64-decoded
+```
+
+## krew plugins
+
+```sh
+# failed to retrieve plugin indexes: failed to list the remote URL for index default
+unset GIT_CONFIG
+
+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
+```
+
+[krew.sigs.k8s.io/docs/user-guide/quickstart/](https://krew.sigs.k8s.io/docs/user-guide/quickstart/)
+
+## see also
+
+- [[kubernetes]], [[oc]]
+- [[helm]], [[kustomize]]
+- [[cmctl]], [[nerdctl]]
+- [[bazel]]
+- [[kubectx]], [[kubens]], [[kubeseal]], [[kubeval]]
+- [[kim]], [[opa]]
+- [[aws]], [[eksctl]], [[kops]]
+- [[minikube]], [[k3s]], [[k3d]], [[k0s]], [[k9s]]
+- [[yml]], [[jsonpath]], [[go-template]]
+- [[socat]]
+- [kubernetes.io/docs/reference/kubectl](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands)
+- [stackoverflow.com/questions/47369351/kubectl-apply-vs-kubectl-create](https://stackoverflow.com/questions/47369351/kubectl-apply-vs-kubectl-create)
diff --git a/notes/kubectx.md b/notes/kubectx.md
new file mode 100644
index 00000000..7eba98e9
--- /dev/null
+++ b/notes/kubectx.md
@@ -0,0 +1,47 @@
+---
+tags: [container]
+title: kubectx
+created: '2020-10-09T09:19:33.429Z'
+modified: '2023-04-11T20:19:07.330Z'
+---
+
+# kubectx
+
+> switch between clusters
+
+## install
+
+```sh
+brew install derailed/k9s/k9s
+```
+
+## option
+
+```sh
+-c, --current # show the current context name
+-d NAME # delete context NAME ('.' for current-context)
+-u, --unset # unset the current context
+-h, --help # show this message
+```
+
+## usage
+
+```sh
+kubectx # list the contexts
+
+kubectx NEW_NAME=NAME # rename context NAME to NEW_NAME
+
+kubectx NEW_NAME=. # rename current-context to NEW_NAME, won't delete the user/cluster entry that is used by the context
+
+kubectx -c # show current context
+
+kubectx NAME # switch to context NAME
+
+kubectx - # switch to the previous context
+```
+
+## see also
+
+- [[kubectl]]
+- [[kubens]]
+- [[k9s]]
diff --git a/notes/kubens.md b/notes/kubens.md
new file mode 100644
index 00000000..723c2337
--- /dev/null
+++ b/notes/kubens.md
@@ -0,0 +1,39 @@
+---
+tags: [container]
+title: kubens
+created: '2020-10-12T10:37:20.976Z'
+modified: '2023-04-11T20:19:40.337Z'
+---
+
+# kubens
+
+> switch between kubernetes namespaces
+
+## install
+
+```sh
+brew install derailed/k9s/k9s
+```
+
+## option
+
+```sh
+-c, --current # show the current namespace
+-h, --help # show this message
+```
+
+## usage
+
+```sh
+kubens # list the namespaces in the current context
+
+kubens NAME # change the active namespace of current context
+
+kubens - # switch to the previous namespace in this context
+```
+
+## see also
+
+- [[kubectl]]
+- [[kubectx]]
+- [[k9s]]
diff --git a/notes/kubernetes rbac.md b/notes/kubernetes rbac.md
new file mode 100644
index 00000000..00937bfe
--- /dev/null
+++ b/notes/kubernetes rbac.md
@@ -0,0 +1,39 @@
+---
+tags: [container]
+title: kubernetes rbac
+created: '2022-03-23T21:22:09.880Z'
+modified: '2023-03-22T10:19:58.621Z'
+---
+
+# kubernetes rbac
+
+> `role base access controll` - defines user privileges in cluster
+
+maps http-vers to permissions -> POST to CREATE
+
+ROLE -> What
+ROLEBINDING -> WHO
+
+ROLE,ROLEBINDING -> namespace wide
+CLUSTERROLE,CLUSTEROLEBINDING -> cluster wide
+
+
+default ClusterRoles
+
+cluster-admin: Cluster-wide superuser
+admin: Full access within a Namespace
+edit: Read/write within a Namespace
+view: Read-only within a Namespace
+
+
+rbac.authorization.k8s.io
+
+
+## see also
+
+- [anaisurl.com/kubernetes-rbac/](https://anaisurl.com/kubernetes-rbac/)
+- [medium.com/devops-mojo/kubernetes-role-based-access-control-rbac-overview-introduction-rbac-with-kubernetes-what-is-2004d13195df](https://medium.com/devops-mojo/kubernetes-role-based-access-control-rbac-overview-introduction-rbac-with-kubernetes-what-is-2004d13195df)
+- [sysdig.com/learn-cloud-native/kubernetes-security/kubernetes-rbac/](https://sysdig.com/learn-cloud-native/kubernetes-security/kubernetes-rbac/)
+- [blog.aquasec.com/kubernetes-verbs](https://blog.aquasec.com/kubernetes-verbs)
+- [kubernetes.io/docs/reference/access-authn-authz/rbac/](https://kubernetes.io/docs/reference/access-authn-authz/rbac/)
+
diff --git a/notes/kubernetes.md b/notes/kubernetes.md
new file mode 100644
index 00000000..a1942dde
--- /dev/null
+++ b/notes/kubernetes.md
@@ -0,0 +1,52 @@
+---
+tags: [container]
+title: kubernetes
+created: '2019-08-28T08:08:25.156Z'
+modified: '2023-03-22T10:19:58.613Z'
+---
+
+# kubernetes
+
+> `k8s` = kuberntes (`k` + `numbers of letters to` + `s` )
+> `i18n` = internationalization
+> `l10n` = localization
+
+
+- `"broken by design"` => "memorize IP ? you crazy ?"
+- all containers in pod have same loopback device
+- all containers in pod have same IP !!!
+- not imperative but declarative
+- resource oriented
+
+## pattern -> repeatable solution
+- structure: Problem-Name then solution
+- predictable demands
+ - dependencies:
+ - runtime (persist volumes)
+ - resource profiles (CPU and Net)
+ - QOS-Classes (requests & Limits)
+ - Best effort no r or L
+ - burstable r < L
+ - Guaranteed r == L
+- declarative deplyoment
+ - deployment object holds (pods, replicaset, deploy-config)
+- structural pattersn
+ - "initalizer" how to init container ?
+ - "sidecar" external functionality ? without changin container/pod
+ - "ambassador"/"Proxy" decouple acces to outside world ?
+- config patterns
+ - configure different environments
+ - "EnvVars" 12 Factor Apps (-) only during startup
+ - "config-resource"
+ - "config template"
+ - "immutable config"
+ - everything into container
+ - "flexvol-docker/not k8s" shared volumes
+
+
+## see also
+
+- [[kubernetes rbac]]
+- [[devops]]
+- [[minikube]]
+- [ro14nd-talks/kubernetes-patterns](https://github.com/ro14nd-talks/kubernetes-patterns)
diff --git a/notes/kubeseal.md b/notes/kubeseal.md
new file mode 100644
index 00000000..0130704f
--- /dev/null
+++ b/notes/kubeseal.md
@@ -0,0 +1,29 @@
+---
+tags: [container]
+title: kubeseal
+created: '2020-11-05T12:49:58.867Z'
+modified: '2021-10-29T12:39:49.027Z'
+---
+
+# kubeseal
+
+> `SealedSecrets` are composed of a cluster-side controller / operator and a client-side utility: `kubeseal`
+> `kubeseal` utility uses asymmetric crypto to encrypt secrets that only the controller can decrypt
+
+
+## install
+
+`brew install kuebseal`
+
+## usage
+
+```sh
+kubeseal
+```
+
+## see also
+
+- [[kubectl]]
+- [[kustomize]]
+- [github.com/bitnami-labs/sealed-secrets](https://github.com/bitnami-labs/sealed-secrets)
+- [[openssl]]
diff --git a/notes/kubeval.md b/notes/kubeval.md
new file mode 100644
index 00000000..a7a76df5
--- /dev/null
+++ b/notes/kubeval.md
@@ -0,0 +1,40 @@
+---
+tags: [container]
+title: kubeval
+created: '2021-03-18T09:10:51.860Z'
+modified: '2023-03-25T12:46:10.678Z'
+---
+
+# kubeval
+
+> validate one or more Kubernetes configuration files
+
+## install
+
+```sh
+brew tap instrumenta/instrumenta && brew install kubeval
+```
+
+## option
+
+```sh
+--output=stdout # Plaintext
+--output=json # JSON
+--output=tap # TAP
+```
+
+## usage
+
+```sh
+kubeval FILE.yaml
+
+cat FILE.yaml | kubeval # using stdin
+cat FILE.yaml | kubeval --filename="FILE.yaml" # make the output of pipelines more readable
+
+kubeval --strict FILE.yaml # simulates kubectl throwing error for k8s-api allows for specifying properties on objects that are not part of the schemas
+```
+
+## see also
+
+- [[kubectl]]
+- [[kustomize]]
diff --git a/notes/kustomize.md b/notes/kustomize.md
new file mode 100644
index 00000000..9f79d7c8
--- /dev/null
+++ b/notes/kustomize.md
@@ -0,0 +1,75 @@
+---
+tags: [container]
+title: kustomize
+created: '2020-10-12T10:34:55.454Z'
+modified: '2022-01-25T13:09:34.459Z'
+---
+
+# kustomize
+
+> customizing k8s resource configuration without templates and DSLs
+> tool supporting template-free, structured customization of declarative configuration targeted to k8s-style objects.
+
+## install
+
+```sh
+brew install kustomize
+
+curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
+sudo mv kustomize /usr/local/bin/kustomize
+```
+
+## usage
+
+```sh
+kustomize install-completion # shell completion.
+
+kustomize build PATH # print configuration per contents of kustomization.yaml
+
+kustomize build . | kubectl apply -f - # apply config zu k8s, same as `kubectl apply -k`
+
+
+
+
+kustomize cfg # Commands for reading and writing configuration.
+
+kustomize create # Create a new kustomization in the current directory
+
+kustomize edit # Edits a kustomization file
+
+kustomize fn # Commands for running functions against configuration.
+```
+
+## api reference
+
+```sh
+# kustomization.yaml
+bases # deprecated
+commonAnnotations
+commonLabels
+components
+configMapGenerator
+crds
+generatorOptions
+images
+namePrefix
+namespace
+nameSuffix
+patches # directive is newer, accepts more elements (annotation selector and label selector).
+ # In addition, namespace and name can be regexes.
+ # The target for patches can match more than one resource, all of which will be patched.
+patchesJson6902 # older keyword which can only match one resource via target (no wildcards), and accepts only Gvk, namespace, and name.
+patchesStrategicMerge
+replicas
+resources
+secretGenerator
+vars
+```
+
+## see also
+
+- [[kubectl]]
+- [[helm]]
+- [[jsonnet]]
+- [kubernetes-sigs.github.io/kustomize/](https://kubernetes-sigs.github.io/kustomize/)
+
diff --git a/notes/lang - datatypes.md b/notes/lang - datatypes.md
deleted file mode 100644
index 3bc94566..00000000
--- a/notes/lang - datatypes.md
+++ /dev/null
@@ -1,37 +0,0 @@
----
-tags: [lang]
-title: lang - datatypes
-created: '2019-07-30T06:19:49.149Z'
-modified: '2019-07-30T06:31:01.906Z'
----
-
-# lang - datatypes
-
-## Bash
-
-string, (int), array
-
-## PHP
-
-8 primitives types
- 4 scalar: boolean, integer, float, string
- 2 compound: array, object
- 2 special: resource, NULL
- pseudo-types: mixed, number, callback, array|oject, void)
-
-## JavaScript/ECMAScript
-
-7 data types
- 6 primitive
- boolean
- null
- undefined
- number
- string
- symbol (ECMA6)
- object
-
-
-## JAVA
-
- 8 primitive types: byte, short, int, long, char, float, double, boolean
diff --git a/notes/lang - erlang.md b/notes/lang - erlang.md
deleted file mode 100644
index 863bf0ac..00000000
--- a/notes/lang - erlang.md
+++ /dev/null
@@ -1,34 +0,0 @@
----
-tags: [lang]
-title: lang - erlang
-created: '2019-07-30T06:19:49.150Z'
-modified: '2019-07-30T06:31:01.907Z'
----
-
-# lang - erlang
-
-> `Erlang is based originally on Prolog, a logic programming language`
-
-> the shell evaluates expressions
-> function definitions are not expressions they are forms
-> erl-file defnies forms not expressions
-> [defining-erlang-functions-in-the-shell](https://stackoverflow.com/questions/2065990/defining-erlang-functions-in-the-shell)
-
-> Erlang has two levels of grammar: forms and expressions.
-> Erlang shell is line-oriented and expression-oriented
-> http://ulf.wiger.net/weblog/2007/11/20/extending-the-erlang-shell-part-1/
-
-
-## shell internal commands
-
-```erlang
-help().
-
-f(). -- forget all variable bindings
-
-```
-
-```erlang
-Foo = 123. # Variable always start with uppercase
-```
-
diff --git a/notes/lang - perl.md b/notes/lang - perl.md
deleted file mode 100644
index 154763c2..00000000
--- a/notes/lang - perl.md
+++ /dev/null
@@ -1,12 +0,0 @@
----
-tags: [lang]
-title: lang - perl
-created: '2019-07-30T06:19:49.150Z'
-modified: '2019-07-30T06:31:01.898Z'
----
-
-# lang - perl
-
-```perl
-perl -de1
-```
diff --git a/notes/last.md b/notes/last.md
new file mode 100644
index 00000000..8415cae4
--- /dev/null
+++ b/notes/last.md
@@ -0,0 +1,25 @@
+---
+tags: [linux]
+title: last
+created: '2019-12-21T17:03:56.861Z'
+modified: '2021-05-25T12:03:28.858Z'
+---
+
+# last
+
+> indicate last logins of users and ttys
+
+## usage
+```sh
+last
+
+last USER
+
+last -a # move ip to the far right
+
+
+last -f FILE # read different file as default: /var/log/wtmp
+```
+
+## see also
+- [[ssh]]
diff --git a/notes/launchctl.md b/notes/launchctl.md
new file mode 100644
index 00000000..f239e47e
--- /dev/null
+++ b/notes/launchctl.md
@@ -0,0 +1,30 @@
+---
+tags: [initsystem, macos]
+title: launchctl
+created: '2019-09-04T14:00:13.320Z'
+modified: '2022-02-04T08:25:05.512Z'
+---
+
+# launchctl
+
+> Interfaces with launchd
+
+## usage
+
+```sh
+launchctl load ~/Library/LaunchAgents/com.demo.daemon.plist
+
+launchctl unload ~/Library/LaunchAgents/com.demo.daemon.plist
+
+launchctl list
+launchctl list homebrew.mxcl.mongodb@3.0
+
+launchctl start
+
+launchctl stop
+```
+
+## see also
+
+- [[systemctl]]
+- [[launchd]]
diff --git a/notes/launchd.md b/notes/launchd.md
new file mode 100644
index 00000000..5409e383
--- /dev/null
+++ b/notes/launchd.md
@@ -0,0 +1,16 @@
+---
+tags: [initsystem, linux, macos]
+title: launchd
+created: '2019-08-21T06:37:19.782Z'
+modified: '2020-02-04T12:21:27.449Z'
+---
+
+# launchd
+
+> service management framework for starting, stopping and managing daemons, applications, processes, and scripts. Introduced with Mac OS X Tiger and is licensed under the Apache License.
+
+
+## see also
+- [[launchctl]]
+- [[systemd]]
+- [launchd.info](https://www.launchd.info/)
diff --git a/notes/ld.md b/notes/ld.md
new file mode 100644
index 00000000..3d49dec7
--- /dev/null
+++ b/notes/ld.md
@@ -0,0 +1,37 @@
+---
+tags: [c]
+title: ld
+created: '2020-04-24T08:59:03.868Z'
+modified: '2023-05-09T07:00:49.120Z'
+---
+
+# ld
+
+> gmi linker - combines object and archive files, relocates their data and ties up symbol references. Usually the last step in compiling a program
+
+## option
+
+```sh
+
+```
+
+## usage
+
+```sh
+ld main.o -lc # tell the linker to include `libc`
+
+# produce a file OUTPUT as the result of linking `/lib/crt0.o` with `hello.o` and the library `libc.a`, which will come from the standard search directories.
+ld -o OUTPUT /lib/crt0.o hello.o -lc
+
+ld -macosx_version_min $(MACOS_VERSION) -o FILE FILE.o \
+ -lSystem -syslibroot $(xcrun -sdk macosx --show-sdk-path) -e _start -arch arm64
+```
+
+## see also
+
+- [[as]]
+- [[make]]
+- [[xcrun]]
+- [[ldd]]
+- [[gcc]]
+- [linux.die.net/man/1/ld](https://linux.die.net/man/1/ld)
diff --git a/notes/ldapsearch.md b/notes/ldapsearch.md
new file mode 100644
index 00000000..3b963a61
--- /dev/null
+++ b/notes/ldapsearch.md
@@ -0,0 +1,79 @@
+---
+tags: [linux]
+title: ldapsearch
+created: '2019-07-30T06:19:49.153Z'
+modified: '2023-03-16T09:12:00.678Z'
+---
+
+# ldapsearch
+
+> `Lightweight Directory Access Protocol`
+
+user authentication
+
+This integration works with most LDAP-compliant directory servers, including:
+
+- Microsoft Active Directory
+- Apple Open Directory
+- Open LDAP
+- 389 Server
+
+## install
+
+```sh
+apt-get install ldap-utils
+```
+
+## env
+
+```sh
+LDAPTLS_REQCERT
+```
+
+## option
+
+```sh
+-d LEVEL # useful for debugging ldapmodify and ldapadd: 1=Trace, 2=Packets, 4=Arguments, 32=Filters, 128=ACL
+```
+
+## usage
+
+```sh
+ldapsearch \
+ -h HOST \
+ -p 389 \
+ -w "PASSWORD" \
+ -D "CN=Service LDAP-User,CN=Users,DC=foo,DC=bar,DC=baz" \
+ -b "CN=foo,DC=bar,DC=baz,DC=us" \
+ -s sub \
+ "(objectclass=*)"
+
+LDAPTLS_REQCERT=never ldapsearch \ `# don't verify certificate !`
+ -H ldaps://HOST:636 \
+ -w "PASSWORD" \
+ -D "CN=Service LDAP-User,CN=Users,DC=foo,DC=bar,DC=baz"\
+ -b "CN=foo,DC=bar,DC=baz,DC=us" \
+ -s sub \
+ -Z \
+ "(objectclass=*)"
+```
+
+## queries
+
+```
+"(objectclass=*)"
+"(&(objectclass=user)(samaccountname=user))"
+"(&(objectclass=user)(sn=user))"
+"(&(objectClass=group)(|(cn=GROUP)))"
+"(&(memberof=cn=GROUP,ou=OU,dc=DC,dc=DC,dc=US))"
+"(&(objectClass=group)(&(cn=GROUP)(cn=GROUP)))"
+"(&(objectCategory=person)(|(objectClass=user)))"
+```
+
+## see also
+
+
+- [[gitlab-ctl]]
+- [[gitlab-rails]]
+- [[apt-get]]
+- [ldapsearch (man pages section 1: User Commands)](https://docs.oracle.com/cd/E19455-01/806-0624/6j9vek58u/index.html)
diff --git a/notes/ldd.md b/notes/ldd.md
new file mode 100644
index 00000000..875d22d2
--- /dev/null
+++ b/notes/ldd.md
@@ -0,0 +1,27 @@
+---
+tags: [c]
+title: ldd
+created: '2020-02-21T08:19:15.513Z'
+modified: '2023-03-25T12:40:27.602Z'
+---
+
+# ldd
+
+> print shared library dependencies
+
+## usage
+
+```sh
+ldd file # prints libraries program needs
+
+ldd a.out
+# linux-vdso.so.1 (0x00007ffe97fc9000)
+# libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f18638a7000)
+# /lib64/ld-linux-x86-64.so.2 (0x00007f1863a74000)
+```
+
+## see also
+
+- [[ld]]
+- [[gcc]]
+- [[nm]]
diff --git a/notes/less.md b/notes/less.md
new file mode 100644
index 00000000..dce6303e
--- /dev/null
+++ b/notes/less.md
@@ -0,0 +1,49 @@
+---
+tags: [linux, macos]
+title: less
+created: '2022-05-17T19:16:57.688Z'
+modified: '2023-05-19T11:25:17.456Z'
+---
+
+# less
+
+> opposite of [[more]]
+
+## env
+
+```sh
+COLUMNS # setsnumber of columns on the screen
+EDITOR # name of the editor (used for the v command)
+HOME # Name of the user's home directory (used to find a lesskey file on Unix and OS/2 systems)
+INIT # Name of the user's init directory (used to find a lesskey file on OS/2 systems)
+LANG # Language for determining the character set.
+LC_CTYPE # Language for determining the character set.
+LESS # Options which are passed to less automatically.
+LESSSECURE # set to 1, less runs in a "secure" mode, disables features
+LESS_IS_MORE # set to 1, less behaves (mostly) in conformance with the POSIX "more" command specification
+```
+
+## option
+
+```sh
+-s, --squeeze-blank-lines # causes consecutive blank lines to be squeezed into a single blank line
+-r, --raw-control-chars # causes "raw" control characters to be displayed
+-R, --RAW-CONTROL-CHARS # like -r, but only ANSI "color" escape sequences and OSC 8 hyperlink sequences are output in "raw" form
+```
+
+## usage
+
+```sh
+less FILE
+
+less -sR # see man, if color support is enabled
+```
+
+## see also
+
+- [[ascii]]
+- [[man]]
+- [[cat]]
+- [[vim]]
+- [[more]]
+- [[jless]]
diff --git a/notes/libc.md b/notes/libc.md
new file mode 100644
index 00000000..01273c6e
--- /dev/null
+++ b/notes/libc.md
@@ -0,0 +1,210 @@
+---
+tags: [c, Notebooks]
+title: libc
+created: '2023-05-08T13:01:19.322Z'
+modified: '2023-05-09T11:23:57.040Z'
+---
+
+# libc
+
+> c standard library - provides macros, type definitions and functions for tasks as string handling, math, i/o, memory management and os services
+
+## usage
+
+```c
+assert.h // assert macro, used to assist with detecting logical errors and other types of bugs in debugging versions of a program
+complex.h // C99 set of functions for manipulating complex numbers
+ctype.h // set of functions used to classify characters by their types or to convert between upper and lower case in a way that is independent of the used character set
+errno.h // testing error codes reported by library functions
+fenv.h // C99 set of functions for controlling floating-point environment
+float.h // macro constants specifying the implementation-specific properties of the floating-point library.
+inttypes.h // C99 exact-width integer types
+iso646.h // NA1 several macros that implement alternative ways to express several standard tokens. For programming in ISO 646 variant character sets
+limits.h // macro constants specifying the implementation-specific properties of the integer types.
+locale.h // localization functions
+math.h // common mathematical functions.
+setjmp.h // macros setjmp and longjmp, which are used for non-local exits
+signal.h // signal-handling functions
+stdalign.h // C11 querying and specifying the alignment of objects
+stdarg.h // accessing a varying number of arguments passed to functions
+stdatomic.h // C11 atomic operations on data shared between threads
+stdbool.h // C99 a boolean data type
+stddef.h // several useful types and macros
+stdint.h // C99 exact-width integer types
+stdio.h // core input and output functions
+stdlib.h // numeric conversion functions, pseudo-random numbers generation functions, memory allocation, process control functions
+stdnoreturn.h // C11 For specifying non-returning functions
+string.h // string-handling functions
+tgmath.h // C99 type-generic mathematical functions
+threads.h // C11 functions for managing multiple threads, mutexes and condition variables
+time.h // date- and time-handling functions
+uchar.h // C11 Types and functions for manipulating Unicode characters
+wchar.h // NA1 wide-string-handling functions
+wctype.h // NA1 set of functions used to classify wide characters by their types or to convert between upper and lower case
+
+// Normative Addendum 1 (NA1)
+```
+
+```sh
+man stdio
+```
+
+## stdlib.h
+
+```c
+size_t // unsigned integral type and is the result of the sizeof keyword
+wchar_t // an integer type of the size of a wide character constant
+div_t // structure returned by the div function
+ldiv_t // structure returned by the ldiv function
+
+NULL // macro is the value of a null pointer constant
+EXIT_FAILURE // is the value for the exit function to return in case of failure
+EXIT_SUCCESS // is the value for the exit function to return in case of success
+RAND_MAX // macro is the maximum value returned by the rand function
+MB_CUR_MAX // macro is the maximum number of bytes in a multi-byte character set which cannot be larger than MB_LEN_MAX
+
+void *calloc (size_t nitems, size_t size) // allocates requested memory and returns a pointer to it
+void free (void *ptr) // deallocates memory previously allocated by a call to calloc, malloc, or realloc
+void *malloc (size_t size) // allocates the requested memory and returns a pointer to it
+void *realloc(void *ptr, size_t size) // attempts to resize the memory block pointed to by ptr that was previously allocated with a call to malloc or calloc
+
+void abort (void) // causes an abnormal program termination
+void exit (int status) // causes the program to terminate normally
+void *bsearch(const void *key, const void *base, size_t nitems, size_t size, int (*compar)(const void *, const void *)) // performs a binary search
+void qsort (void *base, size_t nitems, size_t size, int (*compar)(const void *, const void*)) // Sorts an array
+void srand (unsigned int seed) // This function seeds the random number generator used by the function rand
+
+int atoi (const char *str) // Converts the string pointed to, by the argument str to an integer (type int)
+int atexit(void (*func)(void)) // causes the specified function func to be called when the program terminates normally
+int system(const char *string) // The command specified by string is passed to the host environment to be executed by the command processor
+int abs (int x) // Returns the absolute value of x
+int rand (void) // Returns a pseudo-random number in the range of 0 to RAND_MAX
+int mblen (const char *str, size_t n) // Returns the length of a multibyte character pointed to by the argument str
+int mbtowc(whcar_t *pwc, const char *str, size_t n) // Examines the multibyte character pointed to by the argument str
+int wctomb(char *str, wchar_t wchar) // Examines the code which corresponds to a multibyte character given by the argument wchar
+
+long int atol(const char *str) // Converts the string pointed to, by the argument str to a long integer (type long int)
+long int strtol(const char *str, char **endptr, int base) // Converts the string pointed to, by the argument str to a long integer (type long int)
+long int labs(long int x) // Returns the absolute value of x
+
+unsigned long int strtoul(const char *str, char **endptr, int base) // Converts the string pointed to, by the argument str to an unsigned long integer (type unsigned long int)
+
+double atof(const char *str) // Converts the string pointed to, by the argument str to a floating-point number (type double)
+double strtod(const char *str, char **endptr) // Converts the string pointed to, by the argument str to a floating-point number (type double)
+
+char *getenv(const char *name) // Searches for the environment string pointed to by name and returns the associated value to the string
+
+div_t div(int numer, int denom) // Divides numer (numerator) by denom (denominator)
+
+ldiv_t ldiv(long int numer, long int denom) // Divides numer (numerator) by denom (denominator)
+
+size_t mbstowcs(schar_t *pwcs, const char *str, size_t n) // Converts the string of multibyte characters pointed to by the argument str to the array pointed to by pwcs
+size_t wcstombs(char *str, const wchar_t *pwcs, size_t n) // Converts the codes stored in the array pwcs to multibyte characters and stores them in the string str
+```
+
+## stdlib.h
+
+```c
+size_t // unsigned integral type and is the result of the sizeof keyword
+FILE // object type suitable for storing information for a file stream
+fpos_t // object type suitable for storing any position in a file
+
+NULL // macro is the value of a null pointer constant
+_IOFBF, _IOLBF and _IONBF // macros which expand to integral constant expressions with distinct values and suitable for the use as third argument to the setvbuf function
+BUFSIZ // macro is an integer, which represents the size of the buffer used by the setbuf function
+EOF // macro is a negative integer, which indicates that the end-of-file has been reached
+FOPEN_MAX // macro is an integer, which represents the maximum number of files that the system can guarantee to be opened simultaneously
+FILENAME_MAX // macro is an integer, which represents the longest length of a char array suitable for holding the longest possible filename
+L_tmpnam // macro is an integer, which represents the longest length of a char array suitable for holding the longest possible temporary filename created by the tmpnam function
+SEEK_CUR, SEEK_END, and SEEK_SET // macros are used in the fseek function to locate different positions in a file
+TMP_MAX // macro is the maximum number of unique filenames that the function tmpnam can generate
+stderr, stdin, and stdout // macros are pointers to FILE types which correspond to the standard error, standard input, and standard output streams
+
+void clearerr(FILE *stream) // clears end-of-file and error indicators for the given stream
+void rewind (FILE *stream) // sets file position to the beginning of the file of the given stream
+void setbuf (FILE *stream, char *buffer) // defines how a stream should be buffered
+void perror (const char *str) // prints a descriptive error message to stderr. First the string str is printed followed by a colon and then a space
+
+int fclose(FILE *stream) // Closes the stream. All buffers are flushed
+int feof(FILE *stream) // Tests the end-of-file indicator for the given stream
+int ferror(FILE *stream) // Tests the error indicator for the given stream
+int fflush(FILE *stream) // Flushes the output buffer of a stream
+int fgetpos(FILE *stream, fpos_t *pos) // Gets the current file position of the stream and writes it to pos
+int fseek(FILE *stream, long int offset, int whence) // Sets the file position of the stream to the given offset. The argument offset signifies the number of bytes to seek from the given whence position
+int fsetpos(FILE *stream, const fpos_t *pos) // Sets the file position of the given stream to the given position. The argument pos is a position given by the function fgetpos
+int remove(const char *filename) // Deletes the given filename so that it is no longer accessible
+int rename(const char *old_filename, const char *new_filename) // Causes the filename referred to, by old_filename to be changed to new_filename
+int setvbuf(FILE *stream, char *buffer, int mode, size_t size) // Another function to define how a stream should be buffered
+int fprintf(FILE *stream, const char *format, ...) // sends formatted output to a stream
+int printf(const char *format, ...) // sends formatted output to stdout
+int sprintf(char *str, const char *format, ...) // sends formatted output to a string
+
+int vfprintf(FILE *stream, const char *format, va_list arg) // sends formatted output to a stream using an argument list
+int vprintf(const char *format, va_list arg) // sends formatted output to stdout using an argument list
+int vsprintf(char *str, const char *format, va_list arg) // sends formatted output to a string using an argument list
+
+int fscanf(FILE *stream, const char *format, ...) // reads formatted input from a stream
+int scanf(const char *format, ...) // reads formatted input from stdin
+int sscanf(const char *str, const char *format, ...) // reads formatted input from a string
+int fgetc(FILE *stream) // Gets the next character (an unsigned char) from the specified stream and advances the position indicator for the stream
+int fputc(int char, FILE *stream) // Writes a character (an unsigned char) specified by the argument char to the specified stream and advances the position indicator for the stream
+int fputs(const char *str, FILE *stream) // Writes a string to the specified stream up to but not including the null character
+int getc(FILE *stream) // Gets the next character (an unsigned char) from the specified stream and advances the position indicator for the stream
+int getchar(void) // Gets a character (an unsigned char) from stdin
+int putc(int char, FILE *stream) // Writes a character (an unsigned char) specified by the argument char to the specified stream and advances the position indicator for the stream
+int putchar(int char) // Writes a character (an unsigned char) specified by the argument char to stdout
+int puts(const char *str) // Writes a string to stdout up to but not including the null character. A newline character is appended to the output
+int ungetc(int char, FILE *stream) // Pushes the character char (an unsigned char) onto the specified stream so that the next character is read
+
+long int ftell(FILE *stream) // Returns the current file position of the given stream
+
+char *fgets(char *str, int n, FILE *stream) // reads a line from the specified stream and stores it into the string pointed to by str. stops when either (n-1) characters are read, the newline character is read, or the end-of-file is reached
+char *gets(char *str) // reads a line from stdin and stores it into the string pointed to by, str. stops when either the newline character is read or when the end-of-file is reached, whichever comes first
+char *tmpnam(char *str) // Generates and returns a valid temporary filename which does not exist
+
+FILE *fopen (const char *filename, const char *mode) // Opens the filename pointed to by filename using the given mode
+FILE *freopen(const char *filename, const char *mode, FILE *stream) // Associates a new filename with the given open stream and same time closing the old file in stream
+FILE *tmpfile(void) // Creates a temporary file in binary update mode (wb+)
+
+size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream) // reads data from the given stream into the array pointed to by ptr
+size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) // Writes data from the array pointed to by ptr to the given stream
+```
+
+## string.h
+
+```c
+size_t // unsigned integral type and is the result of the sizeof keyword
+NULL // macro is the value of a null pointer constant
+
+void *memchr (const void *str, int c, size_t n) // searches for the first occurrence of the character c (an unsigned char) in the first n bytes of the string pointed to, by the argument str
+void *memcpy (void *dest, const void *src, size_t n) // copies n characters from src to dest
+void *memmove(void *dest, const void *src, size_t n) // another function to copy n characters from str2 to str1
+void *memset (void *str, int c, size_t n) // Copies the character c (an unsigned char) to the first n characters of the string pointed to, by the argument str
+
+int memcmp (const void *str1, const void *str2, size_t n) // compares first n bytes of str1 and str2
+int strcmp (const char *str1, const char *str2) // compares string pointed to, by str1 to the string pointed to by str2
+int strncmp(const char *str1, const char *str2, size_t n) // compares at most the first n bytes of str1 and str2
+int strcoll(const char *str1, const char *str2) // compares string str1 to str2. The result is dependent on the LC_COLLATE setting of the location
+
+char *strcat (char *dest, const char *src) // appends string pointed to, by src to the end of the string pointed to by dest
+char *strncat (char *dest, const char *src, size_t n) // appends string pointed to, by src to the end of the string pointed to, by dest up to n characters long
+char *strchr (const char *str, int c) // searches for the first occurrence of the character c (an unsigned char) in the string pointed to, by the argument str
+char *strcpy (char *dest, const char *src) // copies the string pointed to, by src to dest
+char *strncpy (char *dest, const char *src, size_t n) // copies up to n characters from the string pointed to, by src to dest
+char *strerror(int errnum) // searches an internal array for the error number errnum and returns a pointer to an error message string
+char *strpbrk (const char *str1, const char *str2) // finds the first character in the string str1 that matches any character specified in str2
+char *strrchr (const char *str, int c) // searches for the last occurrence of the character c (an unsigned char) in the string pointed to by the argument str
+char *strstr (const char *haystack, const char *needle) // finds the first occurrence of the entire string needle (not including the terminating null character) which appears in the string haystack
+char *strtok (char *str, const char *delim) // breaks string str into a series of tokens separated by delim
+
+size_t strcspn (const char *str1, const char *str2) // calculates the length of the initial segment of str1 which consists entirely of characters not in str2
+size_t strlen (const char *str) // length of string str up to but not including the terminating null character
+size_t strspn (const char *str1, const char *str2) // calculates length of the initial segment of str1 which consists entirely of characters in str2
+size_t strxfrm (char *dest, const char *src, size_t n) // transforms the first n characters of the string src into current locale and places them in the string dest
+```
+
+## see also
+
+- [[c]]
+- [[ar]]
+- [tutorialspoint.com/c_standard_library/](https://www.tutorialspoint.com/c_standard_library/)
diff --git a/notes/lima.md b/notes/lima.md
new file mode 100644
index 00000000..5abb0db6
--- /dev/null
+++ b/notes/lima.md
@@ -0,0 +1,43 @@
+---
+tags: [container, linux, macos, virtualization]
+title: lima
+created: '2023-05-30T07:38:10.191Z'
+modified: '2023-06-15T06:12:51.762Z'
+---
+
+# lima
+
+## install
+
+```sh
+brew install lima
+```
+
+## env
+
+```sh
+LIMA_INSTANCE #
+LIMA_SHELL #
+LIMA_WORKDIR #
+```
+
+## option
+
+```sh
+lima
+```
+
+## usage
+
+```sh
+limactl start default
+
+limactl start --name=default template://docker
+
+limactl disk list # list all existing disks
+```
+
+## see also
+
+- [[colima]]
+- [[qemu]]
diff --git a/notes/linux packagemanager.md b/notes/linux packagemanager.md
deleted file mode 100644
index 6b900f76..00000000
--- a/notes/linux packagemanager.md
+++ /dev/null
@@ -1,18 +0,0 @@
----
-tags: [linux, linux/packagemanager]
-title: linux packagemanager
-created: '2019-07-30T06:19:49.268Z'
-modified: '2019-07-30T20:39:56.137Z'
----
-
-# linux packagemanager
-
-โ
-
-| comment | alpine | suse | ubuntu | redhat |
-|--|--|--|--|--|
-| list installed packages | `apk info` | `yum list installed` | `apt list --installed` | `rpm -qa` |
-| list available packages | `apk ..` | `yum list available` | | |
-| install package | `apk add pkg ` | `yum install pkg` | `apt install pkg` | `rpm -i pkg` |
-| uninstall package | `apk del pkg ` | `yum remove pkg` | `apt remove pkg` | `rpm -e pkg` |
-
diff --git a/notes/linuxkit.md b/notes/linuxkit.md
new file mode 100644
index 00000000..ae11fdba
--- /dev/null
+++ b/notes/linuxkit.md
@@ -0,0 +1,29 @@
+---
+tags: [linux]
+title: linuxkit
+created: '2019-07-30T06:19:49.164Z'
+modified: '2020-03-12T13:55:04.471Z'
+---
+
+# linuxkit
+
+> toolkit for building custom minimal, immutable Linux distributions
+
+## install
+`brew tap linuxkit/linuxkit && brew install --HEAD linuxkit`
+
+## usage
+```sh
+linuxkit build -format iso-bios -name kitiso minimal.yml
+
+./linuxkit run vbox --iso kitiso.iso # run in virtualbox
+```
+## see also
+- [[rtf]]
+- [[docker]]
+- [[container]]
+- [[containerd]]
+- [[ctr]]
+- [github.com/docker/infrakit](https://github.com/docker/infrakit)
+- [github.com/linuxkit/linuxkit](https://github.com/linuxkit/linuxkit)
+- [collabnix.com/top-10-reasons-why-linuxkit-is-better](http://collabnix.com/top-10-reasons-why-linuxkit-is-better-than-the-traditional-os-distribution)
diff --git a/notes/lldb.md b/notes/lldb.md
new file mode 100644
index 00000000..4e2d519a
--- /dev/null
+++ b/notes/lldb.md
@@ -0,0 +1,53 @@
+---
+tags: [c, macos]
+title: lldb
+created: '2023-05-04T15:35:31.448Z'
+modified: '2023-05-04T15:54:55.975Z'
+---
+
+# lldb
+
+> lldb is a fully featured debugger
+
+## install
+
+```sh
+```
+
+## usage
+
+```sh
+lldb /PATH/TO/FILE # start with FILE
+```
+
+```c
+# [-options [option-value]] [argument [argument...]]
+
+(lldb) file ./helloworld # load file
+
+(lldb) breakpoint set -n main # set breakpoint at function main
+
+(lldb) breakpoint list
+
+
+(lldb) process launch
+(lldb) run
+(lldb) r
+
+
+(lldb) thread continue
+
+(lldb) thread step-in // The same as gdb's "step" or "s"
+(lldb) thread step-over // The same as gdb's "next" or "n"
+(lldb) thread step-out // The same as gdb's "finish" or "f"
+
+(lldb) thread step-inst // The same as gdb's "stepi" / "si"
+(lldb) thread step-over-inst // The same as gdb's "nexti" / "ni"
+```
+
+## see also
+
+- [[gdb]]
+- [[c]]
+- [lldb.llvm.org/use/map](https://lldb.llvm.org/use/map.html)
+- [lldb.llvm.org/use/tutorial](https://lldb.llvm.org/use/tutorial.html)
diff --git a/notes/ln.md b/notes/ln.md
new file mode 100644
index 00000000..ad21acb9
--- /dev/null
+++ b/notes/ln.md
@@ -0,0 +1,52 @@
+---
+tags: [coreutils, macos]
+title: ln
+created: '2019-08-28T09:33:38.811Z'
+modified: '2022-04-09T09:39:32.427Z'
+---
+
+# ln
+
+> make links between files
+
+## option
+
+```sh
+ -F # if target file already exists and is a directory, then remove it so that the link may occur, should be used with either -f or -i options
+ # if neither -f nor -i is specified, -f is implied. -F option is a no-op unless -s is specified
+
+-L # when creating a hard link to a symbolic link, create a hard link to the target of the symbolic link. This is the default. cancels the -P option
+
+-P # when creating a hard link to a symbolic link, create a hard link to the symbolic link itself. cancels the -L option
+
+-f # if the target file already exists, then unlink it so that the link may occur. (The -f option overrides any previous -i and -w options.)
+
+-h # if the target_file or target_dir is a symbolic link, do not follow it. This is most useful with the -f option, to replace a symlink which may point to a directory.
+
+-i # cause ln to write a prompt to standard error if the target file exists
+ # if response from the stdin begins with the character โyโ or โYโ, then unlink the target file so that the link may occur
+
+-s # create a symbolic link
+
+-v # be verbose, showing files as they are processed
+
+-w # warn if the source of a symbolic link does not currently exist
+```
+
+## usage
+
+```sh
+ln -s SOURCE_FILENAME SYMBOLIC_FILENAME # create a soft link named link1 to a file named file1
+
+ls -l FSOURCE_FILENAME SYMBOLIC_FILENAME # verify new soft link
+```
+
+## see also
+
+- [[cp]]
+- [[rm]]
+- [[unlink]]
+- [[ls]]
+- [[find]]
+- [[readlink]]
+- [[brew]]
diff --git a/notes/locale.md b/notes/locale.md
new file mode 100644
index 00000000..6fc7de17
--- /dev/null
+++ b/notes/locale.md
@@ -0,0 +1,26 @@
+---
+tags: [linux]
+title: locale
+created: '2020-03-03T07:13:41.122Z'
+modified: '2020-09-09T11:24:46.759Z'
+---
+
+# locale
+
+> display locale settings
+
+## usage
+```sh
+locale -a # lists all public locales.
+
+LC_MONETARY=en_US.UTF-8 locale currency_symbol # displays `$`
+
+
+LC_ALL='C' # C is the default locale, "POSIX" is the alias of "C" - maybe derived from ANSI-C
+```
+
+## see also
+- [[localectl]]
+- [[localedef]]
+- [[sw_vers]]
+- [unix.stackexchange.com/what-does-lc-all-c-do](https://unix.stackexchange.com/questions/87745/what-does-lc-all-c-do)
diff --git a/notes/localectl.md b/notes/localectl.md
new file mode 100644
index 00000000..71087b25
--- /dev/null
+++ b/notes/localectl.md
@@ -0,0 +1,29 @@
+---
+tags: [linux, systemd]
+title: localectl
+created: '2020-09-09T11:25:04.734Z'
+modified: '2023-03-23T10:18:13.879Z'
+---
+
+# localectl
+
+> control the system locale and keyboard layout settings
+
+## usage
+```sh
+localectl list-locales
+
+localectlstatus # show current settings of the system locale and keyboard mapping. If no command is specified, this is the implied default.
+
+localectl set-locale LOCALE
+localectl set-locale VARIABLE=LOCALE # set the system locale. This takes one locale such as"en_US.UTF-8", or takes one or more locale assignments such as "LANG=de_DE.utf8", "LC_MESSAGES=en_GB.utf8", and so on. If one locale without variable name is provided, then "LANG=" locale variable will be set. See locale(7) for details on the available settings and their meanings. Use list-locales for a list of available locales (see below).
+
+localectl list-locales # list available locales useful for configuration with set-locale.
+
+localectl set-keymap MAP [TOGGLEMAP]
+
+localectl list-keymaps # List available keyboard mappings for the console, useful for configuration with set-keymap.
+```
+
+## see also
+- [[locale]]
diff --git a/notes/localedef.md b/notes/localedef.md
new file mode 100644
index 00000000..90441979
--- /dev/null
+++ b/notes/localedef.md
@@ -0,0 +1,42 @@
+---
+tags: [linux]
+title: localedef
+created: '2020-03-03T07:15:49.031Z'
+modified: '2020-09-02T17:53:37.263Z'
+---
+
+# localedef
+
+> define locale environment
+
+
+## environment vairable
+
+```sh
+LC_CTYPE # defines character classification and case conversion.
+LC_COLLATE # defines collation rules.
+LC_MONETARY # defines the format and symbols used in formatting of monetary information.
+LC_NUMERIC # defines the decimal delimiter, grouping, and grouping symbol for non-monetary numeric editing.
+LC_TIME # defines the format and content of date and time information.
+LC_MESSAGES # defines the format and values of affirmative and negative responses.
+
+# environment variables that affect the execution of localedef
+LANG # Provide a default value for the internationalization variables that are unset or nullbehave as if none of the variables had been defined.
+LC_ALL # If set to a non-empty string value, override the values of all the other internationalization variables.
+LC_COLLATE # has no effect on localedef; the POSIX locale will be used for this category
+LC_CTYPE # Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single- as opposed to multi-byte characters in arguments and input files)
+ # has no effect on the processing of localedef input data; the POSIX locale is used for this purpose, regardless of the value
+LC_MESSAGES # Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error
+NLSPATH # Determine the location of message catalogues for the processing of LC_MESSAGES
+```
+
+## usage
+
+```sh
+localedef -i en_US -f UTF-8 en_US.UTF-8
+```
+
+## see also
+
+- [[locale]]
+- [[bash]]
diff --git a/notes/localstack.md b/notes/localstack.md
new file mode 100644
index 00000000..7eb3e04c
--- /dev/null
+++ b/notes/localstack.md
@@ -0,0 +1,29 @@
+---
+tags: [container, iac, python]
+title: localstack
+created: '2021-05-27T08:52:44.663Z'
+modified: '2023-04-11T20:20:29.945Z'
+---
+
+# localstack
+
+> provides test/mocking framework for cloud services by spinning up a local environment using [[docker]]
+
+## install
+
+```sh
+pip install localstack
+```
+
+## usage
+
+```sh
+localstack start
+```
+
+## see also
+
+- [localstack.cloud](https://localstack.cloud/)
+- [[terraform]]
+- [[docker-compose]]
+- [[aws]]
diff --git a/notes/locate.md b/notes/locate.md
new file mode 100644
index 00000000..0fb92d90
--- /dev/null
+++ b/notes/locate.md
@@ -0,0 +1,16 @@
+---
+tags: [linux, macos]
+title: locate
+created: '2020-12-24T15:06:39.316Z'
+modified: '2023-03-24T08:23:34.459Z'
+---
+
+# locate
+
+## usage
+```sh
+locate CMD
+```
+
+## see also
+- [[mdfind]]
diff --git a/notes/lpr.md b/notes/lpr.md
new file mode 100644
index 00000000..d05094c9
--- /dev/null
+++ b/notes/lpr.md
@@ -0,0 +1,21 @@
+---
+tags: [linux]
+title: lpr
+created: '2021-06-14T13:37:00.674Z'
+modified: '2023-03-24T08:20:50.775Z'
+---
+
+# lpr
+
+> lpr - print files
+
+## usage
+
+```sh
+lpr
+```
+
+## see also
+
+- [[paperkey]]
+- [[cat]]
diff --git a/notes/ls.md b/notes/ls.md
new file mode 100644
index 00000000..b4c0ef66
--- /dev/null
+++ b/notes/ls.md
@@ -0,0 +1,63 @@
+---
+tags: [coreutils]
+title: ls
+created: '2019-07-30T06:19:49.165Z'
+modified: '2022-06-20T06:42:05.132Z'
+---
+
+# ls
+
+> list directory contents
+
+## option
+
+```sh
+-1 # force output to be one entry per line.
+-i # print each file's inode number
+-A # list all entries except for . and ..
+-r # reverse sort
+
+-S # sort by size
+-t # sort by date
+
+-Z, --context # security context so it fits on most displays. displays only mode, user, group, security context and file name. aka "SELinux context"
+```
+
+## usage
+
+```sh
+ls -lisa
+
+ls -d .* # list only .dotfiles and .dotdirs
+
+ls -d */ # only directories
+ls -l | grep "^d" # list only directories
+
+ls -l --ignore=*.gz --ignore=*.1 # ignore extensions
+
+ls -ls foo.dat
+# -s argument to ls returns file size in blocks, just like du
+# 49152 -rw-r--r-- 1 user staff 25165824 3 Jan 17:21 foo.dat
+
+ls -l # prints file-mode, which consists of entry-type, owner-permissions, and group-permissions
+# d rwx r-x r-x ..
+# โฌ
+# entry type character describes the type of file:
+# b Block special file
+# c Character special file
+# d Directory
+# l Symbolic link
+# s Socket link
+# p FIFO
+# - Regular file
+```
+
+## see also
+
+- [[exa]]
+- [[lsattr]]
+- [[chmod]]
+- [[df]]
+- [[find]]
+- [[tree]]
+- [[stat]]
diff --git a/notes/lsattr.md b/notes/lsattr.md
new file mode 100644
index 00000000..d9e81adf
--- /dev/null
+++ b/notes/lsattr.md
@@ -0,0 +1,22 @@
+---
+tags: [linux]
+title: lsattr
+created: '2019-10-18T08:23:37.571Z'
+modified: '2019-12-30T07:34:20.251Z'
+---
+
+# lsattr
+
+> list file attributes on a Linux second extended file system
+
+## usage
+```sh
+lsattr .
+
+lsattr -a # list all files in directories, including files that start with `.`
+```
+
+## see also
+- [[chattr]]
+- [[ls]]
+- [[chmod]]
diff --git a/notes/lsof.md b/notes/lsof.md
new file mode 100644
index 00000000..23d4edce
--- /dev/null
+++ b/notes/lsof.md
@@ -0,0 +1,53 @@
+---
+tags: [linux]
+title: lsof
+created: '2019-07-30T06:19:49.166Z'
+modified: '2023-04-29T17:15:11.789Z'
+---
+
+# lsof
+
+> list open files
+
+## install
+
+```sh
+brew install lsof
+apt-get install lsof
+yum install lsof
+dnf install lsof
+apk add lsof
+```
+
+## option
+
+```sh
+-i :PORT #
+-P # don't convert port-number to port-name
+-w # ignore warnings; "lsof: no pwd entry for UID 100"
+```
+
+## usage
+
+```sh
+lsof -Pi :PORT
+
+lsof -i :80 | grep LISTEN # lsof command find out what is using port 80
+
+lsof -iTCP
+
+lsof -iUDP
+
+lsof -i4
+
+lsof -i6
+```
+
+## see also
+
+- [[ss]]
+- [[nmap]]
+- [[pmap]]
+- [[mount]]
+- [[bash ulimit]]
+- [lsof-no-pwd-entry-for-uid](https://unix.stackexchange.com/a/193920/193945)
diff --git a/notes/lua.md b/notes/lua.md
new file mode 100644
index 00000000..9b93a85b
--- /dev/null
+++ b/notes/lua.md
@@ -0,0 +1,67 @@
+---
+tags: [lua]
+title: lua
+created: '2020-09-02T12:55:03.179Z'
+modified: '2023-05-13T15:07:08.937Z'
+---
+
+# lua
+
+> lightweight, high-level, multi-paradigm programming language designed primarily for embedded use in applications
+> was designed, to be integrated with software written in `c` and other conventional languages
+
+## install
+
+```sh
+apt install build-essential libreadline-dev
+
+curl -R -O http://www.lua.org/ftp/lua-${VERSION}.tar.gz
+tar -zxf lua-${VERSION}.tar.gz && cd lua-${VERSION}
+make linux test && make install
+```
+
+## usage
+
+```sh
+lua # standalone interpreter and interactive shell
+
+lua hello.lua # run script
+```
+
+## language
+
+```lua
+-- Create a prototype object
+local person = {
+ name = "John",
+ age = 30,
+ sayHello = function(self)
+ print("Hello, my name is " .. self.name)
+ end
+}
+
+-- Create a new object that inherits from the prototype
+local student = {
+ studentID = "12345"
+}
+setmetatable(student, {__index = person})
+
+-- Use the inherited properties and methods
+print(student.name)
+print(student.age)
+student:sayHello()
+```
+
+## see also
+
+- [[nvchad]]
+- [[luac]]
+- [[luarocks]]
+- [[nginx]]
+- [[javascript]]
+- [[tcl]]
+- [[awk]]
+- [[groovy]]
+- [lua.org/pil/contents.html](https://www.lua.org/pil/contents.html)
+- [Learn Lua in 15 Minutes (2013) | Hacker News](https://news.ycombinator.com/item?id=23694667)
+
diff --git a/notes/luac.md b/notes/luac.md
new file mode 100644
index 00000000..6747ea58
--- /dev/null
+++ b/notes/luac.md
@@ -0,0 +1,26 @@
+---
+tags: [compiler, lua]
+title: luac
+created: '2020-09-02T13:00:24.846Z'
+modified: '2023-05-13T15:14:19.425Z'
+---
+
+# luac
+
+> bytecode compiler
+
+## install
+
+```sh
+brew install lua
+```
+
+## usage
+
+```sh
+luac # bytecode compiler
+```
+
+## see also
+
+- [[javac]]
diff --git a/notes/luarocks.md b/notes/luarocks.md
new file mode 100644
index 00000000..8f16ad97
--- /dev/null
+++ b/notes/luarocks.md
@@ -0,0 +1,35 @@
+---
+tags: [lua, packagemanager]
+title: luarocks
+created: '2020-09-02T13:03:43.096Z'
+modified: '2023-04-11T20:14:40.089Z'
+---
+
+# luarocks
+
+> package manager for lua modules
+
+## install
+
+```sh
+wget https://luarocks.org/releases/luarocks-${VERSION}.tar.gz
+tar zxpf luarocks-${VERSION}.tar.gz
+cd luarocks-${VERSION}
+```
+
+## usage
+
+```sh
+luarocks # see the available commands
+
+luarocks help install # get help on command
+
+luarocks install dkjson # installing packages
+
+luarocks make
+```
+
+## see also
+- [[lua]]
+- [[luac]]
+- [[make]]
diff --git a/notes/lvdisplay.md b/notes/lvdisplay.md
new file mode 100644
index 00000000..232d20c1
--- /dev/null
+++ b/notes/lvdisplay.md
@@ -0,0 +1,19 @@
+---
+tags: [linux]
+title: lvdisplay
+created: '2020-01-07T08:41:28.794Z'
+modified: '2023-03-24T08:23:51.483Z'
+---
+
+# lvdisplay
+
+## usage
+
+```sh
+lvdisplay -a # all
+```
+
+## see also
+
+- [[fstab]]
+- [[mount]]
diff --git a/notes/lynx.md b/notes/lynx.md
new file mode 100644
index 00000000..8ee6d7dc
--- /dev/null
+++ b/notes/lynx.md
@@ -0,0 +1,29 @@
+---
+tags: [linux, macos]
+title: lynx
+created: '2022-03-23T15:09:24.848Z'
+modified: '2023-03-25T12:30:17.225Z'
+---
+
+# lynx
+
+> cli browser
+
+## install
+
+```sh
+
+```
+
+## usage
+
+```sh
+lynx -dump http://www.google.com/search?q=$searchterm | less
+```
+
+## see also
+
+- [[w3m]]
+- [[curl]]
+- [[ascii]]
+- [[markdown]]
diff --git a/notes/macos keyboard shortcuts.md b/notes/macos keyboard shortcuts.md
new file mode 100644
index 00000000..273c6936
--- /dev/null
+++ b/notes/macos keyboard shortcuts.md
@@ -0,0 +1,73 @@
+---
+tags: [Notebooks]
+title: macos keyboard shortcuts
+created: '2020-08-24T08:09:16.562Z'
+modified: '2023-06-01T05:50:40.829Z'
+---
+
+# macos keyboard shortcuts
+
+## keys
+
+```sh
+โ Command/Cmd
+โง โง
+โฅ Option/Alt
+โ Control/Ctrl
+โช Caps Lock
+ Fn
+```
+
+## window
+
+```sh
+
+โ + up # highlight all windows
+โ + down # highlight current window
+
+โ + h # hide window
+โ + โฅ + h # hide other windows
+
+
+โ + w # close all currently active app windows
+โ + , # open the active appโs preferences
+โ + m # minimize window
+โ +
+```
+
+## screenshot
+
+```sh
+โ + โง + 2 # custom ! read qr-code see `zbar`
+โ + โง + 3 # take a snapshot of your entire screen
+โ + โง + 4 # turn your cursor into a set of crosshairs and select a specific area of screen
+โ + โง + 4 + Spacebar # screenshot only your current window without altering its dimensions
+```
+
+## usage
+
+```sh
+โ + Spacebar # spotlight search bar will appear in the upper center of your screen
+โ + โฅ + d # show/hide the Dock
+โ + โง + [ or ] # cycle through tabs in Safari by pressing [ when moving right or ] when moving left
+โ + โง # See all your open tabs in an active browser
+โ + โง + T # Opens the last closed tab in the active browser
+```
+
+
+## finder
+
+```sh
+โ + โง + g "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/" # go to this location in finder
+```
+
+## see also
+
+- [[tmux]]
+- [[fzf]]
+- [[firefox]]
+- [[mdfind]]
+- [[mdutil]]
+- [[zbar]]
+- [[defaults]]
+- [[gource]]
diff --git a/notes/make.md b/notes/make.md
new file mode 100644
index 00000000..fa3a0490
--- /dev/null
+++ b/notes/make.md
@@ -0,0 +1,141 @@
+---
+tags: [buildsystem, c, go]
+title: make
+created: '2019-07-30T06:19:49.167Z'
+modified: '2023-05-01T14:37:46.039Z'
+---
+
+# make
+
+> GNU make utility to maintain groups of programs
+
+- works on the premise that you have specify a dependency, and then a rule to resolve that dependency [stackoverflow.com/why-is-no-one-using-make-for-java](https://stackoverflow.com/a/2209932/2087704)
+- typically converts `main.c` to `main.o` then runs `cc main.c`
+
+## install
+
+```sh
+brew install make
+```
+
+## option
+
+```sh
+-B, --always-make # unconditionally make all targets
+-p, --print-data-base # print data base (rules and variable values) that results from reading the makefiles; then execute as usual or as otherwise specified
+-f FILE, --file=FILE, --makefile=FILE # Use file as a makefile
+-n, --just-print, --dry-run, --recon # print commands that would be executed, but do not execute them
+-q, --question # question mode, do not run any commands, or print anything;
+ # just return an exit status that is zero if the specified targets are already up to date, nonzero otherwise
+```
+
+## usage
+
+```sh
+make TARGET # run specific target
+
+make -B venv # always run target
+
+make -npq # debug
+```
+
+## Makefile
+
+```makefile
+target: prerequisites
+ recipe
+```
+
+## pattern rule
+
+```sh
+%.o : %.c ; recipeโฆ
+```
+
+[gnu.org/software/make/manual/html_node/Pattern-Intro](https://www.gnu.org/software/make/manual/html_node/Pattern-Intro.html)
+[gnu.org/software/make/manual/html_node/Pattern-Match](https://www.gnu.org/software/make/manual/html_node/Pattern-Match.html)
+
+## Automatic Variables
+
+```makefile
+all: library.cpp main.cpp
+
+# $@ evaluates to: all
+# $< evaluates to: library.cpp
+# $^ evaluates to: library.cpp main.cpp
+```
+
+[gnu.org/software/make/manual/make.html#Concept-Index](https://www.gnu.org/software/make/manual/make.html#Concept-Index)
+
+```makefile
+# macros / variables
+# macros that are names of programs (such as CC)
+# CC Program to compiling C programs; default is `cc`
+# LINT Program to use to run lint on source code; default is `lint`
+# CPP Program to running the C preprocessor, with results to standard output; default is `$(CC) -E'
+
+# Macros that contain arguments of the programs
+# CFLAGS Extra flags to give to the C compiler
+# CXXFLAGS Extra flags to give to the C compiler
+# LINTFLAGS Extra flags to give to lint
+
+CC := gcc
+CC := ${CC}
+
+# `${CC}` and `$(CC)` are valid references to call `gcc`
+# `:=` operator, also called the `simply expanded variable` to avoid infinite loops
+
+all:
+ @echo ${CC}
+
+
+# target
+.PHONY: clean # telling Make that this is a phony target, that it does not build anything
+
+clean:
+ @echo "Cleaning up..." # suppress echoing the actual command place `@` before command
+ rm *.txt
+```
+
+## make script
+
+```make
+# use script to create file via heredoc
+
+define _script
+cat < localstack.auto.tfvars
+aws_region = "eu-central-1"
+aws_access_key_id = "mock_access_key"
+aws_secret_access_key = "mock_secret_key"
+# aws_account_id = "00000000000"
+# environment = "local"
+# logging_active = true
+EOF
+endef
+export script = $(value _script)
+
+
+setup:; @ eval "$$script"
+
+
+$(call variable,param,param) # call function is unique in that it can be used to create new parameterized functions
+ # You can write a complex expression as the value of a variable, then use call to expand it with different values
+```
+
+[unix.stackexchange.com/a/516476/440548](https://unix.stackexchange.com/a/516476/440548)
+[gnu.org/software/make/manual/Call-Function](https://www.gnu.org/software/make/manual/html_node/Call-Function.html)
+
+## see also
+
+- [[gcc]]
+- [[javac]]
+- [[cmake]]
+- [[automake]]
+- [[bundle rake]]
+- [[install]]
+- [[brazel]]
+- [tutorialspoint.com/.../makefile_macros.htm](https://www.tutorialspoint.com/makefile/makefile_macros.htm)
+- [what-how-makefile](https://opensource.com/article/18/8/what-how-makefile)
+- [what-are-makefile-am-and-makefile-in](https://stackoverflow.com/questions/2531827/what-are-makefile-am-and-makefile-in)
+- [confused-about-configure-script-and-makefile-in](https://stackoverflow.com/a/26832773/2087704)
+- [Automation and Make: Introduction](http://swcarpentry.github.io/make-novice/01-intro/index.html)
diff --git a/notes/man.md b/notes/man.md
new file mode 100644
index 00000000..6b6814f7
--- /dev/null
+++ b/notes/man.md
@@ -0,0 +1,115 @@
+---
+tags: [linux, macos]
+title: man
+created: '2019-07-30T06:19:49.175Z'
+modified: '2023-05-19T11:32:48.783Z'
+---
+
+# man
+
+> format and display the on-line manual pages
+
+## install
+
+```sh
+apt-get install man-db
+```
+
+## env
+
+```sh
+MANPATH # manpage locations: /usr/man, /usr/share/man, /usr/local/man, /usr/local/share/man, /usr/X11R6/man
+MANPAGER # pager e.g. less
+MANPAGER=vim -M +MANPAGER --not-a-term -
+MANROFFSEQ # see -p
+MANSECT # see -S
+```
+
+## option
+
+```sh
+-M # manpath Forces a specific colon separated manual path instead of the default search path. See manpath(1). Overrides the MANPATH environment variable
+-P # use specified pager, defaults to "less -sR" if color support is enabled, or "less -s". Overrides the MANPAGER environment variable, which in turn overrides the PAGER environment variable
+-S # mansect Restricts manual sections searched to the specified colon delimited list, default "1:8:2:3:3lua:n:4:5:6:7:9:l"
+-a # display all manual pages instead of just the first found for each page argument
+-d # print extra debugging information
+-f # emulate whatis
+-h # display short help message and exit
+-k # emulate apropos
+-m arch[:machine] # override the default architecture and machine settings allowing lookup of other platform specific manual pages. This option is accepted, but not implemented, on macOS
+-o # force use of non-localized manual pages. See IMPLEMENTATION NOTES for how locale specific searches work. Overrides the LC_ALL, LC_CTYPE, and LANG environment variables
+-p [eprtv] # use the list of given preprocessors before running nroff(1) or troff(1). ARG: e eqn(1), p pic(1), r refer(1), t tbl(1), v vgrind(1
+-t # send manual page source through troff(1) allowing transformation of the manual pages to other formats
+-w # display the location of the manual page instead of the contents of the manual page
+
+# Options that apropos and whatis understand
+-d # Same as the -d option for man.
+-s # Same as the -S option for man.
+```
+
+## usage
+
+```sh
+man man # manual to man and show sections
+
+man -k . | grep '(2)' # list system calls
+
+man -k intro # equivalent to apropos
+man -f intro # equivalent to whatis; lookup pages and print short description
+
+man 7 ascii # show ascii tables, in case ascii command is present
+```
+
+## sections
+
+```sh
+# macos linux
+1. General Commands User commands,executable programs, shell commands
+2. System Calls System calls (functions provided by the kernel)
+3. Library Functions Library calls (functions within program libraries)
+4. Kernel Interfaces Devices documents details of various devices, most of which reside in /dev.
+5. File Formats Files describes various file formats, and includes proc(5), which documents the /proc file system.
+6. Games Games
+7. Miscellaneous Information Overviews, conventions, and miscellaneous. (including macro packages and conventions)
+8. System Manager's System administration commands (usually only for root)
+9. Kernel Developer's Kernel routines [Non standard]
+```
+
+## custom manpage
+
+```sh
+# creating custom man page and open with man
+cat < ./nuseradd
+.\" Manpage for nuseradd.
+.\" Contact vivek@nixcraft.net.in to correct errors or typos.
+.TH man 8 "06 May 2010" "1.0" "nuseradd man page"
+.SH NAME
+nuseradd \- create a new LDAP user
+.SH SYNOPSIS
+nuseradd [USERNAME]
+.SH DESCRIPTION
+nuseradd is high level shell program for adding users to LDAP server. On Debian, administrators should usually use nuseradd.debian(8) instead.
+.SH OPTIONS
+The nuseradd does not take any options. However, you can supply username.
+.SH SEE ALSO
+useradd(8), passwd(5), nuseradd.debian(8)
+.SH BUGS
+No known bugs.
+.SH AUTHOR
+Vivek Gite (vivek@nixcraft.net.in)
+EOF
+
+man ./nuseradd
+```
+
+## see also
+
+- [[c]], [[go]], [[rust]], [[java]]
+- [[apropos]], [[whatis]]
+- [[brew]]
+- [[less]], [[more]]
+- [[asdf]]
+- [The Linux man-pages project](https://www.kernel.org/doc/man-pages/)
+- [Colorized man pages](http://boredzo.org/blog/archives/2016-08-15/colorized-man-pages-understood-and-customized)
+- [[command-not-found]]
+- [[bash help]]
diff --git a/notes/markdown.md b/notes/markdown.md
new file mode 100644
index 00000000..0872cc08
--- /dev/null
+++ b/notes/markdown.md
@@ -0,0 +1,73 @@
+---
+tags: [markdown, Notebooks]
+title: markdown
+created: '2019-08-20T08:24:21.200Z'
+modified: '2023-05-24T14:22:59.701Z'
+---
+
+# markdown
+
+
+- tool
+ - util
+ - language
+ - config
+
+
+- general-notes
+ - concept
+ - protocol
+
+
+## flavors
+
+- commonmark
+- gitlab
+- markdown extra
+
+
+## characters for copy-pasta
+
+```
+โ
+โ โ
+
+
+ โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโ
+ โ Ethernet Frame โ VXLAN-Header โ
+ โโโโโโโโโโโโโโโโโโดโโโฌโโโโโโโโโโโโ
+ โโ VNID
+
+ โโโโโฌโโโ
+
+ foo ยท bar
+```
+
+## table
+
+```md
+| | | | | |
+|---|---|---|---|---|
+| | | | | |
+| | | | | |
+| | | | | |
+
+| Tables | Are | Cool |
+|----------|:-------------:|------:|
+| col 1 is | left-aligned | $1600 |
+| col 2 is | centered | $12 |
+| col 3 is | right-aligned | $1 |
+```
+
+[tablesgenerator.com/markdown_tables](https://www.tablesgenerator.com/markdown_tables)
+
+## see also
+
+- [commonmark.org](https://commonmark.org/)
+- [gitlab markdown](https://help.github.com/en/categories/writing-on-github)
+- [markdown extra](https://michelf.ca/projects/php-markdown/extra/#table)
+- [resources/tutorial/notes - github.com](https://github.com/notable/notable/tree/master/resources/tutorial/notes)
+- [makeuseof.com/create-markdown-table/](https://www.makeuseof.com/tag/create-markdown-table/)
+- [[markdownlint]]
+- [[nerdfonts]]
+- [github.com/hackmdio/CodiMD](https://github.com/hackmdio/CodiMD)
diff --git a/notes/markdownlint.md b/notes/markdownlint.md
new file mode 100644
index 00000000..d3e8e172
--- /dev/null
+++ b/notes/markdownlint.md
@@ -0,0 +1,48 @@
+---
+tags: [javascript]
+title: markdownlint
+created: '2023-04-11T20:28:01.213Z'
+modified: '2023-04-11T20:31:57.368Z'
+---
+
+# markdownlint
+
+> markdown linter
+
+## install
+
+```sh
+npm install -g markdownlint-cli
+brew install markdownlint-cli
+
+docker run -v $PWD:/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "*.md"
+```
+
+## option
+
+```sh
+-V, --version # output the version number
+-c, --config CONF # configuration file (JSON, JSONC, JS, or YAML)
+-d, --dot # include files/folders with a dot (for example `.github`)
+-f, --fix # fix basic errors (does not work with STDIN)
+-i, --ignore [FILE|DIR|GLOB] # file(s) to ignore/exclude (default: [])
+-j, --json # write issues in json format
+-o, --output FILE # write issues to file (no console)
+-p, --ignore-path FILE # path to file with ignore pattern(s)
+-q, --quiet # do not write issues to STDOUT
+-r, --rules [FILE|DIR|GLOB|PACKAGE] # include custom rule files (default: [])
+-s, --stdin # read from STDIN (does not work with files)
+ --enable RULE # Enable certain rules, e.g. --enable MD013 MD041 --
+ --disable RULE # Disable certain rules, e.g. --disable MD013 MD041 --
+-h, --help # display help for command
+```
+
+## usage
+
+```sh
+```
+
+## see also
+
+- [[markdown]]
+- [[npm]]
diff --git a/notes/math.md b/notes/math.md
new file mode 100644
index 00000000..76aca6de
--- /dev/null
+++ b/notes/math.md
@@ -0,0 +1,24 @@
+---
+tags: [Notebooks]
+title: math
+created: '2019-07-30T06:19:49.176Z'
+modified: '2023-03-22T09:48:12.137Z'
+---
+
+# math
+
+> math haxx
+
+```
+x % of y = y % of x
+
+10% of 80 = 80% of 10 => 8
+
+6% of 50 = 50% of 6 => 3
+
+8% of 200 = 200% of 8 => 16
+```
+
+## see also
+
+- [[bash bc]]
diff --git a/notes/max-pods-calculator.md b/notes/max-pods-calculator.md
new file mode 100644
index 00000000..11a1c514
--- /dev/null
+++ b/notes/max-pods-calculator.md
@@ -0,0 +1,43 @@
+---
+tags: [container]
+title: max-pods-calculator
+created: '2022-03-29T14:57:24.315Z'
+modified: '2023-03-24T08:21:00.855Z'
+---
+
+# max-pods-calculator
+
+> script to calculate maxPods value to be used when starting up the kubelet
+
+## install
+
+```sh
+curl -LO https://raw.githubusercontent.com/awslabs/amazon-eks-ami/master/files/max-pods-calculator.sh
+chmod +x max-pods-calculator.sh
+```
+
+## option
+
+```sh
+-h, --help # print this help
+ --instance-type # Specify the instance type to calculate max pods value
+ --instance-type-from-imds # flag if the instance type should be fetched from IMDS
+ --cni-version # specify the version of the CNI (example - 1.7.5)
+ --cni-custom-networking-enabled # indicate if CNI custom networking mode has been enabled
+ --cni-prefix-delegation-enabled # indicate if CNI prefix delegation has been enabled
+ --cni-max-eni # specify how many ENIs should be used for prefix delegation. Defaults to using all ENIs per instance
+ --show-max-allowed # show max number of Pods allowed to run in Worker Node. Otherwise the script will show the recommended value
+```
+
+## usage
+
+```sh
+AWS_PROFILE=PROFILE ./max-pods-calculator.sh --instance-type m5.large --cni-version 1.9.0-eksbuild.1
+
+./max-pods-calculator.sh --instance-type m5.large --cni-version 1.10.1-eksbuild.1
+```
+
+## see also
+
+- [[aws]]
+- [docs.aws.amazon.com/eks/latest/userguide/choosing-instance-type](https://docs.aws.amazon.com/eks/latest/userguide/choosing-instance-type.html)
diff --git a/notes/mc.md b/notes/mc.md
new file mode 100644
index 00000000..ee9a4ded
--- /dev/null
+++ b/notes/mc.md
@@ -0,0 +1,37 @@
+---
+tags: [cloud, go, linux]
+title: mc
+created: '2019-09-19T12:03:17.162Z'
+modified: '2023-03-23T10:20:06.558Z'
+---
+
+# mc
+
+> minio client for cloud storage and filesystems
+
+## install
+
+```sh
+GO111MODULE=on go get github.com/minio/mc
+
+curl -O https://dl.min.io/client/mc/release/linux-amd64/mc
+```
+
+## usage
+
+```sh
+mc --autocompletion # setup autocompletion
+
+mc config host list
+
+mc config host add minio http://127.0.0.1:9000 FDKN3TTEO2B2OD6GZ84V exYeuqvdyuJSAlFJ0QW2+dLJEGznxq1dXZZDm6+C
+
+mc ls BUCKET
+
+mc mirror PATH BUCKET
+```
+
+## see also
+
+- [[aws]]
+- [[rsync]]
diff --git a/notes/md5sum.md b/notes/md5sum.md
new file mode 100644
index 00000000..3a69b287
--- /dev/null
+++ b/notes/md5sum.md
@@ -0,0 +1,26 @@
+---
+tags: [coreutils]
+title: md5sum
+created: '2019-10-11T06:16:32.667Z'
+modified: '2022-03-31T08:08:13.383Z'
+---
+
+# md5sum
+
+> compute and check MD5 message digest
+
+## usage
+
+```sh
+md5sum file.log.tar.gz
+
+echo 'eb6d6eddb5bcb5c4229a45b31f209b0d file.log.tar.gz' | md5sum -c -
+
+md5sum -c .zip.md5 .zip
+```
+
+## see also
+
+- [[openssl]]
+- [[sha256sum]]
+
diff --git a/notes/mdfind.md b/notes/mdfind.md
new file mode 100644
index 00000000..0c113099
--- /dev/null
+++ b/notes/mdfind.md
@@ -0,0 +1,33 @@
+---
+tags: [macos]
+title: mdfind
+created: '2020-12-24T15:03:39.240Z'
+modified: '2023-05-19T17:44:29.016Z'
+---
+
+# mdfind
+
+> anything spotlight finds, mdfind can find, includes ability to search inside files and metadata
+
+## usage
+
+```sh
+-onlyin # restrict the search to a single dir
+```
+
+## usage
+
+```sh
+mdfind -onlyin ~/Documents essay
+
+mdutil -E w # erase index and rebuild from scratch
+
+mdutil -i off # turn off indexing entirely with
+```
+
+## see also
+
+- [[defaults]]
+- [[mdutil]]
+- [[locate]]
+- [[macos keyboard shortuts]]
diff --git a/notes/mdp.md b/notes/mdp.md
new file mode 100644
index 00000000..6ea5d902
--- /dev/null
+++ b/notes/mdp.md
@@ -0,0 +1,80 @@
+---
+tags: [linux, macos]
+title: mdp
+created: '2022-04-05T09:09:21.947Z'
+modified: '2023-03-24T08:21:44.717Z'
+---
+
+# mdp
+
+> cli based markdown presentation tool
+
+## install
+
+```sh
+brew install mdp
+```
+
+## option
+
+```sh
+-d, --debug # enable debug messages on STDERR, add it multiple times to increases debug level
+-e, --expand # enable character entity expansion
+-f, --nofade # disable color fading in 256 color mode
+-h, --help # display this help and exit
+-i, --invert # swap black and white color
+-t, --notrans # disable transparency in transparent terminal
+-s, --noslidenum # do not show slide number at the bottom
+-v, --version # display the version number and license
+-x, --noslidemax # show slide number, but not total number of slides
+-c, --nocodebg # don't change the background color of code blocks
+```
+
+## usage
+
+```sh
+mdp -ex FILE.md # start presentation
+```
+
+## markdown
+
+```sh
+cat < hello.md
+%title: Presentation Title
+%author: $(whoami)
+%date: $(date)
+
+-> # Slide 1 <-
+
+Intro slide
+
+---
+
+-> ## Slide 2 <-
+
+* Item 1
+* Item 2
+* Item 3
+
+---
+-> # Slide 3 <-
+
+This one with a numbered list
+
+1. Item 1
+2. Item 2
+3. Item 3
+
+---
+
+-> # Conclusion <-
+
+mdp supports *other* **formatting**, too. Give it a try!
+
+EOT
+```
+
+## see also
+
+- [[vim]]
+- [[tmux]]
diff --git a/notes/mdutil.md b/notes/mdutil.md
new file mode 100644
index 00000000..afa4c8a3
--- /dev/null
+++ b/notes/mdutil.md
@@ -0,0 +1,26 @@
+---
+tags: [macos]
+title: mdutil
+created: '2020-02-04T12:20:33.596Z'
+modified: '2023-05-19T17:44:52.138Z'
+---
+
+# mdutil
+
+> utility to manage macos spotlight indices
+
+## usage
+
+```sh
+mdutil -a -i off # disable spotlight
+
+mdutil -a -i on # turn on spotlight
+
+mdutil -E / # erase and rebuild entire spotlight-index
+```
+
+## see also
+
+- [[mdfind]]
+- [[defaults]]
+- [[macos keyboard shortcuts]]
diff --git a/notes/meltdown spectre.md b/notes/meltdown spectre.md
new file mode 100644
index 00000000..fef2f8f2
--- /dev/null
+++ b/notes/meltdown spectre.md
@@ -0,0 +1,29 @@
+---
+tags: [Notebooks]
+title: meltdown spectre
+created: '2019-07-30T06:19:49.177Z'
+modified: '2020-03-12T14:14:02.777Z'
+---
+
+# meltdown spectre
+
+- variant 1: `CVE-2017-5753` bounds-check bypass aka spectre
+- variant 2: `CVE-2017-5715` branch target injection aka spectre
+- variant 3: `CVE-2017-5754` rogue data cache load aka meltdown
+
+-| Spectre | Meltdown
+-|-- |--
+CPU mechanism for triggering | Speculative execution from branch prediction | Out-of-order execution
+Affected platforms | CPUs that perform speculative execution from branch prediction | CPUs that allow memory reads in out-of-order instructions
+Difficulty of successful attack | High - Requires tailoring to the software environment of the victim process | Low - Kernel memory access exploit code is mostly universal
+Impact | Cross- and intra-process (including kernel) memory disclosure | Kernel memory disclosure to userspace
+Software mitigations | Variant 1: Compiler changes. Web browser updates to help prevent exploitation from JavaScript; Variant 2: Indirect Branch Restricted Speculation (IBRS). Note: The software mitigation for Spectre variant 2 requires CPU microcode updates Kernel page-table isolation (KPTI)|Kernel page-table isolation `KPTI`
+
+## see also
+- https://meltdownattack.com/
+- https://spectreattack.com/
+- https://googleprojectzero.blogspot.de/2018/01/reading-privileged-memory-with-side.html
+- https://cyber.wtf/2017/07/28/negative-result-reading-kernel-memory-from-user-mode/
+- https://www.kb.cert.org/vuls/id/584653
+- https://github.com/raphaelsc/Am-I-affected-by-Meltdown
+- https://www.cyberciti.biz/faq/check-linux-server-for-spectre-meltdown-vulnerability/
diff --git a/notes/mermaid.md b/notes/mermaid.md
new file mode 100644
index 00000000..aa2bc457
--- /dev/null
+++ b/notes/mermaid.md
@@ -0,0 +1,104 @@
+---
+tags: [markdown, Notebooks]
+title: mermaid
+created: '2019-08-01T10:42:32.003Z'
+modified: '2023-05-24T08:39:20.674Z'
+---
+
+# mermaid
+
+[rich-iannone.github.io/DiagrammeR/mermaid](https://rich-iannone.github.io/DiagrammeR/mermaid.html)
+
+## graph
+- `LR` left to right
+- `RL` right to left
+- `TB` top to bottom
+- `BT` bottom to top
+- `TD` top down (same as `TB`)
+
+
+- `-->` arrow connection
+- `---` line connection
+- `==>` `==` thick line
+
+```mermaid
+graph LR
+ A -- text --> B
+ B -- foo --> C
+```
+
+```mermaid
+graph LR
+ A(node text)
+```
+
+```mermaid
+graph LR
+ A((node text))
+```
+
+```mermaid
+graph LR
+ A{node text}
+```
+
+```mermaid
+graph LR
+ A>node text]
+```
+
+
+
+## Flowchart
+```mermaid
+graph TD;
+ A-->B;
+ A-->C;
+ B-->D;
+ C-->D;
+```
+
+## Sequence diagram
+
+```mermaid
+sequenceDiagram
+ participant Alice
+ participant Bob
+ Alice->>John: Hello John, how are you?
+ loop Healthcheck
+ John->>John: Fight against hypochondria
+ end
+ Note right of John: Rational thoughts prevail!
+ John-->>Alice: Great!
+ John->>Bob: How about you?
+ Bob-->>John: Jolly good!
+```
+
+## git graph
+
+```mermaid
+gitGraph:
+options
+{
+ "nodeSpacing": 150,
+ "nodeRadius": 10
+}
+end
+commit
+branch newbranch
+checkout newbranch
+commit
+commit
+checkout master
+commit
+commit
+merge newbranch
+```
+
+
+## see also
+
+- [[markdown]]
+
+
+
diff --git a/notes/metaprogramming.md b/notes/metaprogramming.md
new file mode 100644
index 00000000..eab1ccf8
--- /dev/null
+++ b/notes/metaprogramming.md
@@ -0,0 +1,44 @@
+---
+tags: [Notebooks]
+title: metaprogramming
+created: '2023-05-06T14:15:38.796Z'
+modified: '2023-05-24T08:42:21.302Z'
+---
+
+# metaprogramming
+
+> technique in which programs threat themselves as data and can modify itself or other programs
+
+
+## example
+
+```sh
+#!/bin/sh
+# metaprogram
+echo '#!/bin/sh' > program
+for i in $(seq 992)
+do
+ echo "echo $i" >> program
+done
+chmod +x program
+```
+
+## reflection
+
+> Reflection in computing is the ability of a program to examine its own structure, particularly through types; itโs a form of metaprogramming.
+
+[go.dev/blog/laws-of-reflection](https://go.dev/blog/laws-of-reflection)
+
+- gives ability to examine types at runtime
+- allows to examine, modify, and create variables, functions, and structs at runtime
+
+[medium.com/capital-one-tech/learning-to-use-go-reflection](https://medium.com/capital-one-tech/learning-to-use-go-reflection-822a0aed74b7)
+
+
+[oracle.com/technical-resources/articles/java/javareflection.html](https://www.oracle.com/technical-resources/articles/java/javareflection.html)
+
+## see also
+
+- [[rust]] `macros`
+- [[java]]
+- [[go]]
diff --git a/notes/micro frontend.md b/notes/micro frontend.md
new file mode 100644
index 00000000..a5341e13
--- /dev/null
+++ b/notes/micro frontend.md
@@ -0,0 +1,18 @@
+---
+tags: [Notebooks]
+title: micro frontend
+created: '2022-04-08T21:02:08.494Z'
+modified: '2023-03-24T08:22:11.895Z'
+---
+
+# micro frontend
+
+
+- mirco frontends
+- mirco frontend framwork
+- host pages
+
+
+## see also
+
+- [[jam stack]]
diff --git a/notes/microdnf.md b/notes/microdnf.md
new file mode 100644
index 00000000..ebce853e
--- /dev/null
+++ b/notes/microdnf.md
@@ -0,0 +1,39 @@
+---
+tags: [packagemanager]
+title: microdnf
+created: '2022-09-30T12:49:43.050Z'
+modified: '2023-03-23T09:27:58.590Z'
+---
+
+# microdnf
+
+> minimal dnf for containers that uses libdnf and hence doesn't require python
+
+## install
+
+```sh
+```
+
+## usage
+
+```sh
+microdnf update
+
+microdnf install PAGE
+
+microdnf install nc \
+ sudo \
+ iputils \
+ hostname \
+ findutils \
+ procps
+
+microdnf clean all
+```
+
+## see also
+
+- [[tdnf]]
+- [[yum]]
+- [[rpm]]
+- [[apt-get]]
diff --git a/notes/microservice.md b/notes/microservice.md
new file mode 100644
index 00000000..dc7447d8
--- /dev/null
+++ b/notes/microservice.md
@@ -0,0 +1,13 @@
+---
+tags: [Notebooks]
+title: microservice
+created: '2020-05-11T06:38:27.336Z'
+modified: '2020-09-02T17:33:36.689Z'
+---
+
+# microservice
+
+##
+
+## see also
+- [[hexagonal architecture]]
diff --git a/notes/minikube.md b/notes/minikube.md
new file mode 100644
index 00000000..ceff5649
--- /dev/null
+++ b/notes/minikube.md
@@ -0,0 +1,86 @@
+---
+tags: [container]
+title: minikube
+created: '2019-07-30T06:19:49.146Z'
+modified: '2023-05-30T08:54:46.922Z'
+---
+
+# minikube
+
+> sets up a local Kubernetes cluster, uses `libmachine`
+
+## installation
+
+```sh
+brew install minikube
+```
+
+## env
+
+```sh
+MINIKUBE_HOME # (string) path for the .minikube dir used for state/configuration
+MINIKUBE_IN_STYLE # (bool) whether or not emoji and colors should appear in minikube
+MINIKUBE_WANTUPDATENOTIFICATION # (bool) sets whether the user wants an update notification for new minikube versions
+MINIKUBE_REMINDERWAITPERIODINHOURS # (int) sets the number of hours to check for an update notification
+MINIKUBE_ENABLE_PROFILING # (int, 1 enables it) enables trace profiling to be generated for minikube
+```
+
+## usage
+
+```sh
+minikube completion bash > $(brew --prefix)/etc/bash_completion.d/minikube
+
+minikube config set cpus 2 # ~/.minikube/config/config.json
+minikube config set memory 4096
+minikube config set kubernetes-version latest
+minikube config view
+
+
+minikube start \
+ --driver=virtualbox --cpus=4 --memory='4096' \
+ --kubernetes-version=latest --nodes=1 \
+ --addons=metrics-server
+# --container-runtime=cri-o
+# --cache-images
+
+minikube start --alsologtostderr --v=2
+
+
+minikube start --nodes 2 -p multinode-demo # start multpile nodes
+minikube stop
+minikube delete # clear local state
+
+minikube profile list # list profiles
+
+minikube status
+
+minikube dashboard
+kubectl config view --namespace kubernetes-dashboard
+
+minikube ssh
+
+minikube ip
+
+minikube service list
+minikube service SERVICE_NAME # open exposed endpoint in browser
+minikube service SERVICE_NAME --url --namespace=NAMESPACE # get service url:port
+```
+
+## addons
+
+```sh
+minikube addons list
+minikube addons enable metrics-server # needed for `kubectl top node`
+minikube addons enable ingress # provisions: configMap, ingress-controller and service (exposes default nginx-pod; handles unmapped requests)
+```
+
+## see also
+
+- [[crc]]
+- [[k3s]]
+- [[kind]]
+- [[kubectl]]
+- [[kubernetes]]
+- [[docker]], [[docker-machine]]
+- [[istioctl]]
+- [minikube.sigs.k8s.io/docs/](https://minikube.sigs.k8s.io/docs/)
diff --git a/notes/mkcert.md b/notes/mkcert.md
new file mode 100644
index 00000000..b4198e87
--- /dev/null
+++ b/notes/mkcert.md
@@ -0,0 +1,38 @@
+---
+tags: [crypto, go]
+title: mkcert
+created: '2023-07-11T11:08:25.241Z'
+modified: '2023-07-12T07:32:53.565Z'
+---
+
+# mkcert
+
+> generate locally-trusted development certificates
+
+## install
+
+```sh
+brew install mkcert
+```
+## env
+
+```sh
+TRUST_STORES
+```
+
+## usage
+
+```sh
+mkcert -install # install local CA in system trust store
+mkcert -uninstall # uninstall local CA (don't delete it)
+
+mkcert example.org # generate "example.org.pem" and "example.org-key.pem"
+mkcert example.com myapp.dev localhost 127.0.0.1 ::1 # generate "example.com+4.pem" and "example.com+4-key.pem"
+mkcert "*.example.it" # generate "_wildcard.example.it.pem" and "_wildcard.example.it-key.pem"
+```
+
+## see also
+
+- [[certutil]]
+- [[openssl]]
+- [github.com/FiloSottile/mkcert](https://github.com/FiloSottile/mkcert)
diff --git a/notes/mkfifo.md b/notes/mkfifo.md
new file mode 100644
index 00000000..508eec1b
--- /dev/null
+++ b/notes/mkfifo.md
@@ -0,0 +1,41 @@
+---
+tags: [linux, macos]
+title: mkfifo
+created: '2021-06-16T15:59:45.047Z'
+modified: '2023-03-24T09:50:28.292Z'
+---
+
+# mkfifo
+
+> make fifos aka `named pipes``
+
+## usage
+
+```sh
+mkfifo PIPE_NAME # create named pipe
+
+mkfifo PIPE_NAME -m700 # custom permissions
+
+ls > PIPE_NAME
+cat < PIPE_NAME
+
+
+ls -lart PIPE_NAME # notice 'p' in the beginning
+
+
+{ ls -l && cat FILE; } >PIPE_NAME &
+
+
+ls -l >PIPE_NAME &
+cat FILE >PIPE_NAME &
+cat PIPE_NAME
+```
+
+## see also
+
+- [[script]]
+- [[cat]]
diff --git a/notes/mkfs.md b/notes/mkfs.md
new file mode 100644
index 00000000..c190c604
--- /dev/null
+++ b/notes/mkfs.md
@@ -0,0 +1,24 @@
+---
+tags: [filesystem, linux]
+title: mkfs
+created: '2019-09-02T05:00:34.964Z'
+modified: '2023-03-22T09:14:18.112Z'
+---
+
+# mkfs
+
+> `make filesystem` - build a Linux file system
+
+## usage
+
+```sh
+mkfs -t ext3 /dev/sdb1 # format the device at /dev/sdb1 with an ext3 file system.
+ # Note that this will for sure delete all data you might have on that device!
+
+mkfs.ext4 /dev/sdb1 # shortcut command
+```
+
+## see also
+
+- [[fdisk]]
+- [[filesystem]]
diff --git a/notes/mkisofs.md b/notes/mkisofs.md
new file mode 100644
index 00000000..6202bce2
--- /dev/null
+++ b/notes/mkisofs.md
@@ -0,0 +1,26 @@
+---
+tags: [filesystem]
+title: mkisofs
+created: '2020-01-03T14:04:32.903Z'
+modified: '2023-03-22T09:14:55.875Z'
+---
+
+# mkisofs
+
+> utility that creates an ISO-9660 image from files on disk
+
+## usage
+
+```sh
+mkisofs -R -l -L -D -b isolinux/isolinux.bin \
+ -c isolinux/boot.cat \
+ -no-emul-boot \
+ -boot-load-size 4 \
+ -boot-info-table \
+ -V \
+ "PHOTON_$(date +%Y%m%d)" . > /home/ubuntu/PHOTON_$(date +%Y%m%d).iso
+```
+
+## see also
+
+- [[mkfs]]
diff --git a/notes/mkpasswd.md b/notes/mkpasswd.md
new file mode 100644
index 00000000..f88f8ec8
--- /dev/null
+++ b/notes/mkpasswd.md
@@ -0,0 +1,29 @@
+---
+tags: [crypto, linux]
+title: mkpasswd
+created: '2019-09-17T09:56:18.545Z'
+modified: '2023-03-24T08:19:14.044Z'
+---
+
+# mkpasswd
+
+> generate new password, optionally apply it to a user
+
+## install
+
+```sh
+apt-get install whois
+yum install expect
+```
+
+## usage
+
+```sh
+mkpasswd --method=SHA-512 # opens prompt for password
+```
+
+## see also
+
+- [etc-shadow-how-to-generate-6-s-encrypted-password](https://unix.stackexchange.com/questions/158400/etc-shadow-how-to-generate-6-s-encrypted-password)
+- [[passwd]]
+- [[xkcdpass]]
diff --git a/notes/mktemp.md b/notes/mktemp.md
new file mode 100644
index 00000000..f1fba871
--- /dev/null
+++ b/notes/mktemp.md
@@ -0,0 +1,58 @@
+---
+tags: [linux]
+title: mktemp
+created: '2019-11-26T08:13:04.385Z'
+modified: '2023-04-12T11:53:31.043Z'
+---
+
+# mktemp
+
+> create a temporary file or directory, safely, and print its name
+
+## env
+
+```sh
+TMPDIR
+```
+
+## option
+
+```sh
+-d # make a dir instead of a file
+-q # fail silently if an error occurs, useful if a script does not want error output to go to standard error
+-t prefix # generate template (using the supplied prefix and TMPDIR if set) to create a filename template
+-u # Operate in ``unsafe'' mode. The temp file will be unlinked before mktemp exits. This is slightly better than mktemp(3) but still introduces a race condition. Use of this option is not encouraged
+```
+
+## usage
+
+```sh
+mktemp -d # make a directory instead of a file
+
+cd $(mktemp -d)
+
+mkdtemp -t $(basename $0) # generate a template (using the supplied prefix and TMPDIR if set) to create a filename template.
+
+
+trap 'rm -rf "${WORKSPACE}"' EXIT
+WORKSPACE="$(mktemp --directory)"
+
+
+
+SCRATCH="$(mktemp -t tmp.XXXXXXXXXX)" # Create a temp file and store the filename in $SCRATCH
+rm -f "$SCRATCH" # Delete the file
+
+Script fragment to create a temp file and quit if unable to get a safe temporary file
+
+tempfoo="$(basename $0)"
+TMPFILE="$(mktemp /tmp/${tempfoo}.XXXXXX)" || exit 1
+echo "program output" >> $TMPFILE
+```
+
+## see also
+
+- [[tmpfs]]
+- [[bash trap]]
+- [[bash jobs]], [[bash fg]]
+- [[bash pushd popd]]
+- [ss64.com/osx/mktemp](https://ss64.com/osx/mktemp.html)
diff --git a/notes/mongo.md b/notes/mongo.md
new file mode 100644
index 00000000..24082c2b
--- /dev/null
+++ b/notes/mongo.md
@@ -0,0 +1,125 @@
+---
+tags: [database, javascript]
+title: mongo
+created: '2019-07-30T06:19:49.178Z'
+modified: '2023-04-30T11:30:01.101Z'
+---
+
+# mongo
+
+> `mongo` shell is an interactive javascript interface to `mongodb` used to query and update data and perform administrative operations
+
+## install
+
+```sh
+```
+
+## option
+
+```sh
+```
+
+## usage
+
+```sh
+mongo "mongodb://HOST:28015"
+
+mongo 'mongodb://USER:PASS@HOST1:PORT,PASS@HOST2:PORT,PASS@HOST3:POR/DATABASE?replicaSet=RELICASET&ssl=true&authSource=admin'
+
+mongo --host=HOST --port=27017
+
+mongo --username admin --password --authenticationDatabase admin --host HOST --port 27017
+
+mongo --help # show command line options
+
+mongo --nodb # start mongo shell without connecting to a database
+
+mongo --shell # used in conjunction with a javascript file (FILE.js) to continue in the mongo shell after running the FILE.js
+````
+
+## mongo shell
+
+```js
+help // show help
+
+show dbs // show database names
+
+show collections // show collections in current database
+
+show users // show users in current database
+
+show profile // show most recent system.profile entries with time >= 1ms
+
+show logs // show the accessible logger names
+
+show log [name] // prints out the last segment of log in memory, 'global' is default
+
+
+use DATABASE // select DATABASE
+
+
+db.runCommand("ismaster") // find out master node
+rs.isMaster().primary // find out master node
+rs.stepDown(60) // cause a new master to be elected, not be eligible for re-election for 60s
+rs.status().members.find(r=>r.state===1).name // current primary server's IP
+
+
+db // list current database
+
+db.adminCommand( { listDatabases: 1 } ) // list databases
+
+db.help() // help on db methods
+
+db.serverStatus().storageEngine // get current storage engine
+
+db.currentOp().inprog[0].msg // progress while indexing
+
+db.repairDatabase() // free up space on `mmapv1`
+db.runCommand({repairDatabase: 1})
+
+db.stats
+db.stats(1024).storageSize
+
+
+db.test.count();
+
+
+db.getCollection('COLLECTION').find({})
+
+// edit multiple fields
+db.getCollection('executions').update({"state":"ERROR"}, {"$set": {"state":"NO_ERROR"} }, {multi: true})
+
+db.getCollection('executions').find({'state': 'ERROR'}, {state: 1, _id: 0}).toArray()
+
+db.getCollection('COLLECTION').count({state: "EXECUTING"}) // count
+
+db.getCollection('COLLECTION').find({}).sort({_id: -1}).limit(1); // get last item of collection
+
+
+db.getCollection('COLLECTION').find({email: /^foo/}) // find where email starts with foo
+db.getCollection('COLLECTION').find({email: /^ma.*l$/})
+// .* means to match 0 or more of any character
+// matches string that starts with "ma" and ends with "l", ignoring whatever is between.
+```
+
+```js
+var states = db.getCollection('executions').distinct('state')
+states
+states.length
+
+for (var i=0; i mongodb daemon
+
+## usage
+
+```sh
+mongod --repair
+```
+
+## see also
+
+- [[mongo]]
diff --git a/notes/mongodump.md b/notes/mongodump.md
new file mode 100644
index 00000000..07ab6280
--- /dev/null
+++ b/notes/mongodump.md
@@ -0,0 +1,47 @@
+---
+tags: [database]
+title: mongodump
+created: '2019-11-14T08:15:23.493Z'
+modified: '2023-03-25T12:46:38.622Z'
+---
+
+# mongodump
+
+> `mongodump` - creates a binary export of the contents of a mongod database
+> `mongorestore` - restores data from a mongodump database dump into a mongod or mongos
+> `bsondump` - converts BSON dump files into JSON
+
+## install
+
+```sh
+brew tap mongodb/brew && brew install mongodb-database-tools
+```
+
+## usage
+
+```sh
+mongodump --host=HOST --port=27017
+
+mongodump --collection=COLLECTION --db=DATABASE
+
+
+mongorestore --host=HOST --port=3017 --username=admin --authenticationDatabase=admin /backup/mongodump-2019-01-01
+
+mongorestore \
+ --db DATABASE \
+ --drop \
+ --host=HOST \
+ --port=27017 \
+ --username=admin \
+ --password="admin" \
+ --authenticationDatabase=admin \
+ /backup/mongodump-2019-01-01
+```
+
+## see also
+
+- [docs.mongodb.com/database-tools](https://docs.mongodb.com/database-tools/)
+- [[mongo]]
+- [[mongoexport]]
+- [[mysqldump]]
+- [[pg_dump]]
diff --git a/notes/mongoexport.md b/notes/mongoexport.md
new file mode 100644
index 00000000..94c2c101
--- /dev/null
+++ b/notes/mongoexport.md
@@ -0,0 +1,29 @@
+---
+tags: [database]
+title: mongoexport
+created: '2021-09-07T07:14:32.779Z'
+modified: '2023-03-22T10:44:14.352Z'
+---
+
+# mongoexport
+
+## install
+
+```sh
+brew tap mongodb/brew && brew install mongodb-database-tools
+```
+
+## usage
+
+```sh
+mongoexport --jsonFormat=canonical --collection=COLLECTION CONNECTION_STRING
+
+mongoimport --db=users --collection=contacts --file=contacts.json
+
+mongoimport
+```
+
+## see also
+
+- [[mongodump]]
+- [[mongo]]
diff --git a/notes/mongosh.md b/notes/mongosh.md
new file mode 100644
index 00000000..896d6c61
--- /dev/null
+++ b/notes/mongosh.md
@@ -0,0 +1,26 @@
+---
+tags: [database]
+title: mongosh
+created: '2021-09-07T07:21:44.793Z'
+modified: '2023-03-22T10:37:43.316Z'
+---
+
+# mongosh
+
+> [[javascript]] and [[node]] REPL environment for interacting with MongoDB deployments. Used to test queries and operations directly
+
+## install
+
+```sh
+brew install mongosh
+```
+
+## usage
+
+```sh
+mongosh --port 28015 # connects to instance running on localhost with a non-default port
+```
+
+## see also
+
+- [[mongo]]
diff --git a/notes/more.md b/notes/more.md
new file mode 100644
index 00000000..c12659ad
--- /dev/null
+++ b/notes/more.md
@@ -0,0 +1,39 @@
+---
+tags: [linux]
+title: more
+created: '2020-05-05T09:48:06.382Z'
+modified: '2023-05-19T11:26:15.457Z'
+---
+
+# more
+
+> file perusal filter for crt viewing
+
+## option
+
+```sh
+-V # get version
+--help # show options
+```
+
+## usage
+
+```sh
+more -d file # prompts `"[Press space to continue, 'q' to quit.]"`
+
+more -s file # squeeze multiple blank lines into one.
+```
+
+## navigation
+
+```sh
+space # scroll down
+b # scroll back/up
+[n]k # scoll back n lines
+v # start vi
+```
+
+## see also
+
+- [[less]]
+- [[man]]
diff --git a/notes/moreutils.md b/notes/moreutils.md
new file mode 100644
index 00000000..a73ae33a
--- /dev/null
+++ b/notes/moreutils.md
@@ -0,0 +1,42 @@
+---
+tags: [linux, moreutils]
+title: moreutils
+created: '2020-09-01T07:32:18.091Z'
+modified: '2023-05-15T13:06:06.171Z'
+---
+
+# moreutils
+
+## install
+
+```sh
+apt-get install moreutils
+
+brew install moreutils --without-parallel && brew install parallel
+```
+
+## usage
+
+- [[chronic]] - runs a command quietly unless it fails
+- [[combine]] - combine the lines in two files using boolean operations
+- [[errno]] - look up errno names and descriptions
+- [[ifdata]] - get network interface info without parsing ifconfig output
+- [[ifne]] - run a program if the standard input is not empty
+- [[isutf8]] - check if a file or standard input is utf-8
+- [[lckdo]] - execute a program with a lock held
+- [[mispipe]] - pipe two commands, returning the exit status of the first
+- [[parallel]] - run multiple jobs at once
+- [[pee]] - tee standard input to pipes
+- [[sponge]] - soak up standard input and write to a file
+- [[ts]] - timestamp standard input
+- [[vidir]] - edit a directory in your text editor
+- [[vipe]] - insert a text editor into a pipe
+- [[zrun]] - automatically uncompress arguments to command
+
+## see also
+
+- [[parallel]]
+- [[procps]]
+- [[coreutils]]
+- [[bsdmainutils]]
+- [joeyh.name/code/moreutils](https://joeyh.name/code/moreutils/)
diff --git a/notes/mount.md b/notes/mount.md
new file mode 100644
index 00000000..66f3c16e
--- /dev/null
+++ b/notes/mount.md
@@ -0,0 +1,42 @@
+---
+tags: [linux]
+title: mount
+created: '2019-07-30T06:19:49.179Z'
+modified: '2023-03-22T08:24:06.653Z'
+---
+
+# mount
+
+> mount a filesystem
+
+## usage
+
+```sh
+mount | column -t
+
+# nfs4
+mount -v -t nfs4 \
+ -o nfsvers=4,rw,async \
+ 10.32.23.10:/nfs-server \
+ /var/lib/nfs/data
+
+# bind - a bind mount is an alternate view of a directory tree
+mount --bind /some/where /else/where
+mount -o bind /some/where /else/where
+
+
+mount | mount | grep "^/dev" | awk '{print $1" " $5}' # filesystem of partitions
+/dev/sda2 ext4
+/dev/sda1 vfat
+/dev/sda2 ext4
+```
+
+## see also
+
+- [[fstab]]
+- [[findmnt]]
+- [[fuser]]
+- [[docker volume]]
+- [[cryptsetup]]
+- [what-is-a-bind-mount - unix.stackexchange.com](https://unix.stackexchange.com/a/198591/193945)
+- [[column]]
diff --git a/notes/mv.md b/notes/mv.md
new file mode 100644
index 00000000..8625ee71
--- /dev/null
+++ b/notes/mv.md
@@ -0,0 +1,23 @@
+---
+tags: [coreutils, macos]
+title: mv
+created: '2020-08-03T12:08:55.090Z'
+modified: '2023-05-10T14:15:01.809Z'
+---
+
+# mv
+
+> move or rename files
+
+## usage
+
+```sh
+mv -f foo bar # rename file without confirmation
+```
+
+## see also
+
+- [[rnr]]
+- [[cp]]
+- [[rm]]
+- [[rsync]]
diff --git a/notes/mvn.md b/notes/mvn.md
new file mode 100644
index 00000000..852378bd
--- /dev/null
+++ b/notes/mvn.md
@@ -0,0 +1,153 @@
+---
+tags: [buildsystem, java]
+title: mvn
+created: '2019-07-30T06:19:49.084Z'
+modified: '2023-04-13T07:17:39.285Z'
+---
+
+# mvn
+
+> `maven`, yiddish word meaning `accumulator of knowledge`
+> began as an attempt to simplify the build processes in the Jakarta Turbine project
+> at its heart `maven` is a plugin execution framework; all work is done by plugins
+
+- `goal`
+- `phase` - step in build lifecycle, are mapped to underlying goals
+- `build lifecyle` can consist of phases like: `validate`, `compile`, `test`, `package`, `verifiy`, `install`, `deploy`
+- `compile` phase actually executes `validate`, `generate-sources`, `process-sources`, `generate-resources`, `process-resources`, `compile`
+
+`pom.xml` = Project Object Model of a project
+
+## install
+
+```sh
+sdk install maven
+```
+
+## env
+
+```sh
+MAVEN_CLI_OPTS # used to pass options to the Maven CLI
+MAVEN_OPTS # used to configure the JVM that runs Maven
+MAVEN_ARGS # contains args passed to maven before cli args, e.g. options and goals could be defined with the value -B -V checkstyle:checkstyle
+
+MVNW_REPOURL # e.g. when using a mirror
+MVNW_USERNAME
+MVNW_PASSWORD
+```
+
+## option
+
+```sh
+-am, --also-make # If project list is specified, also build projects required by the list
+-amd, --also-make-dependents # If project list is specified, also build projects that depend on projects on the list
+-B, --batch-mode # Run in non-interactive (batch) mode (disables output color)
+-b, --builder ARG # The id of the build strategy to use
+-C, --strict-checksums # Fail the build if checksums don't match
+-c, --lax-checksums # Warn if checksums don't match
+ --color ARG # Defines the color mode of the output. Supported are 'auto', 'always', 'never'.
+-cpu, --check-plugin-updates # Ineffective, only kept for backward compatibility
+-D, --define ARG # Define a user property
+-e, --errors # Produce execution error messages
+-emp, --encrypt-master-password ARG # Encrypt master security password
+-ep, --encrypt-password ARG # Encrypt server password
+-f, --file ARG # Force the use of an alternate POM file (or directory with pom.xml)
+-fae, --fail-at-end # Only fail the build afterwards; allow all non-impacted builds to continue
+-ff, --fail-fast # Stop at first failure in reactorized builds
+-fn, --fail-never # NEVER fail the build, regardless of project result
+-gs, --global-settings ARG # Alternate path for the global settings file
+-gt, --global-toolchains ARG # Alternate path for the global toolchains file
+-h, --help # Display help information
+-l, --log-file ARG # Log file where all build output will go (disables output color)
+-llr, --legacy-local-repository # Use Maven 2 Legacy Local Repository behaviour, ie no use of _remote.repositories. Can also be activated by using -Dmaven.legacyLocalRepo=true
+-N, --non-recursive # Do not recurse into sub-projects
+-npr, --no-plugin-registry # Ineffective, only kept for backward compatibility
+-npu, --no-plugin-updates # Ineffective, only kept for backward compatibility
+-nsu, --no-snapshot-updates # Suppress SNAPSHOT updates
+-ntp, --no-transfer-progress # Do not display transfer progress when downloading or uploading
+-o, --offline # Work offline
+-P, --activate-profiles ARG # Comma-delimited list of profiles to activate
+-pl, --projects ARG # Comma-delimited list of specified reactor projects to build instead of all projects. A project can be specified by [groupId]:artifactId or by its relative path
+-q, --quiet # Quiet output - only show errors
+-rf, --resume-from ARG # Resume reactor from specified project
+-s, --settings ARG # Alternate path for the user settings file
+-t, --toolchains ARG # Alternate path for the user toolchains file
+-T, --threads ARG # Thread count, for instance 4 (int) or 2C/2.5C (int/float) where C is core multiplied
+-U, --update-snapshots # Forces a check for missing releases and updated snapshots on remote repositories
+-up, --update-plugins # Ineffective, only kept for backward compatibility
+-v, --version # Display version information
+-V, --show-version # Display version information WITHOUT stopping build
+-X, --debug # Produce execution debug output
+```
+
+## usage
+
+```sh
+mvn help:active-profiles # displays a list of the profiles which are currently active for this build.
+mvn help:all-profiles # displays a list of available profiles under the current project.
+mvn -B help:all-profiles # list profiles
+mvn help:describe # displays a list of the attributes for a Maven Plugin and/or goals (aka Mojo - Maven plain Old Java Object).
+mvn help:describe -Dcmd=compile
+mvn help:effective-pom # displays the effective POM as an XML for this build, with the active profiles factored in, or a specified artifact. If verbose, a comment is added to each XML element describing the origin of the line.
+mvn help:effective-pom -Doutput=effective-pom.xml
+mvn help:effective-settings # displays the calculated settings as XML for this project, given any profile enhancement and the inheritance of the global settings into the user-level settings.
+mvn help:evaluate # evaluates Maven expressions given by the user in an interactive mode.
+mvn help:help # display help information on maven-help-plugin.
+mvn help:help -Ddetail=true -Dgoal=GOAL # to display parameter details.
+mvn help:system # displays a list of the platform details like system properties and environment variables.
+
+
+# commands will automatically download and install the plugin if it hasn't already been installed
+mvn fr.jcgay.maven.plugins:buildplan-maven-plugin:list # list goals by the order they will execute
+mvn fr.jcgay.maven.plugins:buildplan-maven-plugin:list-phase # group goals by phase
+mvn fr.jcgay.maven.plugins:buildplan-maven-plugin:list-plugin # group goals by plugin
+# default: goals search for tasks that run on `mvn deploy`, phases such as `clean` not included
+mvn fr.jcgay.maven.plugins:buildplan-maven-plugin:list -Dbuildplan.tasks=clean,install,deploy
+
+mvn clean install
+
+mvn clean deploy # builds artefact and deploys to repository
+
+mvn generate-sources
+
+mvn clean install -DskipTests
+
+mvn docker:push
+
+mvn dependency:list > dependencies.txt`
+
+
+# encryption
+mvn --encrypt-master-password
+# this goes into .m2/settings-security.xml
+#
+# {Pf5qrzaQNlMHkzYc74qsZ+bhvXmZj268aPdygg4YgF0=}
+#
+mvn --encrypt-password # server pass
+
+
+# multi-module
+mvn versions:set -newVersion=1.2.3
+
+
+mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app \
+ -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
+
+mvn package
+
+# get version from pom.xml
+mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version \
+ | grep -Ev "(^\[|Download[ed]\w+:)"
+mvn --no-transfer-progress org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version \
+ | grep -Ev "^\["
+```
+
+## see also
+
+- [maven-in-five-minutes - apache.org](https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html)
+- [Maven โ Password Encryption](https://maven.apache.org/guides/mini/guide-encryption.html)
+- [[sdk]]
+- [[java]]
+- [[gradle]]
+- [[xmllint]]
+- [[sbt]]
diff --git a/notes/myisamchk.md b/notes/myisamchk.md
new file mode 100644
index 00000000..79dd0697
--- /dev/null
+++ b/notes/myisamchk.md
@@ -0,0 +1,33 @@
+---
+tags: [database]
+title: myisamchk
+created: '2019-08-29T06:08:17.952Z'
+modified: '2023-04-30T11:30:30.016Z'
+---
+
+# myisamchk
+
+> ..
+
+## install
+
+```sh
+```
+
+## option
+
+```sh
+```
+
+## usage
+
+```sh
+myisamchk /var/lib/mysql/Abtelefoniertool/bewo_namen.MYI >> /tmp/myisamchk_log.txt # checks corrupt table
+
+myisamchk -r /var/lib/mysql/Abtelefoniertool/bewo_namen.MYI # repairs corrupt table
+```
+
+## see also
+
+- [[mysql]]
+- [How To Repair Corrupted MySQL Tables Using myisamchk](http://www.thegeekstuff.com/2008/09/how-to-repair-corrupted-mysql-tables-using-myisamchk/)
diff --git a/notes/mysql.md b/notes/mysql.md
new file mode 100644
index 00000000..cd153057
--- /dev/null
+++ b/notes/mysql.md
@@ -0,0 +1,134 @@
+---
+tags: [database]
+title: mysql
+created: '2019-07-30T06:19:49.179Z'
+modified: '2023-04-30T11:29:16.994Z'
+---
+
+# mysql
+
+> mysql cli tool
+
+## install
+
+```sh
+yum install mysql
+```
+
+## option
+
+```sh
+-u, --user=USER # user for login if not current user
+-p, --password[=PASS] # password to use when connecting to server. If password is not given it's asked from the tty
+-P, --port=PORT # port number to use for connection or 0 for default to, in order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default (3306).
+-h, --host=name # connect to host
+
+-e, --execute=name # execute command and quit. Disables --force and history file
+-f, --force # continue even if we get an SQL error
+```
+
+## usage
+
+```sh
+mysql -uUSER -pPASS -hHOST -e "show databases;"
+
+mysql -uUSER -pPASS -hHOST -e "SELECT id, name FROM person WHERE name like '%smith%'" database > smiths.txt
+```
+
+## console
+
+```sql
+\g -- go Send command to mysql server.
+\G -- ego Send command to mysql server, display result vertically.
+
+-- info
+select user,host from mysql.user; -- list all users and privileges
+select User from mysql.user; -- list users
+select USER(),CURRENT_USER(); -- current logged in user
+desc config; -- table info
+
+-- show
+SHOW processlist; -- list processes
+SHOW grants for 'root'@'%'; -- privilegs of specific user
+SHOW databases;
+SHOW engines;
+SHOW TABLE STATUS; -- lists egnine, version, index-length, ...
+SHOW TABLES;
+SHOW tables from foo;
+SHOW FULL TABLES -- show additional Views
+SHOW TABLES LIKE 'p%';
+SHOW TABLES LIKE '%es';
+SHOW TABLES WHERE expression;
+SHOW FULL TABLES WHERE table_type = 'VIEW';
+SHOW VARIABLES LIKE "%version%"; -- get MySQL Version
+SHOW VARIABLES LIKE "character_set_database";
+
+-- search tablename in all databases
+SELECT table_name, table_schema AS dbname FROM INFORMATION_SCHEMA.TABLES;
+SELECT table_name, table_schema AS dbname FROM information_schema.tables where table_name = 'bewo_namen';
+
+-- database size
+SELECT table_schema "Data Base Name", sum( data_length + index_length) / 1024 / 1024 "Data Base Size in MB"
+FROM information_schema.TABLES
+GROUP BY table_schema ;
+
+-- create databaes & user
+CREATE DATABASE `someDB` CHARACTER SET utf8 COLLATE utf8_bin;
+CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
+-- GRANT ALL PRIVILEGES ON `someDB`.* TO "someDB-user"@"localhost";
+-- GRANT ALL PRIVILEGES ON `someDB`.* TO "someDB-user"@"localhost" IDENTIFIED BY 'password';
+GRANT ALL PRIVILEGES ON `someDB`.* TO "someDB-user"@"192.168.1.%";
+FLUSH PRIVILEGES;
+exit
+
+CREATE DATABASE `database_name` CHARACTER SET utf8 COLLATE utf8_bin;
+CREATE USER 'urlshortner'@'localhost' IDENTIFIED BY 'avg-_Duk3VG3BfRIRrsb';
+GRANT ALL PRIVILEGES ON `urlshortnerdb`.* TO 'urlshortner'@'%' IDENTIFIED BY 'avg-_Duk3VG3BfRIRrsb';;
+FLUSH PRIVILEGES;
+
+
+-- privileges
+GRANT SELECT,INSERT,UPDATE,DELETE ON `db`.* TO 'user'@'host';
+FLUSH
+REVOKE all privileges on *.* FROM 'user'@'host';
+show grants for 'urlshortner';
+show grants for 'urlshortner'@'localhost';
+
+-- COLLATE
+utf8_unicode_ci
+utf8_general_ci -- applies Unicode normalization using language-specific rules and compares strings case-insensitively
+utf8_general_cs -- does the same, but compares strings case-sensitively
+utf8_bin -- Compares strings by the binary value of each character in the string
+
+ALTER DATABASE bitbucket CHARACTER SET utf8 COLLATE utf8_bin;
+drop database bitbucket;
+
+
+-- global variables
+SHOW variables;
+SET GLOBAL general_log = 'OFF';
+SELECT status,COUNT(*) as count FROM table GROUP BY status ORDER BY count DESC;
+
+-- transactions
+START TRANSACTION;
+SELECT * FROM nicetable WHERE somthing=1;
+UPDATE nicetable SET nicefield='VALUE' WHERE somthing=1;
+SELECT * FROM nicetable WHERE somthing=1; #check
+COMMIT;
+ROLLBACK; -- or if you want to reset changes
+
+
+INSERT INTO table_name (column1, column2, column3, ...)
+VALUES (value1, value2, value3, ...);
+```
+
+## see also
+
+- [[mongo]]
+- [[psql]]
+- [[sqlite]]
+- [mysql-find-a-table-in-all-database - stackoverflow](http://stackoverflow.com/a/3756768)
+- [how-to-create-a-new-user-and-grant-permissions - digitalocean.com](https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql)
+- [connecting-bitbucket-server-to-mysql](https://confluence.atlassian.com/bitbucketserver/connecting-bitbucket-server-to-mysql-776640382.html)
+- [why-the-g-in-select-from-table-name-g](https://stackoverflow.com/a/40030346/2087704)
+- [How to calculate the MySQL database size โ Mkyong.com](http://www.mkyong.com/mysql/how-to-calculate-the-mysql-database-size/)
diff --git a/notes/mysqladmin.md b/notes/mysqladmin.md
new file mode 100644
index 00000000..8fef68dc
--- /dev/null
+++ b/notes/mysqladmin.md
@@ -0,0 +1,30 @@
+---
+tags: [database]
+title: mysqladmin
+created: '2019-08-29T06:15:54.673Z'
+modified: '2023-04-30T11:31:04.175Z'
+---
+
+# mysqladmin
+
+> ..
+
+## install
+
+```sh
+```
+
+## option
+
+```sh
+```
+
+## usage
+
+```sh
+mysqladmin -u root -p -i 1 processlist # list processes
+```
+
+## see also
+
+- [[mysql]]
diff --git a/notes/mysqlcheck.md b/notes/mysqlcheck.md
new file mode 100644
index 00000000..ba83e924
--- /dev/null
+++ b/notes/mysqlcheck.md
@@ -0,0 +1,38 @@
+---
+tags: [database]
+title: mysqlcheck
+created: '2019-08-18T14:36:02.403Z'
+modified: '2023-04-30T11:31:51.308Z'
+---
+
+# mysqlcheck
+
+> checks, repairs, optimizes and analyzes tables
+
+## install
+
+```sh
+```
+
+## option
+
+```sh
+--verbose # option will give you more information about what mysqlcheck is doing.
+```
+
+## usage
+
+```sh
+mysqlcheck --print-defaults
+
+mysqlcheck -c DATABASE -uroot -p # check database for corrupt tables
+
+mysqlcheck -r DATABASE TABLE -uroot -p # repair table
+```
+
+## see also
+
+- [[mysql]]
+- [mariadb.com/kb/en/library/mysqlcheck](https://mariadb.com/kb/en/library/mysqlcheck/)
+- [mysqlcheck - thegeekstuff.com](http://www.thegeekstuff.com/2011/12/mysqlcheck)
+
diff --git a/notes/mysqldump.md b/notes/mysqldump.md
new file mode 100644
index 00000000..dd11bfb7
--- /dev/null
+++ b/notes/mysqldump.md
@@ -0,0 +1,47 @@
+---
+tags: [database]
+title: mysqldump
+created: '2019-08-18T14:33:58.877Z'
+modified: '2022-02-02T09:34:01.761Z'
+---
+
+# mysqldump
+
+> dump [[mysql]] database
+
+## usage
+
+```sh
+mysqldump -uUSER -pPASSWORD DBNAME > BACKUP.sql # export
+
+mysqldump -uUSER -pPASSWORD DBNAME < BACKUP.sql # import
+
+
+mysqldump -uUSER -pPASSWORD DBNAME | gzip > BACKUP.sql.gz # for encrypted export
+
+gunzip < BACKUP.sql.gz | mysql -uUSER -pPASSWORD DBNAME # for encrypted import
+
+mysqldump \
+ --no-data \
+ --ignore-table=DATABASE.jos_mpm `# ignore tables` \
+ -h$HOST -u$USR -p$PWD \
+ $DB > $(date +%Y-%m-%d)_SCHEME_$DB.sql
+
+mysqldump \
+ --no-create-info \
+ --complete-insert \
+ --ignore-table=DATABASE.jos_mpm \
+ -h$HOST -u$USR -p$PWD \
+ $DB > $(date +%Y-%m-%d)_DATA_$DB.sql
+```
+
+## see also
+
+- [[mysql]]
+- [[mongodump]]
+- [[pg_dump]]
+- [[pv]]
+- [[zip]]
+- [[gzip]]
+- [[pigz]]
+- [[date]]
diff --git a/notes/mytop.md b/notes/mytop.md
new file mode 100644
index 00000000..6cf0d079
--- /dev/null
+++ b/notes/mytop.md
@@ -0,0 +1,20 @@
+---
+tags: [database]
+title: mytop
+created: '2019-08-29T06:08:47.559Z'
+modified: '2023-04-30T11:32:03.522Z'
+---
+
+# mytop
+
+> show mysql procs
+
+## usage
+
+```sh
+mytop -h172.18.0.2 -uroot --prompt
+```
+
+## see also
+
+- [[mysql]]
diff --git a/notes/named.md b/notes/named.md
new file mode 100644
index 00000000..3c4faa80
--- /dev/null
+++ b/notes/named.md
@@ -0,0 +1,19 @@
+---
+tags: [dns]
+title: named
+created: '2020-07-22T08:49:14.742Z'
+modified: '2020-09-02T17:38:04.603Z'
+---
+
+# named
+
+## usage
+```sh
+
+```
+
+## see also
+- [[rndc]]
+- [[dig]]
+- [[BIND]]
+- [[systemctl]]
diff --git a/notes/nat.md b/notes/nat.md
new file mode 100644
index 00000000..4777b712
--- /dev/null
+++ b/notes/nat.md
@@ -0,0 +1,14 @@
+---
+tags: [network]
+title: nat
+created: '2020-01-30T11:33:30.256Z'
+modified: '2020-09-02T17:38:42.510Z'
+---
+
+# nat
+
+> network address translation
+
+## see also
+- [[docker network]]
+- [[pat]]
diff --git a/notes/native-image.md b/notes/native-image.md
new file mode 100644
index 00000000..729217f3
--- /dev/null
+++ b/notes/native-image.md
@@ -0,0 +1,60 @@
+---
+tags: [cloud, container, java]
+title: native-image
+created: '2023-05-11T10:44:23.796Z'
+modified: '2023-05-24T08:43:30.769Z'
+---
+
+# native-image
+
+> [[graalvm]] native image - compiles ahead-of-timejava code to native executables
+
+```sh
+sdk install java 22.3.r19-grl
+sdk use java 22.3.r19-grl
+```
+
+## env
+
+```sh
+GRAALVM_HOME=$HOME/Development/graalvm/Contents/Home/
+```
+
+## option
+
+```sh
+-cp PATH, -classpath PATH, --class-path PATH # : separated list of directories, JAR archives, and ZIP archives to search for class files
+ --native-image-info # show native-toolchain information and image-build settings
+```
+
+## usage
+
+```sh
+native-image --native-image-info ..
+native-image -cp bcprov-jdk15on-164.jar:. -H:ReflectionConfigurationFiles=reflection-config.json test
+```
+
+## compile example
+
+```java
+public class HelloWorld {
+ public static void main(String[] args) {
+ System.out.println("Hello, World!");
+ }
+}
+```
+
+```sh
+javac HelloWorld.java
+
+java HelloWorld
+
+native-image HelloWorld
+```
+
+## see also
+
+- [[sdk]], [[java]], [[mvn]]
+- [[quarkus]]
+- [[graalvm]]
+- [graalvm.org/native-image/](https://www.graalvm.org/native-image/)
diff --git a/notes/nc.md b/notes/nc.md
new file mode 100644
index 00000000..60aa4e34
--- /dev/null
+++ b/notes/nc.md
@@ -0,0 +1,97 @@
+---
+tags: [linux, network]
+title: nc
+created: '2019-07-30T06:19:49.181Z'
+modified: '2023-03-22T10:42:51.836Z'
+---
+
+# nc
+
+> `netcat`- arbitrary tcp/udp connections and listens
+
+## install
+
+```sh
+brew install netcat
+apt install netcat
+yum install netcat
+```
+
+## option
+
+```sh
+-h, --help # display this help and exit
+-z # scan for listening daemons, without sendin any data
+-v # verbose output
+-i interval # delay time interval between lines of text sent and received
+-l # listen for an incoming connection
+-p source_port # not used with -l
+-w timeout # if connection/stdin are idle for more than timeout sec, then the connection is silently closed
+-e, --exec=PROGRAM # program to exec after connect
+-k #
+```
+
+## usage
+
+```sh
+/usr/bin/nc -k -l 4444 # osx default
+/usr/local/bin/nc -l -p 4444 # osx brew uses gnu-netcat; needs -p PORT !
+
+
+nc -zv serverhost 27017 # check if port is open
+
+nc -u -zv 192.168.100.1 80-200 # scan udb prots 80 to 200
+
+
+echo "PING" | nc 127.0.0.1 3310 # sends ping
+
+nc -l 5566 -e /bin/bash # create a backdoor-shell
+nc 192.168.100.1 5566 # use shell
+
+nc -q1 -lvp 1234 < file.txt # poor man's file server
+nc serverhost 1234 > output.txt # to retrieve file from remote host. NAT bugs this.
+
+nc -l 1234 > out.file # wait for receiving file
+nc -w 30 serverhost 1234 < out.file # send file over network, timeout after 30 sec
+
+tar czvf - /path/to/directory | nc host-IP 4444 # sending directory
+nc -l 4444 | tar xzvf - # receiving directory
+
+
+tar c myproject/ | lzma \
+ | gpg -a -c --cipher-algo AES256 --digest-algo SHA512 -o - \
+ | nc -w 1 192.168.1.102 1337 # sending file encrypted
+nc -lp 1337 | gpg -v -o - | lzcat | tar x -C /home/user/ # receiving file encrypted
+
+
+while true; do sudo nc -lp 80 < index.html; done # web-server with a static page
+
+printf "GET /nc.1 HTTP/1.1\r\nHost: man.openbsd.org\r\n\r\n" | nc man.openbsd.org 80 # get request
+echo -ne "POST /-/reload HTTP/1.0r\nHost: localhostr\n" | nc -i localhost 8080 # post request
+
+#!/bin/sh
+echo "why am i like this"
+while [ 1 ]; do
+ {
+ echo -ne "HTTP/1.1 200 OK\nContent-Type: text/html;
+ charset=UTF-8\nServer: netcat\n\n";
+ cat index.md | ./wcgow;
+ } | nc -w 1 -l -N -p 8080;
+done
+
+
+echo 'Hello, Seashells!' | nc seashells.io 1337 # "pipe output from command-line programs to the web in real-time"
+```
+
+## see also
+
+- [[curl]]
+- [[ncat]]
+- [[socat]]
+- [[netstat]]
+- [[tar]]
+- [[gpg]]
+- [[lzcat]]
+- [seashells.io](seashells.io)
+- [samurailink3.com/blog/2013/12/31/ship-it-with-netcat](https://samurailink3.com/blog/2013/12/31/ship-it-with-netcat/)
+- [[redis-cli]]
diff --git a/notes/ncat.md b/notes/ncat.md
new file mode 100644
index 00000000..42bf18b7
--- /dev/null
+++ b/notes/ncat.md
@@ -0,0 +1,23 @@
+---
+tags: [network]
+title: ncat
+created: '2020-01-20T07:22:38.491Z'
+modified: '2021-10-18T12:18:40.990Z'
+---
+
+# ncat
+
+> concat and redirect sockets - `ncat` was written for the nmap-project as a much-improved reimplementation of `netcat`
+
+## usage
+
+```sh
+ncat -C --ssl host 443 # test a host over SSL
+```
+
+## see also
+
+- [man7.org/linux/man-pages/man1/ncat](http://man7.org/linux/man-pages/man1/ncat.1.html)
+- [[nmap]]
+- [[nc]]
+
diff --git a/notes/nerdctl.md b/notes/nerdctl.md
new file mode 100644
index 00000000..3a71826f
--- /dev/null
+++ b/notes/nerdctl.md
@@ -0,0 +1,42 @@
+---
+tags: [container]
+title: nerdctl
+created: '2022-01-27T09:39:31.754Z'
+modified: '2023-05-30T07:24:46.258Z'
+---
+
+# nerdctl
+
+> [[docker]] compatible cli for [[containerd]]
+
+## install
+
+```sh
+brew install nerdctl
+```
+
+## usage
+
+```sh
+nerdctl run -it --rm alpine # run a container with the default bridge CNI network (10.4.0.0/24)
+
+nerdctl build -t foo /some-dockerfile-directory # build an image using BuildKit
+
+nerdctl build -o type=local,dest=. /DIR # build and send output to a local directory using BuildKit
+
+nerdctl compose -f ./docker-compose.yaml up # run containers from docker-compose.yaml
+
+nerdctl --namespace k8s.io ps -a # list Kubernetes containers
+
+nerdctl run -d -p 8080:80 --name nginx nginx:alpine # run a container with rootless containerd
+```
+
+## see also
+
+- [[ctr]]
+- [[kim]]
+- [[colima]]
+- [[docker]]
+- [[docker-compose]]
+- [[containerd]]
+- [[kubectl]]
diff --git a/notes/nerdfonts.md b/notes/nerdfonts.md
new file mode 100644
index 00000000..c72e4252
--- /dev/null
+++ b/notes/nerdfonts.md
@@ -0,0 +1,48 @@
+---
+tags: [linux, macos]
+title: nerdfonts
+created: '2023-04-15T09:17:30.144Z'
+modified: '2023-04-15T09:53:55.589Z'
+---
+
+# nerdfonts
+
+> patches developer targeted fonts with a high number of glyphs (icons)
+> Specifically to adds a high number of extra glyphs from popular โiconic fontsโ such as `Font Awesome`, `Devicons`, `Octicons`
+
+- `mono` - monospaced font, also called a fixed-pitch, fixed-width, or non-proportional font, is a font whose letters and characters each occupy the same amount of horizontal space
+
+## install
+
+```sh
+brew tap homebrew/cask-fonts
+brew search '/font-.*-nerd-font/' # list available nerdfonts
+brew install --cask font-ubuntu-mono-nerd-font # install font
+```
+
+## usage
+
+```sh
+ls -lah ~/Library/Fonts
+
+fc-list | grep -v "/System" | column -t -s:
+/PATH/TO/Library/Fonts/Ubuntu Mono Bold Italic Nerd Font Complete Mono.ttf: UbuntuMono Nerd Font Mono:style=Bold Italic
+# โโโโโโโโโโโโโโโโโโโโโโโโโโโ
+
+fc-list # lists all font faces
+fc-list :lang=hi # lists font faces that cover Hindi.
+fc-list : family style file spacing # lists filename and spacing value for each font face. '':'' is an empty pattern that matches all fonts
+fc-list : file family | grep \/Library
+
+fc-cache # scan font files or directories
+```
+
+
+## see also
+
+- [nerdfonts.com](https://www.nerdfonts.com/)
+- [[brew]]
+- [[alacritty]]
+- [[nvim]]
+- [[nvchad]]
+- [[vim]]
diff --git a/notes/net-tools vs iproute.md b/notes/net-tools vs iproute.md
new file mode 100644
index 00000000..a3d48c8d
--- /dev/null
+++ b/notes/net-tools vs iproute.md
@@ -0,0 +1,44 @@
+---
+tags: [iproute, net-tools, network]
+title: net-tools vs iproute
+created: '2019-07-30T06:19:49.082Z'
+modified: '2021-11-11T08:29:43.186Z'
+---
+
+# net-tools vs iproute
+
+> comparing both toolsets
+
+## usage
+
+```sh
+# net-tools ip-route commands
+arp -a ip neigh
+arp -v ip -s neigh
+arp -s 192.168.1.1 1:2:3:4:5:6 ip neigh add 192.168.1.1 lladdr 1:2:3:4:5:6 dev eth1
+arp -i eth1 -d 192.168.1.1 ip neigh del 192.168.1.1 dev eth1
+
+ifconfig -a ip addr
+ifconfig eth0 down ip link set eth0 down
+ifconfig eth0 up ip link set eth0 up
+ifconfig eth0 192.168.1.1 ip addr add 192.168.1.1/24 dev eth0
+ifconfig eth0 netmask 255.255.255.0 ip addr add 192.168.1.1/24 dev eth0
+ifconfig eth0 mtu 9000 ip link set eth0 mtu 9000
+ifconfig eth0:0 192.168.1.2 ip addr add 192.168.1.2/24 dev eth0
+
+netstat ss
+netstat -neopa ss -neopa
+netstat -g ip maddr
+
+route ip route
+route add -net 192.168.1.0 netmask 255.255.255.0 dev eth0 ip route add 192.168.1.0/24 dev eth0
+route add default gw 192.168.1.1 ip route add default via 192.168.1.1
+```
+
+## see also
+
+- [[net-tools]]
+- [[iproute]]
+- [[netstat]]
+- [access.redhat.com/ip_cheatsheet.pdf](https://access.redhat.com/sites/default/files/attachments/rh_ip_command_cheatsheet_1214_jcs_print.pdf)
+
diff --git a/notes/net-tools.md b/notes/net-tools.md
new file mode 100644
index 00000000..6b66244c
--- /dev/null
+++ b/notes/net-tools.md
@@ -0,0 +1,29 @@
+---
+tags: [net-tools, network]
+title: net-tools
+created: '2020-09-03T06:24:46.842Z'
+modified: '2022-03-04T07:46:19.712Z'
+---
+
+# net-tools
+
+> package contains programs which form base of Linux networking
+
+- [[arp]] - manipulate the kernel's ARP cache, usually to add or delete an entry, or to dump the entire cache.
+- [[dnsdomainname]]* - reports the system's dns domain name
+- [[domainname]] - reports or sets the system's NIS/YP domain name
+- [[hostname]] - reports or sets the name of the current host system
+- [[ifconfig]] - main utility for configuring network interfaces
+- [[nameif]] - names network interfaces based on MAC addresses
+- [[netstat]] - used to report network connections, routing tables, and interface statistics
+- [[nisdomainname]] - does the same as domainname
+- [[plipconfig]] - used to fine tune the PLIP device parameters, to improve its performance
+- [[rarp]] - used to manipulate the kernel's RARP table
+- [[route]] - used to manipulate the IP routing table
+- [[slattach]] - attaches network interface to a serial line This allows you to use normal terminal lines for point-to-point links to other computers
+- [[ypdomainname]] - does the same as domainname
+
+## see also
+
+- [[coreutils]]
+- [[net-tools vs iproute]]
diff --git a/notes/netstat.md b/notes/netstat.md
new file mode 100644
index 00000000..b434db04
--- /dev/null
+++ b/notes/netstat.md
@@ -0,0 +1,55 @@
+---
+tags: [net-tools, network]
+title: netstat
+created: '2019-08-28T22:19:06.348Z'
+modified: '2023-03-23T08:47:22.378Z'
+---
+
+# netstat
+
+> show network status
+
+## install
+
+```
+apt-get install net-tools
+yum install net-tools
+zypper install net-tools
+pacman -S netstat-nat
+```
+
+## option
+
+```sh
+-l, --listening # show only listening sockets. (These are omitted by default.)
+-p, --program # show the PID and name of the program to which each socket belongs
+-t, --tcp # TCP sockets
+-u, --udp # UDP sockets
+-w # Raw sockets
+-x # Unix sockets
+-n, --numeric # show numerical addresses instead of trying to determine symbolic host, port or user names
+-a, --all #
+```
+
+## usage
+
+```sh
+netstat -c # continuasly
+netstat -s # summary
+netstat -i # show interfaces
+netstat -st # summary of tcp
+
+netstat -tulpn # `tulp'n` ๐ท
+netstat -tunapl # `tuna please` ๐
+netstat -ant # ๐
+```
+
+## see also
+
+- [[ss]]
+- [[ip]]
+- [[nc]]
+- [[net-tools vs iproute]]
+- [[firewall-cmd]]
+- [[busybox]]
+- [[unix socket]]
diff --git a/notes/nettop.md b/notes/nettop.md
new file mode 100644
index 00000000..777c65ed
--- /dev/null
+++ b/notes/nettop.md
@@ -0,0 +1,23 @@
+---
+tags: [macos]
+title: nettop
+created: '2020-03-23T13:03:11.754Z'
+modified: '2020-08-12T12:12:06.476Z'
+---
+
+# nettop
+
+> display updated information about the network
+
+## usage
+```sh
+nettop
+
+nettop -d # delta mode: current bandwidth usage instead of the running total
+ # toggle with: d
+```
+
+## see also
+- [[nethogs]]
+- [[dtrace]]
+- [[powermetrics]]
diff --git a/notes/networksetup.md b/notes/networksetup.md
new file mode 100644
index 00000000..0a9e67e6
--- /dev/null
+++ b/notes/networksetup.md
@@ -0,0 +1,32 @@
+---
+tags: [macos, network]
+title: networksetup
+created: '2019-09-06T06:34:44.756Z'
+modified: '2021-10-31T14:49:12.470Z'
+---
+
+# networksetup
+
+> configuration tool for network settings in System Preferences
+
+## usage
+
+```sh
+networksetup -listallhardwareports
+
+networksetup -listnetworkserviceorder
+
+networksetup -listpreferredwirelessnetworks en0
+
+networksetup -setairportpower en0 [on|off]
+
+networksetup -setairportnetwork en0 SSID
+
+networksetup -setairportnetwork devicename network [password]
+```
+
+## see also
+
+- [[airport]]
+- [[nmap]]
+- [[wireshartk]]
diff --git a/notes/nfs.md b/notes/nfs.md
new file mode 100644
index 00000000..c8d85a1f
--- /dev/null
+++ b/notes/nfs.md
@@ -0,0 +1,17 @@
+---
+tags: [filesystem]
+title: nfs
+created: '2019-08-23T11:02:27.673Z'
+modified: '2023-03-22T09:15:00.970Z'
+---
+
+# nfs
+
+`network file system`
+
+> distributed file system protocol originally developed by Sun Microsystems
+> NFS is built on the Remote Procedure Call (RPC) mechanism, making it a stateless protocol (server-side)
+
+## see also
+
+- [NFS_considered_harmful](https://www.time-travellers.org/shane/papers/NFS_considered_harmful.html)
diff --git a/notes/nginx.md b/notes/nginx.md
new file mode 100644
index 00000000..fcf4ecee
--- /dev/null
+++ b/notes/nginx.md
@@ -0,0 +1,51 @@
+---
+tags: [lua]
+title: nginx
+created: '2021-08-31T08:55:05.976Z'
+modified: '2023-05-05T08:15:51.100Z'
+---
+
+# nginx
+
+>
+
+## option
+
+```sh
+-?,-h # show help
+-v # show version and exit
+-V # show version and configure options then exit
+-t # test configuration and exit
+-T # test configuration, dump it and exit
+-q # suppress non-error messages during configuration testing
+-s signal # send signal to a master process: stop, quit, reopen, reload
+-p prefix # set prefix path (default: /etc/nginx/)
+-e filename # set error log file (default: /var/log/nginx/error.log)
+-c filename # set configuration file (default: /etc/nginx/nginx.conf)
+-g directives # set global directives out of configuration file
+```
+
+## module
+
+```sh
+ngx_http_core_module
+
+Syntax: try_files file ... uri;
+ try_files file ... =code;
+Context: server, location
+
+
+Syntax: error_page code ... [=[response]] uri;
+Context: http, server, location, if in location
+
+
+Syntax: error_log file [level];
+ error_log logs/error.log error;
+
+ level: debug, info, notice, warn, error, crit, alert, or emerg
+Context: main, http, mail, stream, server, location
+```
+
+## see also
+
+- [nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls](https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/)
diff --git a/notes/nice.md b/notes/nice.md
new file mode 100644
index 00000000..b03a3ebf
--- /dev/null
+++ b/notes/nice.md
@@ -0,0 +1,20 @@
+---
+tags: [coreutils]
+title: nice
+created: '2020-08-06T09:43:52.727Z'
+modified: '2020-09-01T12:44:58.465Z'
+---
+
+# nice
+
+> execute a utility at an altered scheduling priority
+
+## usage
+```sh
+nice -n 5 date # execute `date` at priority 5 assuming the priority of the shell is 0
+
+nice -n 16 nice -n -35 date # execute `date` at priority -19 assuming the priority of the shell is 0 and you are the super-user
+```
+
+## see also
+- [[nohup]]
diff --git a/notes/ninja.md b/notes/ninja.md
new file mode 100644
index 00000000..aaec7aa3
--- /dev/null
+++ b/notes/ninja.md
@@ -0,0 +1,26 @@
+---
+tags: [buildsystem]
+title: ninja
+created: '2020-08-27T11:49:16.415Z'
+modified: '2023-03-22T08:19:27.305Z'
+---
+
+# ninja
+
+> build system with a focus on speed - differs from other build systems: designed to have its input files generated by higher-level build system, and it is designed to run builds as fast as possible
+
+## usage
+
+```sh
+# many of ninjaโs flags intentionally match those of `make`
+
+ninja -h # prints help
+
+ninja -C DIR -j 20 # changes into DIR dir run 20 build commands in parallel
+```
+
+## see also
+
+- [[cmake]]
+- [[make]]
+- [github.com/ninja-build/ninja](https://github.com/ninja-build/ninja)
diff --git a/notes/nix.md b/notes/nix.md
new file mode 100644
index 00000000..dbe247a3
--- /dev/null
+++ b/notes/nix.md
@@ -0,0 +1,46 @@
+---
+tags: [packagemanager]
+title: nix
+created: '2020-06-16T08:44:19.067Z'
+modified: '2020-08-26T07:57:28.042Z'
+---
+
+# nix
+
+> purely functional package manager
+> treats packages as values in purely functional programming languages
+> packages are built by functions that donโt have side-effects and don't change after they have been built
+
+## usage
+```sh
+
+nix-channel --update
+
+nix-channel --add https://nixos.org/channels/nixpkgs-unstable
+nix-channel --remove nixpkgs
+
+
+nix-env -q # list all installed packages
+nix-env -qa
+nix-env -qa chromium
+nix-env -qas gcc # status of the available package
+nix-env -qaP | grep python3-3 # search for a particular package
+
+
+nix-env -i gcc
+nix-env --install gcc
+
+
+nix-env -e gcc vim # remove multiple packages
+nix-collect-garbage -d # remove unused packages
+
+nix-env -u # upgrade all packages
+nix-env -u vim
+nix-env --upgrade vim
+
+
+nix-env --rollback
+```
+## see also
+- [[brew]]
+- [[apt]]
diff --git a/notes/nl.md b/notes/nl.md
new file mode 100644
index 00000000..510d8a2a
--- /dev/null
+++ b/notes/nl.md
@@ -0,0 +1,33 @@
+---
+tags: [linux]
+title: nl
+created: '2020-08-03T11:54:23.348Z'
+modified: '2021-06-04T12:19:17.849Z'
+---
+
+# nl
+
+> line numbering filter
+
+## usage
+```sh
+-a # number all lines
+-t # number only nonempty lines
+-n # number no Lines
+-p # number only lines that contain a match for the basic regex
+```
+```sh
+nl FILE # print file like cat with line numbers
+
+nl -v 77 FILE # start with specific line number
+
+nl -ba FILE # empty lines get numbered
+
+nl -b p":[0-2]:[0-2]" /etc/passwd # number lines that match a regex
+```
+
+## see also
+- [[cat]]
+- [[paste]]
+- [[wc]]
+
diff --git a/notes/nm.md b/notes/nm.md
new file mode 100644
index 00000000..a691b0f3
--- /dev/null
+++ b/notes/nm.md
@@ -0,0 +1,53 @@
+---
+tags: [c]
+title: nm
+created: '2020-04-24T09:04:34.811Z'
+modified: '2023-05-04T13:46:36.709Z'
+---
+
+# nm
+
+> list symbols from object files
+
+## option
+
+```sh
+-a # Display all symbol table entries, including those inserted for use by debuggers
+-g # Display only global (external) symbols
+-n # Sort numerically rather than alphabetically
+-o # Prepend file or archive element name to each output line, rather than only once
+-p # Don't sort; display in symbol-table order
+-r # Sort in reverse order
+-u # Display only undefined symbols
+-U # Don't display undefined symbols
+-m # Display the N_SECT type symbols (Mach-O symbols) as (segment_name, section_name) followed by either external or non-external and then the symbol name
+-x # Display the symbol table entry's fields in hexadecimal, along with the name as a string
+-j # Just display the symbol names (no value or type)
+-s segname sectname # List only those symbols in the section (segname,sectname). For llvm-nm(1) this option must be last on the command line, and after the files
+-l # List a pseudo symbol .section_start if no symbol has as its value the starting address of the section, used with the -s option above
+-arch arch_type # Specifies architecture, arch_type, of the file for nm(1) to operate on when the file is a universal file (see arch(3) for the currently known arch_types)
+-f format # for llvm-nm(1) this specifies the output format. Where format can be bsd, sysv, posix or darwin.
+-f # For nm-classic(1) this displays the symbol table of a dynamic library flat (as one file not separate modules). This is obsolete and not supported with llvm-nm(1).
+-A # Write the pathname or library name of an object on each line.
+-P # Write information in a portable output format.
+-t format # For the -P output, write the numeric value in the specified format. The format shall be dependent on the single character used as the format option-argument:
+ # d - value shall be written in decimal (default)
+ # o - value shall be written in octal
+ # x - value shall be written in hexadecimal
+-L # display the symbols in the bitcode files in the (__LLVM,__bundle) section if present instead of the object's symbol table
+```
+
+## usage
+
+```sh
+nm main.o
+
+nm -D /lib/x86_64-linux-gnu/libc-2.13.so | grep printf # find out what symbols are in a library
+```
+
+## see also
+
+- [[c]]
+- [[gcc]]
+- [[ldd]]
+- [[ld]]
diff --git a/notes/nmap.md b/notes/nmap.md
new file mode 100644
index 00000000..8bd7e3ab
--- /dev/null
+++ b/notes/nmap.md
@@ -0,0 +1,105 @@
+---
+tags: [linux, network]
+title: nmap
+created: '2019-07-30T06:19:49.181Z'
+modified: '2023-04-29T17:14:58.232Z'
+---
+
+# nmap
+
+> `network mapper`
+
+## install
+
+```sh
+brew install nmap
+apt install nmap
+yum install nmap
+```
+
+## option
+
+```sh
+# scanning options
+-sR # if RPC-Service found send additional RPC-Pakets to find out more of services
+-sV # additional tests contains -sR; option enables version detection
+-O # OS-Destection
+-A # short for -sV -O
+-P0 # before portscan nmap check via PING and TCP-PORT-80 scan if host is available
+ # used for hosts without webserver and block ping; option allows you to switch off ICMP pings
+-oN FILE # write scan to file
+-v # verbose
+
+# port scanning methods
+-sT # Connect Scan: TCP-Connection per scanned port, no root required
+-sS # "SYN-Stealth-Scan" like -sT but without full TCP-Connection aka "half-open"/"stealth scanning"
+-sU # scan UDP-Port
+-sP # ping-scan
+```
+
+## usage
+
+```sh
+nmap localhost # list own open ports
+
+nmap -p 2376 10.32.23.30 # check if port open
+
+nmap -T5 -sP 10.32.22.0-255 # ping network for avail hosts
+
+nmap -sn -PS80 10.32.22.250 # ping one node if ping not avail.
+
+nmap -sS -P0 -sV -O TARGET # Get info about remote host ports and OS detection
+
+nmap -sS -P0 -A -v TARGET
+
+nmap -sT -p 80 -oG โ 192.168.1.* | grep open # list of servers with a specific port open
+
+nmap -sP 192.168.0.* # Find all active IP addresses in a network
+
+nmap -sP 192.168.0.0/24 # for specific subnets
+
+nmap -sP 192.168.1.100-254 # Ping a range of IP addresses
+
+nmap -T4 -sP 192.168.2.0/24 && egrep "00:00:00:00:00:00" /proc/net/arp # Find unused IPs on a given subnet
+
+nmap -sP 192.168.1.1/24 # scan network
+
+
+# Scan Network for Rogue APs. host-timeout 20m โmax-scan-delay 1000 -oA wapscan 10.0.0.0/8
+nmap -A -p 1-85,113,443,8080-8100 -T4 โmin-hostgroup 50 โmax-rtt-timeout 2000 \
+ โinitial-rtt-timeout 300 โmax-retries 3 โ
+
+
+# Use a decoy while scanning ports to avoid getting caught by the sys admin
+sudo nmap -sS 192.168.0.10 -D 192.168.0.2
+# Scan for open ports on the target device/computer (192.168.0.10) while setting up a decoy address (192.168.0.2).
+# This will show the decoy ip address instead of your ip in targets security logs.
+# Decoy address needs to be alive. Check the targets security log at /var/log/secure to make sure it worked.
+
+
+# List of reverse DNS records for a subnet
+nmap -R -sL 209.85.229.99/27 | awk '{if($3=="not")print"("$2") no PTR";else print$3" is "$2}' | grep '('
+# This command uses nmap to perform reverse DNS lookups on a subnet.
+# It produces a list of IP addresses with the corresponding PTR record for a given subnet.
+# You can enter the subnet in CDIR notation (i.e. /24 for a Class C)).
+# You could add "โdns-servers x.x.x.x" after the "-sL" if you need the lookups to be performed on a specific DNS server.
+# On some installations nmap needs sudo I believe. Also I hope awk is standard on most distros.
+
+
+# How Many Linux And Windows Devices Are On Your Network?
+sudo nmap -F -O 192.168.0.1-255 | grep "Running: " > /tmp/os; \
+echo "$(cat /tmp/os | grep Linux | wc -l) Linux device(s)"; \
+echo "$(cat /tmp/os | grep Windows | wc -l) Window(s) devices"
+
+nmap --script ssl-enum-ciphers -p PORT HOST # get availables ssl/tls versions
+```
+
+## see also
+
+- [[ss]]
+- [[lsof]]
+- [[ncat]]
+- [[socat]]
+- [[openssl]]
+- [[wireshart]]
+- [[tcpdump]]
diff --git a/notes/nmcli.md b/notes/nmcli.md
new file mode 100644
index 00000000..93444208
--- /dev/null
+++ b/notes/nmcli.md
@@ -0,0 +1,19 @@
+---
+tags: [linux, network]
+title: nmcli
+created: '2019-07-30T06:19:49.165Z'
+modified: '2020-01-16T07:47:52.620Z'
+---
+
+# nmcli
+
+## usage
+```sh
+nmcli device show | grep IP4.DNS # show dns nameserver
+```
+
+## see also
+- [[lsof]]
+- [[netstat]] tuna,please!
+- [[ss]]
+
diff --git a/notes/node.md b/notes/node.md
new file mode 100644
index 00000000..63177b71
--- /dev/null
+++ b/notes/node.md
@@ -0,0 +1,80 @@
+---
+tags: [javascript, runtime]
+title: node
+created: '2020-02-28T21:20:20.353Z'
+modified: '2023-05-19T13:02:14.871Z'
+---
+
+# node
+
+> server-side [[javascript]] runtime
+
+## install
+
+```sh
+brew install node
+```
+
+# environment
+
+```sh
+NODE_OPTIONS # set opts e.g. NODE_OPTIONS=--max-old-space-size=32768
+```
+
+## option
+
+```sh
+- # alias for STDIN
+-- # indicate end of cli options, pass rest of the script args
+-c, --check # check syntax without executing, exits with error code if script is invalid
+-e, --eval # string Evaluate string as js
+```
+
+## usage
+
+```sh
+node # start repl
+
+node . # exec in current dir ?!
+
+node --version # get version
+
+node -e "console.log(1)" # evaluate string
+
+node -e "var data = require('./FILE'); console.log(JSON.stringify(data, null, 2));" # pretty print json from js-obj
+```
+
+## repl
+
+```js
+.break // when in the process of inputting a multi-line expression, enter the .break command (or press Ctrl+C)
+ // to abort further input or processing of that expression
+
+.clear // resets the REPL context to an empty object and clears any multi-line expression being input.
+.exit // close the I/O stream, causing the REPL to exit.
+.help // show this list of special commands.
+.save // save the current REPL session to a file: > .save ./file/to/save.js
+.load // load a file into the current REPL session. > .load ./file/to/load.js
+.editor // enter editor mode (Ctrl+D to finish, Ctrl+C to cancel)
+
+
+process.cwd() // current working directory of the nodejs process
+
+process.env // print env variables
+
+process.version // current nodejs version
+
+
+var data = require('./FILE') // load a FILE
+```
+
+## see also
+
+- [[js]] `spidermonkey` cli
+- [[nodejs event loop]]
+- [[javascript]]
+- [[npm]], [[npx]], [[nvm]]
+- [[yarn]]
+- [[deno]]
+- [nodejs.org/api/process.html](https://nodejs.org/api/process.html)
+- [nodejs.org/api/repl.html#repl_commands_and_special_keys](https://nodejs.org/api/repl.html#repl_commands_and_special_keys)
diff --git a/notes/nodejs event loop.md b/notes/nodejs event loop.md
new file mode 100644
index 00000000..560dcc27
--- /dev/null
+++ b/notes/nodejs event loop.md
@@ -0,0 +1,43 @@
+---
+tags: [javascript, node, Notebooks]
+title: nodejs event loop
+created: '2023-05-08T17:48:15.446Z'
+modified: '2023-05-24T08:41:05.014Z'
+---
+
+# nodejs event loop
+
+> allows node to perform non-blocking i/o operations, although js is single-threaded , by offloading operations to system kernel whenever possible
+
+
+```sh
+ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
+โโ>โ [ ] timers โ<-- setTimeout(), setInteval()
+โ โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโ
+โ โโโโโโโโโโโโโโโดโโโโโโโโโโโโโโ
+โ โ [ ] pending callbacks โ
+โ โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโ
+โ โโโโโโโโโโโโโโโดโโโโโโโโโโโโโโ
+โ โ [ ] idle, prepare โ
+โ โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ
+โ โโโโโโโโโโโโโโโดโโโโโโโโโโโโโโ โ incoming: โ
+โ โ [ ] poll โ<โโโโโโค connections, โ
+โ โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโ โ data, etc. โ
+โ โโโโโโโโโโโโโโโดโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ
+โ โ [ ] check โ
+โ โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโ
+โ โโโโโโโโโโโโโโโดโโโโโโโโโโโโโโ
+โโโโค [ ] close callbacks โ
+ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
+
+FIFO of callbacks
+```
+
+libuv -> c-lib implements node-event-loop + all async behavior
+
+`unicorn velociraptor`
+
+## see also
+
+- [[node]]
+- [nodejs.org/en/docs/guides/event-loop-timers-and-nexttick](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick)
diff --git a/notes/nodemon.md b/notes/nodemon.md
new file mode 100644
index 00000000..71817af5
--- /dev/null
+++ b/notes/nodemon.md
@@ -0,0 +1,41 @@
+---
+tags: [javascript, linux, macos]
+title: nodemon
+created: '2023-04-30T13:18:52.050Z'
+modified: '2023-04-30T13:21:27.548Z'
+---
+
+# nodemon
+
+> automatically restarting the node application when file changes in the directory are detected
+
+
+## install
+
+```sh
+npm install -g nodemon
+yarn global add nodemon
+```
+
+## env
+
+```sh
+```
+
+## option
+
+```sh
+```
+
+## usage
+
+```sh
+nodemon --signal SIGHUP server.js
+```
+
+## see also
+
+- [[entr]]
+- [[node]], [[npm]], [[yarn]]
+- [[make]]
+- [npmjs.com/package/nodemon](https://www.npmjs.com/package/nodemon)
diff --git a/notes/nohup.md b/notes/nohup.md
new file mode 100644
index 00000000..55310bbf
--- /dev/null
+++ b/notes/nohup.md
@@ -0,0 +1,22 @@
+---
+tags: [shell]
+title: nohup
+created: '2020-08-06T09:39:22.369Z'
+modified: '2021-05-12T08:47:10.258Z'
+---
+
+# nohup
+
+> `no hangup` - prevents command from being aborted after logout
+
+(HUP) hangup-signal, which is normally sent to a process to inform it that the user has logged off (or "hung up"),
+is intercepted by nohup, allowing the process to continue running.
+
+## usage
+```sh
+
+```
+## see also
+- [[signal]]
+- [[nice]]
+- [[bash process-handling]]
diff --git a/notes/npm.md b/notes/npm.md
index 110878db..f1163949 100644
--- a/notes/npm.md
+++ b/notes/npm.md
@@ -1,49 +1,140 @@
---
-tags: [lang/javascript]
+tags: [javascript, packagemanager]
title: npm
created: '2019-07-30T06:19:49.182Z'
-modified: '2019-08-02T07:27:33.030Z'
+modified: '2023-05-23T07:55:34.842Z'
---
# npm
-`node package manager`
+> `node package manager`
+
+## install
+
+```sh
+brew install node
+```
+
+## .npmrc
-### .npmrc
```sh
-registry=https://nexus.domain.net/repository/npm-internal/
+npm help npmrc
+
+cat < ~/.npmrc
_auth=AUTH
+registry=https://host/repository/npm-internal/
strict-ssl=false
+EOF
```
-### registry
+## usage
+
```sh
-npm --registry https://nexus.domain.net/repository/npm-all/ install gulp-coffee
+npm -l # display usage info for all commands
+
+npm run dev
+
+npm set registry "http://$NPM_URL" # setting registry ..
+npm set //$NPM_URL:_authToken $TOKEN # setting token ..
+
+npm get # list configs and paths
```
-[Configuring Your .npmrc for an Optimal Node.js Environment](https://nodesource.com/blog/configuring-your-npmrc-for-an-optimal-node-js-environment)
+## init - create a package.json file
+
+```sh
+-y, --yes
+-f, --force
+ --scope @SCOPE
+-w, --workspace WORKSPACE
+ --no-workspaces-update
+ --include-workspace-roo
+```
-## get
```sh
-npm get # list configs and paths
+npm init -y
+npm init PACKAGE_SPEC # same as `npx
+npm init @SCOPE # same as `npx <@scope>/create`
```
+## install
-## setting auth token
```sh
-echo "getting token .."
-export TOKEN=$(
- curl -s -X PUT \
- -H "Accept: application/json" \
- -H "Content-Type:application/json" \
- --data '{"name": "'${NPM_USER}'", "password": "'${NPM_PASS}'"}' \
- http://$NPM_URL-/user/org.couchdb.user:${NPM_USER} \
- | jq -r '.token'
-)
+-S, --save, --no-save, --save-prod, --save-dev, --save-optional, --save-peer, --save-bundle
+-E, --save-exact
+-g, --global
+ --global-style
+ --legacy-bundling
+ --omit OMIT # dev, optional, peer
+ --strict-peer-deps
+ --no-package-lock
+ --foreground-scripts
+ --ignore-scripts
+ --no-audit
+ --no-bin-links
+ --no-fund
+ --dry-run
+-w, --workspace WORKSPACE
+ --include-workspace-root
+ --install-links
+```
+
+```sh
+npm --registry HOST/repository/npm-all/ install gulp-coffee
+```
-echo "setting registry .."
-npm set registry "http://$NPM_URL"
+## ls - list installed packages
-echo "setting token .."
-npm set //$NPM_URL:_authToken $TOKEN
+```sh
+-a, --all
+ --json
+-l, --long
+-p, --parseable
+-g, --global # list installed packages, globally
+ --depth DEPTH
+ --omit OMIT # dev, optional, peer
+ --link
+ --package-lock-only
+ --no-unicode
+-w, --workspace WORKSPACE
+ --include-workspace-root
+ --install-links
+```
+
+```sh
+npm ls PACKAGE_SPEC
+npm ls -g
+npm list -g
+```
+
+## config - manage the npm configuration files
+
+```sh
+ --json
+-g, --global
+ --editor EDITOR
+-L, --location LOCATION # locations: global, user, project
+-l, --long]
```
+
+```sh
+npm config list --json
+
+npm config set KEY=VAL
+npm config get KEY
+npm config delete KEY
+npm config edit
+```
+
+## see also
+
+- [[javascript]]
+- [[node]]
+- [[nxm]]
+- [[yarn]]
+- [[http-server]], [[fx]]
+- [[nexus api]]
+- [config .npmrc for optimal node env](https://nodesource.com/blog/configuring-your-npmrc-for-an-optimal-node-js-environment)
+- [[cdk]]
+
+
diff --git a/notes/nproc.md b/notes/nproc.md
new file mode 100644
index 00000000..1447b62c
--- /dev/null
+++ b/notes/nproc.md
@@ -0,0 +1,20 @@
+---
+tags: [linux]
+title: nproc
+created: '2020-02-17T10:58:21.321Z'
+modified: '2020-09-02T17:52:01.772Z'
+---
+
+# nproc
+
+> print the number of processing units available
+
+## usage
+```sh
+nproc --all # print the number of installed processors
+
+
+/etc/security/limits.conf
+```
+## see also
+- [[ulimit]]
diff --git a/notes/npx.md b/notes/npx.md
new file mode 100644
index 00000000..be6994b6
--- /dev/null
+++ b/notes/npx.md
@@ -0,0 +1,31 @@
+---
+tags: [javascript]
+title: npx
+created: '2021-06-11T11:54:27.222Z'
+modified: '2022-12-02T14:14:58.207Z'
+---
+
+# npx
+
+> execute [[npm]] package binaries
+
+## install
+
+```sh
+npm install -g npx
+```
+
+## usage
+
+```sh
+npx RUN
+
+npx tsc --init
+```
+
+## see also
+
+- [[node]]
+- [[yarn]]
+- [[npm]]
+- [[tsc]]
diff --git a/notes/nslookup.md b/notes/nslookup.md
new file mode 100644
index 00000000..6812e960
--- /dev/null
+++ b/notes/nslookup.md
@@ -0,0 +1,42 @@
+---
+tags: [dns]
+title: nslookup
+created: '2020-01-16T07:23:01.811Z'
+modified: '2023-03-20T08:52:24.134Z'
+---
+
+# nslookup
+
+> for querying [[dns]] to obtain domain names or IP addresses, mapping or for any other specific DNS Records
+
+## install
+
+```sh
+brew install bind
+apt install net-tools
+```
+
+## usage
+
+```sh
+nslookup example.com
+
+nslookup example.com ns1.nsexample.com # check the using of a specific DNS Serve
+
+nslookup -type=any example.com # find all of the available DNS records of a domain
+
+nslookup -type=ns example.com # check the NS records of a domain
+
+nslookup -type=soa example.com # query the SOA record of a domain
+
+nslookup -query=mx example.com # find the MX records responsible for the email exchange
+
+nslookup 10.32.23.139
+```
+
+## see also
+
+- [[dns]]
+- [[dig]]
+- [[ifconfig]]
+- [[whois]]
diff --git a/notes/numfmt.md b/notes/numfmt.md
new file mode 100644
index 00000000..b576f413
--- /dev/null
+++ b/notes/numfmt.md
@@ -0,0 +1,92 @@
+---
+tags: [linux, macos]
+title: numfmt
+created: '2021-10-19T11:54:38.435Z'
+modified: '2023-03-22T09:49:49.262Z'
+---
+
+# numfmt
+
+> convert numbers from/to human-readable strings
+
+## install
+
+```sh
+brew install coreutils
+```
+
+## option
+
+```sh
+-d, --delimiter=DELIM # use DELIM instead of whitespace for field delimiter
+ --field=FIELDS # replace the numbers in these input fields (default=1); see FIELDS below
+ --format=FORMAT # use printf style floating-point FORMAT; see FORMAT below for details
+ --from=UNIT # auto-scale input numbers to UNITs; default is 'none'; see UNIT below
+ --from-unit=N # specify the input unit size (instead of the default 1)
+ --grouping # use locale-defined grouping of digits, e.g. 1,000,000 (which means it has no effect in the C/POSIX locale)
+ --header[=N] # print (without converting) the first N header lines; N defaults to 1 if not specified
+ --invalid=MODE # failure mode for invalid numbers: MODE can be: abort (default), fail, warn, ignore
+ --padding=N # pad the output to N characters; positive N will right-align; negative N will left-align;
+ # padding is ignored if the output is wider than N; the default is to automatically pad if a whitespace is found
+ --round=METHOD # use METHOD for rounding when scaling; METHOD can be: up, down, from-zero (default), towards-zero, nearest
+ --suffix=SUFFIX # add SUFFIX to output numbers, and accept optional SUFFIX in input numbers
+ --to=UNIT # auto-scale output numbers to UNITs; see UNIT below
+ --to-unit=N # the output unit size (instead of the default 1)
+-z, --zero-terminated # line delimiter is NUL, not newline
+
+ --debug # print warnings about invalid input
+ --help # display help and exit
+ --version # output version information and exit
+```
+
+### units
+
+```sh
+none # no auto-scaling is done; suffixes will trigger an error
+
+auto # accept optional single/two letter suffix:
+ # 1K = 1000, 1Ki = 1024, 1M = 1000000, 1Mi = 1048576,
+
+si # accept optional single letter suffix:
+ # 1K = 1000, 1M = 1000000, ...
+
+iec # accept optional single letter suffix:
+ # 1K = 1024, 1M = 1048576, ...
+
+iec-i # accept optional two-letter suffix:
+ # 1Ki = 1024, 1Mi = 1048576, ...
+```
+
+### usage
+
+```sh
+numfmt --to=si 1000 # "1.0K"
+
+numfmt --to=iec 2048 # "2.0K"
+
+numfmt --to=iec-i 4096 # "4.0Ki"
+
+echo "1K" | numfmt --from=si # "1000"
+
+echo "1K" | numfmt --from=iec # "1024"
+
+echo "7931556Ki" | numfmt --from=iec-i --to=iec
+
+df -B1 | numfmt --header --field 2-4 --to=si
+ls -l | numfmt --header --field 5 --to=iec
+ls -lh | numfmt --header --field 5 --from=iec --padding=10
+ls -lh | numfmt --header --field 5 --from=iec --format "%10f"
+
+
+numfmt --field=2 --from-unit=1024 --to=iec-i --suffix B < /proc/meminfo | sed 's/ kB//' | head -n4
+numfmt --field=2 --from-unit=1024 --to=iec-i --suffix B < <(echo 'MemTotal: 263761228 kB') | sed 's/ kB//'
+```
+
+## see also
+
+- [[unit]]
+- [[coreutils]]
+- [[free]]
+- [[crane]]
+- [gnu.org/coreutils/manual/numfmt](https://www.gnu.org/software/coreutils/manual/html_node/numfmt-invocation.html)
+- [pixelbeat.org/docs/numfmt](https://www.pixelbeat.org/docs/numfmt.html)
diff --git a/notes/nvchad.md b/notes/nvchad.md
new file mode 100644
index 00000000..f3f25cc2
--- /dev/null
+++ b/notes/nvchad.md
@@ -0,0 +1,27 @@
+---
+tags: [editor, linux, lua, macos]
+title: nvchad
+created: '2023-04-15T09:53:58.901Z'
+modified: '2023-05-05T06:58:08.963Z'
+---
+
+# nvchad
+
+## install
+
+```sh
+git clone https://github.com/NvChad/NvChad ~/.config/nvim --depth 1 && nvim
+```
+
+## usage
+
+```sh
+```
+
+## see also
+
+
+- [github.com/NvChad/NvChad](https://github.com/NvChad/NvChad)
+- [[nvim]]
+- [[nerdfonts]]
+- [[lua]]
diff --git a/notes/nvim.md b/notes/nvim.md
new file mode 100644
index 00000000..0d8a4842
--- /dev/null
+++ b/notes/nvim.md
@@ -0,0 +1,37 @@
+---
+tags: [editor, linux, macos]
+title: nvim
+created: '2023-04-14T09:04:09.667Z'
+modified: '2023-05-05T06:57:51.337Z'
+---
+
+# nvim
+
+> neo vim
+
+## install
+
+```sh
+brew install neovim
+```
+
+## option
+
+```sh
+```
+
+## usage
+
+```sh
+nvim
+```
+
+## see also
+
+- [neovim.io](https://neovim.io/)
+- [[vim]]
+- [[ed]]
+- [[lua]]
+- [[freedesktop xdg]]
+
+
diff --git a/notes/nvm.md b/notes/nvm.md
new file mode 100644
index 00000000..5a475b08
--- /dev/null
+++ b/notes/nvm.md
@@ -0,0 +1,52 @@
+---
+tags: [javascript, versionmanager]
+title: nvm
+created: '2019-08-20T09:04:00.908Z'
+modified: '2023-05-16T08:21:11.314Z'
+---
+
+# nvm
+
+> `node version manager` - POSIX-compliant bash script to manage multiple active [[node]] versions
+
+## install
+
+```sh
+curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
+```
+
+## option
+
+```sh
+```
+
+## usage
+
+```sh
+nvm ls-remote # available versions
+
+nvm install --lts # downloads latest LTS version
+nvm install node # "node" is an alias for the latest version
+nvm install 6.14.4 # or 10.10.0, 8.9.1, etc
+nvm install-latest-npm
+
+nvm alias # list aliases
+nvm alias default 18.14 # set default node version in shell
+
+nvm use node
+nvm use 5.12.0 # used older version not having class
+
+nvm run node --version
+
+nvm exec 4.2 node --version # run any arbitrary command in a subshell with the desired version of node
+
+nvm which 5.0 # get the path to the executable to where it was installed:
+```
+
+## see also
+
+- [[node]], [[npm]], [[nxm]]
+- [[sdk]]
+- [[rvm]]
+- [[asdf]]
+- [node.green](https://node.green/) table of features shipped per node version
diff --git a/notes/objective-c.md b/notes/objective-c.md
new file mode 100644
index 00000000..3a995a38
--- /dev/null
+++ b/notes/objective-c.md
@@ -0,0 +1,23 @@
+---
+tags: [c]
+title: objective-c
+created: '2020-08-27T11:05:35.265Z'
+modified: '2023-03-25T12:40:53.868Z'
+---
+
+# objective-c
+
+> objective-c
+
+## usage
+
+```sh
+
+```
+
+## see also
+
+- [[clang]]
+- [[gcc]]
+- [[c]]
+
diff --git a/notes/oc.md b/notes/oc.md
new file mode 100644
index 00000000..ef3816a6
--- /dev/null
+++ b/notes/oc.md
@@ -0,0 +1,45 @@
+---
+tags: [container]
+title: oc
+created: '2021-10-20T09:24:01.749Z'
+modified: '2023-03-22T11:00:40.371Z'
+---
+
+# oc
+
+> cli for openshift a k8s distribution
+
+## install
+
+```sh
+brew install openshift-cli
+
+oc completion bash > $(brew --prefix)/etc/bash_completion.d/oc
+```
+
+
+## usage
+
+```sh
+oc config set-credentials USER
+
+oc config set-cluster CLUSTER
+
+oc config set-credentials vipin --token=TOKEN
+
+
+oc get useroauthaccesstokens
+oc describe useroauthaccesstokens TOKEN
+
+oc project # view current project
+
+oc status # info about current project
+
+oc api-resources # list supported api resources
+```
+
+## see also
+
+- [[crc]]
+- [[kubectl]]
+- [redhat.com/en/blog/openshift-and-kubernetes-whats-difference](https://www.redhat.com/en/blog/openshift-and-kubernetes-whats-difference)
diff --git a/notes/ocaml.md b/notes/ocaml.md
new file mode 100644
index 00000000..5b2f8144
--- /dev/null
+++ b/notes/ocaml.md
@@ -0,0 +1,38 @@
+---
+tags: [ocaml]
+title: ocaml
+created: '2020-02-27T18:56:46.683Z'
+modified: '2023-03-24T09:55:27.855Z'
+---
+
+# ocaml
+
+## install
+
+```sh
+brew install ocaml
+opam switch create 4.10.0
+```
+
+## usage
+
+```sh
+ocaml -version
+
+ocaml # starts repl
+```
+
+## script
+
+```ocaml
+##quit;; (* exit repl *)
+
+#use "mycode.ml";; (* import *)
+```
+
+## see also
+
+- [[opam]]
+- [[ocamlc]]
+- [[scala]]
+- [cs.cornell.edu/courses/cs3110](https://www.cs.cornell.edu/courses/cs3110/2020sp/textbook/)
diff --git a/notes/ocamlbuild.md b/notes/ocamlbuild.md
new file mode 100644
index 00000000..6348bbec
--- /dev/null
+++ b/notes/ocamlbuild.md
@@ -0,0 +1,24 @@
+---
+tags: [ocaml]
+title: ocamlbuild
+created: '2020-03-02T07:16:39.300Z'
+modified: '2023-03-24T09:56:01.768Z'
+---
+
+# ocamlbuild
+
+> [[ocaml]] project compilation tool
+
+## uage
+
+```sh
+ocamlbuild hello.byte
+
+ocamlbuild -clean # removes the _build/ and bytecode, leaving only source code.
+```
+
+## see also
+
+- [[ocamlc]]
+- [[sbt]]
+- [[mvn]]
diff --git a/notes/ocamlc.md b/notes/ocamlc.md
new file mode 100644
index 00000000..55b5a429
--- /dev/null
+++ b/notes/ocamlc.md
@@ -0,0 +1,23 @@
+---
+tags: [ocaml]
+title: ocamlc
+created: '2020-03-02T06:55:02.520Z'
+modified: '2023-03-24T09:56:13.393Z'
+---
+
+# ocamlc
+
+> [[ocaml]] bytecode compiler
+
+## usage
+
+```sh
+ocaml -o hello.byte hello.ml
+```
+
+## see also
+
+- [[ocamlbuild]]
+- [[ocaml]]
+- [[javac]]
+
diff --git a/notes/od.md b/notes/od.md
new file mode 100644
index 00000000..f3a166b6
--- /dev/null
+++ b/notes/od.md
@@ -0,0 +1,56 @@
+---
+tags: [linux]
+title: od
+created: '2019-09-04T06:17:03.101Z'
+modified: '2023-05-19T10:35:14.864Z'
+---
+
+# od
+
+> `octal dump` - decimal, hex, [[ascii]] dump
+
+## option
+
+```sh
+-b FILE # displays contents of input in octal format
+-c FILE # displays contents of input in character format
+
+-N 1 # read one byte from /dev/urandom
+-An # means Address none
+-t T # select a type
+ # d - signed decimal
+ # u - unsigned decimal
+ # C - of size (one) char
+```
+
+## usage
+
+```sh
+od -An -c FILE # displays the contents of input in character format but with no offset information
+
+od -c - # accept input from STDIN
+
+echo '"' | tr -d "\n" | od -An -t uC # print/get decimal-set
+
+od -An -td -N1 /dev/urandom # dump random character
+
+var="$(echo -n 'โ ' | od -An -tx1)"; printf '\\x%s' ${var^^}; echo
+
+echo -n '"' | od -An -t uC # get decimal-set
+# โโโโโโโโโโโโโโโโโ Use od (octal dump) to print:
+# -An means Address none
+# -t select a type
+# u type is unsigned decimal.
+# C of size (one) char
+```
+
+## see also
+
+- [[ascii]]
+- [[xxd]]
+- [[hexdump]]
+- [[rl]]
+- [[tr]]
+- [[bash echo]]
+- [[bash printf]]
+- [[ascii]]
diff --git a/notes/oo paradigm.md b/notes/oo paradigm.md
new file mode 100644
index 00000000..8bd7ea7b
--- /dev/null
+++ b/notes/oo paradigm.md
@@ -0,0 +1,25 @@
+---
+tags: [Notebooks]
+title: oo paradigm
+created: '2020-06-22T07:44:25.123Z'
+modified: '2020-09-02T17:37:25.136Z'
+---
+
+# oo paradigm
+
+encapsulation
+abstraction
+inheritance
+polymorphism
+
+`"message-passing"` โ "method-calling"
+
+smalltalk | java
+--|--
+`foo bar: baz` `#baz` | `foo.bar(baz);`
+
+
+## see also
+- [[functional paradigm]]
+- [[java]]
+- [[smalltalk]]
diff --git a/notes/op.md b/notes/op.md
new file mode 100644
index 00000000..8ebcae0c
--- /dev/null
+++ b/notes/op.md
@@ -0,0 +1,57 @@
+---
+tags: [container]
+title: op
+created: '2021-02-01T08:18:52.088Z'
+modified: '2023-03-24T08:21:54.945Z'
+---
+
+# op
+
+> 1password cli provides commands to manage and administer a 1password account
+
+## usage
+
+```sh
+op signin FOO.1password.eu USER_MAIL
+
+eval $(op signin edithcare)
+
+
+op list vaults
+op list items
+op list items --vault VAULT # e.g. "Private"
+
+op list templates | jq '.[].name' # get categories
+
+op list items --tags TAG | op get item - | jq '.details.fields[] | .value'
+
+op get item ITEM_ID
+
+op get totps ITEM_ID # get one-time code
+
+op get template "Login" > login_template.json
+
+```
+
+## create
+
+```sh
+--generate-password[=recipe] # give the item a randomly generated password
+--tags TAGS # add one or more tags (comma-separated) to the item
+--template FILE # specify the filepath to read an item template from
+--title TITLE # set the item's title
+--url URL # set the URL associated with the item
+--vault VAULT # save the item in this vault
+```
+
+```sh
+op create item CATEGORIE --template FILE
+```
+
+## see also
+
+- [1password.com/downloads/command-line/](https://1password.com/downloads/command-line/)
+- [support.1password.com/command-line-getting-started/](https://support.1password.com/command-line-getting-started/)
+- [[xkcdpass]]
+- [[jq]]
+- [[aws]]
diff --git a/notes/opa.md b/notes/opa.md
new file mode 100644
index 00000000..a4907a5c
--- /dev/null
+++ b/notes/opa.md
@@ -0,0 +1,34 @@
+---
+tags: [container]
+title: opa
+created: '2021-03-16T15:13:29.336Z'
+modified: '2023-05-25T16:01:44.936Z'
+---
+
+# opa
+
+> `โoh-paโ` Open Policy Agent -general-purpose policy engine that unifies policy enforcement across the stack
+> provides a high-level declarative language that lets you specify policy as code and simple APIs to offload policy decision-making from software
+> can be used to enforce policies in microservices, k8s, cicd pipelines, api-gateways, etc.
+
+## install
+
+```sh
+brew install opa
+```
+
+## usage
+
+```sh
+opa
+
+opa eval 'x := 1; y := 2; x < y'
+opa eval --data data.json 'name := data.names[_]' # eval query against JSON data
+opa eval --data file:///path/to/file.json 'data' # eval query against JSON data supplied with a file:// URL:
+```
+
+## see also
+
+- [[rego]]
+- [[kubectl]]
+- [github.com/open-policy-agent/opa/scanner.go](https://github.com/open-policy-agent/opa/blob/d3811e29eba10e9e79e8d517c2858be0dc2494fc/ast/internal/scanner/scanner.go)
diff --git a/notes/opam.md b/notes/opam.md
new file mode 100644
index 00000000..48c9681a
--- /dev/null
+++ b/notes/opam.md
@@ -0,0 +1,35 @@
+---
+tags: [packagemanager]
+title: opam
+created: '2020-02-27T19:00:46.765Z'
+modified: '2023-03-24T09:55:47.590Z'
+---
+
+# opam
+
+> package manager for ocaml
+
+## install
+
+```sh
+brew install opam
+```
+
+## usage
+
+```sh
+opam init # environment setup
+
+opam switch create 4.10.0 # install given version of the compiler
+
+opam switch create 4.10.0
+
+
+opam install utop # install repl
+```
+
+## see also
+- [[ocaml]]
+- [ocaml.org/docs/install](https://ocaml.org/docs/install.html)
+- [[sbt]]
+- [[cargo]]
diff --git a/notes/open.md b/notes/open.md
new file mode 100644
index 00000000..ff1a683d
--- /dev/null
+++ b/notes/open.md
@@ -0,0 +1,60 @@
+---
+tags: [macos]
+title: open
+created: '2020-03-16T16:36:43.316Z'
+modified: '2023-05-19T17:56:39.627Z'
+---
+
+# open
+
+> open files and directories on macos
+
+## option
+
+```sh
+-aย APP # specifies app to use for opening file
+-bย BUNDLE_ID # specifies the bundle identifier for app to use when opening file
+-e # causes file to be opened with /Applications/TextEdit
+-t # causes file to be opened with default text editor, as determined via LaunchServices
+-f # reads input from STDIN and opens results in the default text editor. End input by sending EOF character (type Control-D), useful for piping output to open and having it open in the default text editor
+-F # opens app "fresh," that is, without restoring windows. Saved persistent state is lost, except for Untitled documents.
+-W # causes open to wait until apps it opens (or that were already open) have exited. Use with the -n flag to allow open to function as an appropriate app for the $EDITOR environment variable
+-R # Reveals file(s) in the Finder instead of opening them
+-n # open a new instance of app(s) even if one is already running
+-g # Do not bring app to the foreground
+-j # launches app hidden
+-h # Searches header locations for a header whose name matches the given string and then opens it. Pass a full header name (such as NSView.h) for increased performance
+-s # For -h, partial or full SDK name to use; if supplied, only SDKs whose names contain the argument value are searched. Otherwise the highest versioned SDK in each platform is used
+-u # opens URL with whatever application claims the url scheme, even if URL also matches a file path
+--args # all remaining arguments are passed to opened app in the argv parameter to main()
+--env NAME=VALUE # adds VAR to the environment of the launched app
+--stdin PATH # launches app with STDIN connected to PATH
+--stdout PATH # launches app with STDOUT connected to PATH
+--stderr PATH # launches app with STDERR connected to PATH
+```
+
+## usage
+
+```sh
+
+open . # open current dir in Finder
+
+open http://host # opens the URL in the default browser
+
+open -a KeyboardViewer # opens keyboardviwer :)
+
+open -a /Applications/TextEdit.app '/Volumes/Macintosh HD/foo.txt' # opens the document in TextEdit
+open -b com.apple.TextEdit '/Volumes/Macintosh HD/foo.txt' # opens the document in TextEdit
+open -e '/Volumes/Macintosh HD/foo.txt' # opens the document in TextEdit
+
+open 'file://localhost/Volumes/Macintosh HD/foo.txt' # opens the document in the default application for its type (as determined by LaunchServices).
+open 'file://localhost/Volumes/Macintosh HD/Applications/' # opens that directory in the Finder.
+
+ls | open -f # pip STDOUT to file in `/tmp` and opens file in default text editor
+```
+
+## see also
+
+- [[mdfind]]
+- [[defaults]]
+- [[launchctl]]
diff --git a/notes/openssl.md b/notes/openssl.md
new file mode 100644
index 00000000..c9eb13bf
--- /dev/null
+++ b/notes/openssl.md
@@ -0,0 +1,236 @@
+---
+tags: [crypto, linux, network]
+title: openssl
+created: '2019-07-30T06:19:49.183Z'
+modified: '2023-07-12T08:13:51.407Z'
+---
+
+# openssl
+
+> `openssl` is a cryptography toolkit implementing the `ssl` and `tls` network protocols and related cryptography standards
+
+## install
+
+```sh
+brew install openssl # export PATH after
+```
+
+## usage
+
+```sh
+openssl version -help # get version options
+openssl version -a # show all version data
+openssl version -d # configuration files and certificates location
+
+openssl pkcs12 -in cert.p12 -clcerts -nokeys -out cert.crt
+
+openssl x509 -in cert.crt -text -noout
+
+openssl crl2pkcs7 -nocrl -certfile CHAIN.pem | openssl pkcs7 -print_certs -text -noout
+
+
+openssl verify -CAfile foo.cain.crt foo.crt # verify certificate against CAfile => foo.crt: OK
+```
+
+## rsa
+
+> rsa key management
+
+```sh
+openssl rsa -in privateKey.key -check
+
+openssl rsa -in private_key_noenc.pem -out private_key_noenc.pem # remove passphrase
+
+openssl rsa -aes256 -in private_key_noenc.key -out private_key_enc.key
+
+
+# Verify that private key matches a certificate and CSR
+openssl rsa -noout -modulus -in example.key | openssl sha256
+openssl x509 -noout -modulus -in example.crt | openssl sha256
+openssl req -noout -modulus -in example.csr | openssl sha256
+```
+
+## req - pkcs10 x509
+
+> certificate Signing Request (csr) management
+
+```sh
+# generate a self-signed certificate and key
+openssl req -x509 -nodes -days 365 -sha256 -newkey rsa:2048 -keyout key.pem -out cert.pem
+openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout key.pem -out cert.pem
+
+# auto-fill generate a self-signed certificate
+openssl req -x509 -nodes -days 365 -sha256 -newkey rsa:2048 -keyout key.pem -out cert.pem
+ -subj '/C=US/ST=Oregon/L=Portland/CN=www.foo.bar'
+
+openssl req -x509 -newkey rsa:2048 -keyout local.key -out local.crt -days 90 \
+ -subj '/C=US/ST=XX/L=XX/O=IT/OU=IT/CN=foohost.local/emailAddress=it@foohost.net'
+
+# -nodes don't encrypt the output key
+# -x509 output a x509 structure instead of a cert. req
+# -newkey rsa:bits generate a new RSA key of 'bits' in size
+# -newkey dsa:file generate a new DSA key, parameters taken from CA in 'file'
+# -newkey ec:file generate a new EC key, parameters taken from CA in 'file'
+```
+
+## read csr
+
+```sh
+openssl req -noout -text -in int-ca_intermediate.csr
+
+openssl req -in mycsr.csr -noout -text
+```
+
+## x509 certificate data management
+
+```sh
+openssl x509 -in somecert{.crt,.pem} -text -noout # certificate-information from file
+
+openssl x509 -inform der -in aps.cer -noout -text
+openssl x509 -in FILE.cert -noout -subject
+openssl x509 -in FILE.cert -noout -dates
+openssl x509 -in FILE.cert -noout -fingerprint
+```
+
+## pkcs12
+
+> public key cryptograpy standarts
+
+```sh
+openssl pkcs12 -export -inkey local.key -in local.crt -out local.pfx # generate pkcs12
+openssl pkcs12 -export -inkey privateKey.key -in bundle.crt -out certificate.pfx
+
+openssl pkcs12 -info -in file.p12 # show cert and key
+openssl pkcs12 -nokeys -info -in file.p12 -passin pass:1234 # show only certificate
+openssl pkcs12 -nocerts -info -in file.p12 -passin pass:1234 # show only certificate
+
+openssl pkcs12 -export -in clientprivcert.pem -out clientprivcert.pfx # convert PEM to PKCS12
+
+openssl pkcs12 -in path.p12 -out newfile.crt.pem -nokeys -clcerts # extract certificate
+openssl pkcs12 -in path.p12 -out newfile.key.pem -nocerts -nodes # extract key
+```
+
+## s_client
+
+> implements a generic `SSL/TLS` client which can establish a transparent connection to a remote server speaking SSL/TLS for testing
+
+## usage
+```sh
+openssl s_client -connect google.com:443 # test ssl connection
+GET / HTTP/1.1
+Host: www.google.com
+# returns html
+Q # type Q and return
+DONE
+
+
+openssl s_client -connect localhost:443 -debug
+
+openssl s_client -connect gateway.sandbox.push.apple.com:2195 -CAfile CA/entrust_2048_ca.cer -debug -showcerts -cert newfile.pem
+
+openssl s_client -connect b.com:443 -servername a.com # multiple hosts on the same IP address and you need to use Server Name Indication (SNI) to access this site
+
+echo | openssl s_client -connect www.bar.baz:443 -servername bar.baz 2>/dev/null | openssl x509 -noout -dates
+
+echo | openssl s_client -connect bar.baz:443 2>&1 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' # retrieve remote certificate
+
+openssl s_client -connect example.com:25 -starttls smtp -showcerts /dev/null \
+ | openssl x509 -text -noout | grep -A 1 Serial\ Number | tr -d :
+
+openssl s_client -connect example.com:587 -starttls smtp -showcerts /dev/null \
+ | openssl x509 -text -noout | grep -A 1 Serial\ Number | tr -d :
+
+openssl s_client -connect example.com:143 -starttls imap -showcerts /dev/null \
+ | openssl x509 -text -noout | grep -A 1 Serial\ Number | tr -d :
+
+openssl s_client -connect example.com:993 -showcerts /dev/null \
+ | openssl x509 -text -noout | grep -A 1 Serial\ Number | tr -d :
+
+echo | openssl s_client -connect google.test:443 2>&1 1>/dev/null
+getaddrinfo: nodename nor servname provided, or not known
+connect:errno=0
+
+echo | openssl s_client -connect google.test:443 1>/dev/null 2>&1
+```
+
+### determin certificate type
+
+- `X509` standard defines certificates
+- `RSA` and `DSA` are two of the `public key algorithms` that can be used in those certificates
+- certificates are used to hold public keys, and never private keys.
+- `PKCS#12` is a standard for a container which can hold an `X509` client certificates and the corresponding private keys,
+ - as well as (optionally) the `X509` certificates of the CAs that signed the `X509` client certificate(s).
+- if you're examining a `PKCS#12` file (typically `.p12` extension), then you already know:
+ - contains at least one `X509` client certificate (which contains a public key) and the corresponding private keys
+ - All you don't know is whether those certificate & private key are `RSA` or `DSA`. You can check by extracting the certificate(s) and then examine them
+
+## digest
+
+> dgst - Message Digest Calculation
+
+```sh
+openssl md5 FILENAME
+openssl sha1 FILENAME
+
+openssl dgst -md5 FILENAME
+openssl dgst -sha1 FILENAME
+openssl dgst -sha256 FILENAME
+```
+
+[[md5sum]], [[sha256sum]]
+
+## dhparam
+
+> generate set of diffie-hellman parameters
+> consists of a large prime number `p` and generator value `g` (which is always 2 for openssl)
+
+```sh
+openssl dhparam -out dhparam.pem 4096 # generates dh parameters with 4096 bit
+```
+
+[[prime number]]
+
+## passwd
+
+> generation of hashed passwords
+
+```sh
+openssl passwd MySecret # generate hash: 8E4vqBR4UOYF.
+
+openssl passwd -1 MySecret # generate shadow-style-hash: $1$sXiKzkus$haDZ9JpVrRHBznY5OxB82.
+
+# -crypt standard Unix password algorithm (default)
+```
+
+[[pass]], [[openssl rand]]
+
+
+## rand
+
+> generate pseudo-random bytes and password
+
+```sh
+openssl rand -base64 32 # generate random numner
+```
+
+[[shuf]]
+
+
+## see also
+
+- [[gpg]]
+- [[certutil]]
+- [[mkcert]]
+- [[keytool]]
+- [[p11-kit]]
+- [[keybase]]
+- [[xkcdpass]]
+- [megamorf.gitlab.io/cheat-sheets/openss/](https://megamorf.gitlab.io/cheat-sheets/openssl/)
+- [blog.filippo.io/mkcert-valid-https-certificates-for-localhost](https://blog.filippo.io/mkcert-valid-https-certificates-for-localhost/)
+- [madboa.com/geek/openssl/#how-do-i-get-a-list-of-the-available-commands](https://www.madboa.com/geek/openssl/#how-do-i-get-a-list-of-the-available-commands)
+- [medium.freecodecamp.org/openssl-command-cheatsheet](https://medium.freecodecamp.org/openssl-command-cheatsheet-b441be1e8c4a)
+- [cheat.readthedocs.io/en/latest/openssl](https://cheat.readthedocs.io/en/latest/openssl.html)
+- [sslshopper.com/article-most-common-openssl-commands](https://www.sslshopper.com/article-most-common-openssl-commands.html)
+- [How to determine certificate type from file - Stack Overflow](http://stackoverflow.com/questions/1722181/how-to-determine-certificate-type-from-file)
+- [openssl -connect returns wrong certificate - Stack Overflow](http://stackoverflow.com/a/24615393)
+- [Check SSL Certificate Expiration Date and More - ShellHacks](http://www.shellhacks.com/en/HowTo-Check-SSL-Certificate-Expiration-Date-from-the-Linux-Shell)
diff --git a/notes/operator-sdk.md b/notes/operator-sdk.md
new file mode 100644
index 00000000..e8e8861b
--- /dev/null
+++ b/notes/operator-sdk.md
@@ -0,0 +1,33 @@
+---
+tags: [container]
+title: operator-sdk
+created: '2021-10-19T09:43:07.128Z'
+modified: '2023-03-22T10:10:46.237Z'
+---
+
+# operator-sdk
+
+> a framework that uses the controller-runtime library to make writing operators easier
+
+## install
+
+```sh
+brew install operator-sdk
+```
+
+## usage
+
+```sh
+operator-sdk init --repo=github.com/ORG/REPO
+```
+
+## see also
+
+- [v1-0-x.sdk.operatorframework.io/docs/](https://v1-0-x.sdk.operatorframework.io/docs/)
+- [github.com/kubernetes-sigs/controller-runtime](https://github.com/kubernetes-sigs/controller-runtime)
+- [[kubebuilder]]
+- [[kubectl]]
+- [[kustomize]]
+- [[make]]
+- [[helm]]
+- [[go]]
diff --git a/notes/osd.md b/notes/osd.md
new file mode 100644
index 00000000..50e4ba22
--- /dev/null
+++ b/notes/osd.md
@@ -0,0 +1,31 @@
+---
+tags: [container]
+title: osd
+created: '2019-10-18T09:40:37.238Z'
+modified: '2023-03-22T10:38:03.136Z'
+---
+
+# osd
+
+> openstorage cli
+
+
+## usage
+```sh
+osd cluster status
+
+
+osd nfs enumerate | jq '.[].device_path'
+
+osd nfs enumerate | jq -r '.[]| "\(.id) \(.locator.name)"'
+
+
+osd -d --nodeid %H --clusterid CLUSTERNAME --sdkport 9101 --kvdb consul-kv://localhost:8500 --file /etc/config.yaml
+```
+
+## see also
+- https://github.com/libopenstorage/openstorage
+- [[nfs]]
+- [[jq]]
+- [[findmnt]]
+- [[lsof]]
diff --git a/notes/osi model.md b/notes/osi model.md
new file mode 100644
index 00000000..6669cd7e
--- /dev/null
+++ b/notes/osi model.md
@@ -0,0 +1,34 @@
+---
+tags: [network]
+title: osi model
+created: '2020-09-03T05:22:30.643Z'
+modified: '2022-03-18T15:56:51.637Z'
+---
+
+# osi model
+
+> `Open Systems Interconnection`
+
+- `Please Do Not Touch Steve's Pet Aligator`
+- `Please Do Not Throw Sausage Pizza Away`
+
+## layers
+
+```sh
+8 Human # the problem's on layer 8 x)
+7 Applicatoin # End user Layer - http, [[ftp]], irc, [[ssh]], dns
+6 Presentation # Syntax Layer - ssl, [[ssh]], imap, [[ftp]], mpeg, jpeg
+5 Session # Sync and send to port - api's, sockets, winsock
+4 Transport # End-to-end connection - tcp, udp
+3 Network # Packets - ip, icmp, ipsec, igmp
+2 Datalink # Frames - ethernet, ppp, switch, bridge
+1 Physical # Physical Structure - coax, fiber, wireless, hubs, repeaters
+```
+
+## see also
+
+- [twitter.com/TechParida/status/1301064140002177024](https://twitter.com/TechParida/status/1301064140002177024)
+- [trejrc0.blogspot.com/2006/09/osi-vs-7-layer-burrito.html](https://trejrc0.blogspot.com/2006/09/osi-vs-7-layer-burrito.html)
+- [[tcp-ip model]]
+- [[http]]
+- [[12 factor app]]
diff --git a/notes/p11-kit.md b/notes/p11-kit.md
new file mode 100644
index 00000000..bf4f18d1
--- /dev/null
+++ b/notes/p11-kit.md
@@ -0,0 +1,25 @@
+---
+tags: [crypto]
+title: p11-kit
+created: '2020-03-09T12:25:18.791Z'
+modified: '2023-07-11T11:40:42.664Z'
+---
+
+# p11-kit
+
+> Provides a way to load and enumerate PKCS#11 modules
+
+## usage
+
+```sh
+p11-kit list-modules
+
+
+trust extract --format=x509-directory --filter=ca-anchors /path/to/dir # extract trust policy from shared trust policy store
+```
+
+## see also
+
+- [[keytool]]
+- [[openssl]]
+- [[mkcert]]
diff --git a/notes/pack.md b/notes/pack.md
new file mode 100644
index 00000000..d74620cb
--- /dev/null
+++ b/notes/pack.md
@@ -0,0 +1,29 @@
+---
+tags: [container, packagemanager]
+title: pack
+created: '2023-04-24T08:05:09.255Z'
+modified: '2023-05-05T06:58:38.046Z'
+---
+
+# pack
+
+> tool maintained by the Cloud Native Buildpacks project to support the use of buildpacks
+
+## install
+
+```sh
+brew install buildpacks/tap/pack
+```
+
+## usage
+
+```sh
+pack build test_img --path apps/test-app --builder cnbs/sample-builder:bionic
+```
+
+## see also
+
+- [[mvn]]
+- [[quarkus]]
+- [[skopeo]]
+- [buildpacks.io/docs/tools/pack](https://buildpacks.io/docs/tools/pack/)
diff --git a/notes/paperkey.md b/notes/paperkey.md
new file mode 100644
index 00000000..7ca2155f
--- /dev/null
+++ b/notes/paperkey.md
@@ -0,0 +1,60 @@
+---
+tags: [linux, macos]
+title: paperkey
+created: '2021-06-14T13:30:55.412Z'
+modified: '2023-03-24T08:22:22.393Z'
+---
+
+# paperkey
+
+> backup/extract only secret information out of OpenPGP secret keys
+
+## install
+
+```sh
+brew install paperkey
+```
+
+## option
+
+```sh
+-o, --output-type TYPE # TYPES
+ # "base16" is human readable
+ # "raw" is useful if you want to pass the output to another program like a bar code or QR code generator
+
+--input-type # same as --output-type, but for the restore side of things. By default the input type is inferred automatically from the input data
+
+--output-width # sets the width of base16 output (i.e. given your font, how many columns fit on the paper you're printing on). Defaults to 78
+
+--ignore-crc-error # allows paperkey to continue when reconstructing even if it detects data corruption in the input
+
+-v, --verbose # be chatty about what is happening. Repeat this multiple times for more verbosity
+
+-V, --version
+
+--comment # add comment to base64 output
+```
+
+## usage
+
+```sh
+# take secret key in KEY.gpg and generate a file OUTPUT.txt that contains the secret data
+paperkey \
+ --secret-key KEY.gpg \
+ --output OUTPUT.txt
+
+# Take secret key data in my-key-text-file.txt and combine it with my-public-key.gpg to reconstruct my-secret-key.gpg
+paperkey \
+ --pubring my-public-key.gpg \
+ --secrets my-key-text-file.txt \
+ --output my-secret-key.gpg
+
+gpg --export-secret-key KEY_ID | paperkey | lpr # if --output is not specified output goes to STDOUT
+ # if --secret-key is not specified, the data is read from STDIN
+```
+
+## see also
+
+- [jabberwocky.com/software/paperkey](https://www.jabberwocky.com/software/paperkey/)
+- [[gpg]]
+- [[lpr]]
diff --git a/notes/parallel gnu.md b/notes/parallel gnu.md
deleted file mode 100644
index fab30b4d..00000000
--- a/notes/parallel gnu.md
+++ /dev/null
@@ -1,20 +0,0 @@
----
-tags: [bash]
-title: parallel gnu
-created: '2019-07-30T06:19:49.203Z'
-modified: '2019-07-30T08:10:06.742Z'
----
-
-# parallel gnu
-
-
-```sh
-parallel --eta -j8 ./parallel_check-short-links.sh {} :::: ./foo.csv
-
-# --bar
-
-
-tail -n +266300 ./OTSDE/shortener_OTSDE_YESPPYESPM_OK.txt.csv | \
- parallel --eta ./parallel_check-short-links.sh {}
-
-```
diff --git a/notes/parallel.md b/notes/parallel.md
new file mode 100644
index 00000000..858e263b
--- /dev/null
+++ b/notes/parallel.md
@@ -0,0 +1,57 @@
+---
+tags: [linux, moreutils]
+title: parallel
+created: '2019-07-30T06:19:49.203Z'
+modified: '2023-03-22T08:11:56.000Z'
+---
+
+# parallel
+
+> gnu parallel is a replacement for xargs and for loops. It can also split a file or a stream into blocks and pass those to commands running in parallel
+
+## install
+
+```sh
+brew install parallel
+```
+
+## usage
+
+```sh
+parallel --jobs 200% gzip ::: *.html # Compress all *.html files in parallel โ 2 jobs per CPU thread in parallel
+
+parallel lame {} -o {.}.mp3 ::: *.wav # Convert all *.wav to *.mp3 using lame โ 1 job per CPU thread in parallel (default)
+
+cat bigfile | parallel --pipe grep foobar # Chop bigfile into 1MB blocks and grep for the string foobar
+
+cat FILE.csv | parallel --eta ./parallel_check-short-links.sh {}
+
+parallel -j2 ./script.sh -- $(echo 1 2 3)
+
+parallel --eta -j8 ./script.sh {} :::: ./foo.csv
+
+# --bar
+
+CMD | parallel --j 0 --eta bash compress.sh {}
+
+ls *.json | parallel "ls -lh {}"
+
+
+# input sources
+parallel echo ::: FILE1 FILE2 FILE3
+
+cat INPUT_FILE | parallel echo
+
+parallel echo ::: FILE1 FILE2 FILE3 ::: with valuesparallel -a INPUT_FILE echo
+
+parallel echo :::: INPUT_FILE
+
+parallel echo :::: INPUT_FILE ::: CMD
+```
+
+## see also
+
+- [[moreutils]]
+- [[xargs]]
+- [gnu.org/software/parallel/parallel_cheat.pdf](https://www.gnu.org/software/parallel/parallel_cheat.pdf)
+- [shakthimaan.com/.../gnu-parallel/news.html](http://www.shakthimaan.com/posts/2014/11/27/gnu-parallel/news.html)
diff --git a/notes/pass.md b/notes/pass.md
new file mode 100644
index 00000000..8baca4f1
--- /dev/null
+++ b/notes/pass.md
@@ -0,0 +1,28 @@
+---
+tags: [crypto]
+title: pass
+created: '2019-07-30T06:19:49.204Z'
+modified: '2023-06-30T07:33:46.718Z'
+---
+
+# pass
+
+## usage
+
+```sh
+pass -c path/dir/some-pass # copy password to clipboard
+
+pass insert Business/cheese-whiz-factory
+
+pass insert --multiline # multiline password
+
+pass edit pass-name # can be used to set multiline password
+```
+
+## see also
+
+- [[openssl]]
+- [[gpg]]
+- [[gpg-agent]]
+- [[xkcdpass]]
+- [Pass: The Standard Unix Password Manager](https://www.passwordstore.org/)
diff --git a/notes/passwd.md b/notes/passwd.md
new file mode 100644
index 00000000..4f5ffc5b
--- /dev/null
+++ b/notes/passwd.md
@@ -0,0 +1,18 @@
+---
+tags: [linux]
+title: passwd
+created: '2020-01-03T13:08:02.535Z'
+modified: '2020-09-02T17:52:01.804Z'
+---
+
+# passwd
+
+> change user password
+
+## usage
+```sh
+passwd root # change root password
+```
+## see also
+- [[sshd]]
+- [[mkpasswd]]
diff --git a/notes/paste.md b/notes/paste.md
new file mode 100644
index 00000000..c52e5174
--- /dev/null
+++ b/notes/paste.md
@@ -0,0 +1,29 @@
+---
+tags: [coreutils]
+title: paste
+created: '2020-08-03T11:16:34.527Z'
+modified: '2020-09-01T12:43:12.444Z'
+---
+
+# paste
+
+> merge corresponding or subsequent lines of files
+
+## usage
+```sh
+paset FILE # prints file like cat
+
+ls | paste - - - # list files in the current directory in three columns
+
+paste -s -d '\t\n' FILE # combine pairs of lines from a file into single lines
+
+sed = FILE | paste -s -d '\t\n' - - # number the lines in a file
+
+find / -name bin -type d | paste -s -d : - # colon-separated list of dirs named bin, suitable for use in the PATH environment variable
+```
+
+## see also
+- [[awk]]
+- [[column]]
+- [[nl]]
+- [[sed]]
diff --git a/notes/pat.md b/notes/pat.md
new file mode 100644
index 00000000..b6873f95
--- /dev/null
+++ b/notes/pat.md
@@ -0,0 +1,19 @@
+---
+tags: [network]
+title: pat
+created: '2020-01-30T11:34:05.916Z'
+modified: '2020-09-02T17:38:52.426Z'
+---
+
+# pat
+
+> port address translation
+
+## usage
+```sh
+
+```
+
+## see alos
+- https://study-ccna.com/port-address-translation-pat-configuration/
+- [[docker network]]
diff --git a/notes/pattern lazy loading.md b/notes/pattern lazy loading.md
new file mode 100644
index 00000000..5c30ec8f
--- /dev/null
+++ b/notes/pattern lazy loading.md
@@ -0,0 +1,15 @@
+---
+tags: [java]
+title: pattern lazy loading
+created: '2019-08-14T06:52:21.265Z'
+modified: '2019-08-20T07:24:24.720Z'
+---
+
+# pattern lazy loading
+
+delay creation of object to later time if to expensive
+
+- virtual proxy
+- lazy initialization
+
+https://www.geeksforgeeks.org/lazy-loading-design-pattern/
diff --git a/notes/pbcopy.md b/notes/pbcopy.md
new file mode 100644
index 00000000..73317074
--- /dev/null
+++ b/notes/pbcopy.md
@@ -0,0 +1,40 @@
+---
+tags: [macos]
+title: pbcopy
+created: '2019-07-30T06:19:49.205Z'
+modified: '2023-03-22T09:28:47.588Z'
+---
+
+# pbcopy
+
+> copy data from `stdin` to clipboard
+
+## option
+
+```sh
+-pboard {general | ruler | find | font} # specifies pasteboard to copy or paste from. default: general
+
+-Prefer {txt | rtf | ps} # what type of data to look for in the pasteboard first
+```
+
+## usage
+
+```sh
+pbcopy < FILE
+
+echo STRING | pbcopy
+```
+
+## pbpaste
+
+```sh
+pbpaste
+
+pbpaste >> FILE
+```
+
+## see also
+
+- [ss64.com/osx/pbcopy](https://ss64.com/osx/pbcopy.html)
+- [[screencapture]]
+- [[cp]]
diff --git a/notes/pee.md b/notes/pee.md
new file mode 100644
index 00000000..a014cfe6
--- /dev/null
+++ b/notes/pee.md
@@ -0,0 +1,24 @@
+---
+tags: [linux, moreutils]
+title: pee
+created: '2020-09-01T07:26:48.805Z'
+modified: '2023-03-22T08:28:05.128Z'
+---
+
+# pee
+
+> pee - tee standard input to pipes
+
+## usage
+
+```sh
+echo "Hello world" | pee cat cat # redirects to multiple secondary commands
+
+cat file | pee 'sort -u > sorted' 'sort -R > unsorted'
+```
+
+## see also
+
+- [[tee]]
+- [[moreutils]]
+- [[sort]]
diff --git a/notes/perl.md b/notes/perl.md
new file mode 100644
index 00000000..2bcb3e40
--- /dev/null
+++ b/notes/perl.md
@@ -0,0 +1,46 @@
+---
+tags: [linux]
+title: perl
+created: '2019-07-30T06:19:49.150Z'
+modified: '2023-03-25T12:33:10.563Z'
+---
+
+# perl
+
+> perl language interpreter
+
+## option
+
+```sh
+-v # print version, patchlevel and license
+```
+
+## usage
+
+```sh
+perl -de 42 # starts debugger in repl-mode, 42 has no meaning it's just valid
+
+perl -MHTTP::Server::Brick \
+ -e '$s=HTTP::Server::Brick->new(port=>8000); $s->mount("/"=>{path=>"."}); $s->start'
+```
+
+## script
+
+```perl
+#!/usr/bin/perl
+=head1 DESCRIPTION
+printenv โ a CGI program that just prints its environment
+source: https://en.wikipedia.org/wiki/Common_Gateway_Interface
+=cut
+print "Content-type: text/plain\r\n\r\n";
+
+for my $var ( sort keys %ENV ) {
+ printf "%s = \"%s\"\r\n", $var, $ENV{$var};
+}
+```
+
+## see also
+
+- [[cpan]]
+- [[php]]
+- [[python]]
diff --git a/notes/pg_dump.md b/notes/pg_dump.md
new file mode 100644
index 00000000..60d9c05d
--- /dev/null
+++ b/notes/pg_dump.md
@@ -0,0 +1,58 @@
+---
+tags: [database]
+title: pg_dump
+created: '2021-03-15T07:59:51.829Z'
+modified: '2023-03-22T10:27:08.748Z'
+---
+
+# pg_dump
+
+> extract a postgresql database into a script file or other archive file
+
+## environment
+
+```sh
+PGDATABASE # -
+PGHOST # -
+PGOPTIONS # -
+PGPORT # -
+PGUSER # -
+PGSSLMODE # determines whether or with what priority a secure SSL TCP/IP connection will be negotiated with the server. There are six modes:
+ # disable only try a non-SSL connection
+ # allow first try a non-SSL connection; if that fails, try an SSL connection
+ # prefer (default) first try an SSL connection; if that fails, try a non-SSL connection
+ # require only try an SSL connection. If a root CA file is present, verify the certificate in the same way as if verify-ca was specified
+ # verify-ca only try an SSL connection, and verify that the server certificate is issued by a trusted CA
+ # verify-full only try an SSL connection, verify that the server certificate is issued by a trusted CA and that the server host name matches that in the certificate
+```
+
+## usage
+
+```sh
+pg_dump -h HOST -p PORT -U USER -d DATABASE > FILE.dump
+
+pg_dump DATABASE > db.sql # dump database called DATABASE into sql-script file
+
+psql -d NEWDB -f db.sql # reload script into a (freshly created) database: NEWDB
+
+pg_dump -Fc DATABASE > db.dump # dump database into custom-format archive file
+pg_dump -Fd DATABASE -f dumpdir # dump database into directory-format archive
+pg_dump -Fd DATABASE -j 5 -f dumpdir # dump database into directory-format archive in parallel with 5 worker jobs
+
+pg_restore -d NEWDB db.dump # reload an archive file into a (freshly created) database: NEWDB
+
+pg_dump -t TABLE DATABASE > db.sql # dump a single table
+pg_dump -t "\"MixedCaseName\"" DATABASE > mytab.sql # specify upper-/mixed-case name in -t and related switches, name needs to be double-quoted else it will be folded to lower case (see Patterns)
+
+pg_dump -t 'detroit.emp*' -T detroit.employee_log DATABASE > db.sql # dump all tables whose names start with emp in the detroit schema, except for the table named employee_log
+pg_dump -n 'east*gsm' -n 'west*gsm' -N '*test*' DATABASE > db.sql # dump all schemas whose names start with east or west and end in gsm, excluding schemas whose names contain word test
+pg_dump -n '(east|west)*gsm' -N '*test*' DATABASE > db.sql # same as above, using regular expression notation to consolidate the switches
+pg_dump -T 'ts_*' DATABASE > db.sql # dump all database objects except for tables whose names begin with ts_
+```
+
+## see also
+
+- [[psql]]
+- [[mysqldump]]
+- [[mongodump]]
+- [postgresql.org/docs/9.0/libpq-envars](https://www.postgresql.org/docs/9.0/libpq-envars.html)
diff --git a/notes/pgrep.md b/notes/pgrep.md
new file mode 100644
index 00000000..981a67c1
--- /dev/null
+++ b/notes/pgrep.md
@@ -0,0 +1,33 @@
+---
+tags: [linux, macos]
+title: pgrep
+created: '2023-03-22T08:18:20.842Z'
+modified: '2023-03-24T08:23:34.408Z'
+---
+
+# pgrep
+
+> find signal processes by name
+
+## option
+
+```sh
+ -f # match against full argument lists. The default is to match against process names
+ -l # long output. For pgrep, print the process name in addition to the process ID for each matching process.
+ # If used in conjunction with -f, print the process ID and the full argument list for each matching process.
+ # For pkill, display the kill command used for each process killed.
+```
+
+## usage
+
+```sh
+pgrep -fl PROCESS_NAME
+```
+
+## see also
+
+- [[procps]]
+- [[pkill]]
+- [[grep]]
+- [[bash kill]]
+- [[ps]]
diff --git a/notes/php.md b/notes/php.md
index 2a66282b..578c9f32 100644
--- a/notes/php.md
+++ b/notes/php.md
@@ -1,20 +1,84 @@
---
-tags: [lang, lang/php]
+tags: [php]
title: php
created: '2019-07-30T06:19:49.206Z'
-modified: '2019-08-02T07:19:54.381Z'
+modified: '2023-03-22T08:31:34.655Z'
---
# php
+> general-purpose scripting language
+
+## option
+
```sh
php -i
-php -a # start php repl
+php -a # start php repl
-php -r # exec php code in oneline
+php -r # exec php code in oneline
+
+# inline
+php -r '
+ echo gethostbyname("foo.bar.domain.net").PHP_EOL;
+ foreach(dns_get_record("foo.bar.domain.net", DNS_A) as $i){ echo $i["ip"].PHP_EOL; };
+'
```
-### inline
-```sh
-php -r \'echo gethostbyname("foo.bar.domain.net").PHP_EOL; echo "---".PHP_EOL; foreach(dns_get_record("foo.bar.domain.net", DNS_A) as $i){ echo $i["ip"].PHP_EOL;};\'
+
+## usage
+
+## read from stdin
+
+```php
+ $val) { fwrite($fd, $key.":".$val . "\n"); }
+}
+fclose($fd);
+```
+
+## simple mailer
+
+```php
+isSMTP();
+$mail->Host = 'smtp.host.com';
+$mail->SMTPAuth = true;
+$mail->Username = 'user@host';
+$mail->Password = '*******';
+$mail->SMTPSecure = 'tls';
+$mail->Port = 587;
+$mail->CharSet = "UTF-8";
+$mail->setFrom('it@host', 'Mailer');
+$mail->addAddress('user@host', 'Foo Bar');
+$mail->Subject = 'Subject: รค ร รถ ร รผ ร';
+$mail->Body = 'hello user, ...';
+if(!$mail->send()) {
+ echo 'Message could not be sent.';
+ echo 'Mailer Error: ' . $mail->ErrorInfo;
+} else {
+ echo 'Message has been sent';
+}
+```
+
+## see also
+
+- [[composer]]
+- [[python]]
+- [[scala]]
+- [[irb]]
diff --git a/notes/pigz.md b/notes/pigz.md
new file mode 100644
index 00000000..3d246f94
--- /dev/null
+++ b/notes/pigz.md
@@ -0,0 +1,53 @@
+---
+tags: [linux]
+title: pigz
+created: '2020-01-22T13:43:00.526Z'
+modified: '2022-02-02T09:32:20.505Z'
+---
+
+# pigz
+
+> compress or expand files - multithreaded replacement for `gzip`
+> pronounced `pig-zee` - It is not pronounced like the plural of pig
+
+## compression levels
+
+```sh
+6 # default compression
+1 # fastest, but offers least compression
+9 # slowest, but best compression
+0 # no compression
+```
+
+## usage
+
+```sh
+pigz -9 FILE # compress FILE with level 9 to .gz and remove origial !
+
+pigz -k FILE # keep original FILE
+
+pigz -l FILE # list content of compressed FILE
+```
+
+## tar
+
+pigz does not have options to compress a folder, it only compresses single files.
+As a workaround, [[pigz]] is used in conjunction with [[tar]] command to [[zip]] directories
+
+```sh
+tar cf - paths-to-archive | pigz -9 -p 32 > archive.tar.gz
+
+tar -I pigz -xf archive.tar.gz -C /tmp # fast unpack
+tar -cf archive.tar.gz -I pigz /opt # fast pack
+
+tar --use-compress-program="pigz --best --recursive" -cf archive.tar.gz directory
+tar --use-compress-program="pigz --best --recursive | pv" -cf archive.tar.gz directory # monitor progresse
+```
+
+## see also
+
+- [[zip]]
+- [[tar]]
+- [[gzip gunzip zcat]]
+- [[pv]]
+- [linux.die.net/man/1/pigz](https://linux.die.net/man/1/pigz)
diff --git a/notes/ping.md b/notes/ping.md
new file mode 100644
index 00000000..7feb3fb5
--- /dev/null
+++ b/notes/ping.md
@@ -0,0 +1,67 @@
+---
+tags: [linux, network]
+title: ping
+created: '2019-07-30T06:19:49.207Z'
+modified: '2022-11-04T10:53:17.986Z'
+---
+
+# ping
+
+> `Packet InterNet Groper` find out if a host is reachable from your network and how fast you get a response
+> calculates the "Round Trip Time" `RTT` that it takes a packet to reach a host
+
+## install
+
+```sh
+apt install iputils-ping
+yum install iputils
+```
+
+
+## option
+
+```sh
+-c count # stop after sending (and receiving) count ECHO_RESPONSE packets
+-s packetsize # specify number of data bytes to send (default: 56, translates to 64-bytes ICMP-data when combined with 8-bytes ICMP-header-data
+```
+
+## usage
+
+```sh
+ping -c 5 192.168.1.5 # stop after sending count
+
+ping -s 100 -c 6 unixmen.com # heavier packages
+
+ping -i 3 unixmen.com # increase interval 3 seconds
+
+ping -i 0.2 unixmen.com # decrease interval
+
+ping -c 5 -q unixmen.com # summary statistics
+
+ping -w 6 unixmen.com # timeout after 6 seconds
+
+
+# ip notations
+ping 0 # linux: 127.0.0.1 osx: 0.0.0.0
+
+ping 127.0 # 127.0.0.1
+
+ping 10.50.1 # 10.50.1
+
+ping 10.0.513 # overflow: 2 x 256 + 1 shifts to the left
+
+
+ping 167772673 # decimal notation
+
+ping 0xa000201 # hex notation
+
+ping 10.0.2.010 # octal notation
+```
+
+## see also
+
+- [[traceroute]]
+- [[arp]]
+- [[nc]]
+- [[nmap]]
+- [There's more than one way to write an IP address](https://ma.ttias.be/theres-more-than-one-way-to-write-an-ip-address/)
diff --git a/notes/pip.md b/notes/pip.md
new file mode 100644
index 00000000..8f9a6b63
--- /dev/null
+++ b/notes/pip.md
@@ -0,0 +1,35 @@
+---
+tags: [python]
+title: pip
+created: '2019-08-02T07:21:18.995Z'
+modified: '2022-11-23T11:23:49.644Z'
+---
+
+# pip
+
+> package-management system used to install and manage software packages written in python
+
+## install
+
+```sh
+curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
+python get-pip.py --force-reinstall
+```
+
+## usage
+
+```sh
+pip list
+
+pip install virtualenv --verbose # --verbose see where package gets installed to
+
+pip install PACKAGE --user # avoid "Operation not permitted" and using sudo
+```
+
+## see also
+
+- [[virtualenv]]
+- [[gem]]
+- [[curl]]
+- [How do I install pip on macOS or OS X? - Stack Overflow](https://stackoverflow.com/questions/17271319/how-do-i-install-pip-on-macos-or-os-x)
+- [How to install and use pip without sudo - GitHub](https://gist.github.com/haircut/14705555d58432a5f01f9188006a04ed)
diff --git a/notes/pipx.md b/notes/pipx.md
new file mode 100644
index 00000000..41cf399d
--- /dev/null
+++ b/notes/pipx.md
@@ -0,0 +1,54 @@
+---
+tags: [python]
+title: pipx
+created: '2020-11-05T12:54:51.421Z'
+modified: '2023-03-22T08:33:03.434Z'
+---
+
+# pipx
+
+> install and run [[python]] apps in isolated environments
+
+## install
+
+```sh
+brew install pipx
+```
+
+## env
+
+```sh
+PIPX_HOME # overrides default pipx location - virtual envs install to $PIPX_HOME/venvs
+PIPX_BIN_DIR # overrides location of app installations - apps are symlinked/copied here
+USE_EMOJI # overrides emoji behavior
+PIPX_DEFAULT_PYTHON # overrides default python used for commands
+```
+
+## usage
+
+```sh
+pipx list # List installed packages
+
+pipx install PACKAGE
+pipx install . --force
+
+pipx reinstall PACKAGE
+pipx uninstall PACKAGE
+pipx upgrade PACKAGE
+
+pipx inject # install packages into an existing virtual env
+pipx upgrade-all # upgrade all packages - `pip install -U ` for each package
+pipx uninstall-all # un-install all packages
+pipx reinstall-all # re-install all packages
+
+pipx run # download latest version of package to temp virtual env, then run app from it - compatible with local `__pypackages__` dir
+pipx runpip # run pip in an existing pipx-managed virtual env
+pipx ensurepath # ensure dir necessary for pipx operation are in your PATH environment variable.
+pipx completions # print instructions on shell completions
+```
+
+## see also
+
+- [[pyenv]]
+- [[pip]]
+- [[python]]
diff --git a/notes/pkill.md b/notes/pkill.md
new file mode 100644
index 00000000..f9b35b95
--- /dev/null
+++ b/notes/pkill.md
@@ -0,0 +1,35 @@
+---
+tags: [linux]
+title: pkill
+created: '2020-01-02T14:25:22.992Z'
+modified: '2023-03-22T08:19:12.976Z'
+---
+
+# pkill
+
+> kill signal processes by name
+
+## option
+
+```sh
+ -f # match against full argument lists. The default is to match against process names
+ -l # long output. For pgrep, print the process name in addition to the process ID for each matching process.
+ # If used in conjunction with -f, print the process ID and the full argument list for each matching process.
+ # For pkill, display the kill command used for each process killed.
+```
+
+## usage
+
+```sh
+pkill -fl PROCESS_NAME # match full path
+
+pkill -HUP sshd
+```
+
+## see also
+
+- [[procps]]
+- [[pgrep]]
+- [[grep]]
+- [[bash kill]]
+- [[ps]]
diff --git a/notes/pmap.md b/notes/pmap.md
new file mode 100644
index 00000000..29910daa
--- /dev/null
+++ b/notes/pmap.md
@@ -0,0 +1,39 @@
+---
+tags: [linux]
+title: pmap
+created: '2019-12-11T11:14:55.135Z'
+modified: '2023-03-22T08:02:41.286Z'
+---
+
+# pmap
+
+> report memory map of a process
+
+## usage
+
+```sh
+pmap PID
+
+pmap -q -d PID # strip pmap output of headers and footers
+
+pmap -xx PID # used to display everything the kernel provides
+
+
+
+memtop() {
+ {
+ echo "_PID_ _Name_ _Mem_"
+ for i in /proc/[0-9]*; do
+ echo -e "${i##*/}\t$(<$i/comm)\t$(pmap -d "${i##*/}" | tail -1 | { read a b c mem d; echo $mem; })"
+ done \
+ | sort -nr -k3 | head -$((${LINES:-23} - 3 ))
+ } | column -t
+} 2>/dev/null
+```
+
+## see also
+
+- [[procps]]
+- [[lsof]]
+- [[bash ulimit]]
+- [[sysctl]]
diff --git a/notes/podman.md b/notes/podman.md
new file mode 100644
index 00000000..c813f4d5
--- /dev/null
+++ b/notes/podman.md
@@ -0,0 +1,39 @@
+---
+tags: [container]
+title: podman
+created: '2021-09-06T12:17:24.319Z'
+modified: '2023-05-30T07:23:55.859Z'
+---
+
+# podman
+
+> manage pods, containers and images
+
+## install
+
+```sh
+brew install podman
+```
+
+## usage
+
+```sh
+podman machine init
+
+podman machine start
+
+podman machine list
+
+podman machine ssh
+
+podman build -t TAG .
+
+podman run -ti --rm IMAGE
+```
+
+## see also
+
+- [[docker]]
+- [[colima]]
+- [[skopeo]]
+- [[crc]]
diff --git a/notes/postgres vs mysql.md b/notes/postgres vs mysql.md
new file mode 100644
index 00000000..9debab14
--- /dev/null
+++ b/notes/postgres vs mysql.md
@@ -0,0 +1,48 @@
+---
+tags: [database, Notebooks]
+title: postgres vs mysql
+created: '2023-05-04T11:13:23.713Z'
+modified: '2023-05-04T11:25:14.422Z'
+---
+
+# postgres vs mysql
+
+## main differences
+
+- implementation of primary and secondary indexes
+- how data is stored and updated
+
+## b+ tree
+
+- index is a datastructure (b+ tree)
+- allows searching for keys
+- keys in b+trees indexes are columns on the table
+
+mysql "index organized tables"
+
+- primary index value is the full row object with all the attributes
+- secondary index the key is whatever column(s) you indexed and the value is a pointer to where the full row really live. value of secondary index leaf pages are usually primary keys
+
+postgres "heap organized tables"
+
+- all indexes are secondary and all point to system managed tuple ids in data pages loaded in the heap
+
+## process vs thread
+
+MySQL uses threads
+
+- threads are lighter weight and share their parent process virtual memory address
+- smaller thread control block (TCB)
+
+Postgres uses processes
+
+- processes have overhead of dedicated virtual memory
+- larger control block (PCB)
+
+## see also
+
+- [[mysql]]
+- [[psql]]
+- [medium.com/PostgresvsMySQL-fundamentalDifferences](https://medium.com/@hnasr/postgres-vs-mysql-5fa3c588a94e)
+
+
diff --git a/notes/powermetrics.md b/notes/powermetrics.md
new file mode 100644
index 00000000..33674912
--- /dev/null
+++ b/notes/powermetrics.md
@@ -0,0 +1,19 @@
+---
+tags: [macos]
+title: powermetrics
+created: '2020-08-12T12:08:21.435Z'
+modified: '2020-08-12T12:11:55.241Z'
+---
+
+# powermetrics
+
+> gathers and display cpu usage statistics
+
+## usage
+```sh
+powermetrics --samplers smc |grep -i "CPU die temperature" # poll cpu temp
+
+powermetrics --samplers smc -i1 -n1 # get a single instant sample of SMC sensor reading
+```
+## see also
+- [[nettop]]
diff --git a/notes/powershell.md b/notes/powershell.md
new file mode 100644
index 00000000..4a07e9c9
--- /dev/null
+++ b/notes/powershell.md
@@ -0,0 +1,140 @@
+---
+tags: [powershell]
+title: powershell
+created: '2019-07-30T06:19:49.207Z'
+modified: '2023-05-24T08:44:46.566Z'
+---
+
+# powershell
+
+## usage
+
+```sh
+echo $null >> script.bat # equivalent to `touch script.bat`
+
+
+$myString = @"
+ This is the first line
+ of a very long string. A "here string"
+ lets you to create blocks of text
+ that span several lines.
+ "@
+
+# file Get-TimeResult.ps1
+function Get-TimesResult {
+ Param ([int]$a,[int]$b)
+ $c = $a * $b
+ Write-Output $c
+}
+
+# source file
+. ./Get-TimeResult.ps1
+Get-TimeResult -a 6 -b 8
+
+
+Foo-Bar | Out-File docker.json -Append # write output to file
+```
+
+## cmdlets
+
+```sh
+alias
+gal # alias: Get-Alias
+[ gci | dir | ls ] # alias: Get-ChildItem
+```
+
+## command
+
+```sh
+get-command
+gcm # alias for get-command
+gcm *get* # lists als command that contain get
+
+Get-Command -PSSnapin snapin
+
+(Get-Command docker).Path # C:\Program Files\Docker\Docker\resources\bin\docker.exe
+```
+https://www.youtube.com/watch?v=zps_3l0TQDY
+
+## Snap-ins
+
+* cmdlets are "packaged" in a snap-in (similar to ms-management-console: start->run->"mmc")
+* multiple snap-ins can be loaded into the shell (Add-PSSnapIn)
+* 120+ cmdlets provided by default snapins (Get-PSSnapin)
+
+```
+Get-PSSnapin
+
+Get-Command -pssnapin Microsoft.PowerShell.Management # list cmdlets from a perticular snapin
+```
+
+```sh
+gcm # get a list of cmdlets
+
+get-process # get a list of processes
+
+get-service # get a list of services
+
+New-Alias # create a new alias
+
+New-Service # create a new service
+```
+
+```
+Get-ChildItem -path C:\Test*.txt -exclude "sample.txt"
+
+# alias position and short parameter
+Dir C:\Test*.txt -ex "sample.txt"
+```
+
+## vsphere
+
+```sh
+docker run --rm --name powercli -it --volume $(pwd):/usr/scripts vmware/powerclicore
+
+PS /usr/scripts> cat ./connectVCenter.ps1
+Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Scope Session
+
+Connect-VIServer -Server vcenter1.domain.net # login
+```
+
+```sh
+PS /usr/scripts> cat ./listVMsnapshots.ps1
+Get-VM | Get-Snapshot | Select VM,Name,Description,@{Label="Size";Expression={"{0:N2} GB" -f ($_.SizeGB)}},Created |
+Export-Csv 'results/aktive-snapshots.txt' -Encoding UTF8 -NoTypeInformation -Delimiter "|"
+
+Get-Snapshot -vm * -name VEEAM BACKUP* | remove-snapshot # remove backups snapshots
+```
+
+```sh
+Get-VM -? # get help
+
+Get-VM -name * \
+ |Select Name,@{N=โvNICโ;E={($_.ExtensionData.Config.Hardware.Device \
+ | where{$_ -is [VMware.Vim.VirtualEthernetCard]}).Count}}
+```
+
+### Get full information about the VMs
+
+```sh
+Get-VM -name * \
+ | Select Name,@{N=โvDiskโ;E={($_.ExtensionData.Config.Hardware.Device \
+ | where{$_ -is [VMware.Vim.VirtualDisk]}).Count}},@{N=โvNICโ;E={($_.ExtensionData.Config.Hardware.Device \
+ | where{$_ -is [VMware.Vim.VirtualEthernetCard]}).Count}}, Notes, Guest, NumCpu, CoresPerSocket, MemoryGB, ResourcePool, UsedSpaceGB, ProvisionedSpaceGB
+
+Get-VMHostNetworkAdapter \
+ | select VMhost, Name, IP \
+ | format-table -autosize
+
+Get-VM | Select Name, @{N=โClusterโ;E={Get-Cluster -VM $_}}
+
+
+Get-VM log \
+ | Get-NetworkAdapter \
+ | Select-Object @{N=โVMโ;E={$_.Parent.Name}},@{N=โNICโ;E={$_.Name}},@{N=โNetworkโ;E={$_.NetworkName}} \
+ | ft -AutoSize
+
+Get-Datastore | Select Name,@{N=โCanonicalNameโ;E={$_.Extensiondata.Info.Vmfs.Extent[0].DiskName}}
+```
+
+[day-to-day useful PowerCLi commands/scripts](https://arabitnetwork.com/2018/07/31/for-vmware-admins-day-to-day-useful-powercli-commands-scripts/amp/)
diff --git a/notes/prime number.md b/notes/prime number.md
new file mode 100644
index 00000000..ee1f85ac
--- /dev/null
+++ b/notes/prime number.md
@@ -0,0 +1,67 @@
+---
+tags: [crypto, Notebooks]
+title: prime number
+created: '2020-08-03T07:39:20.122Z'
+modified: '2023-03-24T08:19:38.694Z'
+---
+
+# prime number
+
+## belphegor's prime
+
+```
+1 000 000 000 000 066 600 000 000 000 001 = 10ยณโฐ + 666 + 10ยนโด + 1
+```
+
+- palindromic prime number with `666` in the middle and 13 0s on either side, named after seven princes of hell
+
+
+## Diffie-Hellman algorithm
+
+```
+If Alice and Bob wish to communicate with each other, they
+
+1) first agree between them a large prime number p, and a generator (or base) g (where 0 < g < p).
+
+Alice
+- chooses a secret integer "a" (her private key)
+- then calculates "g^a mod p" (her public key)
+
+Bob
+- chooses his private key "b" (his private key)
+- then calculates "g^b mod p" (his public key) in the same way
+
+
+
+Alice and Bob then send each other their public keys
+
+
+Alice
+- now knows "a" and Bob's public key "g^b mod p"
+- She is not able to calculate the value "b" from Bob's public key as this is a hard mathematical problem (known as the discrete logarithm problem)
+- She can however calculate "(g^b)^a mod p = g^ab mod p"
+
+Bob
+- knows b and "g^a", so he can calculate "(g^a)^b mod p = g^ab mod p"
+
+Therefore both Alice and Bob know a shared secret "g^ab mod p"
+
+Eve who was listening in on the communication knows
+- "p"
+- "g"
+- Alice's public key (ga mod p)
+- Bob's public key (gb mod p)
+
+She is unable to calculate the shared secret from these values.
+
+In static-static mode both Alice and Bob retain their private/public keys over multiple communications.
+Therefore the resulting shared secret will be the same every time.
+In ephemeral-static mode one party will generate a new private/public key every time, thus a new shared secret will be generated.
+```
+
+[security.stackexchange.com/questions/94390/whats-the-purpose-of-dh-parameters](https://security.stackexchange.com/questions/94390/whats-the-purpose-of-dh-parameters)
+
+## see also
+
+- [[math]]
+- [[openssl]]
diff --git a/notes/printenv.md b/notes/printenv.md
new file mode 100644
index 00000000..b81cf7d2
--- /dev/null
+++ b/notes/printenv.md
@@ -0,0 +1,18 @@
+---
+tags: [shell]
+title: printenv
+created: '2020-01-17T07:50:06.349Z'
+modified: '2021-05-12T08:47:10.282Z'
+---
+
+# printenv
+
+> print out the environment
+
+## usage
+```sh
+printenv [name]
+```
+## see also
+- [[bash]]
+- [[env]]
diff --git a/notes/procfs.md b/notes/procfs.md
new file mode 100644
index 00000000..065c5fe1
--- /dev/null
+++ b/notes/procfs.md
@@ -0,0 +1,32 @@
+---
+tags: [filesystem, network]
+title: procfs
+created: '2019-09-03T11:42:10.908Z'
+modified: '2023-03-22T07:57:21.733Z'
+---
+
+# procfs
+
+> procfs or `/proc`, special linux filesystem used to present process information and kernel processes
+
+## usage
+
+```sh
+cat /proc/meminfo # memory info see also `free`
+
+/proc/self/cgroup
+
+/proc/self/mountinfo
+
+/proc/filesystems # available filesystems
+```
+
+## see also
+
+- [[procps]]
+- [[filesystem hierarchy standard]]
+- [[filesystem]]
+- [[sysfs]]
+- [[free]]
+- [[top]]
+- [[container]]
diff --git a/notes/procps.md b/notes/procps.md
new file mode 100644
index 00000000..a682e91a
--- /dev/null
+++ b/notes/procps.md
@@ -0,0 +1,37 @@
+---
+tags: [linux]
+title: procps
+created: '2023-03-22T07:58:03.748Z'
+modified: '2023-05-05T08:14:29.615Z'
+---
+
+# procps
+
+> set of utilities that provide info out of the pseudo-filesystem most commonly located at `/proc`
+
+## usage
+
+- [[free]] Report the amount of free and used memory in the system
+- [[kill]] Send a signal to a process based on PID
+- [[pgrep]] List processes based on name or other attributes
+- [[pkill]] Send a signal to a process based on name or other attributes
+- [[pmap]] Report memory map of a process
+- [[ps]] Report information of processes
+- [[pwdx]] Report current directory of a process
+- [[skill]] Obsolete version of pgrep/pkill
+- [[slabtop]] Display kernel slab cache information in real time
+- [[snice]] Renice a process
+- [[sysctl]] Read or Write kernel parameters at run-time
+- [[tload]] Graphical representation of system load average
+- [[top]] Dynamic real-time view of running processes
+- [[uptime]] Display how long the system has been running
+- [[vmstat]] Report virtual memory statistics
+- [[w]] Report logged in users and what they are doing
+- [[watch]] Execute a program periodically, showing output fullscreen
+
+## see also
+
+- [[syscall]]
+- [[coreutils]]
+- [gitlab.com/procps-ng/procps](https://gitlab.com/procps-ng/procps)
+- [fabiokung.com/2014/03/13/memory-inside-linux-containers](https://fabiokung.com/2014/03/13/memory-inside-linux-containers/)
diff --git a/notes/procs.md b/notes/procs.md
new file mode 100644
index 00000000..91aab890
--- /dev/null
+++ b/notes/procs.md
@@ -0,0 +1,33 @@
+---
+tags: [linux, rust]
+title: procs
+created: '2021-05-12T17:09:50.481Z'
+modified: '2023-05-10T14:14:02.687Z'
+---
+
+# procs
+
+> `procs` -- a modern replacement for [[ps]] writen in [[rust]]
+
+## install
+
+```sh
+cargo install procs
+brew install procs`
+```
+
+## usage
+
+```sh
+procs USER
+
+procs PROCESS_NAME
+```
+
+## see also
+
+- [[procps]]
+- [[ps]]
+- [[exa]]
+- [[rust]]
+- [[cargo]]
diff --git a/notes/prolog.md b/notes/prolog.md
new file mode 100644
index 00000000..b1956b61
--- /dev/null
+++ b/notes/prolog.md
@@ -0,0 +1,25 @@
+---
+tags: [runtime]
+title: prolog
+created: '2023-05-25T11:31:02.833Z'
+modified: '2023-07-19T11:19:55.188Z'
+---
+
+# prolog
+
+> logic programming language first specified in 1972, and refined into multiple modern implementations
+
+## usage
+
+```prolog
+% this is a comment
+
+% Lines that begin with ?- can be typed in interactive mode
+
+?- maplist(plus(1), [2,3,4], Output). % Output = [3, 4, 5]. % generate lists based on other lists
+```
+
+## see also
+
+- [[erlang]]
+- [learnxinyminutes.com/docs/prolog/](https://learnxinyminutes.com/docs/prolog/)
diff --git a/notes/prometheus.md b/notes/prometheus.md
new file mode 100644
index 00000000..2cbd4a03
--- /dev/null
+++ b/notes/prometheus.md
@@ -0,0 +1,45 @@
+---
+tags: [container]
+title: prometheus
+created: '2019-11-17T17:42:41.438Z'
+modified: '2023-05-05T06:58:17.552Z'
+---
+
+# prometheus
+
+## usage
+
+```sh
+# capacity planing
+# needed_disk_space = retention_time_seconds * ingested_samples_per_second * bytes_per_sample
+# average, Prometheus uses only around 1-2 bytes per sample
+# 15811200 * 179.4 * 2 = 5 673 058 560.0 bytes
+
+--storage.tsdb.retention.time=183d => 15811200 s
+```
+
+## usage
+
+```sh
+prometheus
+```
+
+## api
+
+```sh
+GET /api/v1/label/SERVICE_NAME/values # label which use SERVICE_NAME=".."
+
+GET /api/v1/label/name/values # labels which use name=".."
+
+GET /-/reload
+```
+
+## see also
+
+- [[promtool]]
+- [prometheus.io/docs/prometheus/latest/querying/basics](https://prometheus.io/docs/prometheus/latest/querying/basics/)
+- [timber.io/blog/promql-for-humans](https://timber.io/blog/promql-for-humans/)
+- [eave.works/blog/promql-queries-for-the-rest-of-us](https://www.weave.works/blog/promql-queries-for-the-rest-of-us/)
+- [Prometheus: grouping metrics by metric names - Stack Overflow](https://stackoverflow.com/a/49151596)
+- [Google Groups](https://groups.google.com/d/msg/prometheus-developers/oK_bx8rHmZs/0AA3lWnwAQAJ)
+- [prometheus.io/docs/prometheus/latest/storage/](https://prometheus.io/docs/prometheus/latest/storage/)
diff --git a/notes/promtool.md b/notes/promtool.md
new file mode 100644
index 00000000..98bd188f
--- /dev/null
+++ b/notes/promtool.md
@@ -0,0 +1,47 @@
+---
+tags: [cloud]
+title: promtool
+created: '2019-07-30T06:19:49.218Z'
+modified: '2023-05-24T08:42:35.056Z'
+---
+
+# promtool
+
+> query promtheus via cli
+
+## usage
+
+```sh
+promtool query instant http://prometheus.domain.net:9090 'node_memory_Cached_bytes{instance="docker-registry"}'
+```
+
+## promql
+
+> `prometheus query language`
+
+```sh
+topk(10, count by (__name__)({__name__=~".+"})) # top 10 metrics
+
+sort_desc (sum by(__name__)({name=~"afp-outbound_application.1.*"}))
+
+sum by (__name__)({name=~"rabbitmq.*"})
+
+time() - process_start_time_seconds{job="traefik-metrics", instance=~"$server"} # uptime
+
+time() - node_boot_time_seconds{instance=~"$server"}
+
+histogram_quantile(0.$percentiles, rate(traefik_entrypoint_request_duration_seconds_bucket{code="200",method="GET"}[5m]))
+
+sum(rate(traefik_backend_requests_total{code=~"2.."}[5m])) by (method, code)
+
+sum by (instance) (irate(node_disk_io_time_ms{instance=~"swarm-2.node.ddev.domain.net:9100"}[5m]))
+
+rate(v range-vector)
+
+rate(prometheus_local_storage_ingested_samples_total[5m]) 179.4
+```
+
+## see also
+
+- [[prometheus]]
+
diff --git a/notes/ps.md b/notes/ps.md
new file mode 100644
index 00000000..ff26187c
--- /dev/null
+++ b/notes/ps.md
@@ -0,0 +1,70 @@
+---
+tags: [linux]
+title: ps
+created: '2019-07-30T06:19:49.218Z'
+modified: '2023-03-16T07:59:18.312Z'
+---
+
+# ps
+
+> prints a line of information about the current running login shell and any processes running under it
+
+## install
+
+```sh
+apt install procps
+dnf install procps
+yum install procps
+microdnf install procps
+```
+
+## usage
+
+```sh
+ps -a # selects all processes with a tty except session leaders
+
+ps a --forest # macos not supported !
+ps fax
+
+ps -C sleep
+
+ps -u yourusername # lists your processes
+
+
+# all processes on the system
+ps ax # bsd-style
+ps -e # standard-style
+
+# all processes on the system with UUID
+ps aux # bsd-style
+ps -ef # standard-style
+
+# a show processes for all users
+# u display the process's user/owner
+# x also show processes not attached to a terminal
+
+
+# format
+ps -o KEYWORD
+ps -o user,pid,time
+ps -o user pid comm command
+
+ps xawf -eo pid,user,cgroup,args
+
+ps aux | sort -nrk 3,3 | head -n 5 # top 5 processes
+ps aux | grep apache | awk '{print $6/1024 " MB";}' # Ram consumption per apache process
+ps aux | grep "[f]nord" # don't show grep in result
+```
+
+## see also
+
+- [[procs]]
+- [[pgrep]]
+- [[pkill]]
+- [[sort]]
+- [[awk]]
+- [[grep]]
+- [[docker]]
+- [[kill]]
+- [[bash kill]]
+- [linuxcommand.org/lc3_man_pages/ps](http://linuxcommand.org/lc3_man_pages/ps1.html)
diff --git a/notes/psql.md b/notes/psql.md
new file mode 100644
index 00000000..132676a8
--- /dev/null
+++ b/notes/psql.md
@@ -0,0 +1,79 @@
+---
+tags: [database, linux]
+title: psql
+created: '2019-07-30T06:19:49.220Z'
+modified: '2023-05-04T12:30:45.313Z'
+---
+
+# psql
+
+> postgresql - object-relational database management system written in [[c]]
+
+## install
+
+```sh
+apt install postgresql
+
+docker run -ti --rm -e POSTGRES_PASSWORD=password postgres psql -U postgres
+```
+
+## usage
+
+```sh
+psql DBNAME USER
+
+psql DBNAME -U USER -d DATABASE
+
+psql -U USER -d DATABASE -c "SELECT * FROM some_table"
+
+psql -h HOST -p 5432 -U postgres
+```
+
+## console
+
+```sql
+\? -- help for psql commands
+\h -- help for SQL commands
+
+\conninfo -- information about the current database connection
+
+\list -- list all databases
+
+\connect DATABASE -- switch to database
+
+\dt -- list all tables in the current database
+
+\z -- list all of the tables, views, and sequences in the database
+
+\q -- exit the psql program
+
+\d+ table -- describe
+DESCRIBE TABLE
+
+\x auto -- output format
+
+-- init
+CREATE DATABASE bookstore;
+CREATE USER bookstore_user WITH ENCRYPTED PASSWORD 'secret';
+GRANT ALL PRIVILEGES ON DATABASE bookstore TO bookstore_user;
+GRANT ALL PRIVILEGES ON TABLE books TO bookstore_user;
+
+psql "dbname=bookstore host=localhost user=bookstore_user password=secret port=5432"
+sslmode=require
+
+
+BEGIN; UPDATE users SET admin = 't' WHERE id = '38'; select admin from users where id = '38'; ROLLBACK; -- dryrun
+
+
+SELECT pg_size_pretty( pg_database_size('DATABASE') ); -- get db size
+```
+
+## see also
+
+- [[pg_dump]]
+- [[mysql]]
+- [[mongo]]
+- [postgresql.org/docs/current](https://www.postgresql.org/docs/current/index.html)
+- [PSQL-META-COMMANDS](https://www.postgresql.org/docs/current/static/app-psql.html#APP-PSQL-META-COMMANDS)
+- [alternate-output-format-for-psql](https://stackoverflow.com/questions/9604723/alternate-output-format-for-psql)
+
diff --git a/notes/pstree.md b/notes/pstree.md
new file mode 100644
index 00000000..df5e32f4
--- /dev/null
+++ b/notes/pstree.md
@@ -0,0 +1,18 @@
+---
+tags: [linux, macos]
+title: pstree
+created: '2022-11-29T08:23:13.377Z'
+modified: '2023-03-24T09:40:21.076Z'
+---
+
+# pstree
+
+## usage
+
+```sh
+pstree
+```
+
+## see also
+
+- [[initsystem]]
diff --git a/notes/pushd and popd.md b/notes/pushd and popd.md
deleted file mode 100644
index 91ba44d8..00000000
--- a/notes/pushd and popd.md
+++ /dev/null
@@ -1,18 +0,0 @@
----
-deleted: true
-tags: [bash, bash/builtin]
-title: pushd and popd
-created: '2019-07-30T06:19:49.221Z'
-modified: '2019-08-02T06:51:06.376Z'
----
-
-# pushd and popd
-
-
-```sh
-pushd DIR
-
-popd DIR
-
-dirs -v # list stack
-```
diff --git a/notes/pv.md b/notes/pv.md
new file mode 100644
index 00000000..d20903bb
--- /dev/null
+++ b/notes/pv.md
@@ -0,0 +1,57 @@
+---
+tags: [shell]
+title: pv
+created: '2020-01-22T14:05:40.771Z'
+modified: '2023-04-30T11:32:30.090Z'
+---
+
+# pv
+
+> `pipe-viewr` - monitor the progress of data through a pipe
+
+## install
+
+```sh
+brew install pv
+```
+
+## usage
+
+```sh
+pv file | nc -w 1 somewhere.com 3000 # watch how quickly a file is transferred
+
+cat file | pv -s 12345 | nc -w 1 somewhere.com 3000 # transferring a file from another process and passing the expected size to pv
+
+# numeric output to feed into the dialog(1) program for a full-screen progress display:
+( tar cf - . \
+ | pv -n -s 'du -sb . | awk '{print $1}'' \
+ | gzip -9 > out.tgz \
+) 2>&1 | dialog --gauge 'Progress' 7 70
+
+mysqldump -hxxx -uxxx -p dbname | pv -W > dump.sql
+
+pv sqlfile.sql | mysql -uxxx -pxxxx dbname
+
+mysqldump .. | pv --progress --size 100m > dumpfile.sql
+mysqldump .. --hex-blob | pv --progress --size $SIZE_BYTES > dumpfile.sql
+
+
+zcat "$INPUT_FILE" | pv -cN zcat | mysql --user=USER ..
+zcat "$INPUT_FILE" | pv --progress --size $(gzip -l $INPUT_FILE | sed -n '2{p;q}' | awk '{print $2}') | mysql --user=USER ..
+
+mysql_import() {
+ zcat $2 | pv --progress --size `gzip -l %s | sed -n 2p | awk '{print $2}'` --name ' Importing.. ' | mysql -uuser -ppass $1
+}
+
+
+pv -tpreb /dev/zero | dd of=/dev/mapper/DEVICE bs=128M # write zeros to device
+```
+
+## see
+
+- [[mysqldump]]
+- [[dialog]]
+- [[tar]]
+- [[nc]]
+- [[awk]]
+- [[dd]]
diff --git a/notes/pyenv.md b/notes/pyenv.md
new file mode 100644
index 00000000..b18f4210
--- /dev/null
+++ b/notes/pyenv.md
@@ -0,0 +1,29 @@
+---
+tags: [python, versionmanager]
+title: pyenv
+created: '2019-08-20T09:07:27.833Z'
+modified: '2023-03-22T08:33:40.852Z'
+---
+
+# pyenv
+
+> pyenv lets you easily switch between multiple versions of Python
+
+## install
+
+```sh
+brew install pyenv
+```
+
+## usage
+
+```sh
+eval "$(pyenv init -)"
+```
+
+## see also
+
+- [[bash eval]]
+- [[python]]
+- [[virtualenv]]
+- [[asdf]]
diff --git a/notes/pytest.md b/notes/pytest.md
new file mode 100644
index 00000000..5cd17c74
--- /dev/null
+++ b/notes/pytest.md
@@ -0,0 +1,19 @@
+---
+tags: [python]
+title: pytest
+created: '2020-11-24T10:29:50.502Z'
+modified: '2023-03-22T10:46:44.382Z'
+---
+
+# pytest
+
+## usage
+
+```sh
+pytest --capture=no # show print statements in console
+pytest -s # equivalent to previous command
+```
+
+## see also
+
+- [[python]]
diff --git a/notes/python virtualenv.md b/notes/python virtualenv.md
deleted file mode 100644
index e6ab0d32..00000000
--- a/notes/python virtualenv.md
+++ /dev/null
@@ -1,23 +0,0 @@
----
-tags: [lang/python]
-title: python virtualenv
-created: '2019-07-30T06:19:49.221Z'
-modified: '2019-07-30T08:08:59.440Z'
----
-
-# python virtualenv
-
-### install
-```sh
-pip install virtualenv --verbose
-```
-
-### usage
-```sh
-cd project/
-virtualenv venv # virtualenv-name
-. venv/bin/activate
-pip install pre-commit
-```
-
-[python - Virtualenv Command Not Found - Stack Overflow](https://stackoverflow.com/a/36577160)
diff --git a/notes/python.md b/notes/python.md
index 2331a80e..93228316 100644
--- a/notes/python.md
+++ b/notes/python.md
@@ -1,19 +1,111 @@
---
-tags: [lang/python]
+tags: [python]
title: python
created: '2019-07-30T06:19:49.222Z'
-modified: '2019-08-02T07:21:15.653Z'
+modified: '2023-05-25T11:43:03.986Z'
---
# python
-### json
+> interpreted, interactive, object-oriented programming language
+
+## usage
+
```sh
-cat file.json | python -m json.tool # pretty print json
+python # start repl
+python -q # start repl without version info
+
+
+
+python -m MODULE # run library module as a script
+
+python3 -m http.server # start web server
+
+python -m json.tool < <(echo '{"foo":"bar", "val": 1}') # pretty print json
+
+echo STRING | python -m base64 # encode STRING
+
+
+# command strings - program passed in as string
-docker network inspect monitoring_default | python -c 'import sys, json; print json.load(sys.stdin)[0]["Name"]'
+python -c 'import sys,yaml; yaml.safe_load(sys.stdin)' < yamltest.txt # validate yaml
+
+python -c 'import sys,json; print json.load(sys.stdin)[0]["Name"]' < <(docker network inspect terraform_default)
+
+python -c 'import sys,yaml,json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)' < IN_YAML > OUT_JSON
+
+python -c 'import sys,yaml,json; yaml.safe_dump(json.load(sys.stdin), sys.stdout, default_flow_style=False)' < IN_JSON > OUT_YAML
+```
+
+## switch ? use dictionary mapping
+
+```py
+def numbers_to_strings(argument):
+ switcher = {
+ 0: "zero",
+ 1: "one",
+ 2: "two",
+ }
+ return switcher.get(argument, "nothing")
```
-### validate yaml
+
+[daniel.feldroy.com/posts/why-doesnt-python-have-switch-case](https://daniel.feldroy.com/posts/why-doesnt-python-have-switch-case)
+
+## dict
+
+> constructor to make a new dictionary
+
+```python
+dict(foo="bar", person="alice") # constructor to make a new dictionary
+```
+
+## iter
+
+> Return an iterator object
+
+```python
+foo = iter({'foo': 'bar', 'age': 10})
+
+next(foo)
+```
+
+## python comprehensions
+
+> comprehensions are a tool for transforming one list, set or dict into another list, set or dict
+> syntactic sugar for a `filter` followed by a `map`
+
+## usage
+
```sh
-python -c 'import yaml,sys;yaml.safe_load(sys.stdin)' < yamltest.txt
+ [ e**2 for e in a_list if type(e) == types.IntType ] # list comprehension
+# โโโฌโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโ
+# output โ โ
+# iterate through intput sequence โ
+# optional predicate
+#
+# a_list = [1, โ4โ, 9, โaโ, 0, 4] => [ 1, 81, 0, 16 ]
+
+
+{ name[0].upper() + name[1:].lower() for name in names if len(name) > 1 } # set comprehension
+
+# names = [ 'Bob', 'JOHN', 'alice', 'bob', 'ALICE', 'J', 'Bob' ] => { 'Bob', 'John', 'Alice' }
+
+
+
+{ k.lower() : mcase.get(k.lower(), 0) + mcase.get(k.upper(), 0) for k in mcase.keys() } # dict comprehension
+
+# mcase = {'a':10, 'b': 34, 'A': 7, 'Z':3}
+# mcase_frequency == {'a': 17, 'z': 3, 'b': 34}
```
+
+## see also
+
+- [[irb]]
+- [[pip]]
+- [[pyenv]]
+- [[virtualenv]]
+- [[ruby]]
+- [[java]]
+- [[scala]]
+- [[php]]
+- [[yaml]]
diff --git a/notes/qemu.md b/notes/qemu.md
new file mode 100644
index 00000000..3c3ab329
--- /dev/null
+++ b/notes/qemu.md
@@ -0,0 +1,30 @@
+---
+tags: [virtualization]
+title: qemu
+created: '2020-03-13T12:51:22.771Z'
+modified: '2023-05-30T07:42:39.503Z'
+---
+
+# qemu
+
+> generic and open source machine emulator and virtualizer
+
+## install
+
+```sh
+brew install qemu
+```
+
+## usage
+
+```sh
+sudo qemu-system-x86_64 -boot d -cdrom ./boot2docker.iso -m 512
+```
+
+## see also
+
+- [[lima]], [[colima]]
+- [[vboxmanage]]
+- [[vagrant]]
+- [[hyperkit]]
+- [qemu.org/docs](https://www.qemu.org/docs/master/system/index.html)
diff --git a/notes/qrencode.md b/notes/qrencode.md
new file mode 100644
index 00000000..b8b6cab5
--- /dev/null
+++ b/notes/qrencode.md
@@ -0,0 +1,23 @@
+---
+tags: [linux, macos]
+title: qrencode
+created: '2019-12-29T18:42:05.637Z'
+modified: '2020-02-04T12:21:27.544Z'
+---
+
+# qrencode
+
+> encode input data in a qr-code and save as a image
+
+## install
+`brew install qrencode`
+
+## usage
+```sh
+qrencode -o wifi.png "WIFI:T:WPA;S:;P:;;"
+
+qrencode -t SVG -o wifi.svg "WIFI:S:${SSID};T:WPA2;P:${SSID_PASS};;"
+```
+
+## see also
+- [encoding-wifi-access-point-passwords-qr-code](https://feeding.cloud.geek.nz/posts/encoding-wifi-access-point-passwords-qr-code/)
diff --git a/notes/quarkus.md b/notes/quarkus.md
new file mode 100644
index 00000000..c10e8405
--- /dev/null
+++ b/notes/quarkus.md
@@ -0,0 +1,51 @@
+---
+tags: [java]
+title: quarkus
+created: '2023-03-14T12:54:49.416Z'
+modified: '2023-05-11T06:48:55.496Z'
+---
+
+# quarkus
+
+> cli for quarkus, which is a k8s native [[java]] framework tailored for OpenJDK HotSpot and [[graalvm]]
+
+## install
+
+```sh
+sdk install quarkus
+```
+
+## option
+
+```sh
+
+```
+
+## env
+
+```sh
+QUARKUS_BANNER_ENABLED
+```
+
+## usage
+
+```sh
+quarkus
+
+quarkus create app org.acme:getting-started --extension='resteasy-reactive'
+
+quarkus:dev # runs dev mode, which enables live reload with background compilation
+
+quarkus build --native --no-tests -Dquarkus.native.container-build=true
+
+./mvnw install -Dnative -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel-builder-image:22.3-java17
+./mvnw package -Pnative -Dquarkus.native.container-build=true -Dquarkus.container-image.build=true
+```
+
+## see also
+
+- [[graalvm]]
+- [[gu]]
+- [[sdk]]
+- [[mvn]]
+- [[java]]
diff --git a/notes/quota.md b/notes/quota.md
new file mode 100644
index 00000000..7df27088
--- /dev/null
+++ b/notes/quota.md
@@ -0,0 +1,26 @@
+---
+tags: [linux]
+title: quota
+created: '2021-05-25T12:00:06.506Z'
+modified: '2023-03-24T08:25:10.885Z'
+---
+
+# quota
+
+> display disk usage and limits
+
+## usage
+
+```sh
+quota -g # print group quotas for the group of which the user is a member. The optional -u flag is equivalent to the default.
+
+quota -v # quota will display quotas on filesystems where no storage is allocated.
+
+quota -q # print a more terse message, containing only information on filesystems where usage is over quota.
+```
+
+## see also
+
+- [[ssh]]
+- [[df]]
+- [[du]]
diff --git a/notes/quotes.md b/notes/quotes.md
new file mode 100644
index 00000000..f5a984d4
--- /dev/null
+++ b/notes/quotes.md
@@ -0,0 +1,275 @@
+---
+tags: [Notebooks]
+title: quotes
+created: '2019-07-30T06:19:27.513Z'
+modified: '2023-05-29T06:51:29.596Z'
+---
+
+# quotes
+
+```
+As a programmer, never underestimate your ability to come up with ridiculously complex soluations for simple problems
+
+- Thomas Fuchs
+```
+
+```
+Get your data structures correct first, and the rest of the program will write itself.
+
+- Davice Jones
+```
+
+```
+Data dominates.
+If you've chosen the right data structures and organized things well, the algorithms will almost always be self-evident.
+
+Data structures, not algorithms, are central to programming.
+
+Rob Pike's 5. Rule of Programming
+```
+
+```
+"scalabilit" the #1 problem don't actually have but still solve.
+
+- Eberhard Wolff
+```
+
+```
+Duplication is better htna the wrong abstractions
+
+- RDC
+```
+
+
+```
+do you wish me a good morning, or mean that it is a good morning wether I want it or not;
+or that you feel good this morning; or that it is a morning to bee goot on ?
+
+- gandalf
+```
+
+```
+organizations which design systems .. are constrained to produce designs which are copies of the communication structures of the organization.
+
+- M. Connoway "Connoway's Law"
+```
+
+```
+A language that doesn't affect the way you think about programming is not worth knowing.
+
+- Alan J. Perlis
+```
+
+```
+Ein Kluger bemerkt alles. Ein Dummer macht รผber alles eine Bemerkung.
+
+- Heinrich Heine
+```
+
+```
+What good is the warmth of summer, without the cold of winter to give it sweetness.
+
+- John Steinbeck
+```
+
+```
+Not only is the Universe stranger than we think, it is stranger than we can think.
+
+- Werner Heisenberg, Across the Frontiers
+```
+
+```
+Courage is not the absence of fear, but rather the judgement that something is more important than fear.
+
+- The Princess Diaries
+```
+
+```
+What Is Important Is Seldom Urgent and What Is Urgent Is Seldom Important
+
+- Dwight D. Eisenhower
+```
+
+```
+Simplicity recognizes the imports thing while ignoring the trivial things
+
+- amazon review, on the one thing
+```
+
+```
+The mass of men lead lives of quiet desperation. What is called Resignation is confirmed desperation.
+
+- Henry David Therau
+```
+
+## C.S. Lewis
+
+```
+Very often what God first helps us towards is not the virtue itself but just this power of always trying again.
+
+- C.S. Lewis
+
+
+The more we let God take us over, the more truly ourselves we become
+
+- because He made us. He invented us.
+
+- C.S. Lewis
+
+
+Every moment is always Present for Him. If you like to put it this way, He has all eternity in which to listen to a split second of prayerโฆ
+
+- C.S. Lewis
+```
+
+---
+
+```
+Living by faith includes the call to something greater than cowardly self-preservation.
+
+- Tolkien
+```
+
+
+```
+A strong man acts within that which constrains him.
+
+(series wolfhall, cromwell to king henry VIII)
+```
+
+
+```
+Beweisen und stetig und beharrlich dran bleiben. Jesus hat sich zuerst als Schreiner bewiesen. Gott erfรผllte Handwerker mit Weisheit.
+
+- Michael
+
+
+feeding the flesh, which is never satisfied
+
+- Jack
+
+
+
+Payed from the neck down" meticulous, crafty
+
+- Jack
+
+
+A worse (woman) would've a done me rightly (=Alot less would've been good for me)
+
+- Grandad/Jack
+
+
+Seek God with all your heart; Prayer and fasting; Reading and meditating;
+
+- Philip
+```
+
+```
+Prepare yourself for the Future that's coming, Not the Future you Wish were coming.
+
+- Daniel Miessler
+```
+
+```
+You cannot keep birds from flying over your head, but you can keep them from building a nest in your Hair.
+
+- Martin Luther
+```
+
+```
+Whoever conceals his transgressions will not prosper, but he who confesses and forsakes them will obtain mercy.
+
+- proverbs 28,13
+
+I, even I, am the LORD, And besides Me there is no savior.
+I have declared and saved, I have proclaimed, And there was no foreign god among you;
+Therefore you are My witnesses,โ Says the LORD, โthat I am God.
+
+- Isaiah 43:11-12
+```
+
+```
+cela est bien dit, mais il faut cultiver notre jardin.
+
+- Voltaire
+```
+
+```
+Between stimulus and response, there is a space. In that space is our power to choose our response, and in our response lies our growth and our freedom.
+
+- Victor Fankl
+```
+
+```
+The vast accumulations of knowledgeโor at least of informationโdeposited by the nineteenth century
+have been responsible for an equally vast ignorance. When there is so much to be known,
+when there are so many fields of knowledge in which the same words are used with different meanings,
+when every one knows a little about a great many things,
+it becomes increasingly difficult for anyone to know whether he knows what he is talking about or not.
+And when we do not know, or when we do not know enough, we tend always to substitute emotions for thoughts.
+
+- T.S. Eliot, The Sacred Wood
+```
+
+```
+He who wants to become master in his field should study its history. Without historic foundation all knowledge remains incomplete and the judgment about appearances of the present unsure and immature
+
+- Friedrich Unger, History of Binary
+```
+
+```
+Misconception: Juniors get mentored from Seniors
+The reality is that seniors are just juniors preppered with years of experience
+dealing with all kinds of crap and problems thrown at them.
+```
+
+```
+There is something which unites magic and applied science (technology) while separating them from the "wisdom" of earlier ages.
+For the wise men of old, the cardinal problem of human life was how to conform the soul to objective reality, and the solution was wisdom, self-discipline, and virtue.
+For the modern, the cardinal problem is how to conform reality to the wishes of man, and the solution is a technique.
+```
+
+```
+If you asked twenty good men to-day what they thought the highest of the virtues, nineteen of them would reply, Unselfishness.
+But if you asked almost any of the great Christians of old he would have replied, Love - You see what has happened?
+A negative term has been substituted for a positive, and this is of more than philological importance.
+The negative ideal of Unselfishness carries with it the suggestion not primarily of securing good things for others,
+but of going without them ourselves, as if our abstinence and not their happiness was the important point.
+
+- C.S. Lewis, The Weight of Glory
+```
+
+```
+Flint Sky: Those people in the forest, what did you see on them ?
+Jaguar Paw: I do not understand.
+Flint Sky: Fear. Deep rotting fear. They were infected by it.
+ Did you see? Fear is a sickness. It will crawl into the soul of anyone who engages it.
+ It has tainted your peace already. I did not raise you to see you live with fear.
+ Strike it from your heart. Do not bring it into our village.
+
+- movie, apocalypto
+```
+
+```
+"If you want to make an apple pie from scratch, you must first create the universe"
+
+~ Dr. Carl Sagan
+```
+
+```
+The most important thing to do in solving a problem is to begin.
+
+โ Frank Tyger
+```
+
+````
+You donโt understand anything until you learn it more than one way.
+
+โ Marvin Minsky
+```
+
+## see also
+
+- [[mktemp]]
+- [Some of the Best Catchphrases Of The Ancient Spartans](https://www.warhistoryonline.com/instant-articles/best-spartan-laconic-phrases-boldest-wittiest-lines-ever-recorded.html)
diff --git a/notes/rabbitmqctl.md b/notes/rabbitmqctl.md
new file mode 100644
index 00000000..241cc2e0
--- /dev/null
+++ b/notes/rabbitmqctl.md
@@ -0,0 +1,28 @@
+---
+tags: [erlang]
+title: rabbitmqctl
+created: '2019-07-30T06:19:49.223Z'
+modified: '2023-05-24T14:42:06.126Z'
+---
+
+# rabbitmqctl
+
+> message-broker, originally implemented `Advanced Message Queuing Protocol`
+> has since been extended with a plug-in architecture to support
+> `Streaming Text Oriented Messaging Protocol`, `Message Queuing Telemetry Transport` and other protocols
+
+## usage
+
+```sh
+rabbitmqctl status
+
+rabbitmqctl environment
+
+rabbitmqctl eval 'application:get_all_env(kernel).'
+```
+
+## see also
+
+- [[erlang]]
+- [[aws]] `sns`/`sqs`
+- [[kafka]]
diff --git a/notes/raft consesus algorithm.md b/notes/raft consesus algorithm.md
new file mode 100644
index 00000000..8c7284b9
--- /dev/null
+++ b/notes/raft consesus algorithm.md
@@ -0,0 +1,19 @@
+---
+tags: [Notebooks]
+title: raft consesus algorithm
+created: '2021-10-20T08:58:11.735Z'
+modified: '2023-03-24T08:24:53.152Z'
+---
+
+# raft consesus algorithm
+
+>
+
+##
+
+## see also
+
+- [raft.github.io](https://raft.github.io/)
+- [[consul]]
+- [[etcdctl]]
+- [[kafka]]
diff --git a/notes/rar.md b/notes/rar.md
new file mode 100644
index 00000000..095319a4
--- /dev/null
+++ b/notes/rar.md
@@ -0,0 +1,57 @@
+---
+tags: [linux, macos]
+title: rar
+created: '2023-01-27T09:01:58.297Z'
+modified: '2023-03-25T12:26:05.034Z'
+---
+
+# rar
+
+## install
+
+```sh
+brew install rar
+```
+
+## commands
+
+```sh
+a # Add files to archive
+c # Add archive comment
+ch # Change archive parameters
+cw # Write archive comment to file
+d # Delete files from archive
+e # Extract files without archived paths
+f # Freshen files in archive
+i[par]= # Find string in archives
+k # Lock archive
+l[t[a],b] # List archive contents [technical[all], bare]
+m[f] # Move to archive [files only]
+p # Print file to stdout
+r # Repair archive
+rc # Reconstruct missing volumes
+rn # Rename archived files
+rr[N] # Add data recovery record
+rv[N] # Create recovery volumes
+s[name|-] # Convert archive to or from SFX
+t # Test archive files
+u # Update files in archive
+v[t[a],b] # Verbosely list archive contents [technical[all],bare]
+x # Extract files with full path
+```
+
+## usage
+
+```sh
+tar # print commands and switches
+
+unrar x FILE
+unrar l FILE.rar # list content
+unrar e FILE.rar DIR/FILE DESTINATION/ # extract single file
+```
+
+## see also
+
+- [[7z]]
+- [[zip]]
+- [[tar]]
diff --git a/notes/rbenv.md b/notes/rbenv.md
new file mode 100644
index 00000000..2f8c8d08
--- /dev/null
+++ b/notes/rbenv.md
@@ -0,0 +1,38 @@
+---
+tags: [ruby]
+title: rbenv
+created: '2021-06-01T13:18:20.553Z'
+modified: '2023-03-22T10:57:31.217Z'
+---
+
+# rbenv
+
+> `ruby environment` - intercepts `ruby` commands using `shim` executables injected into your `PATH`
+
+## install
+
+> Compatibility note: `rbenv` is incompatible with `rvm` !
+
+```sh
+brew install rbenv
+
+rbenv init # setup rbenv in shell
+
+rbenv rehash # after installing new gems
+
+brew upgrade rbenv ruby-build
+
+apt install rbenv
+```
+
+## usage
+
+```sh
+rbenv install --list
+```
+
+## see also
+
+- [github.com/rbenv/rbenv](https://github.com/rbenv/rbenv)
+- [[rvm]]
+- [[pyenv]]
diff --git a/notes/readlink.md b/notes/readlink.md
new file mode 100644
index 00000000..a5640e4e
--- /dev/null
+++ b/notes/readlink.md
@@ -0,0 +1,24 @@
+---
+tags: [linux]
+title: readlink
+created: '2020-01-14T06:52:48.775Z'
+modified: '2023-03-15T07:20:32.656Z'
+---
+
+# readlink
+
+> used to print resolved symbolic links or canonical file names.
+
+## usage
+
+```sh
+readlink -f desk1 # canonicalize by following every symlink in every component of the given name recursively
+
+readlink -n file # do not output the trailing delimiter
+```
+
+## see also
+
+- [[ln]]
+- [[ls]]
+- [[stat]]
diff --git a/notes/realpath.md b/notes/realpath.md
new file mode 100644
index 00000000..8f633393
--- /dev/null
+++ b/notes/realpath.md
@@ -0,0 +1,22 @@
+---
+tags: [linux, macos]
+title: realpath
+created: '2020-10-05T13:31:16.733Z'
+modified: '2023-03-24T08:22:53.628Z'
+---
+
+# realpath
+
+> print the resolved path
+
+## usage
+
+```sh
+realpath FILE
+```
+
+## see also
+
+- [[dirname]]
+- [[basename]]
+
diff --git a/notes/redis-cli.md b/notes/redis-cli.md
new file mode 100644
index 00000000..84581260
--- /dev/null
+++ b/notes/redis-cli.md
@@ -0,0 +1,42 @@
+---
+tags: [cloud, linux]
+title: redis-cli
+created: '2022-10-05T12:58:56.515Z'
+modified: '2023-05-24T08:40:38.318Z'
+---
+
+# redis-cli
+
+## install
+
+```sh
+apt-get install redis-tools
+```
+
+## usage
+
+```sh
+redis-cli --scan --pattern '*-11*'
+
+redis-cli --latency
+```
+
+## console
+
+```
+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/)
diff --git a/notes/regex.md b/notes/regex.md
index 49fb210c..df75c5b0 100644
--- a/notes/regex.md
+++ b/notes/regex.md
@@ -1,37 +1,34 @@
---
-tags: [bash, linux, regex]
+tags: [linux, Notebooks, regex]
title: regex
created: '2019-07-30T06:19:49.223Z'
-modified: '2019-07-30T18:46:01.299Z'
+modified: '2023-03-24T09:57:12.967Z'
---
# regex
-[Regular-Expressions.info - Regexp Patterns](https://www.regular-expressions.info/)
-
## flavors
-|flavor| |
-|--|--|
-| `PCRE` | Perl Compatible Regular Expressions (c library) |
-| `ECAM/JavaScript` | |
-| `java` | |
+
+|flavor | |
+|-- |-- |
+| `PCRE` | [[perl]] Compatible Regular Expressions (c library) |
+| `ECAM/JavaScript` | [[javascript]] |
+| `java` | [[java]] |
| `POSIX BRE` | Basic Regular Expressions IEEE POSIX standard 1003.2. |
| `POSIX ERE` | Extended Regular Expressions as defined in the IEEE POSIX standard 1003.2. |
| `GNU BRE` | GNU Basic Regular Expressions, which are POSIX BRE with GNU extensions |
| `GNU ERE` | GNU Extended Regular Expressions, which are POSIX ERE with GNU extensions |
-
-## tools
-
-* grep [GNU Grep 3.0: Basic vs Extended](https://www.gnu.org/software/grep/manual/html_node/Basic-vs-Extended.html)
-* find
- * `-name` uses pattern
- * `-regex`
-
-
## Patterns
```
-[^="]++(?=")
+[^="]++(?=") # explanation
```
+## see also
+
+- [[grep regex]]
+- [grep regex](@note/grep regex.md)
+- [[find]]
+- [Regular-Expressions.info - Regexp Patterns](https://www.regular-expressions.info/)
+- [Basic vs Extended - gnu.org](https://www.gnu.org/software/grep/manual/html_node/Basic-vs-Extended.html)
diff --git a/notes/rego.md b/notes/rego.md
new file mode 100644
index 00000000..b28bf516
--- /dev/null
+++ b/notes/rego.md
@@ -0,0 +1,38 @@
+---
+tags: [container]
+title: rego
+created: '2021-03-16T15:14:14.515Z'
+modified: '2023-05-25T16:13:04.286Z'
+---
+
+# rego
+
+> "ray-go" - a high-level declarative language, purpose-built for expressing policies over complex hierarchical data structures
+> inspired by datalog (query language). Rego extends Datalog to support structured document models such as json
+> rego queries are assertions on data
+
+## usage
+
+```rego
+pi := 3.14159 # rule as a single expression and is defined in terms of a Scalar Value
+rect := {"width": 2, "height": 4} # rule as a s composite value
+
+
+t if { x := 42; y := 41; x > y } # use semicolon to separate expressions
+
+t2 if {
+ x := 42 # use linebreak to separate expressions
+ y := 41
+ x > y
+}
+```
+
+## see also
+
+- [[opa]]
+- [[kubectl]]
+- [[jq]]
+- [[wasm]]
+- [[terraform]]
+- [[ghci]], [[erlang]]
+- [openpolicyagent.org/docs/latest/policy-language/](https://www.openpolicyagent.org/docs/latest/policy-language/)
diff --git a/notes/resize2fs.md b/notes/resize2fs.md
new file mode 100644
index 00000000..ad698ebe
--- /dev/null
+++ b/notes/resize2fs.md
@@ -0,0 +1,16 @@
+---
+tags: [filesystem]
+title: resize2fs
+created: '2020-06-12T07:01:48.002Z'
+modified: '2020-09-02T17:40:09.860Z'
+---
+
+# resize2fs
+
+## usage
+```sh
+
+```
+
+## see also
+- [[xfs_growfs]]
diff --git a/notes/rip.md b/notes/rip.md
new file mode 100644
index 00000000..c98f6005
--- /dev/null
+++ b/notes/rip.md
@@ -0,0 +1,40 @@
+---
+tags: [rust]
+title: rip
+created: '2021-05-27T09:10:45.980Z'
+modified: '2023-03-25T12:51:12.336Z'
+---
+
+# rip
+
+> `rm ImProved` - cli deletion tool focused on safety, ergonomics, and performance
+> does not implement the `xdg-trash`
+> deleted files get sent to the graveyard (`/tmp/graveyard-$USER` by default
+
+## install
+
+```sh
+cargo install rm-improved
+
+brew install rm-improved
+```
+
+## option
+
+```sh
+-d, --decompose permanently deletes (unlink) the entire graveyard
+```
+
+## usage
+
+```sh
+rip -u # undo last deletion
+```
+
+## see also
+
+- [github.com/nivekuil/rip](https://github.com/nivekuil/rip)
+- [[rm]]
+- [[unlink]]
+- [[rust]]
+- [[cargo]]
diff --git a/notes/rl.md b/notes/rl.md
new file mode 100644
index 00000000..5ccfcea3
--- /dev/null
+++ b/notes/rl.md
@@ -0,0 +1,28 @@
+---
+tags: [linux, macos]
+title: rl
+created: '2021-06-28T07:18:18.578Z'
+modified: '2023-03-24T09:53:32.604Z'
+---
+
+# rl
+
+> `randomize lines`
+
+## install
+
+```sh
+brew install randomize-lines
+```
+
+## usage
+
+```sh
+rl -c 1 /usr/share/dict/words
+```
+
+## see also
+
+- [[shuf]]
+- [[od]]
+- [[openssl]]
diff --git a/notes/rm.md b/notes/rm.md
new file mode 100644
index 00000000..9fcfcb05
--- /dev/null
+++ b/notes/rm.md
@@ -0,0 +1,30 @@
+---
+tags: [coreutils, macos]
+title: rm
+created: '2019-08-22T07:14:59.460Z'
+modified: '2021-05-27T09:10:42.609Z'
+---
+
+# rm
+
+> remove directory entries
+
+## usage
+```sh
+rm -f FILE # ignore nonexistent files and arguments, never prompt
+
+rm -r DIR # remove all files contained within DIR recursively
+
+rm -- -f # remove file named `-f`
+
+rm ./-f # remove file named `-f`
+
+rm \~ # no bash expantion from `~` to $HOMEDIR
+```
+
+## see also
+- [[unlink]]
+- [[bash]]
+- [[mv]]
+- [[cp]]
+- [[rip]]
diff --git a/notes/rndc.md b/notes/rndc.md
new file mode 100644
index 00000000..c56f3743
--- /dev/null
+++ b/notes/rndc.md
@@ -0,0 +1,31 @@
+---
+tags: [dns]
+title: rndc
+created: '2020-07-22T08:47:45.145Z'
+modified: '2023-03-20T08:55:56.348Z'
+---
+
+# rndc
+
+> administer the named service
+
+## usage
+
+```sh
+rndc status
+
+rndc dumpdb -zones
+
+rndc freeze home.lan
+rndc freeze 10.168.192.in-addr.arpa
+
+rndc thaw home.lan
+rndc thaw 10.168.192.in-addr.arpa
+```
+
+## see also
+
+- [[named]]
+- [[BIND]]
+- [[dig]]
+
diff --git a/notes/rnr.md b/notes/rnr.md
new file mode 100644
index 00000000..417ae7d3
--- /dev/null
+++ b/notes/rnr.md
@@ -0,0 +1,30 @@
+---
+tags: [rust]
+title: rnr
+created: '2023-05-10T14:15:08.501Z'
+modified: '2023-05-10T14:17:29.578Z'
+---
+
+# rnr
+
+## install
+
+```sh
+brew install rnr
+
+cargo install rnr
+```
+
+## usage
+
+```sh
+rnr -b -l 0 ' ' '-' SOME\ FILE\ HAVING\ -\ SPACES.ext
+rnr -f -b -l 0 ' ' '_' SOME\ FILE\ HAVING\ -\ SPACES.ext
+```
+
+## see also
+
+- [[mv]]
+- [[rip]]
+- [[rust]]
+- [[cargo]]
diff --git a/notes/rpm.md b/notes/rpm.md
index 4ad6226a..03e6fc8e 100644
--- a/notes/rpm.md
+++ b/notes/rpm.md
@@ -1,10 +1,38 @@
---
-tags: [linux/packagemanager]
+tags: [linux, packagemanager]
title: rpm
created: '2019-07-30T20:39:42.276Z'
-modified: '2019-07-30T20:39:45.842Z'
+modified: '2023-03-16T08:03:06.449Z'
---
# rpm
-`rpm` - redhat package manager
+> `redhat package manager`
+
+## usage
+
+```sh
+rpm -qa # list installed packages
+
+rpm -i pkg # install
+
+rpm -e pkg # remove
+
+rpm -qf $(which ip) # find out package
+
+rpm -ql bash # find file and libraries provided by a particular package
+
+curl -O http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm
+
+rpm -ivh yum-3.2.29-81.el6.centos.noarch.rpm # install
+# if "error: Failed dependencies:" download packages and install
+
+rpm -qpR yum-3.2.29-81.el6.centos.noarch.rpm # get dependency list
+```
+
+## see also
+
+- [[yum]]
+- [[microdnf]]
+- [mirror.centos.org/centos/7/os/x86_64/Packages/](http://mirror.centos.org/centos/7/os/x86_64/Packages/)
+- [thegeekdiary.com/how-to-find-which-rpm-package-provides-a-specific-file-or-library-in-rhel-centos/](https://www.thegeekdiary.com/how-to-find-which-rpm-package-provides-a-specific-file-or-library-in-rhel-centos/)
diff --git a/notes/rsync.md b/notes/rsync.md
new file mode 100644
index 00000000..7824c64a
--- /dev/null
+++ b/notes/rsync.md
@@ -0,0 +1,21 @@
+---
+tags: [linux]
+title: rsync
+created: '2019-07-30T06:19:49.224Z'
+modified: '2020-08-03T12:09:28.843Z'
+---
+
+# rsync
+
+> a fast, versatile, remote (and local) file-copying tool
+
+## usage
+```sh
+rsync -av host::src /dest
+
+rsync -avz --remove-source-files user@foo.bar.baz:/home/user/backup.gz.tar .
+```
+
+## see also
+- [[cp]]
+- [[ssh]]
diff --git a/notes/rtf.md b/notes/rtf.md
new file mode 100644
index 00000000..aa9a8872
--- /dev/null
+++ b/notes/rtf.md
@@ -0,0 +1,23 @@
+---
+tags: [linux]
+title: rtf
+created: '2020-03-12T13:55:07.429Z'
+modified: '2023-03-25T12:24:41.022Z'
+---
+
+# rtf
+
+> regression testing framework
+
+## usage
+
+```sh
+rtf run command # executed all the test cases in the supplied cases directory; default `./cases`
+
+rtf compare a.json b.json # compare results
+```
+
+## see also
+
+- [[linuxkit]]
+- [[bats]]
diff --git a/notes/ruby gem.md b/notes/ruby gem.md
deleted file mode 100644
index 6a046820..00000000
--- a/notes/ruby gem.md
+++ /dev/null
@@ -1,18 +0,0 @@
----
-tags: [lang/ruby]
-title: ruby gem
-created: '2019-07-30T06:19:49.225Z'
-modified: '2019-08-02T07:23:44.285Z'
----
-
-# ruby gem
-
-## env
-```sh
-export GEM_PATH=/Users/iser/.gem
-export GEM_HOME=/Users/iser/.gem
-```
-
-```sh
-gem list
-```
diff --git a/notes/ruby symbol.md b/notes/ruby symbol.md
new file mode 100644
index 00000000..83f89e1a
--- /dev/null
+++ b/notes/ruby symbol.md
@@ -0,0 +1,32 @@
+---
+tags: [ruby]
+title: ruby symbol
+created: '2019-07-30T06:19:49.226Z'
+modified: '2020-01-02T13:09:08.526Z'
+---
+
+# ruby symbol
+
+> symbols are often used as the equivalent to enums in Ruby, as well as keys to a dictionary (hash).
+
+- symbol is immutable
+- used in hashes
+
+## usage
+```ruby
+foo = { :ruby => "red"}
+
+x = :my_str
+y = :my_str
+# :my_str will only be created once, and x and y point to the same area of memory. On the other hand, if you have
+
+x = "my_str"
+y = "my_str"
+# a string containing my_str will be created twice, and x and y will point to different instances
+```
+
+ ## see also
+ - https://softwareengineering.stackexchange.com/a/24461/276395
+ - [[go enum]]
+ - [[yaml]]
+
diff --git a/notes/ruby.md b/notes/ruby.md
index f988cba0..e6c2c7ad 100644
--- a/notes/ruby.md
+++ b/notes/ruby.md
@@ -1,31 +1,59 @@
---
-tags: [lang/ruby]
+tags: [ruby]
title: ruby
created: '2019-07-30T06:19:49.226Z'
-modified: '2019-08-02T07:24:19.099Z'
+modified: '2020-08-26T11:19:22.015Z'
---
# ruby
-## symbols
+## usage
+```sh
+ruby -h # Prints a summary of the options
-> symbols are often used as the equivalent to enums in Ruby, as well as keys to a dictionary (hash).
-> https://softwareengineering.stackexchange.com/a/24461/276395
+ruby -e 'puts "Hello, world."; puts "It is now #{Time.now}."'
-- symbol is immutable
+ruby -e 'puts "Hello, world."' -e 'puts "It is now #{Time.now}."'
-- used in hashes
+ruby -e 'puts STDIN.readlines[58]' < ulysses.txt # prints the 59th line
-```ruby
-foo = { :ruby => "red"}
+ruby -e 'puts ARGF.readlines.first(5)' ulysses.txt # first 5 lines
-x = :my_str
-y = :my_str
-# :my_str will only be created once, and x and y point to the same area of memory. On the other hand, if you have
+ruby -e 'puts ARGF.readlines.last(5)' ulysses.txt # last 5 lines
+
+ruby -n -a -e 'puts $F[2]' ulysses.txt
+
+
+ruby -n -e 'p eval($_)' # starts repl; see also irb
+
+ruby -n -e 'puts $_ if $_ =~ /\bold\b/i' ulysses.txt
+
+# -n wraps loop around script: `while gets; SCRIPT; end.`
+# $_ magic global set to the last line returned from gets
+
+
+
+ruby -rjson -ryaml -e "puts YAML.load_file('my_file.yml').to_json" # yaml to json
+
+ruby -rjson -ryaml -e "puts JSON.pretty_generate(YAML.load_file('my_file.yml'))" # yaml to json and pretty print
+
+ruby -e "require 'json'; puts JSON.pretty_generate(JSON.parse(ARGF.read))" file.json # pretty print json
+
+ruby -ryaml -rjson -e 'puts YAML.dump(JSON.load(ARGF))' < file.json # json to yml
+
+ruby -ryaml -rjson -e 'puts YAML.dump(JSON.load(ARGF))' < file.json > file.yml # json to yml
+
+ruby -ryaml -rjson -e 'puts YAML.dump(JSON.load(ARGF))' < file.yml # yml to json
+
+ruby -ryaml -rjson -e 'puts YAML.dump(JSON.load(ARGF))' < file.yml > file.json # yml to json
-x = "my_str"
-y = "my_str"
-# a string containing my_str will be created twice, and x and y will point to different instances
```
-
+
+ ## see also
+ - [[irb]]
+ - [hashrocket.com/blog/posts/ruby-on-the-command-line](https://hashrocket.com/blog/posts/ruby-on-the-command-line)
+ - [[python]]
+ - [[yaml]]
+ - [[brew]]
+
diff --git a/notes/runc.md b/notes/runc.md
new file mode 100644
index 00000000..481c1074
--- /dev/null
+++ b/notes/runc.md
@@ -0,0 +1,27 @@
+---
+tags: [container]
+title: runc
+created: '2020-03-12T13:59:22.450Z'
+modified: '2020-09-02T17:26:09.381Z'
+---
+
+# runc
+
+> runc is a CLI tool for spawning and running containers according to the OCI specification.
+
+## usage
+```sh
+runc create mycontainerid # run as root
+
+runc list # view the container is created and in the "created" state
+
+runc start mycontainerid # start the process inside the container
+
+runc list # after 5 seconds view that the container has exited and is now in the stopped state
+
+runc delete mycontainerid # now delete the container
+```
+
+## see also
+- [[docker]]
+- [github.com/opencontainers/runc](https://github.com/opencontainers/runc)
diff --git a/notes/rust.md b/notes/rust.md
new file mode 100644
index 00000000..f23075d7
--- /dev/null
+++ b/notes/rust.md
@@ -0,0 +1,43 @@
+---
+tags: [rust]
+title: rust
+created: '2020-02-27T17:02:14.571Z'
+modified: '2023-05-06T13:26:35.245Z'
+---
+
+# rust
+
+> multi-paradigm programming language focused on performance and safety, especially safe concurrency
+> combines low-level control over performance with high-level convenience and safety guarantees
+> syntactically similar to [[c++]] and provides memory safety without using garbage collection
+> was originally designed by Graydon Hoare at Mozilla Research, with contributions from Dave Herman, Brendan Eich
+
+## install
+
+```sh
+curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
+```
+
+## environment
+
+```sh
+RUSTUP_HOME # rustup metadata and toolchains will be installed into the Rustup home directory
+CARGO_HOME # cargo, rustc, rustup and other commands will be added to Cargo's bin directory
+RUST_LOG # controls env_logger output
+```
+
+## usage
+
+```rust
+
+```
+
+## see also
+
+- [[c]], [[gcc]], [[make]]
+- [[java]], [[javac]], [[mvn]]
+- [[go]]
+- [[cargo]]
+- [[rustup]], [[rustc]]
+- [[wasm]]
+- [rust-lang.org](https://www.rust-lang.org/)
diff --git a/notes/rustc.md b/notes/rustc.md
new file mode 100644
index 00000000..8c6dc2c4
--- /dev/null
+++ b/notes/rustc.md
@@ -0,0 +1,33 @@
+---
+tags: [compiler, rust]
+title: rustc
+created: '2023-05-06T09:55:29.161Z'
+modified: '2023-05-13T15:13:03.790Z'
+---
+
+# rustc
+
+> rust compiler
+
+## install
+
+```sh
+curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
+```
+
+## usage
+
+```sh
+rustc --version
+
+rustc FILE.rs # compile rust
+
+rustc --explain E0382 # explain
+```
+
+## see also
+
+- [[rust]], [[cargo]]
+- [[gcc]]
+- [[javac]]
+- [[make]]
diff --git a/notes/rustup.md b/notes/rustup.md
new file mode 100644
index 00000000..90305a62
--- /dev/null
+++ b/notes/rustup.md
@@ -0,0 +1,36 @@
+---
+tags: [rust, versionmanager]
+title: rustup
+created: '2020-02-27T17:03:43.319Z'
+modified: '2023-05-06T09:52:35.563Z'
+---
+
+# rustup
+
+> rust toolchain installer
+
+## install
+
+```sh
+curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
+```
+
+## usage
+
+```sh
+rustup show # show active and installed toolchains or profiles
+
+rustup doc --book # open the documentation for the current toolchain
+
+rustup self uninstall # uninstall rust tooling und remove changes to .bashrc etc
+
+rustup update
+rustup update stable
+
+rustup override set stable
+```
+
+## see also
+
+- [[rust]]
+- [[cargo]]
diff --git a/notes/rvm.md b/notes/rvm.md
new file mode 100644
index 00000000..23b820ad
--- /dev/null
+++ b/notes/rvm.md
@@ -0,0 +1,40 @@
+---
+tags: [ruby, versionmanager]
+title: rvm
+created: '2019-08-02T07:23:19.957Z'
+modified: '2022-02-02T10:06:50.776Z'
+---
+
+# rvm
+
+> `ruby version manager` allows you to install, manage, and work with multiple ruby environments from interpreters to sets of gems
+
+USE [[rbenv]] INSTEAD !
+
+[duseev.com/articles/rbenv-vs-rvm/](https://duseev.com/articles/rbenv-vs-rvm/)
+
+## install
+
+[rvm.io/rvm/install](https://rvm.io/rvm/install)
+
+## usage
+
+```sh
+rvm implode # removes all ruby installations it manages, everything in ~/.rvm
+
+rvm user gemsets # enable local gemsets
+
+rvm list known # list installable ruby versions
+
+rvm list rubies # list installed rubies
+
+rvm install ruby
+
+rvm install 2.0.0
+```
+
+## see also
+
+- [[rbenv]]
+- [[nvm]]
+- [[gpg]]
diff --git a/notes/sam.md b/notes/sam.md
new file mode 100644
index 00000000..c7882248
--- /dev/null
+++ b/notes/sam.md
@@ -0,0 +1,49 @@
+---
+tags: [serverless]
+title: sam
+created: '2021-02-08T12:46:40.753Z'
+modified: '2023-03-22T08:47:34.947Z'
+---
+
+# sam
+
+> `aws serverless application model` extends [[aws cloudformation]] to provider simplified way of defining resources needed to run lambda functions in aws
+
+## install
+
+```sh
+brew tap aws/tap && brew install aws-sam-cli
+```
+
+## environment
+
+```sh
+SAM_CLI_TELEMETRY # 0
+```
+
+## usage
+
+```sh
+sam --version
+
+sam init # download a sample application, interactively
+
+sam build # build your application
+
+sam deploy --guided # deploy your application
+
+
+sam local start-api
+
+sam local invoke "HelloWorldFunction" -e events/event.json
+```
+
+## see also
+
+- [[aws]]
+- [[serverless]]
+- [[terraform]]
+- [[tcl]]
+- [[virtualenv]]
+- [docs.aws.amazon.com/serverless-application-model/../serverless-getting-started-hello-world.html](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-getting-started-hello-world.html)
+- [speaking.brunoamaro.com/yUeFUQ/deployment-automation-for-an-aws-serverless-project-sam-vs-cloudformation-vs-terraform#s73xjwC](https://speaking.brunoamaro.com/yUeFUQ/deployment-automation-for-an-aws-serverless-project-sam-vs-cloudformation-vs-terraform#s73xjwC)
diff --git a/notes/sbt.md b/notes/sbt.md
new file mode 100644
index 00000000..0dbf0912
--- /dev/null
+++ b/notes/sbt.md
@@ -0,0 +1,54 @@
+---
+tags: [buildsystem, java]
+title: sbt
+created: '2019-07-30T06:19:49.228Z'
+modified: '2023-03-23T08:44:44.431Z'
+---
+
+# sbt
+
+> `simple build tool` for [[scala]]
+
+## usage
+
+sbt terminology consists of two terms:
+
+- `tasks`: defines an action you perform like compile
+- `settings`: defines a value like name and version of projekt
+
+has two modes:
+- `command-line`: run tasks and exits when finished e.g. `sbt about`
+- `intaractive`: launch repl / interactive `sbt-shell`
+
+```sh
+sbt sbtVersion # find out version
+sbt 'inspect sbtVersion' # find out version
+sbt about # find out version
+
+
+sbt compile
+
+sbt run
+
+sbt reload # after changes in build.sbt
+```
+
+```sh
+# tasks are run in parallel by default
+help -v # display additional settings
+help -V # display all settings
+
+tasks -v # Displays additional tasks. More 'v's increase the number of tasks displayed.
+tasks -V # displays all tasks
+```
+
+## see also
+
+- [[scala]]
+- [scala-sbt.org/0.13/docs/Getting-Started](http://www.scala-sbt.org/0.13/docs/Getting-Started.html)
+- [github.com/shekhargulati/52-technologies-in-2016/blob/master/02-sbt/README.md](https://github.com/shekhargulati/52-technologies-in-2016/blob/master/02-sbt/README.md)
+- [[ant]]
+- [[mvn]]
+- [[gradle]]
+- [[make]]
+
diff --git a/notes/scala.md b/notes/scala.md
new file mode 100644
index 00000000..1ee1c1b4
--- /dev/null
+++ b/notes/scala.md
@@ -0,0 +1,39 @@
+---
+tags: [java]
+title: scala
+created: '2019-08-20T07:27:47.862Z'
+modified: '2023-03-23T08:44:35.706Z'
+---
+
+# scala
+
+> high-level [[jvm]] language which combines object-oriented and functional programming
+
+## usage
+
+```sh
+scala # start repl
+```
+
+```scala
+:help // help command
+
+:reset // clear past commands in session
+
+:type // print type without evaluating
+
+val x, y = 1
+
+// expressions and string
+println(s"Age next year: ${age + 1}") // any arbitrary expression can be embedded in ${}
+println(s"You are 33 years old: ${age == 33}")
+println(s"${hannah.name} has a score of ${hannah.score}") // use curly braces when printing object fields
+```
+
+## see also
+
+- [[sbt]]
+- [String interpolation/substitution - alvinalexander.com](https://alvinalexander.com/scala/string-interpolation-scala-2.10-embed-variables-in-strings)
+- [[ocaml]]
+- [[python]]
+- [[java]]
diff --git a/notes/screencapture.md b/notes/screencapture.md
new file mode 100644
index 00000000..938b3e8e
--- /dev/null
+++ b/notes/screencapture.md
@@ -0,0 +1,19 @@
+---
+tags: [macos]
+title: screencapture
+created: '2020-12-24T15:08:32.912Z'
+modified: '2023-03-24T09:53:45.703Z'
+---
+
+# screencapture
+
+> capture images from screen and save to file or clipboard
+
+## usage
+```sh
+
+```
+## see also
+
+- [[script]]
+- [[pbcopy]]
diff --git a/notes/script.md b/notes/script.md
new file mode 100644
index 00000000..84fdfaee
--- /dev/null
+++ b/notes/script.md
@@ -0,0 +1,48 @@
+---
+tags: [linux, macos]
+title: script
+created: '2021-06-16T15:51:41.553Z'
+modified: '2023-03-24T09:51:00.666Z'
+---
+
+# script
+
+> record everything printed on your terminal
+
+## install
+
+```sh
+brew install util-linux
+apt-get install circos-tools
+```
+
+## option
+
+```sh
+-a # append output to FILE or typescript
+-d # When playing back a session with the -p flag, do not sleep between records when playing back a timestamped session
+-F PIPE # immediately flush output after each write - allow to create a named pipe using `mkfifo` and another user may watch the live session using a utility like cat
+-k # Log keys sent to the program as well as output
+-p # Play back a session recorded with the -r flag in real time
+-q # Run in quiet mode, omit the start, stop and command status messages
+-r # Record a session with input, output, and timestamping
+-t TIME # specify the interval at which the script output file will be flushed to disk, in seconds.
+ # value of 0 causes script to flush after every character I/O event. default: 30s
+```
+
+## usage
+
+```sh
+script RECORDING_NAME # start recording
+
+script -a RECORDING_NAME # don't overwrite previous recording
+
+script - -timing=timing_file FILE
+```
+
+## see also
+
+- [[asciinema]]
+- [[mkfifo]]
+- [[cat]]
+- [[screencapture]]
diff --git a/notes/scutil.md b/notes/scutil.md
new file mode 100644
index 00000000..b891bc71
--- /dev/null
+++ b/notes/scutil.md
@@ -0,0 +1,34 @@
+---
+tags: [dns, macos]
+title: scutil
+created: '2019-07-30T06:19:49.202Z'
+modified: '2022-02-02T10:11:07.858Z'
+---
+
+# scutil
+
+> Manage system configuration parameters on macos
+
+## usage
+
+```sh
+scutil --get HostName
+scutil --get LocalHostName
+scutil --get ComputerName
+
+
+scutil --dns
+# or
+cat /etc/resolv.conf
+
+
+grep nameserver <(scutil --dns) # list dns cache
+
+tail -f /private/var/log/system.log
+
+sudo killall -INFO mDNSResponder
+```
+
+## see also
+
+- [how-to-view-dns-cache-in-osx](https://stackoverflow.com/a/38882447/2087704)
diff --git a/notes/sdk.md b/notes/sdk.md
new file mode 100644
index 00000000..5003334f
--- /dev/null
+++ b/notes/sdk.md
@@ -0,0 +1,54 @@
+---
+tags: [java, versionmanager]
+title: sdk
+created: '2019-08-20T08:05:04.309Z'
+modified: '2023-05-11T06:24:19.206Z'
+---
+
+# sdk
+
+> `sdkman` manage parallel versions of multiple sdk's - formerly known as `gvm` the `Groovy enVironment Manager`
+
+## install
+
+```sh
+curl -s "https://get.sdkman.io" | bash
+```
+
+## env
+
+```sh
+SDKMAN_CANDIDATES_API # https://api.sdkman.io/2
+SDKMAN_CANDIDATES_DIR # $HOME/.sdkman/candidates
+SDKMAN_DIR # $HOME/.sdkman
+SDKMAN_PLATFORM # darwinx64
+SDKMAN_VERSION # 5.9.1+575
+```
+
+## usage
+
+```sh
+sdk help list
+
+sdk current java
+
+sdk ls java
+
+sdk install sbt # latest version of sbt
+sdk install java 11.0.4.hs-adpt # use version
+sdk install java 12.0.2.hs-adpt
+
+sdk use java 12.0.2.hs-adpt
+
+sdk default java 8.0.222.hs-adpt # make default
+```
+
+## see also
+
+- [[java]]
+- [[scala]]
+- [[gradle]]
+- [[mvn]]
+- [[gradle]]
+- [[nvm]]
+- [[quarkus]]
diff --git a/notes/sed.md b/notes/sed.md
index 2b9faa93..12b1d84f 100644
--- a/notes/sed.md
+++ b/notes/sed.md
@@ -1,55 +1,74 @@
---
-tags: [bash]
+tags: [linux]
title: sed
created: '2019-07-30T06:19:49.228Z'
-modified: '2019-07-30T08:14:16.302Z'
+modified: '2023-05-11T09:34:03.246Z'
---
# sed
-`Stream EDitor`
+> `Stream EDitor`
-[Sed - An Introduction and Tutorial](http://www.grymoire.com/Unix/Sed.html)
+## install
-### substitution
```sh
+brew install gsed
+```
+
+## options
+
+```sh
+
+```
+
+## usage
+
+```sh
+sed "${NUM}q;d" FILE # print line from file
+
+sed -n "2p" # print second line only
+
+sed -n '2{p;q}' FILE # in case there will be no more line 2 after line 2, spare pointless processing by `q`uiting after `p`rinting
+
+
+sed -i '4d' FILE # delete line 4
+sed '/STRING/d' FILE # delete line containing STRING
+sed -i '/2018-01-30/!d' FILE # delete all lines except ones matching pattern
+
+sed '/INCLUDE/ r foo.h' # insert foo.h after 'INCLUDE'
+
+
+# substitution
+
+sed -r "s/[[:cntrl:]]\[[0-9]{1,3}m//g" # remove colors from output
+
sed 's/[^a-zA-Z0-9]//g' # remove non-alphanumeric characters
sed -i.tmp 's/^/\t/' *.txt # keep copy with extension .tmp .. osx must provide an extension !
# -i, --in-place
-
sed -i '' 's/^/\t/' *.txt # without creating a backup, you can use
-sed -i '4d' vector-out-of-bounds.cpp # delete line 4
-
sed -i '5s/#/\/\//' vector-out-of-bounds.cpp # in line 5 substitute '#' with '//'
-sed -i '/2018-01-30/!d' file.log # delete all lines except ones matching pattern
-
-
sed -i 's/\(^ExecStart=\).*/ExecStart=\/usr\/bin\/dockerd -H tcp:\/\/0.0.0.0:2375/' /lib/systemd/system/docker.service
sed -i 's/\(^#DOCKER_OPTS=\).*/DOCKER_OPTS="-H tcp:\/\/0.0.0.0:2375"/' /etc/default/docker
-```
-### using different delimiter
-```sh
-sed -i "s%\$$1%${val}%g" $CONF_PATH # %-delimiter to avoid escaping slashes in URLs
+sed -i "s%\$$1%${val}%g" $CONF_PATH # % as delimiter to avoid escaping slashes in URLs
-sed -n -e 's,.*/bin/sh -c #(nop) \(MAINTAINER .*[^ ]\) *0 B,\1,p' # ,-delimiter
-```
+sed -n -e 's,.*/bin/sh -c #(nop) \(MAINTAINER .*[^ ]\) *0 B,\1,p' # , as delimiter
-## greedy
-```sh
-% echo "foo bar" | sed 's/<.*>//g'
-bar
-
-Non greedy matching:
-
-% echo "foo bar" | sed 's/<[^>]*>//g'
-foobar
+echo "foo bar" | sed 's/<.*>//g' # greedy matching: "bar"
+echo "foo bar" | sed 's/<[^>]*>//g' # non greedy matching: "foobar"
```
-[0x2a.at - sed - non greedy matching](https://0x2a.at/blog/2008/07/sed--non-greedy-matching/)
+## see also
+
+- [[tr]]
+- [[cut]]
+- [[awk]]
+- [grymoire.com/Unix/Sed](http://www.grymoire.com/Unix/Sed.html)
+- [0x2a.at/blog/2008/07/sed--non-greedy-matching](https://0x2a.at/blog/2008/07/sed--non-greedy-matching/)
+- [github.com/adrianscheff/useful-sed](https://github.com/adrianscheff/useful-sed)
diff --git a/notes/semtag.md b/notes/semtag.md
new file mode 100644
index 00000000..c7808041
--- /dev/null
+++ b/notes/semtag.md
@@ -0,0 +1,29 @@
+---
+tags: [linux, macos]
+title: semtag
+created: '2021-03-25T07:59:14.503Z'
+modified: '2023-03-25T12:51:58.500Z'
+---
+
+# semtag
+
+> semantic tagging script for git
+
+## installation
+
+```sh
+brew install semtag
+```
+
+## usage
+
+```sh
+semtag
+
+semtag final -s minor
+```
+
+## see also
+
+- [[git]]
+- [[git flow]]
diff --git a/notes/seq.md b/notes/seq.md
index 27526251..8cc7373c 100644
--- a/notes/seq.md
+++ b/notes/seq.md
@@ -1,14 +1,37 @@
---
-tags: [bash, linux]
+tags: [coreutils]
title: seq
created: '2019-07-30T06:19:49.229Z'
-modified: '2019-07-30T09:04:07.408Z'
+modified: '2023-03-13T09:21:51.496Z'
---
# seq
+> print sequences of numbers
+
+## option
+
+```sh
+-f FRMT, --format FRMT # printf(3) style format Only the %A, %a, %E, %e, %F, %f, %G, %g are valid
+-s SEP, --separator SEP
+-t TER, --terminator TER
+-w, --fixed-width # equalize the widths of all numbers by padding with zeros as necessary.
+```
+
+## usage
+
```sh
-seq 1 10 # print 1 to 10
+seq 1 10 # print 1 to 10
+
+seq 5 2 # print 5 to 2
+
+seq -w 0 .05 .1 # equalize widths of numbers by padding with zeros
seq -s '*' 40 | tr -dc '[*\n]'
```
+
+## see also
+
+- [[bash for]]
+- [[bash printf]]
+- [[tr]]
diff --git a/notes/serverless.md b/notes/serverless.md
new file mode 100644
index 00000000..5b5d5431
--- /dev/null
+++ b/notes/serverless.md
@@ -0,0 +1,21 @@
+---
+tags: [serverless]
+title: serverless
+created: '2021-02-09T11:18:13.436Z'
+modified: '2021-10-29T12:47:13.736Z'
+---
+
+# serverless
+
+> serverless framework -
+
+## install
+`brew install serverless # requirse node`
+
+## usage
+```sh
+```
+
+## see also
+- [[sam]]
+- [[node]]
diff --git a/notes/service.md b/notes/service.md
new file mode 100644
index 00000000..97fb36ca
--- /dev/null
+++ b/notes/service.md
@@ -0,0 +1,20 @@
+---
+tags: [initsystem, linux]
+title: service
+created: '2019-08-21T06:52:46.649Z'
+modified: '2019-08-22T07:24:46.987Z'
+---
+
+# service
+
+> `service` is a wrapper script that allows to start, stop, and check the status of services without worrying too much about the actual initsystem being used
+
+can be a wrapper script for:
+- `/etc/init.d`
+- `initctl` (upstart)
+- `systemd`
+
+## see also
+- [Difference between Systemctl and Service - Ask Ubuntu](https://askubuntu.com/a/903405)
+
+
diff --git a/notes/servicemesh.md b/notes/servicemesh.md
new file mode 100644
index 00000000..bb7e0f31
--- /dev/null
+++ b/notes/servicemesh.md
@@ -0,0 +1,26 @@
+---
+tags: [Notebooks]
+title: servicemesh
+created: '2020-05-11T06:38:47.231Z'
+modified: '2023-05-16T15:34:01.898Z'
+---
+
+# servicemesh
+
+- fundamentaly an overlay network
+- differs from `VXLAN` in that it operates at `layer 3` rather than `layer 2`
+- `TLS` encrypted
+- instead of shared `VTEP`'s there is an Envoy proxy instance per service endpoint
+
+### implications
+
+- all traffic in the mesh is encrypted by default
+- traditional security technologies (layer 2 IDS/IPS) will not function as desired due to encryption
+- servicemesh-endpoints can be placed anywhere that has `layer 3` connectivity with the other mesh endpoints (on premise, cloud, etc)
+
+## see also
+
+- [[istioctl]]
+- [[kubectl]]
+- [[microservice]]
+- [[docker network]]
diff --git a/notes/session-manager-plugin.md b/notes/session-manager-plugin.md
new file mode 100644
index 00000000..e64f0f1a
--- /dev/null
+++ b/notes/session-manager-plugin.md
@@ -0,0 +1,34 @@
+---
+tags: [cloud]
+title: session-manager-plugin
+created: '2022-09-30T07:14:39.638Z'
+modified: '2023-03-24T08:27:11.783Z'
+---
+
+# 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]]
diff --git a/notes/sh.md b/notes/sh.md
new file mode 100644
index 00000000..040f09e5
--- /dev/null
+++ b/notes/sh.md
@@ -0,0 +1,20 @@
+---
+tags: [shell]
+title: sh
+created: '2021-05-12T09:02:58.515Z'
+modified: '2023-03-22T09:23:54.114Z'
+---
+
+# sh
+
+## usage
+
+```sh
+sh
+```
+
+## see also
+
+- [[ash]]
+- [[bash]]
+- [[dash]]
diff --git a/notes/sha256sum.md b/notes/sha256sum.md
new file mode 100644
index 00000000..5b028c39
--- /dev/null
+++ b/notes/sha256sum.md
@@ -0,0 +1,42 @@
+---
+tags: [linux]
+title: sha256sum
+created: '2019-11-26T06:51:16.688Z'
+modified: '2023-05-30T09:03:13.871Z'
+---
+
+# sha256sum
+
+> compute and check sha256 message digest
+
+## option
+
+```sh
+-b, --binary # read in binary mode
+-c, --check # read checksums from the FILEs and check them
+ --tag # create a BSD-style checksum
+-t, --text # read in text mode (default)
+-z, --zero # end each output line with NUL, not newline, and disable file name escaping
+
+ --ignore-missing # don't fail or report status for missing files
+ --quiet # don't print OK for each successfully verified file
+ --status # don't output anything, status code shows success
+ --strict # exit non-zero for improperly formatted checksum lines
+-w, --warn # warn about improperly formatted checksum lines
+
+ --help # display this help and exit
+ --version # output version information and exit
+```
+
+## usage
+
+```sh
+sha256sum -c FILE FILE_linux_amd64.zip 2>&1 | grep OK # reads checksums from FILE and checks them
+```
+
+## see also
+
+- [[openssl]]
+- [[md5sum]]
+- [[gpg]]
+- [[hdiutil]]
diff --git a/notes/shellcheck.md b/notes/shellcheck.md
new file mode 100644
index 00000000..85b4b587
--- /dev/null
+++ b/notes/shellcheck.md
@@ -0,0 +1,29 @@
+---
+tags: [linux, macos, shell]
+title: shellcheck
+created: '2021-06-16T16:19:38.843Z'
+modified: '2023-03-25T12:29:50.473Z'
+---
+
+# shellcheck
+
+> tool, written in Haskell, that gives warnings and suggestions for shell scripts
+
+## install
+
+```sh
+brew install shellcheck
+```
+
+## usage
+
+```sh
+shellcheck FILE
+```
+
+## see also
+
+- [[bash]]
+- [[haskell]]
+- [github.com/koalaman/shellcheck](https://github.com/koalaman/shellcheck)
+
diff --git a/notes/shm.md b/notes/shm.md
new file mode 100644
index 00000000..27c1f3ba
--- /dev/null
+++ b/notes/shm.md
@@ -0,0 +1,19 @@
+---
+tags: [filesystem]
+title: shm
+created: '2019-08-23T11:09:23.405Z'
+modified: '2020-01-07T10:10:54.559Z'
+---
+
+# shm
+
+`shared memory` aka `tempfs`
+
+> shm is shared data between processes not threads
+> can be used to set permissions on memory
+
+## usage
+
+## see also
+- [[procfs]]
+- [[sysfs]]
diff --git a/notes/showmount.md b/notes/showmount.md
new file mode 100644
index 00000000..d45f4a09
--- /dev/null
+++ b/notes/showmount.md
@@ -0,0 +1,18 @@
+---
+tags: [filesystem]
+title: showmount
+created: '2020-03-03T08:44:22.304Z'
+modified: '2020-09-02T18:06:42.106Z'
+---
+
+# showmount
+
+> show remote nfs mounts on host
+
+## usage
+```sh
+showmount -e 10.32.32.9 # show the host's exports list
+```
+## see also
+- [[findmnt]]
+- [[mount]]
diff --git a/notes/shuf.md b/notes/shuf.md
new file mode 100644
index 00000000..f728c5e1
--- /dev/null
+++ b/notes/shuf.md
@@ -0,0 +1,22 @@
+---
+tags: [crypto]
+title: shuf
+created: '2020-02-26T12:51:08.820Z'
+modified: '2023-03-24T08:19:14.072Z'
+---
+
+# shuf
+
+> generate random permutations
+
+## usage
+
+```sh
+shuf -i 1000-2000 -n 1 # 1 random num between 1000 and 2000
+```
+
+## see also
+
+- [[cgroup]]
+- [[openssl]]
+- [[rl]]
diff --git a/notes/signal.md b/notes/signal.md
new file mode 100644
index 00000000..af674693
--- /dev/null
+++ b/notes/signal.md
@@ -0,0 +1,57 @@
+---
+tags: [linux, Notebooks]
+title: signal
+created: '2020-01-21T09:37:12.241Z'
+modified: '2023-05-05T07:07:35.739Z'
+---
+
+# signal
+
+> signals are a limited form of `ipc` used in Unix-like and POSIX-compliant os
+> a signal is a asynchronous notification sent to a process/thread within the same process in order to notify it of an event that occurred
+
+## standard signals POSIX.1-1990
+
+```sh
+signal value action comment
+--- --- --- ---
+SIGHUP 1 Term Hangup detected on controlling terminal or death of controlling process
+SIGINT 2 Term Interrupt from keyboard
+SIGQUIT 3 Core Quit from keyboard
+SIGILL 4 Core Illegal Instruction
+SIGABRT 6 Core Abort signal from abort(3)
+SIGFPE 8 Core Floating point exception
+SIGKILL 9 Term Kill signal
+SIGSEGV 11 Core Invalid memory reference
+SIGPIPE 13 Term Broken pipe: write to pipe with no readers
+SIGALRM 14 Term Timer signal from alarm(2)
+SIGTERM 15 Term Termination signal
+SIGUSR1 30, 10, 16 Term User-defined signal 1
+SIGUSR2 31, 12, 17 Term User-defined signal 2
+SIGCHLD 20, 17, 18 Ign Child stopped or terminated
+SIGCONT 19, 18, 25 Cont Continue if stopped
+SIGSTOP 17, 19, 23 Stop Stop process
+SIGTSTP 18, 20, 24 Stop Stop typed at terminal
+SIGTTIN 21, 21, 26 Stop Terminal input for background process
+SIGTTOU 22, 22, 27 Stop Terminal output for background process
+
+SIGKILL and SIGSTOP cannot be caught, blocked, or ignored
+```
+
+## usage
+
+```sh
+kill -l # list signals
+```
+
+## see also
+
+- [[syscall]]
+- [[kill]]
+- [[bash kill]]
+- [[bash trap]]
+- [[errno]]
+- [[nohup]]
+- [[c stackoverflow segfault]]
+- [[12 factor app]]
+- [linux.die.net/man/7/signal](https://linux.die.net/man/7/signal)
diff --git a/notes/skopeo.md b/notes/skopeo.md
new file mode 100644
index 00000000..55b59a4e
--- /dev/null
+++ b/notes/skopeo.md
@@ -0,0 +1,32 @@
+---
+tags: [container]
+title: skopeo
+created: '2021-10-19T11:25:30.764Z'
+modified: '2023-04-24T08:05:06.507Z'
+---
+
+# skopeo
+
+> performs various operations on container images and image repositories
+
+## install
+
+```sh
+brew install skopeo
+```
+
+## usage
+
+```sh
+skopeo login quay.io --username USERNAME
+
+skopeo inspect docker://quay.io/PATH/IMAGE:TAG
+```
+
+## see also
+
+- [[podman]]
+- [[buildah]]
+- [[crictl]]
+- [[crane]]
+- [[pack]]
diff --git a/notes/sleep.md b/notes/sleep.md
new file mode 100644
index 00000000..7d64fb9e
--- /dev/null
+++ b/notes/sleep.md
@@ -0,0 +1,19 @@
+---
+tags: [linux, shell/bash]
+title: sleep
+created: '2020-03-26T10:22:21.098Z'
+modified: '2021-10-29T12:34:48.681Z'
+---
+
+# sleep
+
+> suspend execution for an interval of time
+
+## usage
+```sh
+sleep 1
+```
+
+## see also
+- [[timeout]]
+- [[bash until]]
diff --git a/notes/smalltalk.md b/notes/smalltalk.md
new file mode 100644
index 00000000..9f9d85ed
--- /dev/null
+++ b/notes/smalltalk.md
@@ -0,0 +1,20 @@
+---
+tags: [Notebooks]
+title: smalltalk
+created: '2020-06-23T07:14:41.338Z'
+modified: '2023-05-24T08:42:29.219Z'
+---
+
+# smalltalk
+
+> fully object-oriented, dynamically typed, reflective programming language with no โnon-objectโ types
+
+## usage
+```smalltalk
+result := myObject doSomethingWith: thatObject
+```
+We are sending the message โdoSomethingWith:โ to myObject. This happens to be a message that has a single argument but thatโs not important yet. โmyObjectโ is a โMyExampleClassโ instance so the system looks at the list of messages understood by MyExampleClass
+## see also
+- [learnxinyminutes.com/docs/smalltalk/](https://learnxinyminutes.com/docs/smalltalk/)
+- [[java]]
+- [[oo paradigm]]
diff --git a/notes/socat.md b/notes/socat.md
new file mode 100644
index 00000000..7be6ca81
--- /dev/null
+++ b/notes/socat.md
@@ -0,0 +1,74 @@
+---
+tags: [linux, network]
+title: socat
+created: '2019-07-30T06:19:49.239Z'
+modified: '2023-03-16T09:13:18.415Z'
+---
+
+# socat
+
+> multipurpose relay - `SOcket CAT`
+
+## install
+
+```sh
+brew install socat
+apt install socat
+yum install socat
+```
+
+## usage
+
+```sh
+socat INPUT_TYPE(OPTIONS) OUTPUT_TYPE(OPTIONS)
+
+
+socat SYSTEM:ls - # print system-command to stdout
+
+socat STDIO FILE:/home/user/test,create # read from stdin and write to file
+
+socat FILE:/tmp/test1 FILE:/tmp/test:append
+
+
+socat - TCP:host.com:www,crnl # surf web over stdin
+
+
+socat UDP-LISTEN:8888 - # listen and print to stdout
+socat UDP:localhost:8888 -
+
+socat TCP-LISTEN:9999,reuseaddr - # allow other sockets to bind to address even if parts of it are in use
+socat ยญ-x TCP:localhost:9999 - # write transferred also to stderr in hexadecimal format
+
+
+socat - TCP4:localhost:80 OR socat STDIN TCP4:localhost:80 # same as `nc localhost 80`
+socat TCP4-LISTEN:700 STDOUT # same as `nc -lp localhost 700`
+socat TCP4-LISTEN:700 EXEC:/bin/bash # same as `nc -lp localhost 700 -e /bin/bash`
+
+
+socat OPENSSL-LISTEN:443,cert=/cert.pem - # ssl server
+socat - OPENSSL:localhost:443 # connect via ssl
+socat TCP4-LISTEN:5000,fork OPENSSL:localhost:443 # listen and handle multiple clients with fork
+
+socat TCP4-LISTEN:1234,reuseaddr,fork gopen:/home/user/capture,seek-end=,append
+
+socat TCP-LISTEN:80,fork TCP:202.54.1.5:80 # redirect all port 80 conenctions to ip 202.54.1.5
+
+echo "show info" | socat unix-connect:/var/tmp/haproxy stdio # information about the running HAProxy
+
+socat -d -d -lmlocal2 \
+ TCP4-LISTEN:80,bind=myaddr1,su=nobody,fork,range=10.0.0.0/8,reuseaddr \
+ TCP4:www.nixcraft.net.in:80,bind=myaddr2
+```
+
+## see also
+
+- [socat โ Cindy Sridharan โ Medium](https://medium.com/@copyconstruct/socat-29453e9fc8a6)
+- [[unix socket]]
+- [[nmap]]
+- [[ncat]]
+- [[nc]]
+- [[kubectl]]
+- [[ssh proxy]]
+- [[tcp-ip model]]
+- [[12 factor app]]
+
diff --git a/notes/software design pattern.md b/notes/software design pattern.md
new file mode 100644
index 00000000..96ea1202
--- /dev/null
+++ b/notes/software design pattern.md
@@ -0,0 +1,11 @@
+---
+tags: [Notebooks]
+title: software design pattern
+created: '2020-03-12T09:08:59.935Z'
+modified: '2020-09-02T17:44:11.253Z'
+---
+
+# software design pattern
+
+## see also
+- [[architectural pattern]]
diff --git a/notes/softwareupdate.md b/notes/softwareupdate.md
new file mode 100644
index 00000000..45d126ed
--- /dev/null
+++ b/notes/softwareupdate.md
@@ -0,0 +1,43 @@
+---
+tags: [macos]
+title: softwareupdate
+created: '2021-09-30T06:53:42.930Z'
+modified: '2023-05-30T08:51:48.799Z'
+---
+
+# softwareupdate
+
+> system software update tool
+
+## option
+
+```sh
+-h, --help # print command usage
+-l, --list # list all available updates
+
+-i, --install # each update specified by args is downloaded and installed
+-r, --recommended # all updates that are recommended for your system - are prefixed with a * in --list output
+-R, --restart # automatically restart or shut down if required to complete installation
+ # if the user is not logged in, macOS will trigger a forced reboot if necessary. If you wish to always perform a forced reboot, pass -f (--force)
+-a, --all # all updates that are applicable to your system, including those non-recommended ones, which are prefixed with a - character in the --list output
+ # item ... One or more specified updates. The --list output shows the item names you can specify here, prefixed by the * or - characters. See EXAMPLES.
+
+-d, --download # each update specified by args is downloaded but not installed. The values of args are the same as for the --install command.
+ # updates downloaded with --download can be subsequently installed with --install, or through the App Store (as long as they remain applicable to your system).
+ # Updates are downloaded to /Library/Updates, but are not designed to be installed by double-clicking the packages in that directory: always use --install or the App Store to actually perform the install
+--schedule # returns the per-machine automatic (background) check preference
+```
+
+## usage
+
+```sh
+softwareupdate --all --install --force
+
+softwareupdate --install-rosetta # install Rosetta 2 manually, used for docker-for-macos
+```
+
+## see also
+
+- [[xcode-select]]
+- [[brew]]
+- [[docker]]
diff --git a/notes/solid principles.md b/notes/solid principles.md
new file mode 100644
index 00000000..58917223
--- /dev/null
+++ b/notes/solid principles.md
@@ -0,0 +1,38 @@
+---
+tags: [Notebooks]
+title: solid principles
+created: '2020-02-01T08:30:02.163Z'
+modified: '2020-09-02T17:44:36.559Z'
+---
+
+# solid principles
+
+> five object-oriented design principles by Robert C. Martin aka Uncle Bob.
+
+```
+S O L I D
+| | | | โโ Dependency Inversion Principe
+| | | โโโโ Interface Segregation Principle
+| | โโโโโโ Liskov Substituation Principle
+| โโโโโโโโ Open Close Principle
+โโโโโโโโโโ Single Responsibility Principle
+```
+
+## Single Responsibility Principle
+A class should have one and only one reason to change, meaning that the class should have only one job.
+
+## Open-Closed Principle
+Objects or Entities should be open for extension, but closed for modification
+
+## Liskov Substitution Principle
+Let q(x) be a property provable about objects of x of Type T. Then q(y) should be provable for objects y of type S where S is substitute of T.
+
+## Interface Segregation Principle
+A client should never be forced to implement an interface that it doesn't use or clients shouldn't be forced to depend on methods they do not use.
+
+## Dependency Inversion Principle
+Entities must depend on abstractions not on concretions. It states that high level module must not depend on the low level module, but they should depend on abstractions. => allows for decoupling
+
+
+## see also
+- [[software design pattern]]
diff --git a/notes/sort.md b/notes/sort.md
index d2c46f6a..1d1f6cb8 100644
--- a/notes/sort.md
+++ b/notes/sort.md
@@ -1,16 +1,34 @@
---
-tags: [bash]
+tags: [coreutils]
title: sort
created: '2019-07-30T06:19:49.240Z'
-modified: '2019-07-30T07:08:54.446Z'
+modified: '2021-06-07T06:50:03.576Z'
---
# sort
-## sort ip via gnu sort
+> sort or merge records (lines) of text and binary files
+
+## usage
+
+```sh
+--key, -k #
+--numeric-sort, -n #
+--general-numeric-sort, -g #
+```
```sh
-sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4
+sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4 # sort ip via gnu sort
+
+sort --key 3 -g # sort by key:3 and general numeric sort for floating point
+
+rpm -q kernel | sort -V # order by semantic version
+
+du -d 1 -h | sort -h # order by human readable output
```
-[Sort IP Addresses with GNU sort](https://www.madboa.com/geek/sort-addr/)
+## see also
+- [[du]]
+- [[locale]]
+- [Sort IP Addresses with GNU sort](https://www.madboa.com/geek/sort-addr/)
+- [stackoverflow.com/sorting-floats-with-exponents](https://stackoverflow.com/questions/10311624/sorting-floats-with-exponents-with-sort-g-bash-command)
diff --git a/notes/spf.md b/notes/spf.md
new file mode 100644
index 00000000..e0c1382c
--- /dev/null
+++ b/notes/spf.md
@@ -0,0 +1,48 @@
+---
+tags: [dns]
+title: spf
+created: '2022-01-26T08:24:32.923Z'
+modified: '2023-03-22T10:29:40.362Z'
+---
+
+# spf
+
+> Sender Policy Framework - detect forging sender addresses during the delivery of email
+
+##
+
+```sh
+v=VERSION # defines the version of SPF used
+
+ip4:IP # specify the systems permitted to send messages for the given domain.
+a
+-all # if the previous mechanisms did not match, the message should be rejected
+```
+
+## qualifiers
+
+> Each mechanism can be combined with one of four qualifiers:
+
+```sh
++ # for PASS result. This can be omitted; e.g., +mx is the same as mx.
+? # for NEUTRAL result interpreted like NONE (no policy).
+~ # for SOFTFAIL, a debugging aid between NEUTRAL and FAIL. Typically, messages that return a SOFTFAIL are accepted but tagged.
+- # for FAIL, the mail should be rejected (see below).
+```
+
+```sh
+"v=spf1 ip4:192.0.2.0/24 ip4:198.51.100.123 a -all"
+
+TXT @ "v=spf1 a include:_spf.google.com ~all"
+# TXT The DNS zone record type; SPF records are written as TXT records
+# @ In a DNS file, the "@" symbol is a placeholder used to represent "the current domain"
+# v=spf1 Identifies the TXT record as an SPF record, utilizing SPF Version 1
+# a Authorizes the host(s) identified in the domain's A record(s) to send e-mail include:
+# Authorizes mail to be sent on behalf of the domain from google.com
+# ~all Denotes that this list is all inclusive, and no other servers are allowed to send e-mail
+```
+
+## see also
+
+- [wikipedia.org/wiki/Sender_Policy_Framework](https://en.wikipedia.org/wiki/Sender_Policy_Framework)
+- [[dns]]
diff --git a/notes/sponge.md b/notes/sponge.md
new file mode 100644
index 00000000..64619a39
--- /dev/null
+++ b/notes/sponge.md
@@ -0,0 +1,35 @@
+---
+tags: [linux, macos]
+title: sponge
+created: '2022-01-21T13:33:13.007Z'
+modified: '2023-03-24T08:23:34.451Z'
+---
+
+# sponge
+
+> soak up stdin and write to file
+> unlike a shell redirect, sponge soaks up all its input before opening the output file. This allows constructing pipelines that read from and write to the same file.
+
+It also creates the output file atomically by renaming a temp file into place, and preserves the permissions of the output file if it already exists. If the output file is a special file or symlink, the data
+will be written to it.
+
+If no output file is specified, sponge outputs to stdout.
+
+## usage
+
+```sh
+sed '..' FILE |ย grep FOO |ย sponge FILE
+
+cat $KUBECONFIG |\
+ yq e '.users.[].user.exec.args += ["--profile", "dev"]' - -- | \
+ sed 's/eksworkshop-eksctl./eksworkshop-eksctl-dev./g' | \
+ sponge $KUBECONFIG
+```
+
+## see also
+
+- [[moreutils]]
+- [[bash redirects]]
+- [[sed]]
+- [[yq]]
+- [[tee]]
diff --git a/notes/sqlite.md b/notes/sqlite.md
new file mode 100644
index 00000000..5a400095
--- /dev/null
+++ b/notes/sqlite.md
@@ -0,0 +1,67 @@
+---
+tags: [database]
+title: sqlite
+created: '2019-07-30T06:19:49.240Z'
+modified: '2023-04-30T11:32:42.082Z'
+---
+
+# sqlite
+
+> c lib that implements small, fast, self-contained, high-reliability, full-featured, sql-database engine
+
+## install
+
+```sh
+zypper install sqlite3
+```
+
+## usage
+
+```sh
+sqlite3 DATABASE.db # create or us database
+
+cat < ~/.sqliterc
+.mode column
+.headers on
+.separator ROW "\n"
+.nullvalue NULL
+EOT
+```
+
+## console
+
+```sql
+.open ./PATH/TO/DB -- open from sqlite-shell
+
+.databases -- list dbs
+
+.tables -- list tables
+
+.schema TABLE -- describe table
+
+.mode column -- change output format
+.headers on
+.mode tabs
+
+
+drop table import;
+
+vacuum; -- rebuilds database file, repacking into a minimal amount of disk space
+
+
+.mode csv -- import csv
+.import shakespeare_data.csv import -- table_name is `import`
+
+
+CREATE VIRTUAL TABLE playsearch USING fts5(playsrowid, text); -- inline text search - FTS5, a virtual table module
+INSERT INTO playsearch SELECT rowid, text FROM plays;
+SELECT rowid, text FROM playsearch WHERE text MATCH "whether tis nobler"; -- Now we can search for our soliloquy
+```
+
+## see also
+
+- [[mysql]]
+- [[psql]]
+- [[mongo]]
+- [[fossil]]
+- [[c]]
diff --git a/notes/ss.md b/notes/ss.md
new file mode 100644
index 00000000..09f55809
--- /dev/null
+++ b/notes/ss.md
@@ -0,0 +1,46 @@
+---
+tags: [iproute, network]
+title: ss
+created: '2019-08-18T19:35:04.208Z'
+modified: '2023-03-23T08:46:51.569Z'
+---
+
+# ss
+
+> display `socket statistics`
+
+## install
+
+```sh
+yum install iproute
+apt install iproute
+brew install ss
+```
+
+## option
+
+```sh
+-a # Show all sockets (listening and non-listening)
+-e # Show detailed socket information
+-o # Show timer information
+-n # dont try to resolve ip addresses
+-p # show PIDs using the socket
+
+-l # listening
+-a # listening and connection
+-t # protocol: tcp
+-u # protocol: udp
+-x # protocol: unix domain sockets
+```
+
+## usage
+
+```sh
+ss -tunapls # tuna, please!
+```
+
+## see also
+
+- [[netstat]]
+- [[socat]]
+- [[iproute]]
diff --git a/notes/ssh config.md b/notes/ssh config.md
new file mode 100644
index 00000000..7cffa248
--- /dev/null
+++ b/notes/ssh config.md
@@ -0,0 +1,93 @@
+---
+tags: [crypto, ssh]
+title: ssh config
+created: '2019-08-22T08:32:53.895Z'
+modified: '2023-03-25T12:05:48.987Z'
+---
+
+# ssh config
+
+> ssh client configuration
+
+## usage
+
+```sh
+man ssh_config
+
+ssh -F /dev/null root@host # debug config problem by using different config file
+```
+
+## .ssh/config
+```sh
+Host # Defines host or hosts to which the configuration section applies.
+ # The section ends with a new Host section or the end of the file.
+ # A single * as a pattern can be used to provide global defaults for all hosts.
+
+Host * !martell # all hosts except martell
+```
+
+```sh
+HostName # real host name to log into,n umeric IP addresses are also permitted.
+
+User # username for connection
+
+IdentityFile # Specifies a file from which the userโs DSA, ECDSA or DSA authentication identity is read.
+ # defaults:
+ # protocol version 1: ~/.ssh/identity
+ # protocol version 2: ~/.ssh/id_dsa, ~/.ssh/id_ecdsa and ~/.ssh/id_rsa
+
+ProxyCommand # specifies command to use to connect to the server, placeholders (%h) will be substituted.
+ # command can be basically anything, and should read from its standard input and write to its standard output.
+ # useful in conjunction with nc and its proxy support. e.g. connect via an HTTP proxy at 192.1.0.253:
+ # ProxyCommand /usr/bin/nc -X connect -x 192.1.0.253:3128 %h %p
+
+LocalForward # Specifies that a local tcp-port to be forwarded over the secure channel to the specified host and port from the remote machine.
+ # The first argument must be [bind_address:]port and the second argument must be host:hostport.
+
+Port # port to connect on the remote host
+
+Protocol # possible values: '1', '2'
+
+ServerAliveInterval # timeout interval in seconds after which if no data has been received from the server
+ # will send a message through the encrypted channel to request a response from the server
+
+ServerAliveCountMax # Sets the number of server alive messages which may be sent without receiving any messages back from the server
+ # If threshold is reached while server alive messages are being sent, ssh will disconnect from the server
+
+ProxyJump #
+
+
+LogLevel # INFO
+
+Compression # yes
+```
+
+## placeholders
+
+> HostName accepts the tokens `%%` and `%h`
+
+```sh
+Host service-1 service-2
+ HostName %h.foo.bar
+ User root
+
+# %h - host name
+# %p - port
+# %r - remote user name
+```
+
+## proxy
+```sh
+Host foo
+ HostName %h.host.com
+ ProxyJump root@jumphost.net
+ User root
+```
+
+## see also
+
+- [[ssh]]
+- [[sshd]]
+- [create-ssh-config-file-on-linux-unix - cyberciti.biz](https://www.cyberciti.biz/faq/create-ssh-config-file-on-linux-unix/)
+- [what does h mean in sshd configuration - askubuntu.com](https://askubuntu.com/questions/605479/what-does-h-mean-in-sshd-configuration)
+- [Proxies_and_Jump_Hosts - wikikbooks.org](https://en.wikibooks.org/wiki/OpenSSH/Cookbook/Proxies_and_Jump_Hosts)
diff --git a/notes/ssh keylogger.md b/notes/ssh keylogger.md
deleted file mode 100644
index 90fc41b6..00000000
--- a/notes/ssh keylogger.md
+++ /dev/null
@@ -1,14 +0,0 @@
----
-tags: [ssh]
-title: ssh keylogger
-created: '2019-07-30T06:19:49.241Z'
-modified: '2019-08-02T07:37:52.092Z'
----
-
-# ssh keylogger
-
-```sh
-ssh='strace -o /tmp/sshpwd-$(date '+%d%h%m%s').log -e read,write,connect -s2048 ssh'
-```
-
-[Poor man's SSH keylogger](https://diogomonica.com/2011/02/03/poor-mans-ssh-keylogger/)
diff --git a/notes/ssh pivoting.md b/notes/ssh proxy.md
similarity index 87%
rename from notes/ssh pivoting.md
rename to notes/ssh proxy.md
index d6813576..19237885 100644
--- a/notes/ssh pivoting.md
+++ b/notes/ssh proxy.md
@@ -1,15 +1,13 @@
---
-tags: [ssh]
-title: ssh pivoting
+tags: [crypto, ssh]
+title: ssh proxy
created: '2019-07-30T06:19:49.242Z'
-modified: '2019-08-02T07:53:38.202Z'
+modified: '2023-03-25T12:05:18.550Z'
---
-# ssh pivoting
+# ssh proxy
-- [KringleCon - Derek Rook, Pivoting: SSH - YouTube](https://www.youtube.com/watch?v=f5uaxLjCkK0)
-- [SSH Tunneling Magic โ Reznok](https://reznok.com/ssh-tunneling-magic/)
-- [Derek Rook / Pentest Process ยท GitLab](https://gitlab.com/r00k/pentest-process)
+> aka `"pivoting"`
## local port forwarding
@@ -37,6 +35,7 @@ ssh root@localhost -p 2222
```
## Jump Host
+
```sh
ssh -J
@@ -48,9 +47,18 @@ curl http://127.0.0.1:8080
```
## dynamic port forward
+
```sh
ssh -D
ssh -J r00k@jump1 -D 8080 r00k@jump2
curl -x SOCKS5://localhost:8080 http://jump3
```
+
+## see also
+
+- [[socat]]
+- [[ssh config]]
+- [KringleCon - Derek Rook, Pivoting: SSH - YouTube](https://www.youtube.com/watch?v=f5uaxLjCkK0)
+- [SSH Tunneling Magic โ Reznok](https://reznok.com/ssh-tunneling-magic/)
+- [Derek Rook / Pentest Process ยท GitLab](https://gitlab.com/r00k/pentest-process)
diff --git a/notes/ssh session.md b/notes/ssh session.md
deleted file mode 100644
index 87894bdb..00000000
--- a/notes/ssh session.md
+++ /dev/null
@@ -1,21 +0,0 @@
----
-tags: [ssh]
-title: ssh session
-created: '2019-07-30T06:19:49.242Z'
-modified: '2019-08-02T07:37:52.094Z'
----
-
-# ssh session
-
-## system info
-```sh
-passwd # lets you change your password
-quota -v # shows what your disk quota is
-date # shows the current date and time
-cal # shows the month's calendar
-uptime # shows current uptime
-w # displays whois online
-finger # displays information about user
-uname -a # shows kernel information
-last # lists your last logins
-```
diff --git a/notes/ssh-add.md b/notes/ssh-add.md
index 266b5f8a..fb2bf66a 100644
--- a/notes/ssh-add.md
+++ b/notes/ssh-add.md
@@ -1,17 +1,32 @@
---
-tags: [ssh]
+tags: [crypto, ssh]
title: ssh-add
created: '2019-07-30T06:19:49.243Z'
-modified: '2019-08-02T07:37:52.095Z'
+modified: '2023-07-19T11:16:41.316Z'
---
# ssh-add
-> `ssh-add` -- adds private key identities to the authentication agent
+> adds private key identities to the authentication agent
+
+## option
+
+```sh
+-l # list fingerprints of all identities currently represented by the agent
+-L # list public key parameters of all identities currently represented by the agent
+-k # add keys
+```
+
+## usage
```sh
-ssh-add ~/.ssh/PRIVATE_KEY
+ssh-add ~/.ssh/FILE
-eval "$(ssh-agent -s)" # add-ssh-key-to-agent
+eval "$(ssh-agent -s)" # add-ssh-key-to-agent
```
+## see also
+
+- [[ssh]]
+- [[keychain]]
+- [[bash eval]]
diff --git a/notes/ssh-copy-id.md b/notes/ssh-copy-id.md
index 6ee57b34..a6ac4f6a 100644
--- a/notes/ssh-copy-id.md
+++ b/notes/ssh-copy-id.md
@@ -1,16 +1,24 @@
---
-tags: [ssh]
+tags: [crypto, ssh]
title: ssh-copy-id
created: '2019-07-30T06:19:49.244Z'
-modified: '2019-08-02T07:37:52.097Z'
+modified: '2023-03-25T12:07:25.045Z'
---
# ssh-copy-id
-```sh
-ssh-copy-id user@host # adds your ssh key to host
-```
+> installs an [[ssh]] key on a server as an authorized key
+
+## usage
```sh
+ssh-copy-id user@host # adds your ssh key to host
+
ssh-copy-id -i .ssh/foo@bar.pub user@server
```
+
+## see also
+
+- [[ssh]]
+- [[sshpass]]
+- [[ssh-keygen]]
diff --git a/notes/ssh-keygen.md b/notes/ssh-keygen.md
index 206459fb..969c844a 100644
--- a/notes/ssh-keygen.md
+++ b/notes/ssh-keygen.md
@@ -1,22 +1,46 @@
---
-tags: [ssh]
+tags: [crypto, ssh]
title: ssh-keygen
created: '2019-07-30T06:19:49.245Z'
-modified: '2019-08-02T07:37:52.098Z'
+modified: '2023-03-25T12:05:18.585Z'
---
# ssh-keygen
-```sh
-ssh-keygen -t rsa -b 4096 -C "your_email@example.com" # generate-ssh-key
- -t # type [rs1, dsa, ecdsa, ed25519, rsa]
- -b # bits default 2048bits
- -C # comment provides comment
- -f <$HOME/.ssh/id_rsa>
+> tool for creating new authentication key pairs for [[ssh]]
+
+## option
+```sh
+-t TYPE # key-types: rs1, dsa, ecdsa, ed25519, rsa
+-b BITS # default: 2048bits
+-f .ssh/id_rsa # key-file path
+-C "COMMENT" # provides comment e.g. email
+-o # save private keys using the new OpenSSH format rather than the more compatible PEM format
+-a ROUNDS # When saving a new-format private key (i.e. an ed25519 key or when the -o flag is set)
+-P PASSPHRASE # passphrase, "" is the empty passphrase
```
-### Warning: the ECDSA host key for '..' differs from the key for the IP address
+## usage
+
```sh
-ssh-keygen -R 10.32.23.234 # Remove the cached key on local machine
+ssh-keygen -t rsa -b 4096 -C "john@example.net" # generate ssh-key 4096-bit rsa
+
+ssh-keygen -t rsa -f .ssh/id_rsa -q -P "" # skip passphrase question
+
+ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "john@example.net" # ed25519
+
+
+ssh-keygen -R 10.32.23.234 # Remove the cached key on local machine
+
+ssh-keygen -R [host]:1234 # when non standart port is used
```
+
+## see also
+
+- [[ssh]]
+- [[ssh-keygen]]
+- [[ssh-copy-id]]
+- [medium.com/risan/upgrade-your-ssh-key-to-ed25519](https://medium.com/risan/upgrade-your-ssh-key-to-ed25519-c6e8d60d3c54)
+- [en.wikibooks.org/wiki/OpenSSH/Client_Configuration_Files](https://en.wikibooks.org/wiki/OpenSSH/Client_Configuration_Files)
+- [[vagrant]]
diff --git a/notes/ssh-keyscan.md b/notes/ssh-keyscan.md
new file mode 100644
index 00000000..19737555
--- /dev/null
+++ b/notes/ssh-keyscan.md
@@ -0,0 +1,44 @@
+---
+tags: [crypto, linux]
+title: ssh-keyscan
+created: '2021-06-30T12:48:52.502Z'
+modified: '2023-03-25T12:05:18.593Z'
+---
+
+# ssh-keyscan
+
+> gather ssh host public keys from servers
+
+## option
+
+```sh
+-4 # Force ssh-keyscan to use IPv4 addresses only
+-6 # Force ssh-keyscan to use IPv6 addresses only
+-c # Request certificates from target hosts instead of plain keys
+-D # Print keys found as SSHFP DNS records. The default is to print keys in a format usable as a `ssh` known_hosts file
+-f FILE # Read hosts or โaddrlist namelistโ pairs from file, one per line
+ # If โ-โ is supplied instead of a filename, ssh-keyscan will read from the standard input
+ # Input is expected in the format: 1.2.3.4,1.2.4.4 name.my.domain,name,n.my.domain,n,1.2.3.4,1.2.4.4
+-H # hash all hostnames and addresses in the output
+ # Hashed names may be used normally by `ssh` and `sshd`, but they do not reveal identifying information should the file's contents be disclosed
+-p PORT # connect to port on the remote host
+-T timeout # set the timeout for connection attempts - default: 5 sec
+-t type # type of key to fetch from the scanned hosts - values: dsa, ecdsa, ed25519, rsa. Multiple values may be specified by separating them with commas
+ # default is to fetch โrsaโ, โecdsaโ, and โed25519โ keys
+-v # print debugging messages about progress
+```
+
+## usage
+
+```sh
+ssh-keyscan -H github.com >> ~/.ssh/known_hosts
+
+ssh-keyscan -H IP >> ~/.ssh/known_hosts
+
+ssh-keyscan -t rsa,dsa HOST 2>&1 | sort -u - ~/.ssh/known_hosts
+```
+
+## see also
+
+- [[ssh]]
+- [[git]]
diff --git a/notes/ssh.md b/notes/ssh.md
index 710ad845..6f493d2d 100644
--- a/notes/ssh.md
+++ b/notes/ssh.md
@@ -1,53 +1,72 @@
---
-tags: [ssh]
+tags: [crypto, ssh]
title: ssh
created: '2019-07-30T06:19:49.245Z'
-modified: '2019-08-02T07:37:52.091Z'
+modified: '2023-03-25T12:05:08.874Z'
---
# ssh
-`secure shell`
+> `secure shell`
-```sh
-ssh -T git@github.com # test ssh-connection
-
-ssh -t # Force pseudo-terminal allocation.
-
-ssh -i /Users/user/.ssh/google_compute_engine # use different identity file
+## env
-ssh -p PORT user@host # connects specified port
+```sh
+SSH_ASKPASS # set by ssh user - path to askpass program
+SSH_AUTH_SOCK # set by ssh-agent - path to socket
+SSH_CLIENT # set by sshd - client socket info like ip from which you connected to host
+SSH_CONNECTION # set by sshd - client and server socket info
+SSH_ORIGINAL_COMMAND # set by sshd - clientโs remote command string
+SSH_TTY # set by sshd - name of allocated tty
```
-[Connecting to GitHub with SSH - User Documentation](https://help.github.com/articles/connecting-to-github-with-ssh/)
-## options
+## option
+
```sh
+-n # redirects STDIN from /dev/null which prevents reading from STDIN, used inside loops
+-l # specify username for login
--o ServerAliveInterval=60 -o ServerAliveCountMax=120 # 120 x 60
+-o ServerAliveInterval=60
+-o ServerAliveCountMax=120 # 120 x 60
-o StrictHostKeyChecking=no
-
--o LogLevel=ERROR # QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3
-
-
+-o StrictHostKeyChecking=accept-new
+-o LogLevel=LOGLEVEL # loglevels: QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3
-o CheckHostIP=no
--o HostKeyAlias=compute.1407099891930101147
+-o HostKeyAlias=ALIAS
-o IdentitiesOnly=yes
--o StrictHostKeyChecking=no
--o UserKnownHostsFile=/Users/user/.ssh/google_compute_known_hosts
+-o UserKnownHostsFile=/PATH/TO/.ssh/known_hosts
+-o PreferredAuthentications=password
+-o PubkeyAuthentication=no
```
-[ssh_config(5) - LogLevel](http://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man5/ssh_config.5?query=ssh_config#LogLevel)
+## usage
+
+```sh
+ssh whoami.filippo.io # prints _o/ Hello! and closes
+ssh -T git@github.com # test ssh-connection
+ssh -t # Force pseudo-terminal allocation.
-### don't read from stdin
+ssh -i /Users/user/.ssh/gce # use different identity file
-`-n` Redirects stdin from /dev/null (actually, prevents reading from stdin). This must be used when ssh is run in the background.
+ssh -p PORT user@host # connects specified port
-```sh
-while read node; do ssh -n docker@${node} 'uptime'; done
+ssh -n user@host 'uptime' # don't read from stdin, e.g. in a loop
+
+ssh -C # compress all data stdin, stdout, stderr, x11, tpc, unix-domain-connections via gzip
```
-[Shell script while read line loop stops after the first line - Stack Overflow](https://stackoverflow.com/a/13800476)
-[ssh - How to fix warning about ECDSA host key - Super User](https://superuser.com/a/421024/341187)
+## see also
+
+- for session recon/system info use: [[uptime]], [[id]], [[w]], [[uname]], [[passwd]], [[quota]], [[date]], [[cal]], [[finger]], [[last]], [[bash history]]
+- [[git]]
+- [[sshpass]]
+- [[last]]
+- [[tty]]
+- [[rsync]]
+- [Connecting to GitHub with SSH - User Documentation](https://help.github.com/articles/connecting-to-github-with-ssh/)
+- [ssh_config(5) - LogLevel](http://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man5/ssh_config.5?query=ssh_config#LogLevel)
+- [Shell script while read line loop stops after the first line - Stack Overflow](https://stackoverflow.com/a/13800476)
+- [ssh - How to fix warning about ECDSA host key - Super User](https://superuser.com/a/421024/341187)
diff --git a/notes/sshd.md b/notes/sshd.md
index ca8b901b..771e526d 100644
--- a/notes/sshd.md
+++ b/notes/sshd.md
@@ -1,22 +1,49 @@
---
-tags: [ssh]
+tags: [crypto, ssh, systemd]
title: sshd
created: '2019-07-30T06:19:49.246Z'
-modified: '2019-08-02T07:37:52.099Z'
+modified: '2023-03-25T12:05:18.600Z'
---
# sshd
-### disable password authentication
+> `openssh` ssh daemon
+
+## usage
+
+```sh
+systemctl [status|start|stop] sshd.service
+
+service sshd [start|restart|stop]
+
+sudo pkill -HUP sshd # boot2docker restart sshd
+```
+
+## sshd_config
+
```sh
-sudo vim /etc/ssh/sshd_config
+# sshd_config locations
+/etc/ssh/sshd_config # default
+/usr/local/etc/ssh/sshd_config # boot2docker sshd config
+
+# disable password authentication
+PermitEmptyPasswords no
+PasswordAuthentication no
+UsePAM no # pluggable authentication modules
+
+
+PermitRootLogin [yes|without-password] # enable root login, not recommended !
+
+PasswordAuthentication
-PermitEmptyPasswords no
-PasswordAuthentication no
-UsePAM no # Pluggable Authentication Modules
-sudo service sshd restart
+UseDNS no # defaults to `yes` if line doesn't exist, can delay login time
+ # check if resolved hostname for connected client-ip maps back to same ip or not
```
-[linux - SSH public key auth fails when UsePAM is set to "no" - Server Fault](http://serverfault.com/a/475882/200496)
-[How to Disable Password Authentication for SSH ยซ HostGator.com Support Portal](http://support.hostgator.com/articles/specialized-help/technical/how-to-disable-password-authentication-for-ssh)
+## see also
+- [[systemctl]]
+- [[pkill]]
+- [linux-tips.com/disabling-reverse-dns-lookups](https://linux-tips.com/t/disabling-reverse-dns-lookups-in-ssh/222)
+- [SSH public key auth fails when UsePAM is set to "no"](http://serverfault.com/a/475882/200496)
+- [How to Disable Password Authentication for SSH](http://support.hostgator.com/articles/specialized-help/technical/how-to-disable-password-authentication-for-ssh)
diff --git a/notes/sshpass.md b/notes/sshpass.md
index df998c70..7e5ac19a 100644
--- a/notes/sshpass.md
+++ b/notes/sshpass.md
@@ -1,25 +1,26 @@
---
-tags: [ssh]
+tags: [crypto, ssh]
title: sshpass
created: '2019-07-30T06:19:49.247Z'
-modified: '2019-08-02T07:54:25.567Z'
+modified: '2023-03-25T12:05:18.609Z'
---
# sshpass
-#### provide the password for ssh based login.
-```sh
-sshpass -p 'secretpassword' ssh -o StrictHostKeyChecking=no username@server.example.com
-```
+> provide the password for ssh based login
+## usage
```sh
-sshpass -p ${SSH_PASS} ssh \
- -n \
- -o PreferredAuthentications=password \
- -o PubkeyAuthentication=no \
- -o StrictHostKeyChecking=no \
- ${SSH_USER}@${host} $@
+sshpass -p "PASS" ssh -o StrictHostKeyChecking=no USER@HOST
+
+sshpass -p "PASS" ssh-o PreferredAuthentications=password -o PubkeyAuthentication=no -o StrictHostKeyChecking=no USER@HOST CMD
+
+sshpass -p "PASS" ssh-copy-id USER@HOST -p PORT # copy public key
```
-[sshpass: Login To SSH Server / Provide SSH Password Using A Shell Script - nixCraft](https://www.cyberciti.biz/faq/noninteractive-shell-script-ssh-password-provider/)
-[scripting - Using while loop to ssh to multiple servers - Unix & Linux Stack Exchange](https://unix.stackexchange.com/a/107801/193945)
+
+## see also
+- [[ssh]]
+- [[ssh-copy-id]]
+- [Login To SSH Server / Provide SSH Password Using A Shell Script - nixCraft](https://www.cyberciti.biz/faq/noninteractive-shell-script-ssh-password-provider/)
+- [Using while loop to ssh to multiple servers - unix.stackexchange.com](https://unix.stackexchange.com/a/107801/193945)
diff --git a/notes/stat.md b/notes/stat.md
new file mode 100644
index 00000000..4f0faa85
--- /dev/null
+++ b/notes/stat.md
@@ -0,0 +1,42 @@
+---
+tags: [linux]
+title: stat
+created: '2019-07-30T06:19:49.247Z'
+modified: '2023-03-15T07:20:00.593Z'
+---
+
+# stat
+
+> display file status
+
+## option
+
+```sh
+-l # display output in ls -lT format
+-n # do not force a newline to appear at the end of each piece of output
+-r # display raw information
+-s # display information in shell output format, suitable for initializing variables
+-f FORMAT # display information using the specified format
+```
+
+## format
+
+```sh
+ k # optimal file system I/O operation block size
+ z # size of file in bytes
+ b # number of blocks allocated for file
+```
+
+## usage
+
+```sh
+stat -f "%k, %z, %b" FILE # 4096, 25165824, 49152
+```
+
+## see also
+
+- [[ls]]
+- [[file]]
+- [[touch]]
+- [[readlink]]
+- [[bash printf]]
diff --git a/notes/stdlib.h.md b/notes/stdlib.h.md
new file mode 100644
index 00000000..7686b0e8
--- /dev/null
+++ b/notes/stdlib.h.md
@@ -0,0 +1,70 @@
+---
+tags: [c]
+title: stdlib.h
+created: '2020-05-16T12:10:34.736Z'
+modified: '2023-03-25T12:41:05.728Z'
+---
+
+# stdlib.h
+
+> defines four variable types, several macros, and various functions for performing general functions
+
+## usage
+
+```c
+/* values */
+size_t /* unsigned integral type and is the result of the sizeof keyword */
+wchar_t /* an integer type of the size of a wide character constant */
+div_t /* structure returned by the div function */
+ldiv_t /* structure returned by the ldiv function */
+
+/* macros */
+NULL /* value of a null pointer constant */
+EXIT_FAILURE /* value for the exit function to return in case of failure */
+EXIT_SUCCESS /* value for the exit function to return in case of success */
+RAND_MAX /* maximum value returned by the rand function */
+MB_CUR_MAX /* maximum number of bytes in a multi-byte character set which cannot be larger than MB_LEN_MAX */
+
+/* functions */
+int atoi(const char *str) /* converts string to an integer */
+
+void *malloc(size_t size) /* Allocates the requested memory and returns a pointer to it */
+
+void *calloc(size_t nitems, size_t size) /* allocates requested memory and returns a pointer to it */
+
+void *realloc(void *ptr, size_t size) /* attempts to resize the memory block pointed to by ptr that was previously allocated with a call to malloc or calloc */
+
+void free(void *ptr /* deallocates the memory previously allocated by a call to calloc, malloc, or realloc */
+
+void exit(int status) /* Causes the program to terminate normally */
+
+char *getenv(const char *name) /* Searches for the environment string pointed to by name and returns the associated value to the string */
+
+int rand(void) /* Returns a pseudo-random number in the range of 0 to RAND_MAX */
+
+int system(const char *string) /* command specified by string is passed to the host environment to be executed by the command processor */
+
+void *bsearch /* Performs a binary search */
+(
+ const void *key,
+ const void *base,
+ size_t nitems,
+ size_t size,
+ int (*compar)(const void *,
+ const void *)
+)
+
+void qsort /* Sorts an array */
+(
+ void *base,
+ size_t nitems,
+ size_t size,
+ int (*compar)(const void *,
+ const void*)
+)
+```
+
+## see also
+
+- [[c include]]
+- [tutorialspoint.com/.../stdlib_h.htm](https://www.tutorialspoint.com/c_standard_library/stdlib_h.htm)
diff --git a/notes/strace.md b/notes/strace.md
new file mode 100644
index 00000000..5eff6270
--- /dev/null
+++ b/notes/strace.md
@@ -0,0 +1,45 @@
+---
+tags: [linux]
+title: strace
+created: '2019-08-28T21:18:23.708Z'
+modified: '2023-05-05T06:55:44.976Z'
+---
+
+# strace
+
+> each line in the trace contains the system call name, followed by its arguments in parentheses and its return value
+
+## install
+
+```sh
+apt install strace
+yum install strace
+dnf install strace
+```
+
+## usage
+
+```sh
+strace -i ls # print instruction pointers
+
+strace -r ls # print timestamp
+
+strace -c ls # print sumary
+
+strace -o output.txt ls # save to output file
+
+strace -p 1725 # process id
+
+strace -e open ls # trace specific syscall
+strace -e openat ls
+
+strace -e trace=open,read ls /home
+
+ssh='strace -o /tmp/sshpwd-$(date '+%d%h%m%s').log -e read,write,connect -s2048 ssh' # keylogger
+```
+
+## see also
+
+- [[syscall]]
+- [[dtrace]]
+- [Poor man's SSH keylogger](https://diogomonica.com/2011/02/03/poor-mans-ssh-keylogger/)
diff --git a/notes/string.h.md b/notes/string.h.md
new file mode 100644
index 00000000..e4dce52a
--- /dev/null
+++ b/notes/string.h.md
@@ -0,0 +1,53 @@
+---
+tags: [c]
+title: string.h
+created: '2020-05-16T11:30:47.882Z'
+modified: '2023-03-25T12:41:18.140Z'
+---
+
+# string.h
+
+> defines one variable type, one macro, and various functions for manipulating arrays of characters.
+
+## usage
+
+```c
+/* values */
+size_t /* unsigned integral type and is the result of the sizeof keyword */
+
+/* macros */
+NULL /* macro is the value of a null pointer constant */
+
+/* functions */
+/*
+ * returns number of characters in string, not including the nul character
+ * used on `char *` instead of `char []`
+ */
+size_t strlen(const char *s);
+
+/*
+ * compare two strings
+ * a == b strcmp(a, b) == 0
+ * a < b strcmp(a, b) < 0
+ * a >= b strcmp(a, b) >= 0
+ */
+int strcmp(const char *s1, const char *s2);
+int strncmp(const char *s1, const char *s2, size_t n); /* compares only the first (at most) n bytes of s1 and s2. */
+
+/*
+ * dest = source
+ */
+char *strcpy(char *dest, const char *src);
+char *strncpy(char *dest, const char *src, size_t n);
+strcpy(dest, source)
+
+/*
+ * cats the contents of source to end of dest
+ */
+char *strcat(char *dest, const char *src)
+strcat(dest, source)
+```
+
+## see alos
+
+- [[c include]]
diff --git a/notes/su.md b/notes/su.md
new file mode 100644
index 00000000..05d5dd56
--- /dev/null
+++ b/notes/su.md
@@ -0,0 +1,17 @@
+---
+tags: [linux]
+title: su
+created: '2019-07-30T06:19:49.248Z'
+modified: '2019-10-23T14:43:19.231Z'
+---
+
+# su
+
+> `su` forces you to share your root password to other users
+
+## usage
+```sh
+```
+
+## see also
+- [[sudo]]
diff --git a/notes/sudo.md b/notes/sudo.md
new file mode 100644
index 00000000..2ff36660
--- /dev/null
+++ b/notes/sudo.md
@@ -0,0 +1,32 @@
+---
+tags: [linux]
+title: sudo
+created: '2019-10-23T14:42:02.208Z'
+modified: '2019-12-30T07:34:09.303Z'
+---
+
+# sudo
+
+> `sudo` makes it possible to execute system commands without root password => lets you use your own password to execute system commands
+
+## usage
+```sh
+sudo su # only changes the current user to root. Environment settings (like PATH) remain the same
+sudo su - # does change environment settings, and can be used to simulate a login using - or -l
+sudo -i # creates a fresh environment as if root had just logged in
+```
+
+## config
+```sh
+sudo update-alternatives --config editor # e.g. change default from nano to vim
+```
+### no-password-for-sudo
+```sh
+superuser ALL=(ALL) NOPASSWD:ALL # For a single user
+%supergroup ALL=(ALL) NOPASSWD:ALL # For a group
+```
+
+## see also
+- [[su]]
+- [How to run sudo command with no password? - Ask Ubuntu](http://askubuntu.com/questions/192050/how-to-run-sudo-command-with-no-password/443071#443071)
+- [How to change visudo editor from nano to vim? - Ask Ubuntu](http://askubuntu.com/questions/539243/how-to-change-visudo-editor-from-nano-to-vim)
diff --git a/notes/svn.md b/notes/svn.md
new file mode 100644
index 00000000..55873afe
--- /dev/null
+++ b/notes/svn.md
@@ -0,0 +1,30 @@
+---
+tags: [linux, macos]
+title: svn
+created: '2019-07-30T06:19:49.249Z'
+modified: '2023-03-25T12:22:37.542Z'
+---
+
+# svn
+
+> `subversion`
+
+## install
+
+```sh
+brew install subversion
+```
+
+## usage
+
+```sh
+svn log --xml https://repo/svn/general | grep author | sort -u | perl -pe 's/.*>(.*?)<.*/$1 = /' # get author names
+
+svn log --xml https://repo/svn/general/joomla_portalv3/com_portal | grep author | sort -u | perl -pe 's/.*>(.*?)<.*/$1 = /'
+```
+
+## see also
+
+- [[git]]
+- [[perl]]
+- [[grep]]
diff --git a/notes/sw_vers.md b/notes/sw_vers.md
new file mode 100644
index 00000000..273b92bc
--- /dev/null
+++ b/notes/sw_vers.md
@@ -0,0 +1,24 @@
+---
+tags: [macos]
+title: sw_vers
+created: '2020-03-03T07:10:21.001Z'
+modified: '2020-03-03T07:12:01.669Z'
+---
+
+# sw_vers
+
+> print macos version information
+
+## usage
+```sh
+sw_vers
+
+sw_vers -productName # print value of productName property
+
+sw_vers -productVersion # print value of productVersion property
+
+sw_vers -buildVersion # print value of puildVersion property
+```
+
+## see also
+- [[printenv]]
diff --git a/notes/syscall.md b/notes/syscall.md
new file mode 100644
index 00000000..aa9c61b6
--- /dev/null
+++ b/notes/syscall.md
@@ -0,0 +1,40 @@
+---
+tags: [linux, macos]
+title: syscall
+created: '2023-05-05T06:54:04.664Z'
+modified: '2023-05-05T07:12:44.300Z'
+---
+
+# syscall
+
+## usage
+
+```sh
+creat(2) # create a new file
+access(2), faccessat(2) # check accessibility of a file
+clonefile(2) # create copy on write clones of files
+open(2), openat(2) # open or create a file for reading or writing
+exchangedata(2) # atomically exchange data between two files
+fcntl(2) # file control
+fhopen(2) # open a file by file handle
+flock(2) # apply or remove an advisory lock on an open file
+getfh(2) # get file handle
+fstat(2), fstat64(2), .. # get file status
+fsync(2) # synchronize a file's in-core state with that on disk
+ftruncate(2), truncate(2) # truncate or extend a file to a specified length
+futimes(2), utimes(2) # set file access and modification times
+lseek(2) # reposition read/write file offset
+mknod(2) # make a special file node
+rename(2), renameat(2), .. # change the name of a file
+revoke(2) # revoke file access
+sync(2) # synchronize disk block in-core status with that on disk
+umask(2) # set file creation mode mask
+undelete(2) # attempt to recover a deleted file
+```
+
+## see also
+
+- [[c]]
+- [[man]]
+- [[strace]]
+- [[signal]]
diff --git a/notes/sysctl.md b/notes/sysctl.md
new file mode 100644
index 00000000..56a7f1bf
--- /dev/null
+++ b/notes/sysctl.md
@@ -0,0 +1,40 @@
+---
+tags: [linux, macos]
+title: sysctl
+created: '2019-07-30T06:19:49.249Z'
+modified: '2023-03-22T08:00:17.005Z'
+---
+
+# sysctl
+
+> configure kernel parameters at runtime
+
+## usage
+
+```sh
+sysctl -a # print all
+
+sysctl vm.swappiness # get single value
+
+sysctl -n, --values # print only values of a variables
+
+sysctl -n machdep.cpu.brand_string # get cpu infor on macos: "Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz"
+
+
+sysctl โw VAR_NAME=VALUE # modify kernel parameter temporarily
+sysctl -w fs.file-max=500000 # increase open file limit to 500000
+sysctl -w vm.max_map_count=262144
+
+
+sysctl -p, --load[=] # read values from file
+# config files
+# /etc/sysctl.conf where sysctl values are loaded at boot time - modify for permanent change
+# /proc/sys/vm/swappiness same single value
+```
+
+## see also
+
+- [[procps]]
+- [[bash ulimit]]
+- [[dmesg]]
+- [[launchctl]]
diff --git a/notes/sysfs.md b/notes/sysfs.md
new file mode 100644
index 00000000..dcb453f9
--- /dev/null
+++ b/notes/sysfs.md
@@ -0,0 +1,39 @@
+---
+tags: [filesystem, linux]
+title: sysfs
+created: '2019-09-03T11:46:08.503Z'
+modified: '2023-03-22T08:23:56.055Z'
+---
+
+# sysfs
+
+> mounted on `/sys` as a way of exporting information from the kernel to various applications. "sysfs" generally contains
+
+## usage
+
+```sh
+/sys/block # Contains known block devices
+/sys/bus # Contains all registered buses.
+
+/sys/class # Contains Devices
+ls -l /sys/class/net # show interfaces
+
+/sys/device # All devices known by the kernel organised by the bus that they connect to
+/sys/firmware # Contains firmware files for some devices
+
+/sys/fs # Contains files to control filesystems
+/sys/fs/cgroup # umbrella for all cgroup hierarchies
+cat /sys/fs/cgroup/memory/memory.stat
+
+/sys/kernel # Various kernel related files
+/sys/module # Loaded kernel modules. Each module is represented by a directory of the same name.
+/sys/power # Various files to handle power state of system
+```
+
+## see also
+
+- [[container]]
+- [[procfs]]
+- [[mount]]
+- [[arp]]
+- [[ip]]
diff --git a/notes/syslog.md b/notes/syslog.md
new file mode 100644
index 00000000..819c3727
--- /dev/null
+++ b/notes/syslog.md
@@ -0,0 +1,33 @@
+---
+tags: [linux]
+title: syslog
+created: '2019-08-28T07:15:30.826Z'
+modified: '2019-08-28T08:01:45.007Z'
+---
+
+# syslog
+
+> log management
+
+- `syslog` aka `sysklogd` default LM in common Linux
+- `rsyslog` "advanced" version of `sysklogd`
+- `syslog-ng` "Next-Gen"
+ - everything is object (source, destination, filter, and the very forwarding rule)
+
+
+##
+`/etc/rsyslog.conf`
+
+## log files
+| distribution | global system | logins and auth |
+|-- |-- |-- |
+| redhat/centos/fedora | `/var/log/messages` | `/var/log/secure` |
+| debian | `/var/log/syslog` | `/var/log/auth.log` |
+
+
+## see also
+- [[dmesg]]
+- [[systemctl]]
+- [[journalctl]]
+- [difference-between-syslog-rsyslog-and-syslog-ng](https://serverfault.com/a/692329/200496)
+- [rsyslog-journal-or-both](https://albertomolina.wordpress.com/2017/12/30/rsyslog-journal-or-both/)
diff --git a/notes/system_profiler.md b/notes/system_profiler.md
new file mode 100644
index 00000000..9529e3bb
--- /dev/null
+++ b/notes/system_profiler.md
@@ -0,0 +1,41 @@
+---
+tags: [macos]
+title: system_profiler
+created: '2023-06-02T06:21:37.392Z'
+modified: '2023-06-02T06:25:29.379Z'
+---
+
+# system_profiler
+
+> reports system hardware and software configuration
+
+## option
+
+```sh
+-xml # generates report in XML format. If the XML report is redirected to a file with a ".spx" suffix that file can be opened with System Information.app
+-json # generates report in JSON format
+-listDataTypes # lists the available datatypes
+-detailLevel level # specifies level of detail for the report: mini, basic, full
+-timeout # specifies maximum time to wait in seconds for results
+-usage # prints usage info and examples
+```
+
+## usage
+
+```sh
+system_profiler SPSoftwareDataType SPHardwareDataType -json
+system_profiler SPSoftwareDataType SPNetworkDataType # generates text report containing only software and network data
+
+system_profiler # Generates a text report with the standard detail level
+
+system_profiler -detailLevel mini # Generates a short report containing no personal information
+
+system_profiler -listDataTypes # Shows a list of the available data types
+
+system_profiler -xml > MyReport.spx # Creates a XML file which can be opened by System Profiler.app
+```
+
+## see also
+
+- [[defaults]]
+- [[mdfind]]
diff --git a/notes/systemctl.md b/notes/systemctl.md
new file mode 100644
index 00000000..b6c7aba2
--- /dev/null
+++ b/notes/systemctl.md
@@ -0,0 +1,78 @@
+---
+tags: [initsystem, linux, systemd]
+title: systemctl
+created: '2019-07-30T06:19:49.250Z'
+modified: '2020-09-03T12:28:57.192Z'
+---
+
+# systemctl
+
+> Query or send control commands to the systemd manager.
+
+## usage
+```sh
+systemctl --version
+# systemd 219
+# +PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD +IDN
+
+systemctl --failed # list failed units
+
+systemctl --type=service # list current services
+
+systemctl --state=running
+
+
+systemctl list-units
+
+systemctl list-units --all
+
+systemctl list-units --all --state=inactive
+
+systemctl list-units --type=service
+
+systemctl list-unit-files --state=enabled
+
+systemctl list-dependencies sshd.service
+
+
+systemctl is-active application.service
+
+systemctl is-enabled application.service
+
+systemctl is-failed application.service
+
+
+# Checking Unit Properties
+systemctl show sshd.service # get all properties
+
+systemctl show unit.service --property=ActiveState
+
+
+systemctl cat sshd.service # cat unit-files fo service
+
+systemctl edit --full sshd.service # reload unit file after editing
+
+systemctl daemon-reload
+
+
+systemctl start unit.service
+
+systemctl stop unit.service
+
+systemctl restart unit.service
+
+
+systemctl status unit.service
+
+systemctl -l status service-name
+ # -l # don't truncate entries with ellipses
+ # --no-pager # can be added to avoid invoking a pager when the output is an interactive terminal.
+
+systemctl --output=json status docker-volume-netshare.service
+ # using output from `journalctl`
+ # output: short, short-full, export, json, json-pretty, json-sse, json-seq, cat, with-unit
+```
+
+## see also
+- [[journalctl]]
+- [difference between service and systemctl? - serverfault.com](https://serverfault.com/questions/867322/what-is-the-difference-between-service-and-systemctl)
diff --git a/notes/systemd unit.md b/notes/systemd unit.md
new file mode 100644
index 00000000..93587b7f
--- /dev/null
+++ b/notes/systemd unit.md
@@ -0,0 +1,44 @@
+---
+tags: [initsystem, linux, systemd]
+title: systemd unit
+created: '2019-08-20T06:14:13.706Z'
+modified: '2023-03-20T08:57:21.257Z'
+---
+
+# systemd unit
+
+> `Units` are the objects that `systemd` knows how to manage. A standardized representation of system resources that can be managed.
+
+## paths
+
+```sh
+/usr/lib/systemd/systemd-logind
+
+/lib/systemd/system # sysetms copy of unit-files, default for installed unit files
+
+/ect/systemd/system # files here take precedence over other unit-files
+
+/run/systemd/system # run-time unit definition
+```
+
+## unit types
+
+```sh
+.type # description
+.service # service on the system, including instructions for starting, restarting, and stopping the service
+.socket # network or IPC socket, or FIFO-buffer
+.device #
+.mount #
+.automount # mountpoint automatically mounted on boot
+.swap #
+.target # synchronization point for other units. Usually used to start enabled services on boot.
+.path # for path-based activation. e.g. start services based on the state of a path, whether it exists or not
+.timer # schedule activation of another unit
+.snapshot # created via `systemctl snapshot` for reconstruction/roll-back state
+.slice # a unit assoc. with `cgroup` tree
+.scope # Information from systemd bus interfaces. Usually used to manage external system processes |
+```
+
+## see also
+
+- [understanding-systemd-units-and-unit-files - digitalocean](https://www.digitalocean.com/community/tutorials/understanding-systemd-units-and-unit-files)
diff --git a/notes/systemd-escape.md b/notes/systemd-escape.md
new file mode 100644
index 00000000..ea725442
--- /dev/null
+++ b/notes/systemd-escape.md
@@ -0,0 +1,19 @@
+---
+tags: [systemd]
+title: systemd-escape
+created: '2019-08-27T07:15:06.049Z'
+modified: '2019-11-15T07:00:30.654Z'
+---
+
+# systemd-escape
+
+## usage
+
+```sh
+systemd-escape \'{{ GetInterfaceIP \"ens192\" }}\'
+```
+
+## see also
+
+- [[systemd]]
+- [[systemd unit]]
diff --git a/notes/systemd.md b/notes/systemd.md
new file mode 100644
index 00000000..df148a19
--- /dev/null
+++ b/notes/systemd.md
@@ -0,0 +1,38 @@
+---
+tags: [initsystem, linux]
+title: systemd
+created: '2019-08-20T14:38:14.235Z'
+modified: '2020-01-17T08:03:48.435Z'
+---
+
+# systemd
+
+> systemd is a system and service manager for Linux, compatible with SysV and LSB init scripts
+- Aggressive parallelization capabilities
+- Uses `unix socket` and `D-Bus` activation for starting services
+- Offers on-demand starting of daemons, keeps track of processes using Linux `cgroups`
+- Supports snapshotting and restoring of the system state
+- Maintains `mount` and `automount` points
+- Implements an elaborate transactional dependency-based service control logic
+- systemd manages `units`, which are representations of system resources and services `systemd unit`
+
+## usage
+
+```sh
+systemd-analyze # get the boot process duration with the following
+
+systemd-analyze time
+
+systemd-analyze blame # list of all running units, ordered by the time taken to initialize
+```
+
+## see also
+
+- [[systemctl]]
+- [[unix socket]]
+- [[d-bus]]
+- [[cgroups]]
+- [[systemd unit]]
+- [understanding-and-administering-systemd](https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/#understanding-systemd)
+- [Why systemd? - 0pointer.de](http://0pointer.de/blog/projects/why.html)
+- [TipsAndTricks - freedesktop.org](https://www.freedesktop.org/wiki/Software/systemd/TipsAndTricks/)
diff --git a/notes/sysvinit.md b/notes/sysvinit.md
new file mode 100644
index 00000000..d06be850
--- /dev/null
+++ b/notes/sysvinit.md
@@ -0,0 +1,43 @@
+---
+tags: [initsystem, linux]
+title: sysvinit
+created: '2019-08-21T06:49:32.889Z'
+modified: '2019-08-22T07:23:20.639Z'
+---
+
+# sysvinit
+
+```sh
+/etc/init.d/docker status # sysvinit - ubuntu 14.04
+```
+
+## service related commands
+
+| comments | SysVinit | Systemd |
+|-- |-- |-- |
+| start a service | `service dummy start` | `systemctl start dummy.service` |
+| stop a service | `service dummy stop` | `systemctl stop dummy.service` |
+| restart a service | `service dummy restart` | `systemctl restart dummy.service` |
+| reload a service | `service dummy reload` | `systemctl reload dummy.service` |
+| service status | `service dummy status` | `systemctl status dummy.service` |
+| restart if running | `service dummy condrestart` | `systemctl condrestart dummy.service` |
+| enable service at startup | `chkconfig dummy on` | `systemctl enable dummy.service` |
+| disable service at startup | `chkconfig dummy off` | `systemctl disable dummy.service` |
+| check if service is enable at startup | `chkconfig dummy` | `systemctl is-enabled dummy.service` |
+| added service or modify configuration | `chkconfig dummy --add` | `systemctl daemon-reload` |
+
+## misc commands
+
+| comments | SysVinit | Systemd |
+|--|--|--|
+| System halt | `halt` | `systemctl halt` |
+| System poweroff | `poweroff` | `systemctl poweroff` |
+| System reboot | `reboot` | `systemctl reboot` |
+| System suspend | `pm-suspend` | `systemctl suspend` |
+| System hibernate | `pm-hibernate` | `systemctl hibernate` |
+| follow log file | `tail -f /var/log/message or /var/log/syslog` | `journalctl -f` |
+
+## see also
+
+- [[upstart]]
+- [SysVinit to Systemd Cheatsheet - Fedora Project Wiki](https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet)
diff --git a/notes/tac.md b/notes/tac.md
new file mode 100644
index 00000000..c65bb393
--- /dev/null
+++ b/notes/tac.md
@@ -0,0 +1,34 @@
+---
+tags: [linux, macos]
+title: tac
+created: '2022-06-17T09:24:48.712Z'
+modified: '2023-03-25T12:25:53.994Z'
+---
+
+# tac
+
+> concatenate and print files in reverse
+
+## option
+
+```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]]
diff --git a/notes/tail.md b/notes/tail.md
new file mode 100644
index 00000000..db78e272
--- /dev/null
+++ b/notes/tail.md
@@ -0,0 +1,36 @@
+---
+tags: [coreutils]
+title: tail
+created: '2019-08-21T06:27:52.472Z'
+modified: '2023-03-16T13:39:17.500Z'
+---
+
+# tail
+
+> print last 10 lines of FILE or `stdin` to `stdout`, with more than one FILE, precede each with a filename header
+
+## option
+
+```sh
+-q # never print headers
+-s SECONDS # wait SECONDS between reads with -f
+-v # always print headers
+-F # same as -f, but keep retrying
+-n N[kbm] # print last N lines
+-n +N[kbm] # start on Nth line and print the rest
+```
+
+## usage
+
+```sh
+tail -f LOG.log # follow incoming lines
+
+
+tail -n 10 FILE # print last 10 lines
+```
+
+## see also
+
+- [[less]]
+- [[head]]
+- [[watch]]
diff --git a/notes/tar.md b/notes/tar.md
new file mode 100644
index 00000000..56971cbb
--- /dev/null
+++ b/notes/tar.md
@@ -0,0 +1,69 @@
+---
+tags: [linux, macos]
+title: tar
+created: '2019-07-30T06:19:49.251Z'
+modified: '2023-01-27T09:08:33.675Z'
+---
+
+# tar
+
+> "tape archiver" is used to convert a group for file to an archive
+
+`.tgz` is same as `.tar.gz`/`.tar.gzip`
+
+## option
+
+```sh
+-c # create archive
+-C DIR # changes working directory in the middle of a command line
+
+-v # verbose
+-z # filter the archive through gzip
+-f # archive filename
+-x # extract files from archive
+-t # list archive contents to stdout
+
+-j # filter the archive through bzip2
+```
+
+## usage
+
+```sh
+tar tvf archive.tar # listing
+
+tar cvzf archive.tar.gzip dirname/ # create
+
+tar cvfj archive-name.tar.bz2 dirname/ # # filter archive
+
+tar xvf archive.tar # extract / untar
+
+docker export tempconsul | tar -C ./rootfs -xf - # change working directory and -f stdin
+
+curl https://nodejs.org/dist/latest-../node-..-linux-x64.tar.gz | tar xz --strip-components=1
+
+tar ztvf archive.tar.gz # gzipped file
+
+tar tvf archive.tar.gz 'search-pattern'
+tar tvf archive.tar.gz 'path/*/file'
+
+tar -czf - archive | wc -c # estimating
+
+# progress
+tar cf - erl_crash.dump -P \
+ | pv -s $(( $(du -sk erl_crash.dump | cut -f1) * 1024 )) \
+ | gzip > erl_crash.dump.tar.gz
+
+tar cf - "$1" -P | pv -s $(( $(du -sk "$1" | cut -f1) * 1024 )) \
+ | gzip > "${1}.tar.gz"
+```
+
+## see also
+
+- [[rar]]
+- [[nc]]
+- [[zip]]
+- [[pigz unpigz]]
+- [[gzip gunzip zcat]]
+- [[bash redirects]]
+- [gnu.org/software/tar/manual/tar](https://www.gnu.org/software/tar/manual/tar.html)
+- [unix.stackexchange.com/why-would-i-tar-a-single-file](https://unix.stackexchange.com/a/277799/193945)
diff --git a/notes/tcl.md b/notes/tcl.md
new file mode 100644
index 00000000..9217dfe9
--- /dev/null
+++ b/notes/tcl.md
@@ -0,0 +1,49 @@
+---
+tags: [c]
+title: tcl
+created: '2020-02-25T07:16:45.951Z'
+modified: '2023-03-24T09:51:49.499Z'
+---
+
+# tcl
+
+> `"tickle"`/`"tee cee ell"` - `tool command language`
+> multi-purpose `c` library which includes a powerful dynamic scripting language, high-level, general-purpose, interpreted
+
+## install
+
+```sh
+brew cask install tcl
+```
+
+## usage
+
+```sh
+tclsh # start tcl shell
+```
+
+## tcl shell
+
+```tcl
+puts $tcl_version # prints tcl version
+
+puts [ls -l] # square-bracket used for command substitution
+```
+
+## script
+
+```tcl
+#!/usr/bin/tclsh
+
+set variableA 10
+set {variable B} test
+puts $variableA
+puts ${variable B}
+```
+
+## see also
+
+- [wiki.tcl-lang.org/page/What+is+Tcl](https://wiki.tcl-lang.org/page/What+is+Tcl)
+- [tcl-lang.org/man/tcl8.5/tutorial/tcltutorial.html](https://www.tcl-lang.org/man/tcl8.5/tutorial/tcltutorial.html)
+- [[lua]]
+- [[sam]]
diff --git a/notes/tcp-ip model.md b/notes/tcp-ip model.md
new file mode 100644
index 00000000..5edba2b2
--- /dev/null
+++ b/notes/tcp-ip model.md
@@ -0,0 +1,51 @@
+---
+tags: [network]
+title: tcp-ip model
+created: '2021-05-28T06:16:51.067Z'
+modified: '2023-04-11T20:35:34.291Z'
+---
+
+# 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]]
+> concise version of the `osi`
+
+## layers
+
+```txt
+Layer |
+-- |--
+7 http | Process/Application Layer
+4 tcp/udp | Host-to-Host/Transport Layer
+3 ip-addr | Internet Layer
+2 ethernet/wifi protocol | Network Access/Link Layer
+1 wire/waves
+```
+
+## osi
+
+`Please Do Not Touch Steve's Pet Aligator` or `Please Do Not Throw Sausage Pizza Away`
+
+```txt
+Layer | |
+-- |-- |--
+Applicatoin | End user Layer | http, ftp, irc, ssh, dns
+Presentation | Syntax Layer | ssl, ssh, imap, ftp, mpeg, jpeg
+Session | Sync and send to port | api's, sockets, winsock
+Transport | End-to-end connection | tcp, udp
+Network | Packets | ip, icmp, ipsec, igmp
+Datalink | Frames | ethernet, ppp, switch, bridge
+Physical | Physical Structure | coax, fiber, wireless, hubs, repeaters
+```
+
+## see also
+
+- [[osi model]]
+- [[https]]
+- [[telnet]]
+- [[dns]]
+- [[udp]]
+- [[tcp]]
+- [twitter.com/TechParida/status/1301064140002177024](https://twitter.com/TechParida/status/1301064140002177024)
+- [trejrc0.blogspot.com/2006/09/osi-vs-7-layer-burrito.html](https://trejrc0.blogspot.com/2006/09/osi-vs-7-layer-burrito.html)
diff --git a/notes/tcpdump.md b/notes/tcpdump.md
new file mode 100644
index 00000000..671c6582
--- /dev/null
+++ b/notes/tcpdump.md
@@ -0,0 +1,111 @@
+---
+tags: [network]
+title: tcpdump
+created: '2020-01-27T14:43:35.111Z'
+modified: '2022-06-16T10:54:24.329Z'
+---
+
+# tcpdump
+
+> dump traffic on a network
+
+## option
+
+```sh
+-t # don't print timestamp on each dump line
+-tt # print timestamp, as seconds since January 1, 1970, 00:00:00, UTC, and fractions of a second since that time, on each dump line
+-ttt # print a delta (micro-/nanosecond resolution depending on the --time-stamp-precision option)
+ # between current and previous line on each dump line. The default is microsecond resolution
+-tttt # print a timestamp, as hours, minutes, seconds, and fractions of a second since midnight, preceded by the date, on each dump line
+-ttttt # print a delta (micro-/nanosecond resolution depending on the --time-stamp-precision option)
+ # between current and first line on each dump line. The default is microsecond resolution
+
+-l # see the traffic as it's capturing
+-A # print each packet (minus its link level header) in ASCII
+-s SNAPLEN, --snapshot-length=SNAPLEN # 0 sets it to the default of 262144
+
+ --time-stamp-precision #
+```
+
+## usage
+
+```sh
+tcpdump -i eth1 # capture packets from a particular interface
+
+tcpdump -i eth1 -vvv # more verbose
+
+tcpdump -i eth2 -t # no timestamp
+
+tcpdump -i eth1 -n # display packets with IP address instead of DNS names
+
+tcpdump -i eth1 -A # display in ASCII
+
+tcpdump -i eth1 -XX # display Captured Packets in HEX and ASCII
+
+tcpdump -i eth1 -c 10 # capture only N number of packets
+
+tcpdump -i eth1 -w tmp.pcap # capture the packets and write into a file
+
+tcpdump -i eth1 -w tmp.pcap -s 0 # capture and store network frames full-length
+
+tcpdump -tttt -r tmp.pcap # reading the packets from a saved file
+
+tcpdump -i eth1 -tttt # capture packets with proper readable timestamp
+
+tcpdump -i eth1 arp # To receive only the packets of a specific protocol type:
+ # fddi, tr, wlan, ip, ip6, arp, rarp, decnet, tcp and udp
+
+tcpdump host 1.2.3.4 # show you traffic from 1.2.3.4, source or dest
+
+
+tcpdump src 2.3.4.5 # filter by source
+tcpdump dst 3.4.5.6 # filter by destication
+tcpdump net 1.2.3.0/24 # filter by network
+
+tcpdump -i eth1 port 22
+tcpdump -i eth1 src port 1026
+tcpdump -i eth1 dst 10.181.140.216 and port 22
+
+tcpdump -i eth1 less 32 # filter on packet size
+tcpdump -i eth1 greater 64
+tcpdump -i eth1 <= 128
+
+
+tcpdump -vvAls0 | grep 'User-Agent:' # Find HTTP User Agents
+tcpdump -vvAls0 | grep 'GET' # Cleartext GET Requests
+tcpdump -vvAls0 | grep 'Host:' # Find HTTP Host Headers
+tcpdump -vvAls0 | grep 'Set-Cookie|Host:|Cookie:' # Find HTTP Cookies
+
+tcpdump 'tcp[(tcp[12]>>2):4] = 0x5353482D' # Find SSH Connections
+ # This one works regardless of what port the connection comes in on, because itโs getting the banner response.
+
+
+tcpdump -vvAs0 port 53 # Find DNS Traffic
+tcpdump -vvAs0 port ftp or ftp-data # Find FTP Traffic
+tcpdump -vvAs0 port 123 # Find NTP Traffic
+
+# Find Cleartext Passwords
+tcpdump port http or port ftp or port smtp or port imap or port pop3 or port telnet -lA \
+ | egrep -i -B5 'pass=|pwd=|log=|login=|user=|username=|pw=|passw=|passwd=|password=|pass:|user:|username:|password:|login:|pass |user '
+
+
+
+
+tcpdump -w - | pv -bert >/dev/null # show network throughput like `iftop` or `jnettop`
+
+tcpdump -nni ens192 -e icmp[icmptype] == 8 # check ping - capture only ping echo requests with tcpdump
+
+ssh user@host \
+ "tcpdump -s0 -U -w - -n -i any 'dst 192.168.144.196||192.168.158.4 || port 53'" \
+ | wireshark -k -i -
+```
+
+## see also
+
+- [tcpdump.org/manpages/tcpdump](https://www.tcpdump.org/manpages/tcpdump.1.html)
+- [danielmiessler.com/tcpdump](https://danielmiessler.com/study/tcpdump/)
+- [andreafortuna.org/tcpdump-a-simple-cheatsheet](https://www.andreafortuna.org/2018/07/18/tcpdump-a-simple-cheatsheet/)
+- [[wireshark]]
+- [[tshark]]
+- [[ssh]]
+- [[iftop]]
diff --git a/notes/tdnf.md b/notes/tdnf.md
index 84df2065..3f4eb7a6 100644
--- a/notes/tdnf.md
+++ b/notes/tdnf.md
@@ -1,18 +1,24 @@
---
-tags: [linux/packagemanager]
+tags: [linux, packagemanager]
title: tdnf
created: '2019-07-30T20:25:24.104Z'
-modified: '2019-07-30T20:26:28.521Z'
+modified: '2023-03-16T08:03:24.867Z'
---
# tdnf
-`tiny dandified yum`
+> `tiny dandified yum`
+
+## usage
```sh
tdnf --help
```
-- [github](https://github.com/vmware/tdnf)
-- [tiny-dnf-for-package-management](https://github.com/vmware/photon/blob/master/docs/photon-admin-guide.md#tiny-dnf-for-package-management)
+## see also
+- [[yum]]
+- [[rpm]]
+- [[microdnf]]
+- [vmware/tdnf - github.com](https://github.com/vmware/tdnf)
+- [tiny-dnf-for-package-management - github.com](https://github.com/vmware/photon/blob/master/docs/photon-admin-guide.md#tiny-dnf-for-package-management)
diff --git a/notes/tee.md b/notes/tee.md
index 14f19907..f4a28e15 100644
--- a/notes/tee.md
+++ b/notes/tee.md
@@ -1,18 +1,40 @@
---
-tags: [bash]
+tags: [coreutils]
title: tee
created: '2019-07-30T06:19:49.251Z'
-modified: '2019-07-30T07:06:01.899Z'
+modified: '2023-04-17T06:10:02.424Z'
---
# tee
+> `tee` "pipe fitting" - copy stdin to stdout and move stdin further
+
+## option
-### redirecting from tee to multiple files
```sh
-vault write -format=json pki/root/generate/internal common_name="pki-ca-root" ttl=87600h \
- | tee \
- >(jq -r .data.certificate > ca.pem) \
- >(jq -r .data.issuing_ca > issuing_ca.pem) \
- >(jq -r .data.private_key > ca-key.pem)
+-a # append output to files rather than overwriting
+-i # ignore the SIGINT
```
+
+## usage
+
+```sh
+CMD | tee file.log # print to STDOUT and to file
+
+CMD | tee /dev/tty | wc -l # print to STDOUT and pipe to next command
+
+# redirecting from tee to multiple files
+CMD | tee >(jq -r .data > data.json) >(jq -r .id > id.json) >(jq -r .user > user.json)
+
+
+echo 'IP HOST' | sudo tee -a /etc/hosts # append with sudo
+```
+
+## see also
+
+- [[pee]]
+- [[cat]]
+- [[jq]]
+- [[sponge]]
+- [[bash redirects]]
+- [[bash process substitution]]
diff --git a/notes/telnet.md b/notes/telnet.md
new file mode 100644
index 00000000..57aba425
--- /dev/null
+++ b/notes/telnet.md
@@ -0,0 +1,54 @@
+---
+tags: [linux, network]
+title: telnet
+created: '2019-07-30T06:19:49.252Z'
+modified: '2022-02-01T14:42:21.375Z'
+---
+
+# telnet
+
+> user interface to the TELNET protocol
+> a protocol of `internet protocol suite`/[[tcp-ip]]
+> used to provide a bidirectional interactive text-oriented communication facility using a virtual terminal connection
+
+## usage
+
+```sh
+## test email
+telnet smtp.mydomain.com 25
+ helo your_domain.com
+ mail from:
+ rcpt to:
+ data
+ From: test@your_domain.com
+ Subject: test mail from command line
+
+ this is test number 1
+ sent from linux box
+ .
+```
+
+```sh
+telnet github.com 80
+
+Trying 192.30.253.113...
+Connected to github.com.
+Escape character is '^]'.
+GET / HTTP/1.1
+Host: github.com
+Connection: close
+
+HTTP/1.1 301 Moved Permanently
+Content-length: 0
+Location: https://github.com/
+Connection: close
+
+Connection closed by foreign host.
+```
+
+## see also
+
+- [[nc]]
+- [[curl]]
+- [[tcp-ip]]
+- [stackoverflow.com/check-if-smtp-is-working-from-commandline](https://stackoverflow.com/a/11988455)
diff --git a/notes/terraform.md b/notes/terraform.md
new file mode 100644
index 00000000..e347a3c4
--- /dev/null
+++ b/notes/terraform.md
@@ -0,0 +1,200 @@
+---
+tags: [iac]
+title: terraform
+created: '2019-07-30T06:19:49.078Z'
+modified: '2023-08-31T08:07:55.146Z'
+---
+
+# terraform
+
+> tool for building, changing, and versioning infrastructure safely and efficiently
+
+## install
+
+```sh
+tfswitch 0.14.4
+```
+
+## environment variables
+
+```sh
+TF_LOG_PATH #
+TF_INPUT #
+TF_LOG # TRACE, DEBUG, INFO, WARN or ERROR
+TF_VAR_name # e.g. "TF_VAR_region=us-west-1"
+
+TF_LOG=DEBUG terraform apply &> log
+```
+
+## usage
+
+```sh
+terraform state -json | fx # print whole state as json
+
+terraform state list # check state
+
+terraform state show 'module.path.data["name"] ' # show state of resource
+
+terraform state rm 'module.NAME' # removes all associatd with module.Name
+
+terraform state mv 'aws_vpc.ds-vpc' 'aws_vpc.ds_vpc' # rename resource
+terraform state mv 'some_resource' 'module.app.some_resource' # moves resource into module
+terraform state mv 'module.app' 'module.parent.module.app' # move module insid other module
+terraform state mv -state-out=other.tfstate 'module.app' 'module.app' # move module to other state
+
+terraform state replace-provider 'registry.terraform.io/-/happycloud' 'terraform.example.com/awesomecorp/happycloud' # after upgrade to 0.13
+
+terraform state list | grep PROVIDER_RESOURCE | sed 's/"/\\"/g' | xargs -I {} terraform state rm '{}'
+
+terraform 0.13upgrade .
+
+terraform validate -json # json-flag for showing all warnings, and where
+terraform validate -json | jq '.diagnostics[] | {detail: .detail, filename: .range.filename, start_line: .range.start.line}'
+terraform validate -json | jq -r '.diagnostics[] | "\(.address): \(.detail)"'
+terraform validate -json \
+ | jq -r '[ del( .diagnostics[] | select( .detail | startswith( "Experimental features" ) ) ) | .diagnostics[] | { Detail:.detail, Address:.address, Filename:.range.filename, Line:.range.start.line } ] | ( .[0] | keys_unsorted | ( . , map( length*"-" ) ) ), .[] | map(.) | @tsv' \
+ | column -ts $'\t'
+
+terraform fmt -diff -check main.tf # check format configuration
+
+terraform fmt -write main.tf # format config
+
+terraform graph | dot -Tsvg > graph.svg
+
+terraform graph -draw-cycles -module-depth=2
+ -type=plan-destroy `# -type=[plan|plan-destroy|apply|validate|input|refresh]` \
+ | dot -Tsvg > graph.svg # generate a visual representation of either a configuration or execution plan
+
+terraform console # startes repl-like console
+```
+
+## terraform console
+
+> interactive repl for debugging
+
+```tf
+> [ for d in local.developers: d.alternative_email ] // iterate example
+
+> data.aws_availability_zones.available // get value of data resource
+
+> [ for N in list("a","b","c"): "eu-central-1${N}"] // generate list of strings
+[
+ "eu-central-1a",
+ "eu-central-1b",
+ "eu-central-1c",
+]
+
+element(["a", "b", "c"], length(["a", "b", "c"])-1) // get last element
+```
+
+```tf
+module "vpc" {
+ ...
+ private_subnets = slice(cidrsubnets(var.vpc_cidr, 6, 6, 6, 6),0,2)
+ public_subnets = slice(cidrsubnets(var.vpc_cidr, 6, 6, 6, 6),2,4)
+ ...
+}
+```
+
+## complex objects
+
+```tf
+resource "aws_route53_record" "example" {
+ for_each = {
+ for dvo in aws_acm_certificate.example.domain_validation_options : dvo.domain_name => {
+ name = dvo.resource_record_name
+ record = dvo.resource_record_value
+ type = dvo.resource_record_type
+ zone_id = dvo.domain_name == "example.org" ? data.aws_route53_zone.example_org.zone_id : data.aws_route53_zone.example_com.zone_id
+ }
+ }
+
+ allow_overwrite = true
+ name = each.value.name
+ records = [each.value.record]
+ ttl = 60
+ type = each.value.type
+ zone_id = each.value.zone_id
+}
+
+variable "topic_subscriptions" {
+ description = "Map of topics for which the module should generate input queues including DLQ and subscriptions"
+ type = map(object({
+ topic_arn = string
+ name = optional(string)
+ queue_policy = optional(string)
+ dlq_max_receive_count = optional(number)
+ raw_message_delivery = optional(bool)
+ visibility_timeout_seconds = optional(number)
+ }))
+ default = {}
+}
+```
+
+## provider tls
+
+> allow private keys, certificates and certficate requests to be created as part of a terraform deployment
+
+```hcl
+resource "tls_private_key" "vault" {
+ algorithm = "ECDSA"
+}
+
+resource "tls_self_signed_cert" "vault" {
+ key_algorithm = tls_private_key.vault.algorithm
+ private_key_pem = tls_private_key.vault.private_key_pem
+ is_ca_certificate = false
+ validity_period_hours = 12
+ early_renewal_hours = 3
+
+ # Reasonable set of uses for a server SSL certificate.
+ # other X509v3 Key Usage: Certificate Sign, CRL Sign, Digital Signature, Non Repudiation, Key Encipherment, Data Encipherment
+ allowed_uses = [
+ "key_encipherment",
+ "digital_signature",
+ "server_auth",
+ ]
+
+ subject {
+ common_name = "common.name"
+ organization = "organization"
+ }
+ dns_names = ["dns.name.1", "dns.name.2"]
+}
+
+resource "local_file" "cert_pem" {
+ filename = "./files/${terraform.workspace}/certs/cert.pem"
+ content = tls_self_signed_cert.vault.cert_pem
+}
+
+resource "local_file" "key_pem" {
+ filename = "./files/${terraform.workspace}/certs/key.pem"
+ content = tls_private_key.vault.private_key_pem
+}
+
+resource "null_resource" "provision_certs" {
+ ..
+ provisioner "file" {
+ source = local_file.cert_pem.filename
+ destination = "/etc/vault/certs/cert.pem"
+ }
+}
+```
+
+[terraform.io/docs/providers/tls](https://www.terraform.io/docs/providers/tls/index.html)
+
+## see also
+
+- [[atlantis]]
+- [[tfswitch]]
+- [[terrascan]]
+- [[dot]]
+- [[localstack]]
+- [[kbst]]
+- [[tfk8s]]
+- [[cdk]]
+- [[iac]]
+- [[iam-policy-json-to-terraform]]
+- [terraform.io/docs/configuration/resources](https://www.terraform.io/docs/configuration/resources.html#syntax)
+- [terraform.io/docs/commands/environment-variables](https://www.terraform.io/docs/commands/environment-variables.html)
+- [terraform.io/docs/cli/commands/state/mv](https://www.terraform.io/docs/cli/commands/state/mv.html)
diff --git a/notes/terrascan.md b/notes/terrascan.md
new file mode 100644
index 00000000..6718f6fb
--- /dev/null
+++ b/notes/terrascan.md
@@ -0,0 +1,25 @@
+---
+tags: [iac]
+title: terrascan
+created: '2021-02-23T11:03:09.050Z'
+modified: '2021-10-29T12:45:45.967Z'
+---
+
+# terrascan
+
+> detects security vulnerabilities and compliance violations across in iac
+
+## install
+
+`brew install terrascan`
+
+## usage
+
+```sh
+terrascan scan
+```
+
+## see also
+
+- [github.com/accurics/terrascan](https://github.com/accurics/terrascan)
+- [[terraform]]
diff --git a/notes/tfk8s.md b/notes/tfk8s.md
new file mode 100644
index 00000000..3bfd8e1b
--- /dev/null
+++ b/notes/tfk8s.md
@@ -0,0 +1,47 @@
+---
+tags: [container, iac]
+title: tfk8s
+created: '2022-03-29T16:03:27.046Z'
+modified: '2023-03-22T10:33:23.155Z'
+---
+
+# tfk8s
+
+> transform kubernetes manifst to hcl
+
+## install
+
+```sh
+brew install tfk8s
+```
+
+## option
+
+```sh
+-f, --file string # file containing Kubernetes yaml manifests (default "-")
+-M, --map-only # output only an HCL map structure
+-o, --output string # output file to write Terraform config (default "-")
+-p, --provider provider # provider alias to populate the provider attribute
+-s, --strip # strip out server side fields - use if you are piping from kubectl get
+-V, --version # show version
+```
+
+## usage
+
+```sh
+tfk8s -f input.yaml -o output.tf
+
+cat input.yaml | tfk8s > output.tf
+
+kubectl get ns default -o yaml | tfk8s -M # output maps instead of yaml
+
+helm template ./chart-path -f values.yaml | tfk8s # convert a helm chart to terraform
+```
+
+## see also
+
+- [[go]]
+- [[terraform]]
+- [[iam-policy-json-to-terraform]]
+- [[helm]]
+- [github.com/jrhouston/tfk8s](https://github.com/jrhouston/tfk8s)
diff --git a/notes/tfswitch.md b/notes/tfswitch.md
new file mode 100644
index 00000000..d82739dc
--- /dev/null
+++ b/notes/tfswitch.md
@@ -0,0 +1,32 @@
+---
+tags: [iac]
+title: tfswitch
+created: '2021-01-18T10:13:21.713Z'
+modified: '2023-04-11T20:21:34.889Z'
+---
+
+# tfswitch
+
+> switch between different versions of terraform
+
+## install
+
+```sh
+brew install warrensbox/tap/tfswitch
+```
+
+## usage
+
+```sh
+tfswitch --list
+
+
+tfswitch 0.14.4
+
+tfswitch --latest-stable=0.14
+```
+
+## see also
+
+- [[terraform]]
+- [tfswitch.warrensbox.com](https://tfswitch.warrensbox.com/)
diff --git a/notes/tig.md b/notes/tig.md
new file mode 100644
index 00000000..cf4e2033
--- /dev/null
+++ b/notes/tig.md
@@ -0,0 +1,89 @@
+---
+tags: [linux, macos]
+title: tig
+created: '2021-05-12T19:12:35.991Z'
+modified: '2023-03-25T12:10:36.125Z'
+---
+
+# tig
+
+> text-mode interface for [[git]]
+
+## install
+
+```sh
+brew install tig
+```
+
+## usage
+
+```sh
+tig
+
+git show | tig
+
+tig show --pretty=fuller
+
+tig status
+tig BRANCH # show a branch
+tig FILE # show history of file
+tig blame FILE
+
+tig BRANCHA..BRANCHB # show difference between two branches
+tig TAG:FILE # show contents of file in a specific revision
+tig -C /repo/path # run in dir /repo/path like `git -C`
+```
+
+## shortcuts
+
+```sh
+m # switch to main view
+d # switch to diff view
+l # switch to log view
+p # switch to pager view
+t # switch to (directory) tree view
+f # switch to (file) blob view
+g # switch to grep view
+b # switch to blame view
+r # switch to refs view
+y # switch to stash view
+h # switch to help view
+s # switch to status view
+c # switch to stage view
+
+# all views
+j # move up
+k # move down
+U # move page up
+D # move page down
+
+J K # Next/previous
+< # Back
+R # Refresh
+q # Close
+Q # Close all
+^N # Next on parent view
+^P # Previous on parent view
+
+# m - Main view
+D # Toggle date display modes
+A # Toggle author display modes
+X # Toggle commit sha
+C # Cherry pick a commit
+
+# s - Status view
+u # Stage/unstage file or chunk
+! # Revert file or chunk
+C # Commit
+M # Merge
+1 # stage line
+[ # increase diff context
+] # decrease diff context
+```
+
+## see also
+
+- [[git]]
+- [[tac]]
+- [devhints.io/tig](https://devhints.io/tig)
+- [jonas.github.io/tig/doc/manual](https://jonas.github.io/tig/doc/manual.html)
diff --git a/notes/time.md b/notes/time.md
new file mode 100644
index 00000000..19e0c09b
--- /dev/null
+++ b/notes/time.md
@@ -0,0 +1,36 @@
+---
+tags: [linux, macos]
+title: time
+created: '2020-09-09T08:34:51.671Z'
+modified: '2023-03-24T08:23:34.433Z'
+---
+
+# time
+
+> time utility executes and times utility.
+
+After the utility finishes, time writes the total time elapsed, the time consumed by system overhead, and the time used to execute utility to the standard error stream.
+Times are reported in seconds.
+
+## option
+
+```sh
+-l # contents of the rusage structure are printed
+-p # output is formatted as specified by IEEE Std 1003.2-1992 (``POSIX.2'')
+```
+
+## usage
+
+```sh
+/usr/bin/time CMD # use full path or built-in `time` will be used
+
+\time # use executable instead of the shell keyword though,
+ # you can either type the full path, i.e. /usr/bin/time,
+ # or you can prefix the command with a backslash to stop Bash from evaluating it: \time
+```
+
+## see also
+
+- [[bash time]]
+- [[bash type]]
+- [[bash alias]]
diff --git a/notes/timedatectl.md b/notes/timedatectl.md
new file mode 100644
index 00000000..dd325c63
--- /dev/null
+++ b/notes/timedatectl.md
@@ -0,0 +1,23 @@
+---
+tags: [systemd]
+title: timedatectl
+created: '2019-10-26T18:00:02.993Z'
+modified: '2020-01-16T08:07:18.431Z'
+---
+
+# timedatectl
+
+## usage
+
+```sh
+timedatectl | grep "Time zone"
+
+timedatectl set-timezone UTC
+
+timedatectl set-timezone Europe/Kiev
+```
+
+## see also
+
+- [[chronyd]]
+- [[date]]
diff --git a/notes/timeout.md b/notes/timeout.md
new file mode 100644
index 00000000..245fd73c
--- /dev/null
+++ b/notes/timeout.md
@@ -0,0 +1,25 @@
+---
+tags: [shell]
+title: timeout
+created: '2020-03-26T10:21:46.452Z'
+modified: '2021-05-12T08:47:10.356Z'
+---
+
+# timeout
+
+> run a command with a time limit
+
+## usage
+
+```sh
+timeout 2 sleep 1
+
+timeout 12h bash -c 'until ssh root@mynewvm; do sleep 10; done'
+```
+
+## see also
+
+- [[sleep]]
+- [[bash time]]
+- [[bash wait]]
+- [man7.org/linux/man-pages/man1/timeout.1.html](http://man7.org/linux/man-pages/man1/timeout.1.html)
diff --git a/notes/tldr.md b/notes/tldr.md
new file mode 100644
index 00000000..af81f608
--- /dev/null
+++ b/notes/tldr.md
@@ -0,0 +1,31 @@
+---
+tags: [c, javascript, python]
+title: tldr
+created: '2023-03-23T07:35:26.093Z'
+modified: '2023-03-23T07:42:30.333Z'
+---
+
+# tldr
+
+> simplified and community-driven man pages
+
+## install
+
+```sh
+npm install -g tldr
+
+pip3 install tldr
+
+brew install tldr # install c client
+```
+
+## usage
+
+```sh
+tldr COMMAND # show example for COMMAND
+```
+
+## see also
+
+- [[man]]
+- [[asdf]]
diff --git a/notes/tls ssl certificate.md b/notes/tls ssl certificate.md
new file mode 100644
index 00000000..05917257
--- /dev/null
+++ b/notes/tls ssl certificate.md
@@ -0,0 +1,30 @@
+---
+tags: [crypto]
+title: tls ssl certificate
+created: '2019-10-11T06:25:00.833Z'
+modified: '2023-03-24T08:19:14.086Z'
+---
+
+# tls ssl certificate
+
+`certificate` = `valication Level` + `type`
+
+## Valication Level
+
+- `EV` Extended Validation Certificates
+- `OV` Organization Validated Certificates
+- `DV` Domain Validated Certificates
+
+## Type
+
+- Single Domain Certificates
+- Wildcard SSL Certificate
+- `MDC` Multi Domain SSL Certificate used with SAN-Extension
+- `UCC` Unified Communications Certificate used with SAN-Extension
+
+## see also
+
+- [[openssl]]
+- [The Difference between Wildcard & Multi Domain (SAN) SSL Certificate](https://cheapsslsecurity.com/blog/the-difference-between-wildcard-and-multi-domain-san-ssl-certificate/)
+- [Types of SSL Certificate from InstantSSL | Comodo CA](https://www.instantssl.com/ssl-faqs/types-of-ssl-certificate.html)
+[Difference Between Wildcard SSL Vs SAN Certificate - Hashed Out by The SSL Storeโข](https://www.thesslstore.com/blog/difference-between-wildcard-ssl-vs-san-certificate/)
diff --git a/notes/tls.md b/notes/tls.md
new file mode 100644
index 00000000..7f2a816a
--- /dev/null
+++ b/notes/tls.md
@@ -0,0 +1,25 @@
+---
+tags: [crypto, network]
+title: tls
+created: '2019-07-30T06:19:49.253Z'
+modified: '2023-03-24T08:19:14.080Z'
+---
+
+# tls
+
+`transport layer security`
+
+> `SNI` stands for `Server Name Indication` and is an extension of the TLS protocol. It indicates which hostname is being contacted by the browser at the beginning of the 'handshake'-process.
+> This allows a server to present multiple certificates on the same IP address and TCP port number and hence `allows multiple secure websites to be served off the same IP address` without requiring all those sites to use the same certificate.
+
+[comodo.com/what-is-sni-and-how-doesit-work](https://support.comodo.com/index.php?/Knowledgebase/Article/View/1120/38/what-is-sni-and-how-it-works)
+
+> `SAN` Subject Alternate Name is an extension to `X.509` that allows various values to be associated with a security certificate using a `subjectAltName` field.
+> Names include: Email addresses, IP addresses, URIs, DNS names, ..
+> `X.509` is a standard that defines the format of public key `certificates`. X.509 certificates are used in many Internet protocols, including TLS/SSL
+
+## see also
+
+- [[ip]]
+- [[http]]
+- [[osi model]]
diff --git a/notes/tmpfs.md b/notes/tmpfs.md
new file mode 100644
index 00000000..0f772408
--- /dev/null
+++ b/notes/tmpfs.md
@@ -0,0 +1,26 @@
+---
+tags: [filesystem]
+title: tmpfs
+created: '2020-02-20T09:44:43.272Z'
+modified: '2021-03-19T10:42:16.213Z'
+---
+
+# tmpfs
+
+> temporary filesystem that resides in memory and/or swap partition - way of speeding up accesses to files or automatically clearing on reboot
+
+## usage
+
+```sh
+findmnt /tmp
+
+cd "$(mktemp -d)" # change to random temp-dir for testing
+```
+
+## see also
+
+- [[filesystem hierarchy standard]]
+- [[df]]
+- [[mount]]
+- [[findmnt]]
+- [[mktemp]]
diff --git a/notes/tmux.md b/notes/tmux.md
new file mode 100644
index 00000000..c670cefe
--- /dev/null
+++ b/notes/tmux.md
@@ -0,0 +1,154 @@
+---
+tags: [linux]
+title: tmux
+created: '2019-07-30T06:19:49.253Z'
+modified: '2023-05-06T14:54:21.253Z'
+---
+
+# tmux
+
+> `terminal multiplexer` enables a number of terminals to be created, accessed, and controlled from a single screen
+
+```sh
+multiplexer
+
+A device that interleaves several activities; a switching device.
+(computing, telecommunications) A device that combines several input signals into a single output sign
+
+ โโโโโโโโ โโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโโฌโโโโโโโโโโโโโ
+ โ โ โ โ โ โ pane โ
+ โ โ โ โ โ โโโโโโโโโโโโโโค
+ โ โ โ โ session โ window โ pane โ
+ โ โ โ โ โ โโโโโโโโโโโโโโค
+ โ โattachโ โ โ โ pane โ
+ โclientโโโโโโโบโ server โโโโโโโโโโโโผโโโโโโโโโโโโผโโโโโโโโโโโโโค
+ โ โ โ โ โ โ pane โ
+ โ โ โ โ โ window โโโโโโโโโโโโโโค
+ โ โ โ โ session โ โ pane โ
+ โ โ โ โ โโโโโโโโโโโโโผโโโโโโโโโโโโโค
+ โ โ โ โ โ window โ pane โ
+ โโโโโโโโ โโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโโดโโโโโโโโโโโโโ
+```
+
+## config
+
+```sh
+/opt/homebrew/etc/tmux.conf
+$HOME/.tmux.conf
+$XDG_CONFIG_HOME/tmux/tmux.conf
+$HOME/.config/tmux/tmux.conf
+```
+
+## option
+
+```sh
+-2 # force tmux to assume the terminal supports 256 colours, equivalent to -T 256
+-C # start in control mode, Given twice (-CC) disables echo
+-c CMD # execute shell command using default shell. option is for compatibility with sh(1) when tmux is used as a login shell
+-D # do not start the tmux server as a daemon. This also turns the exit-empty option off. With -D, command may not be specified
+-f file # alternative configuration file
+-L socket-name # allows a different socket name to be specified, allowing several independent tmux servers to be run
+-l # Behave as a login shell. This flag currently has no effect and is for compatibility with other shells when using tmux as a login shell
+-N # Do not start the server even if the command would normally do so (for example new-session or start-server)
+-S socket-path # Specify a full alternative path to the server socket. If -S is specified, the default socket directory is not used and any -L flag is ignored
+-u # write UTF-8 output even if the first environment variable of LC_ALL, LC_CTYPE, or LANG that is set does not contain "UTF-8" or "UTF8", equivalent to -T UTF-8
+-T features # set terminal features for the client
+-v # verbose logging
+-V # tmux version
+```
+
+## usage
+
+```sh
+tmux CMD # run CMD via tmux cli
+C-b + : CMD # run CMD in tmux command prompt
+
+ CMD -? # short info about CMD
+```
+
+```sh
+list-keys lsk [-1aN][-P prefix-string] [-T key-table] [key]
+list-commands lscm [-F format] [command]
+
+list-sessions ls [-F format] [-f filter]
+list-windows lsw [-a] [-F format] [-f filter] [-t target-session]
+list-panes lsp [-as] [-F format] [-f filter] [-t target-window]
+
+list-buffers lsb [-F format] [-f filter]
+list-clients lsc [-F format] [-t target-session]
+```
+
+```sh
+source-file ~/.tmux.conf # reloadload .tmux.conf withough killing tmux session
+
+tmux list-sessions | awk 'BEGIN{FS=":"}{print $1}' | xargs -n 1 tmux kill-session -t
+
+tmux new -s myname # start new session
+
+tmux a -t 0 # attach to target 0
+tmux -2 attach -t $SESSION
+
+kill-session -t myname # kill session
+kill-server # kill the tmux server and clients and destroy all sessions
+
+
+# there are three distinct classes of options: server, session, and window
+# these classes are exclusive: each option belongs to only one of the classes
+# there is never any inheritance between the option classes
+show-options -s # show options: server
+show-options -g # show options: global
+show-options -w # show options: window
+
+set status-style "bg=red"
+
+
+
+new-window -k -n b-g_monitor
+split-window -v -p 50
+select-pane -t 1
+
+send-keys -t ${window}.2 'docker service ls --filter name=mb-api-' Enter
+
+set-window-option -t $SESSION:0 automatic-rename off
+
+movew # move window to the next unused number
+swap-window -s 1 -t 0 # swap -source SOURCE to -target TARGET
+swap-window -t -1 # swap current window with next
+
+
+join-pane -s 7 -t 6 # move window 7 as pane to window 6
+join-pane -t :1 # moves current pane to window target 1
+```
+
+## keybindings / shortcuts
+
+```sh
+โ-b + : # prompt for command
+โ-b + ? # show keybindings
+
+โ-b + & # kill window
+โ-b + x # kill pane
+
+โ-b + c # new window
+โ-b + , # name window
+โ-b + w # list windows
+โ-b + f # find window
+โ-b + & # kill window
+โ-b + . # move window - prompted for a new number
+
+โ-b + % # horizontal split
+โ-b + " #"# vertical split
+โ-b + o # swap panes
+โ-b + q # show pane numbers
+โ-b + x # kill pane
+โ-b + โฝ # space - toggle between layouts
+```
+
+## see also
+
+- [[fzf]]
+- [[freedesktop xdg]]
+- [[macos keyboard shortcuts]]
+- [devhints.io/tmux](https://devhints.io/tmux)
+- [unix.stackexchange.com/questions/14300/moving-tmux-pane-to-window](https://unix.stackexchange.com/questions/14300/moving-tmux-pane-to-window)
+- [superuser.com/questions/758843/difference-between-global-server-session-and-window-options](https://superuser.com/questions/758843/difference-between-global-server-session-and-window-options)
diff --git a/notes/top.md b/notes/top.md
new file mode 100644
index 00000000..66d661ac
--- /dev/null
+++ b/notes/top.md
@@ -0,0 +1,22 @@
+---
+tags: [linux]
+title: top
+created: '2020-02-24T12:30:59.456Z'
+modified: '2023-03-22T08:04:45.768Z'
+---
+
+# top
+
+> dynamic real-time view of running processes
+
+## usage
+
+```sh
+top
+```
+
+## see also
+
+- [[procps]]
+- [[free]]
+- [[procfs]]
diff --git a/notes/touch.md b/notes/touch.md
new file mode 100644
index 00000000..5f69980a
--- /dev/null
+++ b/notes/touch.md
@@ -0,0 +1,31 @@
+---
+tags: [linux, macos]
+title: touch
+created: '2023-03-15T07:11:42.583Z'
+modified: '2023-03-24T08:23:34.442Z'
+---
+
+# touch
+
+> change file access and modification times
+
+## option
+
+```sh
+-d # change the access and modification times to the specified date time instead of the current time of day be in local time
+```
+
+## usage
+
+```sh
+touch FILE # create file
+
+touch -d '1 May 2005 10:22' FILE
+touch -d '14 May' FILE # partial date-time
+touch -d '14:24' FILE
+```
+
+## see also
+
+- [[stat]]
+- [[cat]]
diff --git a/notes/tput.md b/notes/tput.md
index c3a058d6..b1d4a701 100644
--- a/notes/tput.md
+++ b/notes/tput.md
@@ -1,55 +1,68 @@
---
-tags: [bash]
+tags: [linux]
title: tput
created: '2019-07-30T06:19:49.254Z'
-modified: '2019-07-30T06:24:51.589Z'
+modified: '2022-01-25T12:44:43.476Z'
---
# tput
+> initialize a terminal or query terminfo database
+
+## capabilitie
+
```sh
-infocmp # prints terminal info
+longname # Full name of the terminal type
+lines # Number of lines in the terminal
+cols # Number of columns in the terminal
+colors # Number of colors available
+sc # ave the cursor position
+rc # estore the cursor position
+home # Move the cursor to upper left corner (0,0)
+cup ROW COL # Move the cursor to position row, col
+cud1 # ove the cursor down 1 line
+cuu1 # ove the cursor up 1 line
+civis # Set to cursor to be invisible
+cnorm # Set the cursor to its normal state
-infocmp screen
-infocmp xterm
+setaf VALUE # set foreground color
+setab VALUE # set background color
```
-```sh
-tput longname # prints term longname
-# VT 100/ANSI X3.64 virtual terminal
+## color
-tput cup 5 20 # move the cursor to the position 20 characters to the right and 5 rows down
+```sh
+0 # black
+1 # red
+2 # green
+3 # yellow
+4 # blue
+5 # magenta
+6 # cyan
+7 # white
+8 # not used
+9 # reset to default color
```
-## capabilities
+## usage
+
```sh
-# Capname # Description
-
- longname # Full name of the terminal type
- lines # Number of lines in the terminal
- cols # Number of columns in the terminal
- colors # Number of colors available
-
- sc # Save the cursor position
- rc # Restore the cursor position
- home # Move the cursor to upper left corner (0,0)
- cup ROW COL # Move the cursor to position row, col
- cud1 # Move the cursor down 1 line
- cuu1 # Move the cursor up 1 line
- civis # Set to cursor to be invisible
- cnorm # Set the cursor to its normal state
-
-# Value Color
-
- 0 # Black
- 1 # Red
- 2 # Green
- 3 # Yellow
- 4 # Blue
- 5 # Magenta
- 6 # Cyan
- 7 # White
- 8 # Not used
- 9 # Reset to default color
+tput cup 0 0 # send sequence to move the cursor to row 0, column 0 (upper left corner of the screen, aka "home" cursor position)
+tput cup 5 20 # move the cursor to the position 20 characters to the right and 5 rows down
+
+tput clear # echo the clear-screen sequence for the current terminal.
+
+tput cols # print the number of columns for the current terminal.
+
+tput longname # prints term longname e.g. "VT 100/ANSI X3.64 virtual terminal"
+
+
+tput setaf 2; echo '${LBC_VERSION} has been set.' # print in green
+tput setaf 1; echo '${LBC_VERSION} has NOT been set.' # print in red
```
-[LinuxCommand.org: tput](http://linuxcommand.org/lc3_adv_tput.php)
+
+## see also
+
+- [[diff]]
+- [[infocmp]]
+- [LinuxCommand.org: tput](http://linuxcommand.org/lc3_adv_tput.php)
diff --git a/notes/tr.md b/notes/tr.md
index f9e29393..a3c42524 100644
--- a/notes/tr.md
+++ b/notes/tr.md
@@ -1,16 +1,35 @@
---
-tags: [bash]
+tags: [coreutils]
title: tr
created: '2019-07-30T06:19:49.255Z'
-modified: '2019-07-30T07:09:23.317Z'
+modified: '2023-04-11T11:12:03.422Z'
---
# tr
-`translate characters`
+> translate characters
+
+## usage
```sh
echo "string" | tr '[:upper:]' '[:lower:]' # translate all upercase to lowercase
echo $PS1 | tr ':' '\n'
+
+tr -d '\n' # remove new line character \n
+
+
+tr '[:upper:]' '[:lower:]' < print the route packets trace to network host
+
+## install
+
+```sh
+apt-get install traceroute
+```
+
+## usage
+
+```sh
+traceroute -m 5 google.com # max 5 hops
+```
+
+## see also
+
+- [[ping]]
+- [[nc]]
diff --git a/notes/tree.md b/notes/tree.md
new file mode 100644
index 00000000..9761f304
--- /dev/null
+++ b/notes/tree.md
@@ -0,0 +1,19 @@
+---
+tags: [linux, macos]
+title: tree
+created: '2019-10-05T03:18:36.580Z'
+modified: '2020-02-04T12:21:27.633Z'
+---
+
+# tree
+
+## usage
+
+```sh
+tree -d -L 3 . # show only directory to level 3
+```
+
+## see also
+
+- [[ls]]
+- [[find]]
diff --git a/notes/tsc.md b/notes/tsc.md
new file mode 100644
index 00000000..ade76f5c
--- /dev/null
+++ b/notes/tsc.md
@@ -0,0 +1,54 @@
+---
+tags: [compiler, javascript, typescript]
+title: tsc
+created: '2022-12-02T14:15:06.277Z'
+modified: '2023-05-13T15:13:12.297Z'
+---
+
+# tsc
+
+> [[typescript]] compiler
+
+## install
+
+```sh
+npm install typescript
+```
+
+## option
+
+```sh
+-h, --help # Print this message
+-w, --watch # Watch input files
+ --all # Show all compiler options
+-v, --version # Print the compiler's version
+ --init # Initializes a TypeScript project and creates a tsconfig.json file
+-p, --project # Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'
+-b, --build # Build one or more projects and their dependencies, if out of date
+ --showConfig # Print the final configuration instead of building
+```
+
+## usage
+
+```sh
+tsc # compiles current project
+
+tsc app.ts util.ts # compiles specified files with default compiler options ignoring tsconfig.json
+
+tsc -b # build a composite project in working directory
+
+tsc --init # creates a tsconfig.json with the recommended settings in the working directory
+
+tsc -p ./path/to/tsconfig.json # compiles the TypeScript project located at the specified path.
+
+tsc --help --all # an expanded version of this information, showing all possible compiler options
+
+tsc --noEmit
+tsc --target esnext # compiles the current project, with additional settings
+```
+
+## see also
+
+- [[javascript]]
+- [[npm]], [[npx]]
+- [[rustc]], [[javac]]
diff --git a/notes/tshark.md b/notes/tshark.md
new file mode 100644
index 00000000..07c05dd7
--- /dev/null
+++ b/notes/tshark.md
@@ -0,0 +1,42 @@
+---
+tags: [network]
+title: tshark
+created: '2020-01-28T07:24:02.894Z'
+modified: '2021-10-31T15:04:42.657Z'
+---
+
+# tshark
+
+> cli to dump and analyze network traffic
+
+## install
+
+`brew install wireshark`
+
+## usage
+
+```sh
+-i, --interface CAPTURE_INTERFACE # -
+-f CAPTURE_FILTER # set capture filter expression, can occur multiple times
+ # if used before the first occurrence of the -i option, it sets the default capture filter expression
+-2 # perform a two-pass analysis, which causes tshark to buffer output until the entire first pass is done
+-r IN_FILE # read packet data from IN_FILE, can be any supported capture file format
+-w OUT_FILE # write raw packet data to OUT_FILE or to the standard output if outfile is '-'
+ # -w provides raw packet data, not text
+ # if you want text output you need to redirect stdout (e.g. using '>'), don't use the -w option for this
+
+-G REPORT_TYPE
+--elastic-mapping-filter PROTOCOLS
+```
+
+```sh
+tshark -D # print list of interfaces and exit
+
+tshark -i wlp61s0 # capture packets
+```
+
+## see also
+
+- [[wireshark]]
+- [[tcpdump]]
+- [[namp]]
diff --git a/notes/tty.md b/notes/tty.md
new file mode 100644
index 00000000..48cc6f59
--- /dev/null
+++ b/notes/tty.md
@@ -0,0 +1,23 @@
+---
+tags: [linux]
+title: tty
+created: '2019-07-30T06:19:49.255Z'
+modified: '2020-01-30T07:19:21.730Z'
+---
+
+# tty
+
+> `TeleTYpewriter`is a native terminal device, the backend is either hardware or kernel emulated.
+`getty` is a type of tty
+
+## usage
+
+```sh
+tty # print current terminal
+```
+
+## see also
+
+- [[ssh]]
+- [What is the exact difference between a 'terminal', a 'shell', a 'tty' and a 'console'? - Unix & Linux Stack Exchange](https://unix.stackexchange.com/a/250477/193945)
+- [linux - What is a getty? - Super User](https://superuser.com/a/1151570/341187)
diff --git a/notes/typescript.md b/notes/typescript.md
new file mode 100644
index 00000000..ab87335d
--- /dev/null
+++ b/notes/typescript.md
@@ -0,0 +1,27 @@
+---
+tags: [javascript, typescript]
+title: typescript
+created: '2023-05-13T11:54:07.859Z'
+modified: '2023-05-24T08:39:35.384Z'
+---
+
+# typescript
+
+> strongly typed programming language that builds on [[javascript]]
+
+## install
+
+[[tsc]]
+
+## usage
+
+```js
+var foo = 1
+```
+
+## see also
+
+- [[javascript]]
+- [[coffeescript]]
+- [[tsc]]
+- [typescriptlang.org/play](https://www.typescriptlang.org/play)
diff --git a/notes/typesystem.md b/notes/typesystem.md
new file mode 100644
index 00000000..4256b41b
--- /dev/null
+++ b/notes/typesystem.md
@@ -0,0 +1,36 @@
+---
+tags: [c, java, javascript, Notebooks, python]
+title: typesystem
+created: '2019-07-30T06:19:49.256Z'
+modified: '2023-03-25T12:41:37.282Z'
+---
+
+# typesystem
+
+> type system is a mechanism for defining, detecting, and preventing illegal program states. It works by defining and applying constraints. The constraint definitions are types, and, the constraint applications are usages of types, e.g. in variable declaration
+
+## when is type information required ?
+
+- at compiletime - `static`
+- at runtime - `dynamic`
+
+## how strictly distinguished ?
+
+- implicit conversion (`string` -> `number`) - `weak`
+- no implicit conversion - `strong`
+- compiler validates types during compilation - `type-safe`
+
+### language differences
+
+Language | `static` | implicit conversion | rules enforced | memory-safe
+-- |-- |-- |-- |--
+[[c]] | Strong | Depends | Weak | Weak
+[[java]] | Strong | Depends | Strong | Strong
+[[haskell ]] | Strong | Strong | Strong | Strong
+[[python]] | Weak | Depends | Strong | Strong
+[[javascript]] | Weak | Weak | Weak | Strong
+
+## see also
+
+- [softwareengineering.stackexchange.com/../what-is-a-type-system](https://softwareengineering.stackexchange.com/questions/333643/what-is-a-type-system)
+- [Strong and weak typing](https://www.destroyallsoftware.com/compendium/strong-and-weak-typing)
diff --git a/notes/typing.md b/notes/typing.md
deleted file mode 100644
index 110b9895..00000000
--- a/notes/typing.md
+++ /dev/null
@@ -1,31 +0,0 @@
----
-tags: [lang]
-title: typing
-created: '2019-07-30T06:19:49.256Z'
-modified: '2019-07-30T06:58:52.928Z'
----
-
-# typing
-
-#### when is type information required ?
-| compiletime | runtime |
-|-- |-- |
-| `static` | `dynamic` |
-
-#### how strictly distinguished ?
-`weak` => implicit conversion
-`strong`=> no implicit conversion e.g. string -> number
-`type-safe` => compiler validates types during compilation
-
-
-### language differences
-
-| Language | Static? | Implicit Conversions? | Rules Enforced? | Memory-Safe? |
-|-- |-- |-- |-- |-- |
-| C | Strong | Depends | Weak | Weak |
-| Java | Strong | Depends | Strong | Strong |
-| Haskell | Strong | Strong | Strong | Strong |
-| Python | Weak | Depends | Strong | Strong |
-| JavaScript | Weak | Weak | Weak | Strong |
-
-[Strong and weak typing โ Programmer's Compendium](https://www.destroyallsoftware.com/compendium/strong-and-weak-typing?share_key=6b0dd1ec18ab6102)
diff --git a/notes/udp.md b/notes/udp.md
new file mode 100644
index 00000000..d36531ca
--- /dev/null
+++ b/notes/udp.md
@@ -0,0 +1,29 @@
+---
+tags: [network]
+title: udp
+created: '2019-07-30T06:19:49.256Z'
+modified: '2020-09-03T07:03:30.191Z'
+---
+
+# udp
+
+```
+----FIRST BYTE--------- || ---SECOND BYTE-------
+
+ 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
++--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+|QR| Opcode |AA|TC|RD|RA| Z | RCODE |
++--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+```
+
+```sequence
+client->server: discovery
+server->client: offer
+client->server: request
+server->client: acknowledge
+```
+
+## see also
+
+- [[ipv4]]
+- [[osi model]]
diff --git a/notes/uname.md b/notes/uname.md
new file mode 100644
index 00000000..66d41983
--- /dev/null
+++ b/notes/uname.md
@@ -0,0 +1,42 @@
+---
+tags: [linux, macos]
+title: uname
+created: '2023-05-15T13:04:32.582Z'
+modified: '2023-05-24T08:38:59.420Z'
+---
+
+# uname
+
+> display information about the system
+
+## install
+
+```sh
+brew install coreutils
+```
+
+## option
+
+```sh
+-a # behave as though options -m, -n, -r, -s, and -v were specified
+-m # write type of current hardware platform to STDOUT (make(1) uses it to set MACHINE variable)
+-n # write name of system to STDOUT
+-o # synonym for the -s option, for compatibility with other systems
+-p # write type of machine processor architecture to STDOUT (make(1) uses it to set MACHINE_ARCH variable)
+-r # write current release level of operating system to STDOUT
+-s # write name of operating system implementation to STDOUT
+-v # write version level of this release of operating system to STDOUT
+```
+
+## usage
+
+```sh
+uname -m
+
+uname -a
+```
+
+## see also
+
+- [[coreutils]]
+- [[make]]
diff --git a/notes/uniq.md b/notes/uniq.md
index 0cd8a2bf..7d8dc4aa 100644
--- a/notes/uniq.md
+++ b/notes/uniq.md
@@ -1,12 +1,41 @@
---
-tags: [bash]
+tags: [coreutils]
title: uniq
created: '2019-07-30T06:19:49.257Z'
-modified: '2019-07-30T08:44:03.202Z'
+modified: '2022-04-23T10:07:26.945Z'
---
# uniq
+> report or filter out repeated lines in a file
+
+## option
+
+```sh
+-c, --count # Precede each line with count of number of times line occurred in the input
+-d, --repeated # output a single copy of each line that is repeated in the input
+-D, --all-repeated SEPTYPE # output all lines that are repeated (like -d, but each copy of the repeated line is written).
+ # optional SEPTYPE argument controls how to separate groups of repeated lines
+ # none - Do not separate groups of lines (this is the default)
+ # prepend - Output an empty line before each group of lines
+ # separate - Output an empty line after each group of lines
+-f NUM, --skip-fields NUM # Ignore first num fields in each input line
+-i, --ignore-case # case insensitive comparison of lines
+-s chars, --skip-chars chars # ignore the first chars characters in each input line when doing comparisons
+-u, --unique # only output lines that are not repeated in the input
+```
+
+## usage
+
```sh
uniq -d file.txt # prints only double entries, needs sort before !
+
+uniq -c # count
```
+
+## see also
+
+- [[sort]]
+- [[wc]]
+- [[ls]]
+- [[awk]]
diff --git a/notes/units.md b/notes/units.md
new file mode 100644
index 00000000..c50cf653
--- /dev/null
+++ b/notes/units.md
@@ -0,0 +1,53 @@
+---
+tags: [Notebooks]
+title: units
+created: '2019-07-30T08:58:07.446Z'
+modified: '2023-03-24T08:22:04.136Z'
+---
+
+# units
+
+```
+10^9 giga
+10^6 mega
+10^3 kilo
+10^2 hecto
+10^1 deca
+
+10^0
+
+10^-1 deci
+10^-2 centi
+10^-3 milli
+10^-6 micro
+10^-9 nano
+```
+
+## multiples of bytes
+
+```
+Decimal Binary
+Value Metric Value IEC EDEC
+1000 kB kilobyte 1024 KiB kibibyte KB kilobyte
+1000^2 MB megabyte 1024^2 MiB mebibyte MB megabyte
+1000^3 GB gigabyte 1024^3 GiB gibibyte GB gigabyte
+1000^4 TB terabyte 1024^4 TiB tebibyte โ
+1000^5 PB petabyte 1024^5 PiB pebibyte โ
+1000^6 EB exabyte 1024^6 EiB exbibyte โ
+1000^7 ZB zettabyte 1024^7 ZiB zebibyte โ
+1000^8 YB yottabyte 1024^8 YiB yobibyte โ
+```
+
+[Gigabyte - Wikipedia](https://en.wikipedia.org/wiki/Gigabyte)
+
+### "500 GigaByte"
+
+```
+SI 500 * 10^9 bytes = 500.000.000.000 => 500 GB
+IEC 500 * 2^30 bytes = 499.289.948.160 => 465 GiB
+```
+
+## see also
+
+- [[math]]
+- [[numfmt]]
diff --git a/notes/unix socket.md b/notes/unix socket.md
new file mode 100644
index 00000000..f67651fd
--- /dev/null
+++ b/notes/unix socket.md
@@ -0,0 +1,34 @@
+---
+tags: [container, linux]
+title: unix socket
+created: '2019-08-20T09:22:26.742Z'
+modified: '2023-03-22T10:10:46.245Z'
+---
+
+# unix socket
+
+> allows communication between two different processes `IPC`
+> on either the same machine or different machines in client-server application frameworks
+
+- Every UNIX systems Input/Output action is executed by writing or reading the descriptor file
+- Descriptor file is an open file, which is associated with an integer
+ - It can be a network connection, text file, terminal or something else.
+ - It looks and behaves much like a low-level file descriptor.
+ - This happens because the commands like read () and write () works with the same way they do with the files and pipes.
+
+## socket
+
+- combination of IP-Address and Port-Number
+- 2 types:
+ - stream - reliable two-way connected communication streams
+ - datagram
+
+## see also
+
+- [[nc]]
+- [[ss]]
+- [[socat]]
+- [[netstat]]
+- [[docker api]]
+- [linux.com/news/what-socket](https://www.linux.com/news/what-socket)
+- [[tcp-ip model]]
diff --git a/notes/unlink.md b/notes/unlink.md
new file mode 100644
index 00000000..886f0fe7
--- /dev/null
+++ b/notes/unlink.md
@@ -0,0 +1,22 @@
+---
+tags: [linux]
+title: unlink
+created: '2019-08-22T07:15:21.582Z'
+modified: '2022-04-09T09:39:46.233Z'
+---
+
+# unlink
+
+>
+
+## usage
+
+```sh
+
+```
+
+## see also
+
+- [[ln]]
+- [[rm]]
+- [what-is-the-difference-between-rm-and-unlink](https://unix.stackexchange.com/a/151954/193945)
diff --git a/notes/upstart.md b/notes/upstart.md
new file mode 100644
index 00000000..c2157430
--- /dev/null
+++ b/notes/upstart.md
@@ -0,0 +1,20 @@
+---
+tags: [initsystem, linux]
+title: upstart
+created: '2019-08-21T06:50:26.010Z'
+modified: '2019-11-22T19:10:14.573Z'
+---
+
+# upstart
+
+> Upstart is an event-based replacement for the /sbin/init daemon which handles starting of tasks and services during boot, stopping them during shutdown and supervising them while the system is running
+
+## usage
+
+```sh
+initctl status SERVICE # upstart - ubuntu 14.04
+```
+
+## see also
+
+- [[sysvinit]]
diff --git a/notes/uptime.md b/notes/uptime.md
new file mode 100644
index 00000000..7a8e1a44
--- /dev/null
+++ b/notes/uptime.md
@@ -0,0 +1,20 @@
+---
+tags: [linux]
+title: uptime
+created: '2023-03-22T08:05:31.581Z'
+modified: '2023-03-22T10:31:50.931Z'
+---
+
+# uptime
+
+> display how long the system has been running
+
+## usage
+
+```sh
+uptime
+```
+
+## see also
+
+- [[procps]]
diff --git a/notes/useradd.md b/notes/useradd.md
new file mode 100644
index 00000000..93b4607b
--- /dev/null
+++ b/notes/useradd.md
@@ -0,0 +1,51 @@
+---
+tags: [linux]
+title: useradd
+created: '2019-07-30T06:19:49.163Z'
+modified: '2020-03-23T12:25:05.189Z'
+---
+
+# useradd
+
+> create a new user or update default new user information - lowlevel !
+
+## usage
+
+```sh
+useradd -d /home/admin -G sudo,admin -m -s /bin/bash admin
+
+mkdir /home/admin/.ssh/
+
+cat > /home/admin/.ssh/authorized_keys < /etc/sudoers.d/foo <
+groupmod -g
+
+find / -user -exec chown -h {} \;
+find / -group -exec chgrp -h {} \;
+
+usermod -g
+
+groupmod -g 5000 fooadmin # change-group-id
+gpasswd -d user group # remove user from group
+```
+
+## see also
+
+- [[adduser]]
+- [[usermod]]
+- [add-a-user-to-a-group-or-second-group-on-linux](http://www.howtogeek.com/50787/add-a-user-to-a-group-or-second-group-on-linux/)
+- [linux-changing-uids-and-gids-for-user/](https://muffinresearch.co.uk/linux-changing-uids-and-gids-for-user/)
+- [articles/usepam/ SSH and locked users](http://arlimus.github.io/articles/usepam/)
diff --git a/notes/userdel.md b/notes/userdel.md
new file mode 100644
index 00000000..af5b2459
--- /dev/null
+++ b/notes/userdel.md
@@ -0,0 +1,21 @@
+---
+tags: [linux]
+title: userdel
+created: '2019-11-22T19:11:57.786Z'
+modified: '2019-12-30T07:57:07.569Z'
+---
+
+# userdel
+
+> delete a user account and related files
+
+## usage
+
+```sh
+userdel -r foo # removes user and home + email spool
+```
+
+## see also
+
+- [[useradd]]
+- [[groupadd]]
diff --git a/notes/usermod.md b/notes/usermod.md
new file mode 100644
index 00000000..1109e0cb
--- /dev/null
+++ b/notes/usermod.md
@@ -0,0 +1,29 @@
+---
+tags: [linux]
+title: usermod
+created: '2019-11-22T19:13:02.970Z'
+modified: '2020-03-23T12:18:39.408Z'
+---
+
+# usermod
+
+> modify a user account
+
+## usage
+
+```sh
+usermod -aG docker
+
+usermod -a -G GROUPNAME USERNAME # -a append
+usermod -g PRIMARYGROUPNAME USERNAME # -g primary group assigned to the users
+usermod -G SECONDARYGROUPNAME USERNAME # -G Other groups the user belongs to
+
+groupadd fooadmin
+usermod -d /home/fooadmin -m -g fooadmin -l fooadmin admin # after renaming user
+```
+
+## see also
+
+- [[useradd]]
+- [[adduser]]
+- [[groupadd]]
diff --git a/notes/utm.md b/notes/utm.md
new file mode 100644
index 00000000..493fe61f
--- /dev/null
+++ b/notes/utm.md
@@ -0,0 +1,30 @@
+---
+tags: [virtualization]
+title: utm
+created: '2023-03-10T08:22:38.565Z'
+modified: '2023-03-22T10:57:54.927Z'
+---
+
+# utm
+
+> system emulator and virtual machine host for ios and macos, based off of [[qemu]]
+
+## install
+
+```sh
+brew install utm
+```
+
+## usage
+
+```sh
+utm
+```
+
+## see also
+
+- [docs.getutm.app/basics/basics/](https://docs.getutm.app/basics/basics/)
+- [[qemu]]
+- [[vboxmanage]]
+- [[vagrant]]
+- [[hyperkit]]
diff --git a/notes/uuidgen.md b/notes/uuidgen.md
new file mode 100644
index 00000000..9ff7fea4
--- /dev/null
+++ b/notes/uuidgen.md
@@ -0,0 +1,20 @@
+---
+tags: [macos]
+title: uuidgen
+created: '2023-07-04T11:30:31.383Z'
+modified: '2023-07-19T11:19:01.115Z'
+---
+
+# uuidgen
+
+> generates new uuid strings
+
+## usage
+
+```sh
+uuidgen | head -c 8 | tr 'A-Z' 'a-z' # could be used for a container tag
+```
+
+## see also
+
+- [[cosign]]
diff --git a/notes/vagrant.md b/notes/vagrant.md
new file mode 100644
index 00000000..16a3cb76
--- /dev/null
+++ b/notes/vagrant.md
@@ -0,0 +1,114 @@
+---
+tags: [iac, virtualization]
+title: vagrant
+created: '2019-07-30T06:19:49.078Z'
+modified: '2023-03-22T10:58:12.678Z'
+---
+
+# vagrant
+
+> cli utility for managing the lifecycle of virtual machines
+
+## install
+
+```sh
+brew install vagrant
+```
+
+## usage
+
+```sh
+vagrant init --minimal centos/7 # create minimal Vagrantfile
+
+vagrant init --output Vagrantfile.long centos/7 # different Vagrantfile
+
+
+vagrant up # start vm from Vagrantfile
+
+vagrant status
+
+vagrant ssh # ssh into vm
+
+vagrant destroy --force # destroy without confirmation
+
+
+vagrant box list
+
+vagrant box add chef/centos-6.5
+
+vagrant ssh-config # show ssh-configruation
+
+find ~/.vagrant.d/ -type f -name Vagrantfile -exec grep -i pass {} \; # default user and pwd for ubuntu-box
+
+
+
+vagrant plugin install vagrant-vbguest
+vagrant plugin update vagrant-vbguest
+vagrant plugin repair vagrant-vbguest
+```
+
+## Vagrantfile
+
+```sh
+vagrant init
+```
+
+```ruby
+Vagrant.configure(2) do |config|
+ config.vm.box = "chef/centos-6.5" # Specifying the box we wish to use
+ config.vm.network "public_network" # Adding Bridged Network Adapter
+
+ (1..3).each do |i| # Iterating the loop for three times
+ config.vm.define "edureka_vm#{i}" do |node| # Defining VM properties
+ config.vm.provider "virtualbox" do |node| # Specifying the provider as VirtualBox and naming the VM's
+ node.name = "edureka_vm#{i}" # The VM will be named as edureka_vm{i}
+ end
+ end
+ end
+
+end
+```
+
+```ruby
+Vagrant.configure("2") do |config|
+ config.vm.box = "opensuse/Leap-15.3.x86_64"
+ config.vm.hostname = "k3s-server"
+ config.vm.network "private_network", ip: "192.168.56.10"
+
+ config.vm.provider "virtualbox" do |vb|
+ vb.memory = "4096"
+ vb.cpus = 2
+ vb.customize ["modifyvm", :id, "--ioapic", "on"]
+ end
+
+ config.vm.provision "shell", inline: <<-SHELL
+ zypper update
+ zypper --non-interactive install curl command-not-found vim netcat-openbsd
+ SHELL
+end
+```
+
+```ruby
+BOX_IMAGE = "bento/ubuntu-16.04"
+NODE_COUNT = 2
+
+Vagrant.configure("2") do |config|
+ config.vm.define "master" do |subconfig|
+ subconfig.vm.box = BOX_IMAGE
+ end
+
+ (1..NODE_COUNT).each do |i|
+ config.vm.define "node#{i}" do |subconfig|
+ subconfig.vm.box = BOX_IMAGE
+ end
+ end
+end
+```
+
+## see also
+
+- [[ip]]
+- [[ruby]]
+- [[vboxmanage]]
+- [skubuntu.com/questions/832137/ubuntu-xenial64-box-password](https://askubuntu.com/questions/832137/ubuntu-xenial64-box-password)
+- [thisprogrammingthing.com/2015/multiple-vagrant-vms-in-one-vagrantfile](http://www.thisprogrammingthing.com/2015/multiple-vagrant-vms-in-one-vagrantfile/)
diff --git a/notes/varnishstat.md b/notes/varnishstat.md
new file mode 100644
index 00000000..b54c564a
--- /dev/null
+++ b/notes/varnishstat.md
@@ -0,0 +1,26 @@
+---
+tags: [cloud, linux]
+title: varnishstat
+created: '2019-10-09T05:55:54.665Z'
+modified: '2023-05-24T08:41:51.929Z'
+---
+
+# varnishstat
+
+## option
+
+```sh
+-1 # instead continuously updated display print to stdout
+```
+
+## usage
+
+```sh
+varnishstat -1 | awk '$2 > 0 {print $0}'
+```
+
+## see also
+
+- [varnish-cache.org/docs/trunk/reference/varnishstat](https://varnish-cache.org/docs/trunk/reference/varnishstat.html)
+- [book.varnish-software.com/4.0/chapters/Examining_Varnish_Server_s_Output](https://book.varnish-software.com/4.0/chapters/Examining_Varnish_Server_s_Output.html)
+- [[awk]]
diff --git a/notes/vault.md b/notes/vault.md
new file mode 100644
index 00000000..7a7a8d43
--- /dev/null
+++ b/notes/vault.md
@@ -0,0 +1,68 @@
+---
+tags: [iac]
+title: vault
+created: '2019-09-26T05:56:37.432Z'
+modified: '2023-07-04T11:25:41.630Z'
+---
+
+# vault
+
+> tool for securely accessing secrets
+
+## usage
+
+```sh
+vault -autocomplete-install # setup
+
+# export to use agent against server or use login
+VAULT_TOKEN
+VAULT_ADDR
+
+vault login -address=https://ADDRESS:8200 TOKEN
+
+
+vault auth -method=ldap username=user
+
+
+vault status -address=http://ADDRESS:8200
+
+
+vault secrets list -detailed
+
+
+vault token lookup TOKEN
+
+vault token capabilities int-ca/issue/kafka # need token already set !
+
+
+vault list secret
+
+vault list int-ca/roles
+
+vault read int-ca/roles/kafka-server
+
+
+vault write -output-curl-string SECRET # generate curl
+
+# create a role
+vault write int-ca/roles/vault \
+ max_ttl="8760h" allowed_domains="vault*" allow_subdomains=true allow_glob_domains=true
+
+# redirecting from tee to multiple files
+vault write -format=json pki/root/generate/internal common_name="pki-ca-root" ttl=87600h \
+ | tee >(jq -r .data.certificate > cert.pem) >(jq -r .data.issuing_ca > intermediate.pem) >(jq -r .data.private_key > key.pem)
+
+vault write transit/path/encrypt/foo plaintext=$(base64 <<< "my secret data") # encrypt data
+
+vault write transit/path/decrypt/foo ciphertext=vault:v1:3kd1XR2w1lk..8KIWy2VVBA== # decrypt data
+```
+
+## see also
+
+- [[consul]]
+- [[terraform]]
+- [[tee]]
+- [[jq]]
+- [[bash process substitution]]
+- [[cosign]]
+
diff --git a/notes/vboxmanage.md b/notes/vboxmanage.md
new file mode 100644
index 00000000..b6f94d4e
--- /dev/null
+++ b/notes/vboxmanage.md
@@ -0,0 +1,63 @@
+---
+tags: [virtualization]
+title: vboxmanage
+created: '2019-07-30T06:19:49.257Z'
+modified: '2022-01-13T13:15:08.461Z'
+---
+
+# vboxmanage
+
+> oracle virtualbox cli management interface
+
+## install
+
+download platform package at [virtualbox.org/wiki/Downloads](https://www.virtualbox.org/wiki/Downloads)
+
+## usage
+
+```sh
+alias vboxmanage='VBoxManage'
+
+vboxmanage list vms
+vboxmanage list runningvms
+vboxmanage list bridgedifs # get ip of bridged box
+vboxmanage list hostonlyifs
+vboxmanage list dhcpservers
+
+vboxmanage createvm --name VM_NAME --register
+
+vboxmanage modifyvm VM_NAME --ostype VM_OSTYPE --cpus VM_CPUS --memory VM_MEM
+ --rtcuseutc on --acpi on --ioapic on --hpet on --hwvirtex on --vtxvpid on \
+ TXUX_SUPPORT --largepages on --nestedpaging on --firmware bios --bioslogofadein off \
+ --bioslogofadeout off --bioslogodisplaytime 0 --biosbootmenu disabled --boot1 dvd0
+
+vboxmanage guestproperty get "web" "/VirtualBox/GuestInfo/Net/0/V4/IP" # returns the first IP of NIC likely to be NAT 10.0.*.*
+
+vboxmanage guestproperty enumerate "web" | grep -i ip # return full list of all available IPs
+
+vboxmanage startvm ubuntu-16.04-server-amd64 --type headless # start vbox headless
+
+vboxmanage controlvm ubuntu-16.04-server-amd64 poweroff
+
+
+vboxmanage showvminfo VMNAME | grep -i mac # get vm mac address
+nmap -sP 192.168.1.1/24 >/dev/null # update arp-table
+arp -a | grep -i 08:00:27:09:33:C0
+
+
+# snapshot
+vboxmanage snapshot vm04-zca8 take snap1-before-upgrade
+vboxmanage showvminfo vm04-zca8
+vboxmanage snapshot vm04-zca8 restore snap1-before-upgrade
+vboxmanage snapshot vm04-zca8 delete snap1-before-upgrade
+```
+
+## see also
+
+- [[qemu]]
+- [[vagrant]]
+- [[docker-machine]]
+- [Create VirtualBox VM from cli](https://www.perkin.org.uk/posts/create-virtualbox-vm-from-the-command-line.html)
+- [Chapter8 VBoxManage](https://www.virtualbox.org/manual/ch08.html)
+- [dotfiles/boot2docker magicmonty/dotfiles](https://github.com/magicmonty/dotfiles/blob/master/bin/boot2docker)
+- [VirtualBox snapshots using the CLI โ Dirk-Jan's blog](http://www.vleeuwen.net/2012/12/virtualbox-snapshots-using-the-cli)
diff --git a/notes/vim buffers.md b/notes/vim buffers.md
deleted file mode 100644
index 3e89d106..00000000
--- a/notes/vim buffers.md
+++ /dev/null
@@ -1,34 +0,0 @@
----
-tags: [vim]
-title: vim buffers
-created: '2019-07-30T06:19:49.258Z'
-modified: '2019-07-30T06:24:37.662Z'
----
-
-# vim buffers
-
-### list buffers
-```sh
-:ls # list buffers
-:ls! # list deleted buffers
-```
-
-### edit
-```sh
-:e test.yml # adds file to buffer
-:e# # open prevous file
-:e#3 # open 3rd last file in buffer
-```
-
-
-```sh
-:b buffer-filename # opens from deleted buffer
-
-:bn # buffer next
-:bp # buffer previous
-
-:bd # buffer delete
-:bd 4 # close buffer with id 4
-
-:bw # buffer wipe / delete all buffers
-```
diff --git a/notes/vim join lines.md b/notes/vim join lines.md
deleted file mode 100644
index b8413bab..00000000
--- a/notes/vim join lines.md
+++ /dev/null
@@ -1,24 +0,0 @@
----
-tags: [vim]
-title: vim join lines
-created: '2019-07-31T06:11:23.688Z'
-modified: '2019-07-31T06:42:56.380Z'
----
-
-# vim join lines
-
-ggVGJ
-- go to top of file, visually select to end of file and join lines
-
-qqqqqJ@qq@q
-- first three q 's clear the `q` register
-- qqJ@qq records a macro to the `q` register that performs a Join, then calls `q`
-- the last `@q` runs it.
-
-```sh
-:1, 21 j # join line 1 to 21
-
-:%s/\n/ /g # subst line break with space
-```
-
-
diff --git a/notes/vim movement.md b/notes/vim movement.md
deleted file mode 100644
index 52120f45..00000000
--- a/notes/vim movement.md
+++ /dev/null
@@ -1,28 +0,0 @@
----
-tags: [vim]
-title: vim movement
-created: '2019-07-30T06:19:49.259Z'
-modified: '2019-07-30T06:24:37.663Z'
----
-
-# vim movement
-
-
-```sh
-C-b # page backward
-C-f # page forward
-
-C-d # 1/2 page down
-C-u # 1/2 page up
-
-'' # move prev curser position
-
-gd # goto local declartion
-gD # goto global declartion
-g* # jump to next occurrence under cursor
-g# # jump to previous occurrence under cursor
-```
-
-
-
-[Moving efficiently - Trammell Hudson's Projects](https://trmm.net/Moving_efficiently)
diff --git a/notes/vim read.md b/notes/vim read.md
deleted file mode 100644
index 07095c7c..00000000
--- a/notes/vim read.md
+++ /dev/null
@@ -1,21 +0,0 @@
----
-tags: [vim]
-title: vim read
-created: '2019-07-30T06:19:49.260Z'
-modified: '2019-07-30T07:21:57.005Z'
----
-
-# vim read
-
-### read
-```sh
-```sh
-:r
-:read
- name "insert file content below curser
- !cmd "insert cmd content below curser
-```
-
-```sh
-:r!date # insert date
-```
diff --git a/notes/vim script.md b/notes/vim script.md
deleted file mode 100644
index 8b8420d6..00000000
--- a/notes/vim script.md
+++ /dev/null
@@ -1,25 +0,0 @@
----
-tags: [vim]
-title: vim script
-created: '2019-07-30T06:19:49.260Z'
-modified: '2019-07-30T06:24:37.669Z'
----
-
-# vim script
-```sh
-:for i in range(2016,2020)
-: for j in range(1,12)
-: let s = printf("%s-%02d-01;002000,0;00011,111", i, j)
-: put = s
-: endfor
-: endfor
-```
-
-```sh
-:for i in range(2016,2020)
-: for j in range(1,12)
-: let s = printf("%s-%02d-01;002000,0;00011,111", i, j)
-: put = s
-: endfor
-: endfor
-```
diff --git a/notes/vim set.md b/notes/vim set.md
deleted file mode 100644
index 100645d9..00000000
--- a/notes/vim set.md
+++ /dev/null
@@ -1,38 +0,0 @@
----
-tags: [vim]
-title: vim set
-created: '2019-07-30T06:19:49.261Z'
-modified: '2019-07-30T06:24:37.670Z'
----
-
-# vim set
-
-
-```sh
-:se[t] # show options that differ from their default value
-:se[t] # show all but terminal options
-
-:set[t] number
-:set[t] wrap
-:set[t] ignorecase
-
-:set[t] list
-
-:set listchars=tab:โ\ ,trail:ยท
-:set listchars=tab:>\ ,trail:ยท,nbsp:.,extends:#
-:set listchars=tab:ยป\ ,trail:ยท,nbsp:ยท,extends:โบ,precedes:โน,space:.
-
-
-:set hlsearch # highlight search result (.vimrc)
-:noh / :nohlsearch # temp disable search highlight until next search
-```
-[Vim documentation: options](http://vimdoc.sourceforge.net/htmldoc/options.html#options)
-
-#### unsetting
-```sh
-:set nolist
-
-:set list&
-
-:set list!
-```
diff --git a/notes/vim splits.md b/notes/vim splits.md
deleted file mode 100644
index 4d809452..00000000
--- a/notes/vim splits.md
+++ /dev/null
@@ -1,34 +0,0 @@
----
-tags: [vim]
-title: vim splits
-created: '2019-07-30T06:19:49.261Z'
-modified: '2019-07-30T06:24:37.671Z'
----
-
-# vim splits
-
-```sh
-:vsp # vertical split
-:sp # horizontal split
-
-C-w j # navigate down
-C-w k # navigate up
-C-w l # navigate right
-C-w h # navigate left
-
-C-w _ # Max out the height of the current split
-C-w | # Max out the width of the current split
-C-w = # Normalize all split sizes, which is very handy when resizing terminal
-```
-
-
-```sh
-
-# resize
-:res
-:resize 60 " resize splits e.g. :help
-:resize +5
-
-:vertical resize 80
-:vertical resize +4
-```
diff --git a/notes/vim tabs.md b/notes/vim tabs.md
deleted file mode 100644
index 36b1e2a9..00000000
--- a/notes/vim tabs.md
+++ /dev/null
@@ -1,27 +0,0 @@
----
-tags: [vim]
-title: vim tabs
-created: '2019-07-30T06:19:49.262Z'
-modified: '2019-07-30T06:24:37.671Z'
----
-
-# vim tabs
-
-```sh
-:tabnew filename # load file in new tab
-
-:tabm n
-:tabm 2 # move current tab to position 2
-
-gt # pext tab
-gT # prev tab
-[nnn] gt # numbered tab
-
-
-:Sexplore
-:Sex # SplitExplore
-
-:Vex # VerticalExplore
-:Tex # TabExplore <=== *** this is the one ***
-:Ex
-```
diff --git a/notes/vim.md b/notes/vim.md
index 461d7ca3..537150e7 100644
--- a/notes/vim.md
+++ b/notes/vim.md
@@ -1,48 +1,196 @@
---
-tags: [vim]
+tags: [editor]
title: vim
created: '2019-07-30T06:19:49.263Z'
-modified: '2019-07-30T06:24:37.652Z'
+modified: '2023-04-26T17:27:29.240Z'
---
# vim
-```sh
-:verbose set filtetype? #get value of filetype
-:scriptnames
+> `vi-mproved`
-:h
-:help
- vim-modes
+## install
-:digraphs # list special characters
+```sh
+brew install vim
```
-
-## commands
+## option
```sh
-:n
-:prev
-:args # show open files
+-y # easy mode, beavese like click-and-type editore, ctrl+o -> :q to quit
+-p file1 file2 file3 # open files in tabs
```
+## usage
-## syntax highlighting
```sh
-:syntax on
-:sy on
+vim $(!!) # open file from last output
+vim FILE +3 # open File and jump to line 3
+```
+
+[learnbyexample.github.io/mini/vim-prank/](https://learnbyexample.github.io/mini/vim-prank/)
+
+## visual mode
+
+> visual mode permits the user to select the text using the keyboard
+
+```vim
+0
+A ; append end of line
+a ; append
+D ; delete
+C ; change
+
+cw ; correct word
+dw ; delete word
+
+cW ; correct whole word
+dW ; delete whole word
+
+
+
+
+Ctl+b ; page backward
+Ctl+f ; page forward
+
+Ctl+d ; 1/2 page down
+Ctl+u ; 1/2 page up
+
+'' ; move prev curser position
+
+gd ; goto local declartion
+gD ; goto global declartion
+g* ; goto/jump to next occurrence under cursor
+g# ; goto/jump to prev occurrence under cursor
+gt ; goto next tab
+gT ; goto prev tab
+[nnn] gt ; goto numbered tab
+
+
+; shares
+md ; marks share `d`
+`d ; navigate to exact position
+'d ; navigate to the line the holds definition
+
+ggVGJ ; go to top of file, visually select to end of file and join lines
+
+qqqqqJ@qq@q
+; first three q's clear the `q` register
+; qqJ@qq records a macro to the `q` register that performs a Join, then calls `q`
+; the last `@q` runs it.
+
+ctrl+v j j j j space space shift+i esc multiline-indent
+; ctrl + v then move up or down
+; shift + i multiline insert
+; esc
+
+c i w { Ctrl + r " } wrap word in `{}`
+; c i w Delete the word the cursor is on, and end up in insert mode.
+; { add the first curly-brace
+; ctrl + r" Insert the contents of the `"` register, aka the last yank/delete
+; } add the closing curly-brace
+
+di'hPl2x Unquote a word that's enclosed in single quotes
+; di' Delete the word enclosed by single quotes
+; hP Move the cursor left one place (on top of the opening quote) and put the just deleted text before the quote
+; l Move the cursor right one place (on top of the opening quote)
+; 2x Delete the two quotes
+```
+
+### marks
+
+> hidden positions, that allow to jump back to specific location or line
+
+```
+m{a-zA-Z} ; lower-case within file, upper-case among all files
+
+`m ; backtick, jump to exaxt position of mark
+'m ; single quote, jump to beginning of line that holds mark
+
+md ; mark current position with d
+mi ; mark current position with i
+
+`d ; navigate to exact position of mark
+'i ; navigate to line that holds defined mark
+```
+
+[vim - Indent multiple lines quickly in vi - Stack Overflow](http://stackoverflow.com/a/235841/2087704)
+[Moving efficiently - Trammell Hudson's Projects](https://trmm.net/Moving_efficiently)
+
+## command mode
+
+```vim
+:h ; get help
+:help vim-modes ; display help to vim-modes
+
+
+:set list ; show non printable characters
+:digraphs ; list special characters
+
+:verbose set filtetype? ; get value of filetype
+:scriptnames
+
+:w ; write
+:w !sudo tee % ; write with sudo permission
+:wq ; write and quit
+:x
+
+:n
+:prev
+:args ; show open files
+:syntax on ; syntax highlighting
+:sy on
:syntax of
:sy off
-
:colorscheme
-:colo delek
-# on osx check avail colorschemes here: /usr/share/vim/vim80/colors
-```
+:colo delek ; on osx check avail colorschemes here: /usr/share/vim/vim80/colors
+
+
+:ls ; list buffers
+:ls! ; list deleted buffers
+
+:e file ; edit, adds file to buffer
+:e# ; open prevous file
+:e#3 ; open 3rd last file in buffer
+
+:b buffer-filename ; opens from deleted buffer
+
+:bn ; buffer next
+:bp ; buffer previous
+
+:bd ; buffer delete
+:bd 4 ; close buffer with id 4
+
+:bw ; buffer wipe / delete all buffers
+
+
+:tabnew filename ; load file in new tab
+:tabm n
+:tabm 2 ; move current tab to position 2
+:Sexplore
+:Sex ; SplitExplore
+:Vex ; VerticalExplore
+:Tex ; TabExplore <=== *** this is the one ***
+:Ex
+
+
+:10,100s/^/#/ ; substitute (that reads, from line 10 to 100 substitute line start (^) with a # sign.)
+
+:1, 21 j ; join line 1 to 21
+
+:%s/\n/ /g ; substitute line break with space
+
+
+:r
+:read
+ name "insert file content below curser
+ !cmd "insert cmd content below curser
+
+:r!date # insert date
+
-## register
-```sh
:reg
:register
:di
@@ -50,50 +198,129 @@ modified: '2019-07-30T06:24:37.652Z'
:pu
:put
-:[line]pu[t] [x] " put text from register x
-:[line]pu[t]! [x] " put text from register x
+:[line]pu[t] [x] " put text from register x
+:[line]pu[t]! [x] " put text from register x
```
-```
-VISUALMODE !sort
- OBJS = \
- backup.o
- getopt1.o \
- getopt.o \
- inp.o \
- patch.o \
- pch.o \
- util.o \
- version.o \
+## set
+
+set options that configure Vim are of three types:
+
+- `boolean`: on or off (`:help 'autochdir'`)
+- `number`: an integer value (`:help 'textwidth'`)
+- `string`: a string value (`:help 'backspace'`)
+
+```sh
+:help set
+
+:se[t] # show options that differ from their default value
+ # show all but terminal options
+
+:set number # Turn line numbers on
+:set nonumber # Turn line numbers off
+:set invnumber # Toggle line numbers
+:set number!
+:set number& # Set option to default value
+:set number? # Show value of option
+
+:set syntax=bash
+
+
+option short example description
+
+shellcmdflag shellcmdflag=-ic make Vimโs :! shell behave like your command prompt e.g. for aliases
+encoding encoding=utf-8
+
+filetype ft ft=json
+autoindent
+pastetoggle pastetoggle=
+ignorecase
+list
+number
+wrap
+hlsearch hls highlight search result (.vimrc)
+
+
+softtabstop sts sts=4
+tabstop ts ts=2
+shiftwidth sw sw=8
+
+listchars lcs listchars=tab:โ\ ,trail:ยท
+
+listchars=tab:โ\ ,trail:ยท
+listchars=tab:>\ ,trail:ยท,nbsp:.,extends:#
+listchars=tab:ยป\ ,trail:ยท,nbsp:ยท,extends:โบ,precedes:โน,space:.
```
+[Vim documentation: options](http://vimdoc.sourceforge.net/htmldoc/options.html#options)
+[commands-executed-from-vim-are-not-recognizing-bash .. - stackoverflow.com](https://stackoverflow.com/a/4642855/2087704)
+## tabs
+```sh
+:tabnew filename # load file in new tab
+
+:tabm n
+:tabm 2 # move current tab to position 2
+
+gt # pext tab
+gT # prev tab
+[nnn] gt # numbered tab
-### substitute
-```vi
-:10,100s/^/#/ #(that reads, from line 10 to 100 substitute line start (^) with a # sign.)
+
+:Sexplore
+:Sex # SplitExplore
+
+:Vex # VerticalExplore
+:Tex # TabExplore <=== *** this is the one ***
+:Ex
```
-### open file
+## splits
+
```sh
-vim -p file1 file2 file3 # open files in tabs
+:vsp # vertical split
+:sp # horizontal split
-vim $(!!) # open file from last output
+C-w j - navigate down
+C-w k - navigate up
+C-w l - navigate right
+C-w h - navigate left
+C-w _ - Max out the height of the current split
+C-w | - Max out the width of the current split
+C-w = - Normalize all split sizes, which is very handy when resizing terminal
```
+## resize
+```sh
+:res
+:resize 60 " resize splits e.g. :help
+:resize +5
-### multiline-indent
+:vertical resize 80
+:vertical resize +4
```
-CTL+v then move up or down
-Shift+i # multiline insert
-ESC
+
+```sh
+:for i in range(2016,2020)
+: for j in range(1,12)
+: let s = printf("%s-%02d-01;002000,0;00011,111", i, j)
+: put = s
+: endfor
+: endfor
```
-[vim - Indent multiple lines quickly in vi - Stack Overflow](http://stackoverflow.com/a/235841/2087704)
+```sh
+:for i in range(2016,2020)
+: for j in range(1,12)
+: let s = printf("%s-%02d-01;002000,0;00011,111", i, j)
+: put = s
+: endfor
+: endfor
+```
-### vim file
+## vim file
```sh
# -*- mode: ruby -*-
@@ -102,17 +329,23 @@ ESC
# vim: ft=json
```
+[[vagrant]]
-### plugins vim-pathogen
+## see also
-- [GitHub - tpope/vim-pathogen: pathogen.vim: manage your runtimepath](https://github.com/tpope/vim-pathogen)
-- [GitHub - ekalinin/Dockerfile.vim: Vim syntax file & snippets for Docker's Dockerfile](https://github.com/ekalinin/Dockerfile.vim.git)
-- [GitHub - chriskempson/base16-vim: Base16 for Vim](https://github.com/chriskempson/base16-vim.git)
-- [GitHub - powerline/fonts: Patched fonts for Powerline users.](https://github.com/powerline/fonts.git)
-- [GitHub - vim-airline/vim-airline: lean & mean status/tabline for vim that's light as air](https://github.com/vim-airline/vim-airline)
-- [GitHub - airblade/vim-gitgutter: A Vim plugin which shows a git diff in the gutter (sign column) and stages/undoes hunks.](http://github.com/airblade/vim-gitgutter.git)
-- [GitHub - fatih/vim-go: Go development plugin for Vim](https://github.com/fatih/vim-go.git)
-- [GitHub - elzr/vim-json: A better JSON for Vim: distinct highlighting of keywords vs values, JSON-specific (non-JS) warnings, quote concealing. Pathogen-friendly.](https://github.com/elzr/vim-json.git)
-- [GitHub - plasticboy/vim-markdown: Markdown Vim Mode](https://github.com/plasticboy/vim-markdown.git)
-- [GitHub - tpope/vim-surround: surround.vim: quoting/parenthesizing made simple](https://github.com/tpope/vim-surround.git)
-- [GitHub - hashivim/vim-terraform: basic vim/terraform integration](https://github.com/hashivim/vim-terraform.git)
+- [[nvim]]
+- [[less]]
+- [[code]]
+- [[atom]]
+- [[vim command]]
+- [tpope/vim-pathogen: pathogen.vim: manage your runtimepath](https://github.com/tpope/vim-pathogen)
+- [ekalinin/Dockerfile.vim: Vim syntax file & snippets for Docker's Dockerfile](https://github.com/ekalinin/Dockerfile.vim.git)
+- [chriskempson/base16-vim: Base16 for Vim](https://github.com/chriskempson/base16-vim.git)
+- [powerline/fonts: Patched fonts for Powerline users.](https://github.com/powerline/fonts.git)
+- [vim-airline/vim-airline: lean & mean status/tabline for vim that's light as air](https://github.com/vim-airline/vim-airline)
+- [airblade/vim-gitgutter: A Vim plugin which shows a git diff in the gutter...](http://github.com/airblade/vim-gitgutter.git)
+- [fatih/vim-go: Go development plugin for Vim](https://github.com/fatih/vim-go.git)
+- [elzr/vim-json: A better JSON for Vim:..](https://github.com/elzr/vim-json.git)
+- [plasticboy/vim-markdown: Markdown Vim Mode](https://github.com/plasticboy/vim-markdown.git)
+- [tpope/vim-surround: surround.vim: quoting/parenthesizing made simple](https://github.com/tpope/vim-surround.git)
+- [hashivim/vim-terraform: basic vim/terraform integration](https://github.com/hashivim/vim-terraform.git)
diff --git a/notes/virtualenv.md b/notes/virtualenv.md
new file mode 100644
index 00000000..6294998d
--- /dev/null
+++ b/notes/virtualenv.md
@@ -0,0 +1,46 @@
+---
+tags: [python]
+title: virtualenv
+created: '2019-07-30T06:19:49.221Z'
+modified: '2023-04-24T09:47:58.787Z'
+---
+
+# virtualenv
+
+> tool to create isolated python environments
+
+## install
+
+```sh
+pip install virtualenv --verbose
+pip3 install virtualenv
+```
+
+## usage
+
+```sh
+virtualenv VIRTUALENV_NAME
+
+source VIRTUALENV_NAME/bin/activate # activate virtualenv in project
+pip install pre-commit # install to virtualenv
+
+
+pip3 install virtualenv
+virtualenv venv --python=python3.8
+source venv/bin/activate
+
+
+python3 -m venv ./venv
+source ./venv/bin/activate # activate virtual env
+type python pip python3 pip3 # show different paths
+```
+
+## see also
+
+- [[pip]]
+- [[sam]]
+- [[pyenv]]
+- [[python]]
+- [[12 factor app]]
+- [Stack Overflow - Virtualenv Command Not Found](https://stackoverflow.com/a/36577160)
+- [virtualenv.pypa.io/en/latest/](https://virtualenv.pypa.io/en/latest/)
diff --git a/notes/vm disk image.md b/notes/vm disk image.md
new file mode 100644
index 00000000..80a04e43
--- /dev/null
+++ b/notes/vm disk image.md
@@ -0,0 +1,38 @@
+---
+tags: [virtualization]
+title: vm disk image
+created: '2019-07-30T06:19:49.264Z'
+modified: '2019-08-29T12:39:50.311Z'
+---
+
+# vm disk image
+
+## file formats for virtual machines
+
+```
+OVF - Open Virtualization Format XML based,
+ describes single vm or virtual appliance,
+ contains information about format of virtual-disk and
+ description of virtual hardware that should be emulated
+
+OVA - Open Virtualization Applicance OVF + supporing file (disk-images, ..)
+```
+
+## formats for disk images
+
+```
+.vid - VirtualBox
+.vmdk - VMWare (many different versions!)
+.vhd - Microsoft (Virtual PC)
+raw - (.IMG,.ISO,..)
+````
+
+## extract VMDK
+
+rename `.ova` to `.tar` and extract `.vmdk`
+
+## see also
+
+- [OVF? OVA? VMDK? โ File Formats and Tools for Virtualization](https://spin.atomicobject.com/2013/06/03/ovf-virtual-machine/)
+- [How to convert an OVA virtual machine to VHD](https://www.rootusers.com/how-to-convert-an-ova-virtual-machine-to-vhd/)
+- [How to convert RAW image to VDI and otherwise](https://blog.sleeplessbeastie.eu/2012/04/29/virtualbox-convert-raw-image-to-vdi-and-otherwise/)
diff --git a/notes/vsftpd.md b/notes/vsftpd.md
new file mode 100644
index 00000000..fd8b5460
--- /dev/null
+++ b/notes/vsftpd.md
@@ -0,0 +1,51 @@
+---
+tags: [systemd]
+title: vsftpd
+created: '2020-03-31T06:54:59.956Z'
+modified: '2023-03-25T12:51:45.379Z'
+---
+
+# vsftpd
+
+> `very secure ftp daemon`
+
+## install
+
+```sh
+apt install vsftpd
+```
+
+## usage
+
+```sh
+systemctl status vsftpd
+```
+
+## `/etc/vsftpd.conf`
+
+```sh
+anonymous_enable=NO # allow access to the FTP server only the local users
+local_enable=YES
+
+write_enable=YES # allow changes to the filesystem such as uploading and deleting files
+
+chroot_local_user=YES # prevent the FTP users to access any files outside of their home directories
+ # allow uploads when chroot is enabled
+user_sub_token=$USER # method 1: recommended method to allow upload is to keep chroot enabled,
+local_root=/home/$USER/ftp # and configure FTP directories
+ # method 2:
+allow_writeable_chroot=YES # grant writable access to your user to its home directory
+
+pasv_min_port=30000
+pasv_max_port=31000
+
+userlist_enable=YES # allow only certain users to log in to the FTP server
+userlist_file=/etc/vsftpd.user_list
+userlist_deny=NO
+```
+
+## see also
+
+- [[ftp]]
+- [vsftpd.beasts.org/vsftpd_conf.html](http://vsftpd.beasts.org/vsftpd_conf.html)
+- [linuxize.com/how-to-setup-ftp-server-with-vsftpd-on-ubuntu-1804](https://linuxize.com/post/how-to-setup-ftp-server-with-vsftpd-on-ubuntu-18-04/)
diff --git a/notes/vsphere.md b/notes/vsphere.md
new file mode 100644
index 00000000..104c66c4
--- /dev/null
+++ b/notes/vsphere.md
@@ -0,0 +1,48 @@
+---
+tags: [virtualization]
+title: vsphere
+created: '2019-07-30T06:19:49.264Z'
+modified: '2023-03-22T10:43:01.583Z'
+---
+
+# vsphere
+
+> vmware vSphere is a cloud computing virtualization platform
+
+- `VID` `vSphere Installation Bundle`
+- `VUM` `vSphere Update Manager`
+- `VDVS` `vSphere`
+- `VMCI` `Virtual Machine Communication Interface`
+
+## vm bootorder via .vmx
+
+```sh
+bios.forceSetupOnce = "TRUE"
+bios.bootOrder = "hdd"
+```
+
+## mob - managed object browser
+
+`https://vcenter1.domain.net/mob/`
+
+```
+RetrieveProductComponents -> Invoke Method
+ -> rootFolder/group-d1
+ -> childEntity/datacenter-21
+ -> datastore/datastore-29
+ ->
+```
+
+photon-template:
+
+- `https://vcenter1.domain.net/mob/?moid=vm%2d97645`
+- `https://vcenter1.domain.net/mob/?moid=vm%2d97645&doPath=summary%2econfig` # UUID
+
+## see also
+
+- [Can't Change BIOS Settings on VM in Fusion 5](https://www.eager0.com/2013/02/cant-change-bios-settings-on-vm-in.html)
+- [Looking up Managed Object Reference](https://kb.vmware.com/s/article/1017126)
+- [vSphere Integrated Containers by VMwareยฎ](https://vmware.github.io/vic-product/)
+- [GitHub - vmware/vic: Integrated containers engine on vSphere](https://github.com/vmware/vic#project-status)
+- [harbor/user_guide.md at master ยท vmware/harbor ยท GitHub](https://github.com/vmware/harbor/blob/master/docs/user_guide.md)
+- [Install vSphere Integrated Containers v0.1 via VMware Photon OS TP2 โ think-v](http://blog.think-v.com/?p=3649)
diff --git a/notes/w3m.md b/notes/w3m.md
new file mode 100644
index 00000000..9fbb4ae1
--- /dev/null
+++ b/notes/w3m.md
@@ -0,0 +1,26 @@
+---
+tags: [linux, macos]
+title: w3m
+created: '2022-03-23T15:11:59.376Z'
+modified: '2023-03-25T12:30:17.240Z'
+---
+
+# w3m
+
+> cli browser
+
+## install
+
+```sh
+brew install w3m
+```
+
+## usage
+
+```sh
+w3m
+```
+
+## see also
+
+- [[lynx]]
diff --git a/notes/wasm.md b/notes/wasm.md
new file mode 100644
index 00000000..62a25f5f
--- /dev/null
+++ b/notes/wasm.md
@@ -0,0 +1,54 @@
+---
+tags: [Notebooks]
+title: wasm
+created: '2020-08-19T07:23:59.679Z'
+modified: '2023-05-25T16:16:56.382Z'
+---
+
+# wasm
+
+> webassembly
+
+> virtual instruction set architecture
+> binary instruction format for stack-based virtual machine
+> designed as portable target for compiliation of high-level langs like c, c++, rust
+
+- brackets are called `s-expressions` (`lisp`) and used to represent tree-like structures
+ - root of the tree is a `module` (like `javascript` modules)
+- basic building blocks of `wasm` are instructions that operate on the stack
+- uses structured control flow (`if` `else` `loop`) and avoids `GOTO` jumps, which allows parsing source in one pass
+- `wasm` uses `linear memory model` as memory addressing technique in which memory is organized in a single contagious address space. (aka flat memory model)
+- `wasm` is compiled and executed on the fly, as the bytes stream in
+
+## usage
+
+```c
+int sign(int x) { return (x % 2) * (2 - (x % 4)); }
+```
+
+```wasm
+(func (;1;) (type 0) (param i32) (result i32)
+
+ ;; (2 - (x % 4))
+ i32.const 2 ;; push values: integer 2
+ local.get 0 ;; push first parameter of the function
+ i32.const 4 ;; push values: integer 4
+ i32.rem_s ;; instruction removes two values from stack (first function parameter and the integer 4)
+ ;; divide first value by second then pushes the remainder back on stack
+ i32.sub ;; pops ramainder and 2 from stack and subtracts one from another, pushes the result
+
+ ;; (x % 2) * REMAINDER
+ local.get 0
+ i32.const 2
+ i32.rem_s
+ i32.mul)
+```
+
+## see also
+
+- [[deno]]
+- [[asm]]
+- [[rust]], [[go]], [[clang]]
+- [[emcc]]
+- [evilmartians.com/chronicles/hands-on-webassembly-try-the-basics](https://evilmartians.com/chronicles/hands-on-webassembly-try-the-basics)
+- [wingolog.org/archives/2021/12/13/webassembly-the-new-kubernetes](https://wingolog.org/archives/2021/12/13/webassembly-the-new-kubernetes)
diff --git a/notes/watch.md b/notes/watch.md
index a2573b17..4041a3f7 100644
--- a/notes/watch.md
+++ b/notes/watch.md
@@ -1,29 +1,38 @@
---
-tags: [bash]
+tags: [linux]
title: watch
created: '2019-07-30T06:19:49.265Z'
-modified: '2019-08-02T06:33:56.412Z'
+modified: '2023-03-25T12:31:26.967Z'
---
# watch
+> execute a program periodically, showing output fullscreen
+
+## env
```sh
-watch -d "ps -ef | awk -F' ' '{print \$2}'" # use double quotes and escape $
- # -n .5 --interval
+WATCH_INTERVAL # persistently set a non-default interval
```
-[bash - Using the watch command with an argument that contains quotes - Super User](https://superuser.com/a/276706)
+
+## option
```sh
-watch -d 'docker service ps --filter desired-state=running --format "{{.Node}} {{.Name}}" $(docker service ls --filter mode=replicated -q) | sort | column -t'
+-n, --interval SECONDS # update interval, will not allow quicker than 0.1 second interval, in which the smaller values are converted
```
-### poor man java monitoring
+## usage
+
```sh
-watch 'for pid in `jps` ; do echo -n "$pid " && ps huH p $pid | wc -l ; done'
+watch -d "ps -ef | awk -F' ' '{print \$2}'" # use double quotes and escape $
+
+watch -d 'docker service ps --filter desired-state=running --format "{{.Node}} {{.Name}}" $(docker service ls --filter mode=replicated -q)'
+
+watch 'for pid in `jps` ; do echo -n "$pid " && ps huH p $pid | wc -l ; done' # poor man java monitoring
```
-### watch-alternative using while
+### watch alternative
+
```sh
while sleep 5; do # every 5 seconds
printf "\033c"; # clear screen
@@ -33,3 +42,12 @@ while sleep 5; do # every 5 seconds
done
done
```
+
+## see also
+
+- [[entr]]
+- [[procps]]
+- [[consul]]
+- [[bash while]]
+- [[bash printf]]
+- [Using watch with an argument that contains quotes](https://superuser.com/a/276706)
diff --git a/notes/wc.md b/notes/wc.md
new file mode 100644
index 00000000..e07f1468
--- /dev/null
+++ b/notes/wc.md
@@ -0,0 +1,37 @@
+---
+tags: [linux]
+title: wc
+created: '2022-11-29T08:07:33.392Z'
+modified: '2023-04-21T12:12:25.443Z'
+---
+
+# wc
+
+> displays the number of lines, words, and bytes contained in each input
+
+## option
+
+```sh
+-c # number of bytes in each input file is written to the STDOUT
+-l # number of lines in each input file is written to the STDOUT
+-m # number of characters in each input file is written to the STDOUT
+-w # number of words in each input file is written to the STDOUT
+```
+
+## usage
+
+```sh
+CMD | wc -l | xargs # pipe to xargs to trim spaces
+
+echo STRING | wc -c
+
+history | wc
+8744 61819 628428
+# no lines, words, bytes
+```
+
+## see also
+
+- [[grep]]
+- [[xargs]]
+- [[bash history]]
diff --git a/notes/wget.md b/notes/wget.md
new file mode 100644
index 00000000..4f186b24
--- /dev/null
+++ b/notes/wget.md
@@ -0,0 +1,39 @@
+---
+tags: [linux, network]
+title: wget
+created: '2019-07-30T06:19:49.266Z'
+modified: '2022-11-23T10:13:22.767Z'
+---
+
+# wget
+
+> non-interactive network downloader
+
+## install
+
+```
+apt-get install wget
+yum install wget
+```
+
+## option
+
+```sh
+-q # no stdout
+-O # redirect output to file
+- # 'dash' -> stdout
+```
+
+## usage
+
+```sh
+wget -qO- URL | CMD
+
+wget --quiet --tries=1 --spider http://localhost/
+```
+
+## see also
+
+- [[curl]]
+- [[nc]]
+- [daniel.haxx.se/docs/curl-vs-wget](https://daniel.haxx.se/docs/curl-vs-wget.html)
diff --git a/notes/whatis.md b/notes/whatis.md
new file mode 100644
index 00000000..6d4d3495
--- /dev/null
+++ b/notes/whatis.md
@@ -0,0 +1,21 @@
+---
+tags: [linux, macos]
+title: whatis
+created: '2019-09-23T06:20:07.498Z'
+modified: '2023-05-19T11:12:42.025Z'
+---
+
+# whatis
+
+> search the whatis database for complete words
+
+## usage
+
+```sh
+whatis
+```
+
+## see also
+
+- [[man]], [[apropos]]
+- [[apropos]]
diff --git a/notes/which.md b/notes/which.md
new file mode 100644
index 00000000..5575c4a6
--- /dev/null
+++ b/notes/which.md
@@ -0,0 +1,32 @@
+---
+tags: [linux]
+title: which
+created: '2020-01-15T09:27:59.855Z'
+modified: '2022-02-02T10:04:31.844Z'
+---
+
+# which
+
+> locate a command
+
+## usage
+
+```sh
+which -a CMD # print all matching pathnames of each argument
+```
+
+## exit status
+
+```sh
+0 # if all specified commands are found and executable
+1 # if one or more specified commands is nonexistent or not executable
+2 # if an invalid option is specified
+```
+
+## see also
+
+- [[file]]
+- [[bash type]]
+- [[bash command]]
+- [[bash hash]]
+- [[bash test []] `test -x filename`
diff --git a/notes/whois.md b/notes/whois.md
new file mode 100644
index 00000000..cf5bd49e
--- /dev/null
+++ b/notes/whois.md
@@ -0,0 +1,30 @@
+---
+tags: [linux]
+title: whois
+created: '2021-12-23T09:09:20.217Z'
+modified: '2023-03-22T10:35:10.686Z'
+---
+
+# whois
+
+> utility to look up records in databases maintained by several `NICs` (=Network Information Centers)
+> default first querying the `IANA` (=Internet Assigned Numbers Authority) whois serve
+
+## env
+
+```sh
+WHOIS_SERVER # primary default whois server - if unset, whois uses RA_SERVER
+RA_SERVER # secondary default whois server - if unset, whois will use whois.iana.org
+```
+
+## usage
+
+```sh
+whois HOST
+```
+
+## see also
+
+- [[dig]]
+- [[host]]
+- [[nslookup]]
diff --git a/notes/wireshark.md b/notes/wireshark.md
new file mode 100644
index 00000000..060ded73
--- /dev/null
+++ b/notes/wireshark.md
@@ -0,0 +1,35 @@
+---
+tags: [network]
+title: wireshark
+created: '2020-01-27T14:43:12.327Z'
+modified: '2023-03-25T12:48:59.536Z'
+---
+
+# wireshark
+
+> starts gui network protocol analyzer that is used to interactively dump and analyze network traffic
+
+## install
+
+```sh
+brew install wireshark --with-qt
+```
+
+## option
+
+```sh
+-k # start capturing immediately
+-i INTERFACE # name or idx of interface
+```
+
+## usage
+
+```sh
+ssh USR@HOST "tcpdump -s0 -U -w - -n -i any 'dst 192.168.144.196||192.168.158.4 || port 53'" | wireshark -k -i -
+```
+
+## see also
+
+- [[nmap]]
+- [[ssh]]
+- [[tcpdump]]
diff --git a/notes/xar.md b/notes/xar.md
new file mode 100644
index 00000000..fc2582c5
--- /dev/null
+++ b/notes/xar.md
@@ -0,0 +1,21 @@
+---
+tags: [macos]
+title: xar
+created: '2023-05-17T07:49:03.717Z'
+modified: '2023-05-17T07:50:31.839Z'
+---
+
+# xar
+
+> eXtensible ARchiver, no longer under active development by apple
+
+## usage
+
+```sh
+xar -xf FILE.pkg -C DIR
+```
+
+## see also
+
+- [[installer]]
+- [[cpio]]
diff --git a/notes/xargs.md b/notes/xargs.md
new file mode 100644
index 00000000..d3db2cd6
--- /dev/null
+++ b/notes/xargs.md
@@ -0,0 +1,58 @@
+---
+tags: [linux, macos]
+title: xargs
+created: '2019-07-30T06:19:49.266Z'
+modified: '2023-03-22T10:39:44.062Z'
+---
+
+# xargs
+
+> cli utility for building an execution pipeline from STDIN
+
+## install
+
+```sh
+brew install findutils # as gxargs
+```
+
+## option
+
+```sh
+-I REPL_STR # Execute utility for each input line, replacing one or more occurrences of replstr in up to replacements
+ # (or 5 if no -R flag is specified) arguments to utility with the entire line of input
+-R REPLACEMENTS # Specify the maximum number of arguments that -I will do replacement in
+ # If replacements is negative, the number of arguments in which to replace is unbounded
+-t # echo the command to be executed to standard error immediately before it is executed
+-p # echo each command to be executed and ask the user whether it should be executed
+-x # force xargs to terminate immediately if a command line containing number arguments will not fit in the specified cli length
+```
+
+## usage
+
+```sh
+echo 'one two three' | xargs mkdir
+
+echo 'one two three' | xargs -t rm # -t prints each command that will be executed
+
+echo 'one two three' | xargs -p touch # -p will print the command to be executed and prompt the user to run it
+
+cat foo.txt | xargs -I % sh -c 'echo %; mkdir %' # -I replaces occurrences of the argument with the argument passed to xargs
+
+echo 210 | xargs -I {} bash -c "if [[ "{}" =~ 2 ]]; then echo {}; fi" # replace string
+
+# when no -I => defaults to `{}`
+
+for FILE in "$(ls)"; do echo "$FILE rugal"; done
+
+ls | xargs -I% echo "% rugal"
+
+xargs -I % -P 5 curl -I "https://HOST" < <(printf '%s\n' {1..10})
+seq 1 10 | xargs -n1 -P 5 curl -I "https://HOST"
+```
+
+## see also
+
+- [[grep]]
+- [[curl]]
+- [[parallel]]
+- [Replacement for xargs -d in osx](https://superuser.com/questions/467176/replacement-for-xargs-d-in-osx)
diff --git a/notes/xcode-select.md b/notes/xcode-select.md
new file mode 100644
index 00000000..1dc89ca0
--- /dev/null
+++ b/notes/xcode-select.md
@@ -0,0 +1,37 @@
+---
+tags: [macos]
+title: xcode-select
+created: '2020-11-30T13:00:10.243Z'
+modified: '2023-05-09T07:02:28.468Z'
+---
+
+# xcode-select
+
+> manages active developer directory for Xcode and BSD tools
+
+## option
+
+```sh
+-s PATH, --switch PATH # sets the active developer directory to PATH
+-p, --print-path # prints path to currently selected developer directory
+-r, --reset # unsets any user-specified developer directory, developer directory will be found via the default search mechanism
+-v, --version # prints xcode-select version information
+ --install # opens a user interface dialog to request automatic installation of the command line developer tools
+```
+
+## usage
+
+```sh
+xcode-select --print-path # find out version of xcode being used by tools
+
+xcode-select --switch /Applications/Xcode8.3.3/Xcode.app # select default xcode for cli
+
+xcode-select --install # download and install xcode cli tools
+```
+
+## see also
+
+- [[cc]]
+- [[brew]]
+- [[softwareupdate]]
+- [[xcrun]]
diff --git a/notes/xcrun.md b/notes/xcrun.md
new file mode 100644
index 00000000..bf1690ed
--- /dev/null
+++ b/notes/xcrun.md
@@ -0,0 +1,21 @@
+---
+tags: [macos]
+title: xcrun
+created: '2023-05-09T07:00:54.064Z'
+modified: '2023-05-09T07:02:35.408Z'
+---
+
+# xcrun
+
+> Run or locate development tools and properties
+
+## usage
+
+```sh
+xcrun -sdk macosx --show-sdk-path
+```
+
+## see also
+
+- [[ld]]
+- [[xcode-select]]
diff --git a/notes/xfs.md b/notes/xfs.md
new file mode 100644
index 00000000..cbf558f3
--- /dev/null
+++ b/notes/xfs.md
@@ -0,0 +1,22 @@
+---
+tags: [filesystem]
+title: xfs
+created: '2020-01-07T10:12:23.945Z'
+modified: '2022-02-02T10:05:59.463Z'
+---
+
+# xfs
+
+> xfs
+
+## usage
+
+```sh
+xfs
+```
+
+## see also
+
+- [[xfs_info]]
+- [[xfs_repair]]
+- [[xfs_growfs]]
diff --git a/notes/xfs_growfs.md b/notes/xfs_growfs.md
new file mode 100644
index 00000000..8eb3c309
--- /dev/null
+++ b/notes/xfs_growfs.md
@@ -0,0 +1,28 @@
+---
+tags: [filesystem]
+title: xfs_growfs
+created: '2020-01-07T07:50:39.728Z'
+modified: '2020-06-12T07:01:24.050Z'
+---
+
+# xfs_growfs
+
+> increae fs size
+
+## usage
+
+```sh
+growpart /dev/sda 1 # !!!!
+
+xfs_growfs -d /mnt
+```
+
+## see also
+
+- [[growpart]]
+- [[resize2fs]]
+- [[xfs]]
+- [[xfs_info]]
+- [[xfs_repair]]
+- [[findmnt]]
+- [stackoverflow.com/a/42126869/2087704](https://stackoverflow.com/a/42126869/2087704)
diff --git a/notes/xfs_info.md b/notes/xfs_info.md
new file mode 100644
index 00000000..39a542ee
--- /dev/null
+++ b/notes/xfs_info.md
@@ -0,0 +1,25 @@
+---
+tags: [filesystem]
+title: xfs_info
+created: '2020-01-07T07:48:24.148Z'
+modified: '2020-01-07T10:12:10.190Z'
+---
+
+# xfs_info
+
+> `xfs_info` is equivalent to invoking xfs_growfs with `-n` , no change to be made to the filesystem
+
+## usage
+
+```sh
+xfs_info -V # get version
+
+xfs_info /dev/sda1 # XFS file system information
+```
+
+## see also
+
+- [[xfs]]
+- [[xfs_growfs]]
+- [[xfs_repair]]
+- [[findmnt]]
diff --git a/notes/xfs_repair.md b/notes/xfs_repair.md
new file mode 100644
index 00000000..0008cc84
--- /dev/null
+++ b/notes/xfs_repair.md
@@ -0,0 +1,29 @@
+---
+tags: [filesystem]
+title: xfs_repair
+created: '2020-01-07T10:05:34.393Z'
+modified: '2020-06-11T11:52:42.560Z'
+---
+
+# xfs_repair
+
+> repair corrupt or damaged xfs filesystem
+
+## usage
+
+```sh
+xfs_repair -V
+
+umount /dev/sda2
+
+xfs_repair /dev/sda2
+```
+
+## see also
+
+- [[xfs]]
+- [[xfs_info]]
+- [[xfs_growfs]]
+- [[growpart]]
+- [nerdbynature.de/sXFS-Corruption-warning-Metadata-has-LSN-ahead-of-current-LSN](http://nerdbynature.de/s9y/2016/05/06/XFS-Corruption-warning-Metadata-has-LSN-ahead-of-current-LSN)
+- [Corruption warning: Metadata has LSN (6:49052) ahead of current LSN](https://microdevsys.com/wp/corruption-warning-metadata-has-lsn-649052-ahead-of-current-lsn-649006-please-unmount-and-run-xfs_repair-v4-3-to-resolve/)
diff --git a/notes/xhyve.md b/notes/xhyve.md
new file mode 100644
index 00000000..ebb272c2
--- /dev/null
+++ b/notes/xhyve.md
@@ -0,0 +1,25 @@
+---
+tags: [virtualization]
+title: xhyve
+created: '2020-03-13T13:21:40.521Z'
+modified: '2023-05-30T13:01:50.567Z'
+---
+
+# xhyve
+
+## install
+
+```sh
+brew install --HEAD xhyve
+```
+
+## usage
+
+```sh
+xhyve -h
+```
+
+## see also
+
+- [[hyperkit]]
+- [[qemu]]
diff --git a/notes/xkcdpass.md b/notes/xkcdpass.md
new file mode 100644
index 00000000..aab46d1d
--- /dev/null
+++ b/notes/xkcdpass.md
@@ -0,0 +1,55 @@
+---
+tags: [python]
+title: xkcdpass
+created: '2021-02-12T12:38:07.546Z'
+modified: '2023-03-22T10:56:07.227Z'
+---
+
+# xkcdpass
+
+> flexible and scriptable password generator which generates strong passphrases, inspired by [XKCD-936](http://xkcd.com/936/)
+
+## install
+
+```sh
+pip3 install xkcdpass
+```
+
+## option
+
+```sh
+-h, --help # show this help message and exit
+-w WORDFILE, --wordfile=WORDFILE # list of valid words from which to generate passphrases
+ --min=MIN_LENGTH # Minimum length of words to make password
+ --max=MAX_LENGTH # Maximum length of words to make password
+-n NUMWORDS, --numwords=NUMWORDS # Number of words to make password
+-i, --interactive # Interactively select a password
+-v VALID_CHARS, --valid-chars=VALID_CHARS # valid chars, using regexp style (e.g. '[a-z]')
+-V, --verbose # report various metrics for given options, including word list entropy
+-c COUNT, --count=COUNT # number of passwords to generate
+-d DELIM, --delimiter=DELIM # separator character between words
+-s SEP, --separator SEP # separate generated passphrases with SEP.
+-C CASE, --case CASE # choose method for setting case of each word in passphras ['alternating', 'upper','lower', 'random', 'capitalize']
+```
+
+## usage
+
+```sh
+xkcdpass # could output "correct horse battery staple"
+
+xkcdpass \
+ --count=5 \
+ --acrostic='chaos' \
+ --delimiter='-' \
+ --min=5 \
+ --max=6 \
+ --valid-chars='[a-z]'
+```
+
+## see also
+
+- [[op]]
+- [[mkpasswd]]
+- [[openssl]] `passwd`
+- [pypi.org/project/xkcdpass/](https://pypi.org/project/xkcdpass/)
+- [[pip]]
diff --git a/notes/xmllint.md b/notes/xmllint.md
index f2906aa8..2d85f3f8 100644
--- a/notes/xmllint.md
+++ b/notes/xmllint.md
@@ -1,14 +1,30 @@
---
-tags: [bash, xml]
+tags: [linux]
title: xmllint
created: '2019-08-01T08:20:39.353Z'
-modified: '2019-08-01T08:55:16.385Z'
+modified: '2020-10-09T12:02:31.976Z'
---
# xmllint
+## install
+
+`apk add --no-ache libxml2-utils`
+
+## usage
+
+```sh
+# pom.xml
+xmllint --shell pom.xml <<< 'setns ns=http://maven.apache.org/POM/4.0.0
+cat /ns:project/ns:version/text()'
+```
+
+```sh
+xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' pom.xml # get version
+```
## xpath
+
```sh
cat < /tmp/sourcefile.xml
@@ -46,24 +62,23 @@ EOF
/tmp/namespace.xml
```
+
### shell mode and declare the namespace with a prefix
+
```sh
xmllint --shell /tmp/namespace.xml
/ > setns x=http://purl.org/net/ulf/ns/0.4-02
/ > xpath /x:chat
```
+
### local-name() to match element names
+
```sh
xmllint --xpath "/*[local-name()='chat']" /tmp/namespace.xml
```
+## see also
-### pom.xml
-
-```sh
-xmllint --shell pom.xml <<< 'setns ns=http://maven.apache.org/POM/4.0.0
-cat /ns:project/ns:version/text()'
-
-xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' pom.xml
-```
-[get-pom-xml-version-with-xmllint](https://stackoverflow.com/a/41115011/2087704)
+- [[xpath]]
+- [[mvn]]
+- [get-pom-xml-version-with-xmllint](https://stackoverflow.com/a/41115011/2087704)
diff --git a/notes/xpath.md b/notes/xpath.md
new file mode 100644
index 00000000..f991dac3
--- /dev/null
+++ b/notes/xpath.md
@@ -0,0 +1,22 @@
+---
+tags: [container, linux, macos]
+title: xpath
+created: '2020-10-09T12:01:24.801Z'
+modified: '2023-03-25T12:10:16.895Z'
+---
+
+# xpath
+
+> query language for selecting nodes from an XML document
+
+## usage
+
+```sh
+/store/book[1]/title
+```
+
+## see also
+
+- [[xmllint]]
+- [[jsonpath]]
+- [[jq]]
diff --git a/notes/xxd.md b/notes/xxd.md
new file mode 100644
index 00000000..bb7848c3
--- /dev/null
+++ b/notes/xxd.md
@@ -0,0 +1,63 @@
+---
+tags: [linux]
+title: xxd
+created: '2019-09-04T06:14:01.648Z'
+modified: '2023-05-19T10:15:51.022Z'
+---
+
+# xxd
+
+> make a hexdump or do the reverse
+
+## install
+
+```sh
+brew install vim # part of vim for some reaseon ?!
+```
+
+## option
+
+```sh
+-a # toggle autoskip: A single '*' replaces nul-lines Default off
+-b # binary digit dump (incompatible with -ps,-i,-r) Default hex
+-C # capitalize variable names in C include file style (-i)
+-c COLS # format COLS octets per line Default 16 (-i: 12, -ps: 30)
+-E # show characters in EBCDIC Default ASCII
+-e # little-endian dump (incompatible with -ps,-i,-r)
+-g BYTES # number of octets per group in normal output Default 2 (-e: 4)
+-h # print this summary
+-i # output in C include file style
+-l LEN # stop after octets
+-n NAME # set the variable name used in C include output (-i)
+-o off # add to the displayed file position
+-ps # output in postscript plain hexdump style
+-r # reverse operation: convert (or patch) hexdump into binary
+-r -s off # revert with added to file positions found in hexdump
+-d # show offset in decimal instead of hex
+-s [+][-]seek # start at bytes abs. (or +: rel.) infile offset
+-u # use upper case hex letters
+-v # show version: "xxd 2022-01-14 by Juergen Weigert et al."
+```
+
+## usage
+
+```sh
+echo "STRING" |ย xxd # get hex of string
+
+xxd docker-compose.yml # hexdump file
+
+xxd -plain # output in postscript continuous hexdump style. Also known as plain hexdump style.
+
+echo '0 4a' | xxd -r
+echo '0x4a' | xxd -r
+# xxd -r <<<'0 4a' # decimal
+```
+
+## see also
+
+- [[od]]
+- [[vim]]
+- [[brew]]
+- [[ascii]]
+- [[hexdump]]
+- [[bash echo]]
diff --git a/notes/yaml.md b/notes/yaml.md
new file mode 100644
index 00000000..674ba1e5
--- /dev/null
+++ b/notes/yaml.md
@@ -0,0 +1,70 @@
+---
+tags: [Notebooks]
+title: yaml
+created: '2019-07-30T06:19:49.267Z'
+modified: '2023-05-24T11:35:21.366Z'
+---
+
+# yaml
+
+> `y`aml `a`in't `m`arkup `l`anguage - is a human friendly data serialization standard for all programming languages
+
+## usage
+
+```yml
+%YAML 1.2 # directive
+--- # separate directives from document content, also serves to signal start of doc if no directives are present
+foo: bar
+... # indicate end of document without starting a new one, for use in communication channels
+```
+
+## collection types: maps / dictionaries
+
+```yml
+val:
+ sval: "bar"
+ bval: true
+```
+## collection types: sequence / arrays
+
+```yml
+val:
+- sval=bar
+- bval=true # true is not evaluated at first !
+```
+
+# block scalars
+
+```yml
+Block Style Indicator:
+- literal: `|`
+- float: `>`
+
+Block Chomping Indicator:
+- strip: `-`
+- keep: `+`
+
+
+example: | \n # Keep newlines (literal)
+ some text.
+
+example: > \n # Replace newlines with spaces (folded)
+ some text
+
+example: | # Single newline at end (clip)
+example: >- # No newline at end (strip)
+example: |+ # All newlines from end (keep)
+
+
+example: >3 # indendation indicator
+```
+
+## see also
+
+- [[json]]
+- [[yq]], [[jq]]
+- [[heredoc]]
+- [[python]], [[ruby]], [[javascript]], [[go]]
+- [[kubectl]], [[docker-compose]]
+- [yaml.org/](https://yaml.org/)
+- [yaml-multiline.info](https://yaml-multiline.info/)
diff --git a/notes/yarn.md b/notes/yarn.md
new file mode 100644
index 00000000..d25a7870
--- /dev/null
+++ b/notes/yarn.md
@@ -0,0 +1,39 @@
+---
+tags: [javascript]
+title: yarn
+created: '2021-01-25T12:13:20.192Z'
+modified: '2022-12-02T14:06:24.664Z'
+---
+
+# yarn
+
+> provides cli commands to help with yarn package, including installation, administration, publishing
+
+## install
+
+```sh
+npm install --global yarn
+```
+
+## usage
+
+```sh
+yarn --version
+
+yarn add # adds a package to use in your current package
+
+yarn init # initializes the development of a package
+
+yarn install # installs all the dependencies defined in a package.json file
+
+yarn publish # publishes a package to a package manager
+
+yarn remove # removes an unused package from your current package
+```
+
+## see also
+
+- [[node]]
+- [[npm]]
+- [[npx]]
+- [classic.yarnpkg.com/en/docs/usage](https://classic.yarnpkg.com/en/docs/usage)
diff --git a/notes/yes.md b/notes/yes.md
new file mode 100644
index 00000000..a46eb1a3
--- /dev/null
+++ b/notes/yes.md
@@ -0,0 +1,37 @@
+---
+tags: [coreutils]
+title: 'yes'
+created: '2020-05-06T11:21:08.436Z'
+modified: '2023-05-13T15:13:40.470Z'
+---
+
+# yes
+
+> output a string repeatedly until killed
+
+## option
+
+```sh
+--help # display this help and exit
+--version # output version information and exit
+```
+
+## usage
+
+```sh
+yes [STRING]... # Repeatedly output a line with all specified STRING(s), or 'y'.
+
+yes OPTION
+
+yes | rm -r large_directory
+
+yes | fsck /dev/foo
+
+yes | keytool -import -trustcacerts -alias "ALIAS" -file "CERT.pem" -cacerts -storepass "PASS"
+```
+
+## see also
+
+- [[openssl]]
+- [[fsck]]
+- [endler.dev/yes](https://endler.dev/2017/yes/)
diff --git a/notes/yml.md b/notes/yml.md
deleted file mode 100644
index 883f9c1a..00000000
--- a/notes/yml.md
+++ /dev/null
@@ -1,67 +0,0 @@
----
-tags: [yml]
-title: yml
-created: '2019-07-30T06:19:49.267Z'
-modified: '2019-08-01T08:23:13.011Z'
----
-
-# yml
-
-## collection types
-
-
-```yml
-# maps / dictionaries
-val:
- sval: "bar"
- bval: true
-
-# sequence / arrays
-val:
-- sval=bar
-- bval=true # true is not evaluated at first !
-```
-
-## Block Scalars
-
-Block Style Indicator
-- literal: `|`
-- float: `>`
-
-Block Chomping Indicator
-- strip: `-`
-- keep: `+`
-
-
-```sh
-example: | \n # Keep newlines (literal)
- some text.
-
-example: > \n # Replace newlines with spaces (folded)
- some text
-
-example: | # Single newline at end (clip)
-example: >- # No newline at end (strip)
-example: |+ # All newlines from end (keep)
-
-
-example: >3 # indendation indicator
-```
-
-[YAML Multiline Strings](https://yaml-multiline.info/)
-
-## yq
-
-### update inplace via script
-```sh
-# ../update-deploy.yml
-# services.application.deploy.mode: replicated
-# services.application.deploy.replicas: 0
-
-yq w -i -s ../update.yml file.yml
-```
-
-
-```sh
-yq r file.yml services.application.image
-```
diff --git a/notes/youtube-dl.md b/notes/youtube-dl.md
new file mode 100644
index 00000000..704ec34b
--- /dev/null
+++ b/notes/youtube-dl.md
@@ -0,0 +1,51 @@
+---
+tags: [python]
+title: youtube-dl
+created: '2019-07-30T06:19:49.267Z'
+modified: '2023-05-11T10:37:52.281Z'
+---
+
+# youtube-dl
+
+> download videos from youtube.com or other video platforms
+
+## install
+
+```sh
+brew install youtube-dl
+
+pip install --upgrade youtube-dl
+```
+
+## usage
+
+```sh
+youtube-dl --continue --extract-audio --audio-format mp3 --embed-thumbnail h3Q12OkBTHk
+
+youtube-dl --continue --extract-audio --audio-format mp3 --embed-thumbnail --batch-file FILE
+
+youtube-dl --skip-download --write-thumbnail VIDEO_ID # download just the thumbnail from a youtube video
+
+youtube-dl \
+ --extract-audio \
+ -f bestaudio \
+ -o '/PATH/FILE.mp3' \
+ --metadata-from-title "%(artist)s - %(title)s" \
+ YOUTUBE_ID 2>&1
+
+youtube-dl `# extract audio from playlist starting at playlist-index: 17` \
+ --no-overwrites \
+ --continue \
+ --extract-audio \
+ --audio-format mp3 \
+ --playlist-start 17 \
+ LIST_ID
+```
+
+## see also
+
+- [[imagemagick]]
+- [[ffmpeg]]
+- [[eyed3]]
+- [[python]]
+- [[curl]]
diff --git a/notes/yq.md b/notes/yq.md
new file mode 100644
index 00000000..5da6accc
--- /dev/null
+++ b/notes/yq.md
@@ -0,0 +1,111 @@
+---
+tags: [go]
+title: yq
+created: '2019-08-20T12:05:18.926Z'
+modified: '2023-04-20T11:40:38.472Z'
+---
+
+# yq
+
+> lightweight and portable command-line YAML processor
+
+## install
+
+```sh
+brew install yq
+
+GO111MODULE=on go get github.com/mikefarah/yq/v4 # from source
+
+yq shell-completion bash > /etc/bash_completion.d/yq # install bach_completion
+```
+
+## option
+
+```sh
+-C, --colors # force print with colors
+-M, --no-colors # force print with no colors
+-e, --exit-status # set exit status if there are no matches or null or false is returned
+-f, --front-matter STRING # first input as yaml front-matter: extract, process
+ # extract: will pull out the yaml content
+ # process: will run the expression against the yaml content, leaving the remaining data intact
+ --header-preprocess # slurp any header comments and separators before processing expression.
+ # workaround for go-yaml to persist header content. (default true)
+-I, --indent INT # sets indent level for output (default 2)
+-i, --inplace # update the yaml file inplace of first yaml file given.
+-N, --no-doc # don't print document separators `---`
+-n, --null-input # don't read input, simply evaluate the expression given. Useful for creating yaml docs from scratch.
+-o, --output-format STRING # output format (default "yaml"): yaml, y, json, j, props, p
+-P, --prettyPrint # pretty print, shorthand for '... style = ""'
+ --unwrapScalar # unwrap scalar, print the value with no quotes, colors or comments (default true)
+-v, --verbose # verbose mode
+```
+
+## operators
+
+> `yq` expressions are made up of operators and pipes
+
+```sh
+add
+
+reduce # powerful way to process a collection of data into a new form
+ # EXPRESSION as $NAME ireduce (INIT; BLOCK)
+
+.[] as $item ireduce (0; . + $item)
+
+
+env
+strenv # inject the contents from an environment variable
+
+sort_keys(.) # sort keys of map
+sort_keys(..) # sort keys recursively
+```
+
+## usage
+
+```sh
+yq r file.yml services.application.image # read file and print ..image
+
+yq w -i -s ../update.yml file.yml # write/update file
+
+
+helm template CHART | yq eval-all # read multiple yaml documents
+
+readarray actions < <(yq e '.coolActions[]' sample.yaml) # create a bash array
+
+LICENSE=$(cat LICENSE) yq eval -n '.a = strenv(LICENSE)' # strenv operator to inject the contents from an environment variable.
+
+# merge multiple documents into one
+# to merge, use the reduce operator with the * (multiply) operator.
+# note: the use of ea/eval-all to load all files into memory so that they can be merged
+yq ea '. as $item ireduce ({}; . * $item )' FILE1.yml FILE2.yml
+
+
+yq eval '... comments=""' FILE.yaml # strip all comments, `...` ensure key nodes are included
+
+diff -y -W $(tput cols) <(yq e -P FILE1.yaml) <(yq e -P FILE2.yaml) # using pretty print to normalise styling and running diff
+diff -y -W $(tput cols) <(yq e 'sort_keys(..)' 1.yaml) <(yq e 'sort_keys(..)' 2.yaml) # sort keys recursively, reducing diff noise
+
+yq e '. | select(.kind == "Service") ' FILE.yaml # print only document of kind: Service
+
+
+# https://stackoverflow.com/a/68291270/14523221
+yq -y 'del(.. | select(objects and length == 0))' # Remove empty objects
+yq -y 'del(.. | select(arrays and length == 0))' # Remove empty arrays
+yq -y 'del(.. | select(length == 0))' # Remove empty objects, arrays and strings
+
+
+# concat two strings
+kubectl get node -o yaml | yq e '.items[].metadata.labels | ."kubernetes.io/role" + " " + ."node.kubernetes.io/instance-type" ' -
+
+# select two values via `(.val, .foo)`
+kubectl get node -o yaml | yq e '.items[].metadata.labels | (."kubernetes.io/role", ."node.kubernetes.io/instance-type") ' -
+```
+
+## see also
+
+- [[yaml]]
+- [[jq]]
+- [[kubectl]]
+- [[docker-compose]]
+- [[bash readarray]]
+- [mikefarah.gitbook.io/yq](https://mikefarah.gitbook.io/yq/)
diff --git a/notes/yum.md b/notes/yum.md
index e22e008e..68a1bc77 100644
--- a/notes/yum.md
+++ b/notes/yum.md
@@ -1,13 +1,44 @@
---
-tags: [linux/packagemanager]
+tags: [linux, packagemanager]
title: yum
created: '2019-07-30T20:38:53.233Z'
-modified: '2019-07-30T20:39:40.611Z'
+modified: '2023-03-14T11:29:09.820Z'
---
# yum
-`yum` - yellowdog updater, modified
+> `yellowdog updater, modified`
-[readhat.com/yum-cheat-sheet](https://access.redhat.com/articles/yum-cheat-sheet)
+## usage
+```sh
+yum install -y package
+
+yum install -q package
+
+yum remove pkg
+
+
+yum provides $(which ip) # find out package
+
+yum whatprovides */mkpasswd # find out package
+
+
+yum makecache fast # Download yum repository data to cache
+
+yum list installed
+
+yum list available
+
+yum repolist
+```
+
+## see also
+
+- [[rpm]]
+- [[tdnf]]
+- [[microdnf]]
+- [redhat.com/yum-cheat-sheet](https://access.redhat.com/articles/yum-cheat-sheet)
+- [[apt-get]]
+- [[aws]]
+- [[amazon-linux-extras]]
diff --git a/notes/zbar.md b/notes/zbar.md
new file mode 100644
index 00000000..a3048b9d
--- /dev/null
+++ b/notes/zbar.md
@@ -0,0 +1,28 @@
+---
+tags: [macos]
+title: zbar
+created: '2021-10-14T11:46:06.399Z'
+modified: '2023-03-24T09:54:23.120Z'
+---
+
+# zbar
+
+> read qr codes
+
+## install
+
+```sh
+brew install zbar
+```
+
+## usage
+
+```sh
+โ + โง + 2 # read qr-code see `zbar`
+```
+
+## see also
+
+- [[macos keyboard shortcuts]]
+- [github.com/mchehab/zbar](https://github.com/mchehab/zbar)
+- [github.com/FrederikRogalski/QR-Reader-Mac](https://github.com/FrederikRogalski/QR-Reader-Mac)
diff --git a/notes/zcat.md b/notes/zcat.md
new file mode 100644
index 00000000..8e5ab946
--- /dev/null
+++ b/notes/zcat.md
@@ -0,0 +1,31 @@
+---
+tags: [linux, macos]
+title: zcat
+created: '2022-02-02T09:36:52.954Z'
+modified: '2023-03-25T12:09:55.405Z'
+---
+
+# zcat
+
+> expands a compressed file to STDOUT
+
+## option
+
+```sh
+-n # omits compressed file header from the compressed file
+-V # writes current version and compile options to standard error
+```
+
+## usage
+
+```sh
+zcat FILE
+```
+
+## see also
+
+- [[cat]]
+- [[bat]]
+- [[moreutils]]
+- [[zip]]
+- [[gzip]]
diff --git a/notes/zig.md b/notes/zig.md
new file mode 100644
index 00000000..d773fd96
--- /dev/null
+++ b/notes/zig.md
@@ -0,0 +1,31 @@
+---
+tags: [zig]
+title: zig
+created: '2023-05-23T07:00:36.740Z'
+modified: '2023-05-24T08:38:50.555Z'
+---
+
+# zig
+
+> general-purpose programming language and toolchain for maintaining robust, optimal and reusable software
+
+## usage
+
+```sh
+zig build-exe hello.zig
+```
+
+```zig
+const std = @import("std");
+
+pub fn main() !void {
+ const stdout = std.io.getStdOut().writer();
+ try stdout.print("Hello, {s}!\n", .{"world"});
+}
+```
+
+## see also
+
+- [[bun]]
+- [[rust]], [[go]]
+- [ziglang.org/](/https://ziglang.org/)
diff --git a/notes/zip.md b/notes/zip.md
new file mode 100644
index 00000000..dc28c782
--- /dev/null
+++ b/notes/zip.md
@@ -0,0 +1,80 @@
+---
+tags: [linux, macos]
+title: zip
+created: '2019-09-26T06:55:59.693Z'
+modified: '2023-03-13T11:20:49.550Z'
+---
+
+# zip
+
+> package and compress (archive) files
+
+## zip
+
+## option
+
+```sh
+-r, --recurse-paths # travel the directory structure recursively
+
+-R, --recurse-patterns # travel the directory structure recursively starting at the current directory; for example:
+```
+
+## usage
+
+```sh
+zip -r foo.zip foo
+zip -r foo foo # all the files and directories in foo are saved in a zip archive named foo.zip, including files with names starting with "."
+ # recursion does not use shell's file-name substitution mechanism
+
+zip -r foo foo1 foo2 # multiple source directories, which first zips up foo1 and then foo2, going down each directory
+
+zip -r FILE.zip FILE/ # recursively zip all files in dir
+
+zip -R foo "*.c" # all the files matching *.c in the tree starting at the current directory are stored into a zip archive foo.zip.
+ # Note: that *.c will match file.c, a/file.c and a/b/.c
+ # More than one pattern can be listed as separate arguments
+
+zip -d FILE.jar BOOT-INF/classes/logback/logback-spring.xml # remove file out of jar
+```
+
+## unzip
+
+## option
+
+> list, test and extract compressed files in a zip archive
+
+```sh
+-c # extract files to stdout; similar to the -p option except that the name of each file is printed as it is extracted
+-p # extract files to pipe (stdout). Nothing but the file data is sent to stdout, and the files are always extracted in binary format
+
+-l # list archive files in short format
+-v # list verbosely or show version info
+-z # display only the archive comment
+
+-t # test archive files. This option extracts each specified file in memory and compares the CRC
+ # (cyclic redundancy check, an enhanced checksum) of the expanded file with the original file's stored CRC value
+
+-f # freshen existing files, extract only those files that already exist on disk and that are newer than the disk copies
+-u # update existing files and create new ones if needed. same as -f option and in addition it extracts files that do not already exist on disk
+```
+
+## usage
+
+```sh
+unzip FILE.zip
+
+unzip -l FILE.jar # list files of jar
+
+unzip -v FILE.zip # list more verbose
+
+unzip -p FILE.jar META-INF/MANIFEST.MF # get current versions
+```
+
+## see also
+
+- [[rar]]
+- [[gzip]]
+- [[zcat]]
+- [[tar]]
+- [[zrun]]
+- [[jar]]
diff --git a/notes/zookeeper-shell.md b/notes/zookeeper-shell.md
new file mode 100644
index 00000000..ffd58c0f
--- /dev/null
+++ b/notes/zookeeper-shell.md
@@ -0,0 +1,34 @@
+---
+tags: [linux]
+title: zookeeper-shell
+created: '2019-09-23T09:47:31.660Z'
+modified: '2023-04-11T11:09:58.933Z'
+---
+
+# zookeeper-shell
+
+## usage
+
+```sh
+zookeeper-shell zookeeper-1:2181 # starts interactive shell
+
+zookeeper-shell zookeeper-2:2181 ls /brokers/ids # get a list of available brokers
+
+echo stat | nc localhost 2181 | grep Mode # determine which node is acting as a leader
+
+
+# interactive mode
+ls /brokers/ids # list from path
+
+ls / true # Watch can be set on any znode while using read operations like ls or get command.
+ # Watch is set by setting the second argument of read operations as true:
+```
+
+## see also
+
+- [[redis-cli]]
+- [[consul]]
+- [[etcdctl]]
+- [[kafka]]
+- [serverfault.com/get-zookeeper-cluster-status](https://serverfault.com/questions/801251/get-zookeeper-cluster-status)
+
diff --git a/notes/zrun.md b/notes/zrun.md
new file mode 100644
index 00000000..2aa45208
--- /dev/null
+++ b/notes/zrun.md
@@ -0,0 +1,23 @@
+---
+tags: [linux, moreutils]
+title: zrun
+created: '2020-09-01T07:18:25.941Z'
+modified: '2022-02-02T09:36:32.647Z'
+---
+
+# zrun
+
+> automatically uncompress arguments to command
+
+## usage
+
+```sh
+zrun grep WORD FILE.gz # uncompresses to temp files (not pipes) and feeds to grep
+```
+
+## see also
+
+- [[moreutils]]
+- [[zip]]
+- [[gzip]]
+- [[zcat]]
diff --git a/notes/zsh.md b/notes/zsh.md
new file mode 100644
index 00000000..ae91e55b
--- /dev/null
+++ b/notes/zsh.md
@@ -0,0 +1,20 @@
+---
+tags: [shell]
+title: zsh
+created: '2021-05-12T09:00:09.604Z'
+modified: '2023-03-22T09:24:02.613Z'
+---
+
+# zsh
+
+> `z shell` - unix shell, extended bourne shell `sh` with many improvements
+
+## usage
+
+```sh
+zsh
+```
+
+## see also
+
+- [[sh]], [[ash]], [[bash]], [[dash]]
diff --git a/notes/zypper.md b/notes/zypper.md
new file mode 100644
index 00000000..85201746
--- /dev/null
+++ b/notes/zypper.md
@@ -0,0 +1,26 @@
+---
+tags: [linux, packagemanager]
+title: zypper
+created: '2022-01-13T13:56:52.606Z'
+modified: '2023-04-12T13:33:10.797Z'
+---
+
+# zypper
+
+> cli interface to ZYpp system management library (`libzypp`)
+
+## usage
+
+```sh
+zypper help COMMAND
+
+zypper update
+
+zypper --non-interactive install curl command-not-found vim netcat-openbsd hostname
+```
+
+## see also
+
+- [[apt-get]]
+- [[k3s]]
+- [[command-not-found]]