diff --git a/.github/workflows/markdown-lint.yml b/.github/workflows/markdown-lint.yml index 5491335..3f9d5dc 100644 --- a/.github/workflows/markdown-lint.yml +++ b/.github/workflows/markdown-lint.yml @@ -1,28 +1,25 @@ name: GitHub Actions Demo + on: [push] + jobs: - lint-changelog: - name: Lint changelog file + +# 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: Check out code - uses: actions/checkout@v2 - - name: lint files - uses: avto-dev/markdown-lint@v1 + - name: Checkout + uses: actions/checkout@v1 + - name: debug output + uses: docker://ghcr.io/igorshubovych/markdownlint-cli:latest with: - args: 'README.md' - -# - name: Lint changelog file -# uses: docker://avtodev/markdown-lint:v1 # fastest way -# with: -# rules: '/lint/rules/changelog.js' -# config: '/lint/config/changelog.yml' -# args: './CHANGELOG.md' -# ignore: './one_file.md ./another_file.md' # multiple files must be separated with single space - -# - name: Lint changelog file -# uses: avto-dev/markdown-lint@v1 -# with: -# rules: '/lint/rules/changelog.js' -# config: '/lint/config/changelog.yml' -# args: './CHANGELOG.md' + args: ./notes/t*.md --disable MD013 MD025 MD013 MD040 MD010 diff --git a/notes/12 factor app.md b/notes/12 factor app.md index c1bf38f..d3d9533 100644 --- a/notes/12 factor app.md +++ b/notes/12 factor app.md @@ -1,23 +1,22 @@ --- title: 12 factor app created: '2022-02-15T10:15:31.700Z' -modified: '2022-02-15T10:36:03.327Z' +modified: '2022-04-04T13:17:34.056Z' --- # 12 factor app -> methodology for building software-as-a-service apps +> methodology for building software-as-a-service apps ## 12 factors - ## I. Codebase > one codebase tracked in a vcs, many deploy ## II. Dependencies -> explicitly declare and isolat dependencies +> explicitly declare and isolat dependencies ?! @@ -27,7 +26,7 @@ modified: '2022-02-15T10:36:03.327Z' ## IV. Backing Services -> treat backing services as attached resources +> treat backing services as attached resources ?? @@ -67,10 +66,8 @@ what is a run stage ? > rund admin/management tasks as one-off processes - - ## see also - [[devops]] -- [12factor.net](https://12factor.net/) - [[unix socket]] +- [12factor.net](https://12factor.net/) diff --git a/notes/acid crud.md b/notes/acid crud.md index 917c998..b381439 100644 --- a/notes/acid crud.md +++ b/notes/acid crud.md @@ -10,6 +10,7 @@ modified: '2022-02-02T08:49:37.072Z' ## acid > set of properties that guarante reliable database transactions + ``` A C I D | | | └─ Durability @@ -23,12 +24,15 @@ A C I D > 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 @@ -40,6 +44,7 @@ On POSIX systems, durability is achieved through `sync` operations: `fsync`, `fd ## crud > 4 basic functions of persistent storage + ``` C R U D | | | └─ Delete @@ -47,6 +52,7 @@ C R U D | └───── Read └─────── Ceate ``` + | CRUD-Operation | SQL-92 | HTTP/REST | |-- |-- |-- | diff --git a/notes/apk.md b/notes/apk.md index e64eabe..6b5ded3 100644 --- a/notes/apk.md +++ b/notes/apk.md @@ -2,12 +2,12 @@ tags: [linux, packagemanager, shell/ash] title: apk created: '2019-07-30T20:26:52.476Z' -modified: '2021-10-29T12:34:30.798Z' +modified: '2022-04-27T06:58:49.004Z' --- # 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"` ## usage diff --git a/notes/apt-file.md b/notes/apt-file.md index 9222d73..f39bc11 100644 --- a/notes/apt-file.md +++ b/notes/apt-file.md @@ -2,16 +2,19 @@ tags: [linux] title: apt-file created: '2020-01-16T07:31:31.148Z' -modified: '2020-08-31T09:36:13.206Z' +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 @@ -19,4 +22,6 @@ apt-file search mkpasswd ``` ## see also + - [[apt]] +- [[apt-get]] diff --git a/notes/architectural pattern.md b/notes/architectural pattern.md index 98e8946..a2896b2 100644 --- a/notes/architectural pattern.md +++ b/notes/architectural pattern.md @@ -2,7 +2,7 @@ tags: [Notebooks] title: architectural pattern created: '2020-03-12T09:08:11.760Z' -modified: '2020-09-02T17:34:53.328Z' +modified: '2022-04-06T11:36:03.247Z' --- # architectural pattern @@ -10,5 +10,6 @@ modified: '2020-09-02T17:34:53.328Z' > 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 index 5fd9f5d..181ae7f 100644 --- a/notes/argocd.md +++ b/notes/argocd.md @@ -2,7 +2,7 @@ tags: [container] title: argocd created: '2020-10-26T12:29:59.372Z' -modified: '2022-01-17T13:55:14.545Z' +modified: '2022-03-16T07:10:31.142Z' --- # argocd @@ -28,6 +28,8 @@ argocd app create guestbook \ --path guestbook \ --dest-server https://kubernetes.default.svc \ --dest-namespace default + +argocd app list ``` ## see also diff --git a/notes/arping.md b/notes/arping.md index c46c9a3..94f16e1 100644 --- a/notes/arping.md +++ b/notes/arping.md @@ -2,16 +2,19 @@ tags: [linux] title: arping created: '2019-12-26T19:30:34.765Z' -modified: '2020-01-16T08:02:30.826Z' +modified: '2022-04-06T11:36:24.621Z' --- # arping + > send ARP requests to a neighbour host ## install + `apt install arping`, `yum install arping` ## usage + ```sh arping # Send ARP request to a neighbour host @@ -21,4 +24,6 @@ arping -D -I eth0 192.168.1.1 # Check for duplicate MAC addresses at 192.168.1 ``` ## see also + - [[arp]] +- [[ping]] diff --git a/notes/ascii.md b/notes/ascii.md index a026615..0b2ae5a 100644 --- a/notes/ascii.md +++ b/notes/ascii.md @@ -1,7 +1,7 @@ --- title: ascii created: '2019-07-30T06:19:48.987Z' -modified: '2022-02-04T10:55:01.286Z' +modified: '2022-04-08T20:47:57.207Z' --- # ascii @@ -39,12 +39,19 @@ char | oct | hex | dec J | 112 | 4a | 74 ``` + +```sh + + +``` + ## see also +- [asciiflow.com/](https://asciiflow.com/#/) +- [asciimoji.com](http://asciimoji.com/) - [[http]] - [[url encoding]] - [[xxd]] - [[od]] - [[baudot]] - [jafrog.com/2013/11/23/colors-in-terminal](http://jafrog.com/2013/11/23/colors-in-terminal.html) -- [asciimoji.com](http://asciimoji.com/) diff --git a/notes/asm.md b/notes/asm.md index 6c62827..a4ad979 100644 --- a/notes/asm.md +++ b/notes/asm.md @@ -2,7 +2,7 @@ tags: [c] title: asm created: '2019-07-30T06:19:48.988Z' -modified: '2020-09-02T17:33:49.395Z' +modified: '2022-04-06T11:36:41.806Z' --- # asm @@ -15,6 +15,7 @@ modified: '2020-09-02T17:33:49.395Z' - `VLIW` Very Long Instruction Word ## usage + ```asm ; opcode operands add R1, R2, 3 @@ -59,6 +60,7 @@ void junk( void ) { ``` ## see also + - [[wasm]] - [[c]] - [[rust]] diff --git a/notes/atlantis.md b/notes/atlantis.md new file mode 100644 index 0000000..14f581d --- /dev/null +++ b/notes/atlantis.md @@ -0,0 +1,25 @@ +--- +title: atlantis +created: '2022-04-19T08:16:22.864Z' +modified: '2022-04-19T08:23:00.405Z' +--- + +# 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/autoconf.md b/notes/autoconf.md index 3a1d1b7..ef2fc65 100644 --- a/notes/autoconf.md +++ b/notes/autoconf.md @@ -1,14 +1,14 @@ --- title: autoconf created: '2022-02-02T13:35:55.731Z' -modified: '2022-02-02T13:40:39.001Z' +modified: '2022-04-06T11:36:53.143Z' --- # autoconf > generate configuration scripts -## usage +## flags ```sh # operation modes @@ -29,6 +29,8 @@ modified: '2022-02-02T13:40:39.001Z' -i, --initialization # also trace autoconf's initialization process ``` +## usage + ```sh autoreconf -fi # generate config script ``` diff --git a/notes/awk.md b/notes/awk.md index ae72d1b..d59a812 100644 --- a/notes/awk.md +++ b/notes/awk.md @@ -2,7 +2,7 @@ tags: [dsl] title: awk created: '2019-07-30T06:19:48.989Z' -modified: '2021-10-31T15:06:43.809Z' +modified: '2022-04-06T11:37:07.791Z' --- # awk @@ -11,13 +11,14 @@ modified: '2021-10-31T15:06:43.809Z' > data-driven scripting language > name derived from authors surnames: Alfred Aho, Peter Weinberger, and Brian Kernighan -### implementation +### implementations + - [[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 -## usage +## flags ```sh -f SCRIPT # read awk program from file @@ -25,7 +26,62 @@ modified: '2021-10-31T15:06:43.809Z' -F ";" # field seperator ``` +## 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. +``` + +## functions + ```sh +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 + +split($1,swm,"."); # split $1 into array swm[] with optional seperator "." + +substr("foobar", 2, 3) # => "oob" + +substr("foobar", 4) # => "bar" + +length("foo") # => 3 + +tolower("FOO") # => "foo" + +toupper("foo") # => "FOO" + +gsub(/"/, "") #"# remove quotes globally +``` + +## 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 @@ -85,53 +141,6 @@ awk '{ 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++){}}' ``` -## variables - -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 - -```sh -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. -``` - -## functions - -```sh -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 - -split($1,swm,"."); # split $1 into array swm[] with optional seperator "." - -substr("foobar", 2, 3) # => "oob" - -substr("foobar", 4) # => "bar" - -length("foo") # => 3 - -tolower("FOO") # => "foo" - -toupper("foo") # => "FOO" - -gsub(/"/, "") #" # remove quotes globally -``` - ## see also - [learnxinyminutes.com/docs/awk](https://learnxinyminutes.com/docs/awk/) diff --git a/notes/aws loadbalancers.md b/notes/aws loadbalancers.md deleted file mode 100644 index cdd9376..0000000 --- a/notes/aws loadbalancers.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: aws loadbalancers -created: '2022-02-15T13:21:52.943Z' -modified: '2022-02-15T13:36:42.973Z' ---- - -# aws loadbalancers - -```sh -Feature . Application LB Network LB Gateway LB Classic LB - . -LB type . L7 L4 L3 Gateway + L4 Load Balancing L4/7 -Target type . IP, Instance, Lambda IP, Instance, ALB IP, Instance -Terminates . -flow/proxy behavior . Yes Yes No Yes -Protocol listeners . HTTP, HTTPS, gRPC TCP, UDP, TLS IP TCP, SSL/TLS, HTTP, HTTPS -Reachable via . VIP VIP Route table entry - -. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . -Layer 7 . - . -Redirects . ✔ -Fixed Response . ✔ -Desync Mitigation Mode . ✔ -HTTP header based routing . ✔ -HTTP2/gRPC . ✔ -. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - -Common configurations and characteristics - -Slow start . ✔ -Outpost support . ✔ -Local Zone . ✔ -IP address - Static, Elastic . ✔ -Connection draining (deregistration delay) ✔ ✔ ✔ ✔ -Configurable idle connection timeout ✔ ✔ -PrivateLink Support ✔ (TCP, TLS) ✔ (GWLBE) -Zonal Isolation ✔ ✔ -Session resumption ✔ ✔ -Long-lived TCP connection ✔ ✔ -Load Balancing to multiple ports on the same instance ✔ ✔ ✔ -Load Balancer deletion protection ✔ ✔ ✔ -Preserve Source IP address ✔ ✔ ✔ -WebSockets ✔ ✔ ✔ -Supported network/Platforms VPC VPC VPC EC2-Classic, VPC -Cross-zone Load Balancing ✔ ✔ ✔ ✔ -IAM Permissions(Resource, Tag based) ✔ ✔ ✔ ✔ (Only resource based) - -Flow Stickiness -(All packets of a flow are sent - to one target, and return - traffic comes from same target) Symmetric Symmetric Symmetric Symmetric - -Target Failure behavior - Fail close on targets, unless all targets are unhealthy(fail open) Fail close on targets, unless all targets are unhealthy(fail open) Existing flows continue to go to existing target appliances, new flows are rerouted to healthy target appliances. -Health Checks HTTP, HTTPS, gRPC TCP, HTTP, HTTPS TCP, HTTP, HTTPS TCP, SSL/TLS, HTTP, HTTPS - -. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - -Security - -SSL Offloading ✔ ✔ ✔ -Server Name Indication (SNI) ✔ ✔ -Back-end Server Encryption ✔ ✔ ✔ -User Authentication ✔ -Custom Security Policy ✔ -ALPN ✔ ✔ - -. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - -Kubernetes Controller - -Direct-to-pod ✔ ✔ (Fargate pods) -Load Balance to -multiple namespaces ✔ -Support for fully -private EKS clusters ✔ ✔ -. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - -Logging and monitoring - -CloudWatch Metrics ✔ ✔ ✔ ✔ -Logging ✔ ✔ ✔ ✔ -``` - -## see also - -- [aws.amazon.com/elasticloadbalancing/features/#compare](https://aws.amazon.com/elasticloadbalancing/features/#compare) -- [[kubectl]] -- [[eksctl]] -- [[aws]] diff --git a/notes/aws-iam-authenticator.md b/notes/aws-iam-authenticator.md new file mode 100644 index 0000000..310843e --- /dev/null +++ b/notes/aws-iam-authenticator.md @@ -0,0 +1,24 @@ +--- +title: aws-iam-authenticator +created: '2022-03-24T07:18:31.601Z' +modified: '2022-03-24T07:20:08.681Z' +--- + +# aws-iam-authenticator + +> tool to use AWS IAM credentials to authenticate to Kubernetes cluster + +## install + +`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.md b/notes/aws.md index e4f1ced..f0559cc 100644 --- a/notes/aws.md +++ b/notes/aws.md @@ -2,7 +2,7 @@ tags: [iac] title: aws created: '2019-07-30T06:19:48.990Z' -modified: '2022-03-04T07:31:25.433Z' +modified: '2022-04-11T09:21:01.116Z' --- # aws @@ -11,18 +11,86 @@ modified: '2022-03-04T07:31:25.433Z' ## install -`curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg" && installer -pkg ./AWSCLIV2.pkg -target /` +```sh +curl -LO "https://awscli.amazonaws.com/AWSCLIV2.pkg" && installer -pkg ./AWSCLIV2.pkg -target / +``` ## environment variables ```sh -AWS_PROFILE # use profile from config -AWS_ACCESS_KEY_ID -AWS_SECRET_ACCESS_KEY -AWS_CONFIG_FILE # default: "~/.aws/config" -AWS_SHARED_CREDENTIALS_FILE # default: ~/.aws/credentials -AWS_DEFAULT_OUTPUT # json, yaml, yaml-stream, text, table -AWS_DEFAULT_REGION +AWS_ACCESS_KEY_ID # access key associated with an IAM user or role + # overrides profile setting: aws_access_key_id +AWS_CA_BUNDLE # path to a certificate bundle to use for HTTPS certificate validation. + # overrides profile setting: ca_bundle + # can override by --ca-bundle +AWS_CLI_AUTO_PROMPT # enables auto-prompt, two settings can be used: + # `on` uses full auto-prompt mode each time you attempt to run an aws command. This includes pressing ENTER after both a complete command or incomplete command. + # `on-partial` uses partial auto-prompt mode. If a command is incomplete or cannot be run due to client-side validation errors, auto-prompt is used. This mode is particular useful if you have pre-existing scripts, runbooks, or you only want to be auto-prompted for commands you are unfamiliar with rather than prompted on every command. + # aws_cli_auto_prompt=on + # aws_cli_auto_prompt=on-partial + # overrides profile setting: cli_auto_prompt + # You can override this environment variable by using the --cli-auto-prompt and --no-cli-auto-prompt cli parameters + +AWS_CLI_FILE_ENCODING # encoding used for text files. By default encoding matches your locale + # to set encoding different from the locale, use the aws_cli_file_encoding environment variable. For example, if you use Windows with default encoding CP1252, setting aws_cli_file_encoding=UTF-8 sets the CLI to open text files using UTF-8 +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 when loading AWS CLI data + # Setting this environment variable indicates additional directories to check first before falling back to the built-in search path. Multiple entries should be separated with the os.pathsep character, which is : on Linux or macOS and ; on Windows. +AWS_DEFAULT_OUTPUT # output format: json, yaml, yaml-stream, text, table + # overrides profile setting: output + # You can override this environment variable by using the --output cli parameter +AWS_DEFAULT_REGION # AWS Region to send the request to. + # overrides profile setting: region + # override by --region +AWS_EC2_METADATA_DISABLED # Disables use of the Amazon EC2 instance metadata service (IMDS) + # If set to true, user credentials or configuration (like the region) are not requested from IMDS +AWS_MAX_ATTEMPTS # Specifies a value of maximum retry attempts the AWS CLI retry handler uses, where the initial call counts toward the value that you provide. For more information on retries, see AWS CLI retries. + # overrides profiles settin:g max_attempts +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. By default, AWS CLI version 2 returns all output through your operating system’s default pager program. + # unset to disable all use external paging program + # overrides profile setting: cli_pager +AWS_PROFILE # name of profile with credentials and options + # If defined, overrides the behavior of using the profile named [default] in the configuration file + # You can override this environment variable by using the --profile cli parameter. +AWS_REGION # The AWS SDK compatible environment variable that specifies the AWS Region to send the request to. + # If defined, overrides the values in the environment variable AWS_DEFAULT_REGION and the profile setting region + # You can override this environment variable by using the --region cli parameter. +AWS_RETRY_MODE # Specifies which retry mode AWS CLI uses. There are three retry modes available: legacy (default), standard, and adaptive. For more information on retries, see AWS CLI retries. + # overrides profiles settin:g retry_mode + +AWS_ROLE_ARN # ARN of an IAM role with a web identity provider that you want to use to run the AWS CLI commands + # Used with the AWS_WEB_IDENTITY_TOKEN_FILE and AWS_ROLE_SESSION_NAME environment variables + # overrides profile setting: role_arn. You can't specify a role session name as a cli parameter + # Note: this environment variable only applies to an assumed role with web identity provider it does not apply to the general assume role provider configuration. + # For more information on using web identities, see Assume role with web identity. +AWS_ROLE_SESSION_NAME # name to attach to the role session. value provided to the RoleSessionName parameter when the AWS CLI calls the AssumeRole operation, and becomes part of the assumed role user ARN: arn:aws:sts::123456789012:assumed-role/role_name/role_session_name + # This is an optional parameter. If you do not provide this value, a session name is generated automatically. This name appears in AWS CloudTrail logs for entries associated with this session. + # overrides profile setting: role_session_name + # Used with the AWS_ROLE_ARN and AWS_WEB_IDENTITY_TOKEN_FILE environment variables. + # For more information on using web identities, see Assume role with web identity. + # Note: This environment variable only applies to an assumed role with web identity provider it does not apply to the general assume role provider configuration. +AWS_SECRET_ACCESS_KEY # secret key associated with the access key. This is essentially the "password" for the access key. + # overrides profile setting: aws_secret_access_key. You can't specify the secret access key ID as a cli option +AWS_SESSION_TOKEN # session token value that is required if you are using temporary security credentials that you retrieved directly from AWS STS operations + # For more information, see the Output section of the assume-role command in the AWS CLI Command Reference + # overrides profile setting: aws_session_token +AWS_SHARED_CREDENTIALS_FILE # location of the file that the AWS CLI uses to store access keys. default path ~/.aws/credentials + # You can't specify this value in a named profile setting or by using a cli parameter + +AWS_STS_REGIONAL_ENDPOINTS # how CLI determines AWS service endpoint that the AWS CLI client uses to talk to the AWS Security Token Service (AWS STS). + # default value for version 1: "legacy" + # – Uses global STS endpoint, sts.amazonaws.com, for the following AWS Regions: ap-northeast-1, ap-south-1, ap-southeast-1, ap-southeast-2, aws-global, ca-central-1, eu-central-1, eu-north-1, eu-west-1, eu-west-2, eu-west-3, sa-east-1, us-east-1, us-east-2, us-west-1, and us-west-2. All other Regions automatically use their respective regional endpoint + # default value for version 2: "regional" + # – The AWS CLI always uses the AWS STS endpoint for the currently configured Region. For example, if the client is configured to use us-west-2, all calls to AWS STS are made to the regional endpoint sts.us-west-2.amazonaws.com instead of the global sts.amazonaws.com endpoint. To send a request to the global endpoint while this setting is enabled, you can set the Region to aws-global. + +AWS_WEB_IDENTITY_TOKEN_FILE # path to a file that contains an OAuth 2.0 access token or OpenID Connect ID token that is provided by an identity provider + # The AWS CLI loads the contents of this file and passes it as the WebIdentityToken argument to the AssumeRoleWithWebIdentity operation + # Used with the AWS_ROLE_ARN and AWS_ROLE_SESSION_NAME environment variables + # overrides profile setting: web_identity_token_file ``` [docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html) @@ -32,11 +100,16 @@ AWS_DEFAULT_REGION ```sh --color STRING # support for color output: on, off, auto --debug # enables debug logging by providing full python logs; (`CMD 2> FILE`, `CMD &> FILE`) ---regeion REGION # override region +--region REGION # override region --dry-run --output text ---owners amazon +--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) @@ -61,6 +134,13 @@ credential_source=Ec2InstanceMetadata ```sh aws sts get-caller-identity --query Account --output text # get current account id + +aws sts get-access-key-info --access-key-id ASIA...4B5S # 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 ``` ## identity and access management @@ -101,6 +181,9 @@ 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 + +aws iam list-users | jq '.Users[].UserName' \ + | xargs -I{} aws iam list-access-keys --user-name {} | jq -r '.AccessKeyMetadata[] | "\(.UserName) \(.AccessKeyId)"' ``` ## simple storage service @@ -227,6 +310,45 @@ 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 +``` + +### 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 @@ -236,14 +358,14 @@ aws eks list-clusters aws eks describe-cluster --name CLUSTER_NAME -aws eks describe-cluster `# get vpc id`\ - --name CLUSTER_NAME \ +aws eks describe-cluster --output text --name CLUSTER_NAME `# get vpc id` \ --query "cluster.resourcesVpcConfig.vpcId" \ - --output text 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 ``` ## relational database service @@ -347,4 +469,5 @@ aws securityhub get-findings \ - [[jq]], [[yq]] - [[installer]] - [[localstack]], [[minikube]] +- [[installer]] - [AWS Regions and Endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html) diff --git a/notes/axfr.md b/notes/axfr.md new file mode 100644 index 0000000..6fd83bb --- /dev/null +++ b/notes/axfr.md @@ -0,0 +1,31 @@ +--- +title: axfr +created: '2022-04-19T08:32:12.828Z' +modified: '2022-04-19T08:45:55.971Z' +--- + +# 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 + + +## usage + +```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 +``` + +## see also + + - [[dns]] + - [[dig]] + - [acunetix.com/blog/articles/dns-zone-transfers-axfr/](https://www.acunetix.com/blog/articles/dns-zone-transfers-axfr/) diff --git a/notes/basename.md b/notes/basename.md index 86bb928..59c4c70 100644 --- a/notes/basename.md +++ b/notes/basename.md @@ -2,7 +2,7 @@ tags: [coreutils] title: basename created: '2019-10-04T07:16:41.100Z' -modified: '2020-10-06T07:07:46.368Z' +modified: '2022-04-06T11:37:26.896Z' --- # basename @@ -10,11 +10,13 @@ modified: '2020-10-06T07:07:46.368Z' > 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 index a16c887..c2e2863 100644 --- a/notes/bash [ [.md +++ b/notes/bash [ [.md @@ -2,7 +2,7 @@ tags: [shell/bash/keyword] title: 'bash [ [' created: '2020-09-02T14:24:09.002Z' -modified: '2021-05-12T08:46:30.644Z' +modified: '2022-04-06T11:37:45.711Z' --- # bash [ [ @@ -11,6 +11,7 @@ modified: '2021-05-12T08:46:30.644Z' > expressions are composed of same primaries used by `test` ## usage + ```sh [[ EXPRESSION ]] @@ -27,5 +28,6 @@ OPERATORS ``` ## see also + - [[bash test []] - [[bash built-in vs keyword]] diff --git a/notes/bash alias.md b/notes/bash alias.md index f17f604..849c20f 100644 --- a/notes/bash alias.md +++ b/notes/bash alias.md @@ -2,12 +2,13 @@ tags: [shell/bash/builtin] title: bash alias created: '2019-08-02T06:42:37.554Z' -modified: '2021-05-12T08:46:07.511Z' +modified: '2022-04-06T11:38:03.695Z' --- # bash alias ## usage + ```sh alias l='ls -l' # define alias @@ -21,6 +22,7 @@ ls unalias ls ``` ## see also + - [[bash unalias]] - [[git log]] - [[time]] diff --git a/notes/bash arguments.md b/notes/bash arguments.md index a24f7fc..8465d56 100644 --- a/notes/bash arguments.md +++ b/notes/bash arguments.md @@ -2,7 +2,7 @@ tags: [shell/bash] title: bash arguments created: '2019-07-30T06:19:48.991Z' -modified: '2021-05-12T08:46:50.913Z' +modified: '2022-04-06T11:38:10.410Z' --- # bash arguments @@ -12,6 +12,7 @@ modified: '2021-05-12T08:46:50.913Z' - `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 + ```sh for i in "$@"; do case $i in @@ -62,6 +63,7 @@ echo ${CMD[*]} ${ARGS[*]} ``` ## 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) diff --git a/notes/bash arithmetic expansion.md b/notes/bash arithmetic expansion.md index 2be42e6..5b0c0e3 100644 --- a/notes/bash arithmetic expansion.md +++ b/notes/bash arithmetic expansion.md @@ -2,7 +2,7 @@ tags: [shell/bash] title: bash arithmetic expansion created: '2019-07-30T06:19:48.992Z' -modified: '2021-05-12T08:46:50.936Z' +modified: '2022-04-06T11:38:20.902Z' --- # bash arithmetic expansion @@ -10,6 +10,7 @@ modified: '2021-05-12T08:46:50.936Z' > most (if not all) GNU/Linux shells only perform `integer` operations. ## usage + ```sh $((EXPRESSION)) # is arithmetic expansion; return result @@ -34,6 +35,7 @@ echo $((13380009932/1024**3)) # 1024 to the power of 3 ``` ## see also + - [[bc]] - [[expr]] - [[bash let]] diff --git a/notes/bash array.md b/notes/bash array.md index 90902b9..743850f 100644 --- a/notes/bash array.md +++ b/notes/bash array.md @@ -2,12 +2,13 @@ tags: [shell/bash] title: bash array created: '2019-08-01T07:14:55.242Z' -modified: '2021-10-25T09:41:19.353Z' +modified: '2022-04-06T11:38:27.710Z' --- # bash array ## usage + ```sh array[0] = val # several ways to define an array array[1] = val @@ -57,6 +58,7 @@ declare | grep Colors # Colors=([0]="purple" [1]="reddish-orange" [2]="light g ``` ## see also + - [[bash declare]] - [[bash mapfile]] - [[bash readarray]] diff --git a/notes/bash bg.md b/notes/bash bg.md index ae081d3..415c56b 100644 --- a/notes/bash bg.md +++ b/notes/bash bg.md @@ -2,12 +2,13 @@ tags: [shell/bash/builtin] title: bash bg created: '2019-08-02T06:42:37.556Z' -modified: '2021-05-12T08:46:07.538Z' +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 @@ -15,6 +16,7 @@ fg # brings job to the foreground ``` ## see also + - [[bash jobs]] - [[bash fg]] - [[bash process-handling]] diff --git a/notes/bash bind.md b/notes/bash bind.md index 9b830f7..4b62ce2 100644 --- a/notes/bash bind.md +++ b/notes/bash bind.md @@ -2,7 +2,7 @@ tags: [shell/bash/builtin] title: bash bind created: '2019-08-02T06:42:37.558Z' -modified: '2021-06-08T05:29:28.715Z' +modified: '2022-04-06T11:40:42.770Z' --- # bash bind @@ -10,9 +10,11 @@ modified: '2021-06-08T05:29:28.715Z' > Set Readline key bindings and variables.Set Readline key bindings and variables ## usage + ```sh bind -X # List key sequences bound with -x and associated commands in a form that can be reused as input. ``` ## see also + - [[gnu readline]] diff --git a/notes/bash.md b/notes/bash.md index 023e06b..8cec421 100644 --- a/notes/bash.md +++ b/notes/bash.md @@ -2,13 +2,14 @@ tags: [shell/bash] title: bash created: '2019-07-30T06:19:49.025Z' -modified: '2022-03-03T16:01:45.227Z' +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 + [gnu.org/what-is-a-shell](https://www.gnu.org/software/bash/manual/html_node/What-is-a-shell_003f.html) ## flags diff --git a/notes/cmake.md b/notes/cmake.md index 3d2573f..35a068b 100644 --- a/notes/cmake.md +++ b/notes/cmake.md @@ -2,7 +2,7 @@ tags: [buildsystem] title: cmake created: '2020-08-27T11:35:46.274Z' -modified: '2020-08-28T06:44:11.908Z' +modified: '2022-04-27T06:59:29.670Z' --- # cmake @@ -10,6 +10,7 @@ modified: '2020-08-28T06:44:11.908Z' > generator of buildsystems - can produce `Makefile`, `ninja` build files, etc. from same `CMakeLists.txt` ## usage + ```sh cmake -version @@ -17,6 +18,7 @@ cmake . ``` ## CMakeLists.txt + ```txt cmake_minimum_required(VERSION 2.8.9) project (hello) @@ -24,6 +26,7 @@ add_executable(hello helloworld.cpp) ``` ## see also + - [[make]] - [[ninja]] - [[clang]] diff --git a/notes/cmctl.md b/notes/cmctl.md new file mode 100644 index 0000000..a73aad8 --- /dev/null +++ b/notes/cmctl.md @@ -0,0 +1,41 @@ +--- +title: cmctl +created: '2022-03-16T06:30:28.296Z' +modified: '2022-03-16T06:39:35.359Z' +--- + +# 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 +``` + +## flags + +```sh +``` + +## usage + +```sh +cmctl check api +``` + +## see also + +- [[kubectl]] +- [[go]] +- [[openssl]] diff --git a/notes/cp.md b/notes/cp.md index 0990ef6..4de1277 100644 --- a/notes/cp.md +++ b/notes/cp.md @@ -2,14 +2,26 @@ tags: [coreutils, macos] title: cp created: '2020-08-03T12:02:25.389Z' -modified: '2020-09-01T12:43:12.269Z' +modified: '2022-04-09T09:35:41.742Z' --- # cp > copy files +## flags + +```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 @@ -19,7 +31,10 @@ cp -R DIR /tmp # copy the dir (including subdirectories) to the /tmp d 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/cryptsetup.md b/notes/cryptsetup.md index 9fe71a7..f9fbdc1 100644 --- a/notes/cryptsetup.md +++ b/notes/cryptsetup.md @@ -2,7 +2,7 @@ tags: [cryptography] title: cryptsetup created: '2020-01-20T19:52:26.328Z' -modified: '2020-09-02T18:05:23.696Z' +modified: '2022-03-31T08:09:03.501Z' --- # cryptsetup @@ -10,29 +10,30 @@ modified: '2020-09-02T18:05:23.696Z' > utility used to conveniently set up disk encryption based on the DMCrypt kernel module ## install + `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]] -- https://medium.com/@amritanshu16/how-to-mount-luks-encrypted-disk-in-raspbian-821b0a56c18e -- https://linuxwiki.de/cryptsetup +- [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/defaults.md b/notes/defaults.md index a558e7a..674b27b 100644 --- a/notes/defaults.md +++ b/notes/defaults.md @@ -2,7 +2,7 @@ tags: [macos] title: defaults created: '2019-07-30T06:19:49.183Z' -modified: '2021-03-25T13:21:28.500Z' +modified: '2022-04-19T04:55:35.284Z' --- # defaults @@ -10,12 +10,14 @@ modified: '2021-03-25T13:21:28.500Z' > access the mac macos user defaults system ## usage + ```sh defaults write com.apple.desktopservices DSDontWriteNetworkStores true # disable .DS_Store creation 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 @@ -39,4 +41,5 @@ defaults write com.apple.screencapture name screenshot ``` ## see also + - [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) diff --git a/notes/dig.md b/notes/dig.md index c0128f5..849bbdb 100644 --- a/notes/dig.md +++ b/notes/dig.md @@ -2,7 +2,7 @@ tags: [dns, linux] title: dig created: '2019-07-30T06:19:49.037Z' -modified: '2022-01-26T08:32:14.154Z' +modified: '2022-04-19T08:46:25.014Z' --- # dig @@ -13,14 +13,15 @@ modified: '2022-01-26T08:32:14.154Z' `apt install dnsutils`, `yum install bind-utils`, `apk add --no-cache bind-tools` -## usage +## flags ```sh -t TYPE # any valid query type which is supported in BIND 9, default: A ``` +## query options + ```sh -# query options +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. @@ -29,6 +30,8 @@ modified: '2022-01-26T08:32:14.154Z' +ttlid ``` +## usage + ```sh dig +short example.com diff --git a/notes/dns.md b/notes/dns.md index 24b5ca8..b5b4d41 100644 --- a/notes/dns.md +++ b/notes/dns.md @@ -2,7 +2,7 @@ tags: [dns] title: dns created: '2019-07-30T06:19:49.040Z' -modified: '2022-01-26T08:32:31.576Z' +modified: '2022-04-19T09:00:47.606Z' --- # dns @@ -16,26 +16,75 @@ modified: '2022-01-26T08:32:31.576Z' - DNS-DB: NameServer - ZoneFile: SOA (=Start of Authority), NAS, A, AAAA, CNAME, MX, PTR, TXT -## resolve.conf config-directives -```sh -man resolv.conf +## namespace + +## zone + +## record + +> administrative concept, defines a part of the DNS namespace + +### A - `address` + +> holds the IPv4 address of a domain + +### AAAA - `address` + +> contains the IPv6 address for a domain + +### CNAME - `canonical name` + +> forwards one domain/subdomain to another domain, does NOT provide an IP address + +must point to a domain, never to an IP address ! + +### MX + +> Directs mail to an email server -nameserver IP_ADDR # Up to 3 name servers may be listed. +### TXT -domain LOCAL_DOMAIN_NAME - # resolving short host-names - # e.g.: domain example.com - # test => trys to resolve test.example.com +> Lets an admin store text notes in the record. often used for email security -search SEARCH_LIST - # search example.com example.net - # test => will try test.example.com then test.example.net +### NS - `name server` + +> Stores the `name server` for a DNS entry + +### SOA - `start of authority` + +> Stores admin information about a domain + +- zone files must always start with a SOA record + +```sh +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 ``` +### SRV + +> Specifies a port for specific services + +### PTR + +> Provides a domain name in reverse-lookups + + ## see also +- [[axfr]] - [[spf]] -- [No domain defined in /etc/resolv.conf](https://unix.stackexchange.com/a/128096/193945) - [[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 index 953730a..96724cd 100644 --- a/notes/dnsmasq.md +++ b/notes/dnsmasq.md @@ -2,7 +2,7 @@ tags: [dns] title: dnsmasq created: '2020-08-05T09:18:05.574Z' -modified: '2020-09-02T17:30:43.100Z' +modified: '2022-04-19T08:31:48.411Z' --- # dnsmasq @@ -10,9 +10,11 @@ modified: '2020-09-02T17:30:43.100Z' > lightweight dhcp- and caching dns-server ## install + `yum install dnsmasq`, `apt-get install dnsmasq` ## usage + ```sh /etc/init.d/dnsmasq restart @@ -24,6 +26,8 @@ dnsmasq --test # check config syntax for errors ``` ## see also + +- [[dns]] - [[dig]] - [[BIND]] - [[dhcp]] diff --git a/notes/entr.md b/notes/entr.md new file mode 100644 index 0000000..413b9d5 --- /dev/null +++ b/notes/entr.md @@ -0,0 +1,40 @@ +--- +title: entr +created: '2022-04-27T12:10:47.470Z' +modified: '2022-04-27T12:14:20.611Z' +--- + +# entr + +> run arbitrary commands when files change + +## install + +`brew install entr` + +## flags + +```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 + +``` + +## see also + +- [[find]] +- [eradman.com/entrproject/](http://eradman.com/entrproject/) diff --git a/notes/gitops.md b/notes/gitops.md index 76af431..2240cb1 100644 --- a/notes/gitops.md +++ b/notes/gitops.md @@ -2,7 +2,7 @@ tags: [Notebooks] title: gitops created: '2020-06-23T07:09:33.298Z' -modified: '2022-01-17T13:51:36.625Z' +modified: '2022-04-06T11:34:52.228Z' --- # gitops @@ -19,4 +19,5 @@ update in repo leads to update in infra - [[argocd]] - [[flux]] - [[kubectl]] +- [[infrastructure as code]] diff --git a/notes/go-template.md b/notes/go-template.md index 08a6b4c..2d0c880 100644 --- a/notes/go-template.md +++ b/notes/go-template.md @@ -2,7 +2,7 @@ tags: [container/docker, go] title: go-template created: '2019-07-30T06:19:49.074Z' -modified: '2022-01-25T10:58:18.109Z' +modified: '2022-04-04T13:39:40.823Z' --- # go-template @@ -34,14 +34,17 @@ println # prints each value on a new line index # function: can lookup arbitrary strings in the map ``` -## [[kubectl]] +## 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]] +## docker ```sh # docker ps diff --git a/notes/go.md b/notes/go.md index 3c7663d..cd3500d 100644 --- a/notes/go.md +++ b/notes/go.md @@ -2,30 +2,12 @@ tags: [go] title: go created: '2019-07-30T06:19:49.075Z' -modified: '2022-01-17T13:30:05.257Z' +modified: '2022-04-07T07:19:54.056Z' --- # go -> `go` is a tool for managing go source code - - -``` - has doesn't have - -+ package system - implicit numeric conversion -+ first-class-functions - constructors/destructors -+ lexical-scope - operator overloading -+ system call interface - default parameter values -+ immutable string in utf-8 - inheritance (type-based inheritance → subclasses) -+ struct ~ class - generics `parametrics polimorphism` ≈ `generics` -+ concurrency support (CSP) - exceptions - - macros -+ `garbage collected` - function annotations -+ it's `staticallly typed` - thread local storage - - inheritance but composition of type - - explicit declaration, interface-implementation required -``` +> tool for managing `go` source code ## install @@ -37,7 +19,7 @@ export GOPATH=$(go env GOPATH) export PATH="${PATH}:/usr/local/go/bin:${GOPATH}/bin" ``` -## usage +## environment variables ```sh GOROOT # /usr/local/opt/go/libexec @@ -57,8 +39,16 @@ CXX # clang++ CGO_ENABLED # - GOMOD # - GO11MODULE + +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 ``` +## usage + ```sh go help env # more information about a command @@ -70,18 +60,6 @@ go list -m all # lists the current module and all its dep go list -m -versions rsc.io/sampler # list available tagged versions of module go list -m rsc.io/... # list current versions -go get # downloads packages named by the import paths, along dependencies, - # then installs the package, using `go install`, - # which uses `go build` and go build caches recent build results in `$GOPATH/pkg` - # flags - # -v enables verbose progress and debug output - # -u update the named packages and their dependencies - # -d stop after downloading the packages; don't install the packages -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 - - go doc -all rsc.io/quote/v3 # get documentation go clean -cache -modcache -i -r # clear cache @@ -91,10 +69,50 @@ go run go test -json # Convert test output to JSON suitable for automated processing +go clean -i github.com/motemen/gore... # remove installed package +``` -go env # show current env vars go uses -go env GOCACHE # print specific value -go env -json # print in json format +### 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` + +#### flags + +```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 + ++ package system - implicit numeric conversion ++ first-class-functions - constructors/destructors ++ lexical-scope - operator overloading ++ system call interface - default parameter values ++ immutable string in utf-8 - inheritance (type-based inheritance → subclasses) ++ struct ~ class - generics `parametrics polimorphism` ≈ `generics` ++ concurrency support (CSP) - exceptions + - macros ++ `garbage collected` - function annotations ++ it's `staticallly typed` - thread local storage + - inheritance but composition of type + - explicit declaration, interface-implementation required ``` ## semicolon rule @@ -116,3 +134,4 @@ if the new line comes after a `token` that could end the statement => insert `;` - [Does go get command do cache?](https://stackoverflow.com/a/52813009/2087704) - [lecstor.com/go-clear-cache](https://lecstor.com/go-clear-cache/) - [[gcc]] +- [[wasm]] diff --git a/notes/grep.md b/notes/grep.md index db975d0..93d2e67 100644 --- a/notes/grep.md +++ b/notes/grep.md @@ -2,14 +2,14 @@ tags: [linux] title: grep created: '2019-07-30T06:19:49.077Z' -modified: '2022-02-15T10:47:45.404Z' +modified: '2022-04-08T14:58:03.264Z' --- # grep > file pattern searcher - derived from [[ed]] operation `g/re/p` -## usage +## flags ```sh -s, --no-messages # suppress error messages @@ -70,6 +70,8 @@ $ (Question) # match expression at the end of a line, as in `A$ \{x,\} # match x or more occurrences of the preceding. ``` +## usage + ```sh find | grep 'pattern' file /dev/null # show filename with find ! diff --git a/notes/host.md b/notes/host.md index e7f7839..a8638f3 100644 --- a/notes/host.md +++ b/notes/host.md @@ -2,17 +2,22 @@ tags: [dns] title: host created: '2019-07-30T06:19:49.080Z' -modified: '2021-12-23T09:14:06.905Z' +modified: '2022-04-19T07:17:53.366Z' --- # host > lookup utility +## flags + ```sh -# options: -# -t is used to select the query type (CNAME, NS, SOA, SIG, KEY, AXFR,..) +-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 @@ -20,6 +25,7 @@ host -t ns twitter.com # verify NS ## see also +- [[dns]] - [[dig]] - [[whois]] - [[hostnamectl]] diff --git a/notes/hugo.md b/notes/hugo.md new file mode 100644 index 0000000..85923dd --- /dev/null +++ b/notes/hugo.md @@ -0,0 +1,89 @@ +--- +title: hugo +created: '2022-04-08T21:02:53.354Z' +modified: '2022-04-08T21:14:10.048Z' +--- + +# hugo + +> static site generator + +## install + +```sh +brew install hugo +``` + +## flags + +```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/iam-policy-json-to-terraform.md b/notes/iam-policy-json-to-terraform.md new file mode 100644 index 0000000..42915ce --- /dev/null +++ b/notes/iam-policy-json-to-terraform.md @@ -0,0 +1,37 @@ +--- +title: iam-policy-json-to-terraform +created: '2022-03-29T16:06:00.334Z' +modified: '2022-03-29T16:09:58.655Z' +--- + +# iam-policy-json-to-terraform + +## install + +```sh +brew install iam-policy-json-to-terraform +``` + +## flags + +```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/infrastructure as code.md b/notes/infrastructure as code.md index 6392d94..e0dcf26 100644 --- a/notes/infrastructure as code.md +++ b/notes/infrastructure as code.md @@ -2,7 +2,7 @@ tags: [Notebooks] title: infrastructure as code created: '2019-07-30T06:19:49.081Z' -modified: '2021-02-09T11:07:18.870Z' +modified: '2022-04-06T11:34:41.761Z' --- # infrastructure as code @@ -14,6 +14,7 @@ modified: '2021-02-09T11:07:18.870Z' ## providers + | | chef | puppet | ansible | saltstack | cloudformation | terraform | |:-- |:-- |:-- |:-- |:-- |:-- |:-- | | code | opensource | opensource | opensource | opensource | opensource | opensource | @@ -23,6 +24,8 @@ modified: '2021-02-09T11:07:18.870Z' | arch | Client/Server | Client/Server | Client/Server | Client/Server | Client-Only | Client-Only | ## see also + +- [[gitops]] - [[terraform]] - [[aws cloudformation]] - [cloudscaling.com/the-history-of-pets-vs-cattle/](http://cloudscaling.com/blog/cloud-computing/the-history-of-pets-vs-cattle/) diff --git a/notes/install.md b/notes/install.md index 5470bc1..b461f69 100644 --- a/notes/install.md +++ b/notes/install.md @@ -2,20 +2,25 @@ tags: [linux, macos] title: install created: '2019-09-25T07:09:47.701Z' -modified: '2021-09-23T06:30:12.461Z' +modified: '2022-04-06T08:37:58.499Z' --- # install > copy files and set attributes, but also change ownership/permissions and remove debugging symbols from executables -## usage +## flags + ```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 +-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 @@ -28,6 +33,7 @@ install -m 0644 FILE.1 DIR/man1/FILE.1 ``` ## see also + - [[chmod]] - [[mv]] - [[make]] diff --git a/notes/installer.md b/notes/installer.md index a84ff90..cf49a76 100644 --- a/notes/installer.md +++ b/notes/installer.md @@ -2,17 +2,62 @@ tags: [macos] title: installer created: '2020-06-10T09:03:37.546Z' -modified: '2022-03-04T07:41:26.823Z' +modified: '2022-04-06T08:37:14.754Z' --- # installer > system software and package installer tool +## flags + +```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 diff --git a/notes/jam stack.md b/notes/jam stack.md new file mode 100644 index 0000000..710c18b --- /dev/null +++ b/notes/jam stack.md @@ -0,0 +1,57 @@ +--- +title: jam stack +created: '2022-04-08T10:29:14.554Z' +modified: '2022-04-08T21:03:39.322Z' +--- + +# 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/jekyll.md b/notes/jekyll.md new file mode 100644 index 0000000..63edd34 --- /dev/null +++ b/notes/jekyll.md @@ -0,0 +1,17 @@ +--- +title: jekyll +created: '2022-04-08T21:03:45.559Z' +modified: '2022-04-08T21:03:56.500Z' +--- + +# jekyll + +> + +## usage + +## see als + +- [[jam stack]] +- [[hugo]] +- [[ruby]] diff --git a/notes/kbst.md b/notes/kbst.md new file mode 100644 index 0000000..d6074d9 --- /dev/null +++ b/notes/kbst.md @@ -0,0 +1,37 @@ +--- +title: kbst +created: '2022-03-23T06:54:40.598Z' +modified: '2022-03-23T08:58:32.352Z' +--- + +# 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/kubectl.md b/notes/kubectl.md index e1a0d67..d5eac0e 100644 --- a/notes/kubectl.md +++ b/notes/kubectl.md @@ -2,7 +2,7 @@ tags: [container, container/k8s] title: kubectl created: '2019-07-30T06:19:49.145Z' -modified: '2022-02-17T07:53:51.257Z' +modified: '2022-04-04T13:39:03.891Z' --- # kubectl @@ -26,12 +26,57 @@ KUBE_EDITOR # - ## flags ```sh --v=6 # debug level 6 --o # output format [json|yaml|wide] +-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 ---kubeconfig CONFIG # .. ---namespace NAMESPACE # .. ---context CONTEXT # .. +-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 ``` @@ -62,8 +107,16 @@ KUBECONFIG="$HOME/.kube/config:file2:file3" kubectl config view --merge --flatte 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 @@ -108,6 +161,9 @@ kubectl patch NODE_NAME -p '{"metadata":{"finalizers":[]}}' --type=merge 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 @@ -225,9 +281,11 @@ kubectl run POD_NAME --image=mongo:4.0 `# run pod on specific node `\ ```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}}' + -o 'go-template={{range .items}}{{.involvedObject.name}}{{"\t"}}{{.involvedObject.kind}}{{"\t"}}{{.message}}{{"\t"}}{{.reason}}{{"\t"}}{{.type}}{{"\t"}}{{.firstTimestamp}}{{"\n"}}{{end}}' ``` ## logs @@ -278,11 +336,18 @@ 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 +``` + ## see also - [kubernetes.io/docs/reference/kubectl](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands) - [[kubernetes]], [[oc]] - [[helm]], [[kustomize]] +- [[cmctl]] +- [[nerdctl]] - [[bazel]] - [[kubectx]], [[kubens]] - [[kubeseal]] @@ -290,7 +355,6 @@ kubectl access-matrix # use plugin to see the level of access user - [[kim]], [[opa]] - [[aws]], [[eksctl]], [[kops]] - [[minikube]], [[k3s]], [[k3d]], [[k0s]], [[k9s]] -- [[nerdctl]] - [[yml]], [[jsonpath]], [[go-template]] - [[socat]] - [stackoverflow.com/questions/47369351/kubectl-apply-vs-kubectl-create](https://stackoverflow.com/questions/47369351/kubectl-apply-vs-kubectl-create) diff --git a/notes/kubernetes rbac.md b/notes/kubernetes rbac.md new file mode 100644 index 0000000..e5c3c53 --- /dev/null +++ b/notes/kubernetes rbac.md @@ -0,0 +1,38 @@ +--- +title: kubernetes rbac +created: '2022-03-23T21:22:09.880Z' +modified: '2022-03-23T21:33:43.208Z' +--- + +# 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 index a2231de..d4e4691 100644 --- a/notes/kubernetes.md +++ b/notes/kubernetes.md @@ -2,7 +2,7 @@ tags: [container/k8s] title: kubernetes created: '2019-08-28T08:08:25.156Z' -modified: '2021-11-29T12:58:21.303Z' +modified: '2022-03-23T21:26:10.566Z' --- # kubernetes @@ -46,6 +46,7 @@ modified: '2021-11-29T12:58:21.303Z' ## see also +- [[kubernetes rbac]] - [[devops]] - [[minikube]] - [ro14nd-talks/kubernetes-patterns](https://github.com/ro14nd-talks/kubernetes-patterns) diff --git a/notes/ln.md b/notes/ln.md index 211e8c2..a7e474b 100644 --- a/notes/ln.md +++ b/notes/ln.md @@ -2,13 +2,37 @@ tags: [coreutils, macos] title: ln created: '2019-08-28T09:33:38.811Z' -modified: '2022-02-01T15:10:16.072Z' +modified: '2022-04-09T09:39:32.427Z' --- # ln > make links between files +## flags + +```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 @@ -19,6 +43,9 @@ ls -l FSOURCE_FILENAME SYMBOLIC_FILENAME # verify new soft link ## see also +- [[cp]] +- [[rm]] +- [[unlink]] - [[ls]] - [[find]] - [[readlink]] diff --git a/notes/lynx.md b/notes/lynx.md new file mode 100644 index 0000000..be55158 --- /dev/null +++ b/notes/lynx.md @@ -0,0 +1,26 @@ +--- +title: lynx +created: '2022-03-23T15:09:24.848Z' +modified: '2022-03-23T15:10:29.615Z' +--- + +# lynx + +> cli browser + +## install + +```sh + +``` + +## usage + +```sh +lynx -dump http://www.google.com/search?q=$searchterm | less +``` + +## see also + +- [[w3m]] +- [[curl]] diff --git a/notes/max-pods-calculator.md b/notes/max-pods-calculator.md new file mode 100644 index 0000000..2938ecf --- /dev/null +++ b/notes/max-pods-calculator.md @@ -0,0 +1,42 @@ +--- +title: max-pods-calculator +created: '2022-03-29T14:57:24.315Z' +modified: '2022-03-29T15:08:41.942Z' +--- + +# 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 +``` + +## flags + +```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/md5sum.md b/notes/md5sum.md index d531231..3a69b28 100644 --- a/notes/md5sum.md +++ b/notes/md5sum.md @@ -2,7 +2,7 @@ tags: [coreutils] title: md5sum created: '2019-10-11T06:16:32.667Z' -modified: '2020-09-01T12:43:12.413Z' +modified: '2022-03-31T08:08:13.383Z' --- # md5sum @@ -10,6 +10,7 @@ modified: '2020-09-01T12:43:12.413Z' > compute and check MD5 message digest ## usage + ```sh md5sum file.log.tar.gz @@ -17,7 +18,9 @@ echo 'eb6d6eddb5bcb5c4229a45b31f209b0d file.log.tar.gz' | md5sum -c - md5sum -c .zip.md5 .zip ``` + ## see also -- [[sha256sum]] + - [[openssl]] +- [[sha256sum]] diff --git a/notes/mdp.md b/notes/mdp.md new file mode 100644 index 0000000..84273e1 --- /dev/null +++ b/notes/mdp.md @@ -0,0 +1,79 @@ +--- +title: mdp +created: '2022-04-05T09:09:21.947Z' +modified: '2022-04-06T07:38:45.745Z' +--- + +# mdp + +> cli based markdown presentation tool + +## install + +```sh +brew install mdp +``` + +## flags + +```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/micro frontend.md b/notes/micro frontend.md new file mode 100644 index 0000000..d08d5be --- /dev/null +++ b/notes/micro frontend.md @@ -0,0 +1,17 @@ +--- +title: micro frontend +created: '2022-04-08T21:02:08.494Z' +modified: '2022-04-08T21:02:46.166Z' +--- + +# micro frontend + + +- mirco frontends +- mirco frontend framwork +- host pages + + +## see also + +- [[jam stack]] diff --git a/notes/nslookup.md b/notes/nslookup.md index 247b1cc..92ed95f 100644 --- a/notes/nslookup.md +++ b/notes/nslookup.md @@ -2,12 +2,12 @@ tags: [dns] title: nslookup created: '2020-01-16T07:23:01.811Z' -modified: '2021-12-23T09:13:48.422Z' +modified: '2022-04-19T07:18:16.203Z' --- # nslookup -> for querying `DNS` to obtain domain names or IP addresses, mapping or for any other specific DNS Records +> for querying [[dns]] to obtain domain names or IP addresses, mapping or for any other specific DNS Records ## install @@ -33,6 +33,7 @@ nslookup 10.32.23.139 ## see also +- [[dns]] - [[dig]] - [[ifconfig]] - [[whois]] diff --git a/notes/openssl.md b/notes/openssl.md index dcad1b4..4da22b4 100644 --- a/notes/openssl.md +++ b/notes/openssl.md @@ -2,7 +2,7 @@ tags: [cryptography, linux, network] title: openssl created: '2019-07-30T06:19:49.183Z' -modified: '2021-10-28T11:52:58.407Z' +modified: '2022-03-18T13:22:14.931Z' --- # openssl @@ -24,9 +24,11 @@ openssl crl2pkcs7 -nocrl -certfile CHAIN.pem | openssl pkcs7 -print_certs -text openssl verify -CAfile foo.cain.crt foo.crt # verify certificate against CAfile => foo.crt: OK +``` +## rsa - rsa key management -# 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 @@ -76,8 +78,11 @@ openssl x509 -in git.domain.net.crt -noout -dates openssl x509 -in git.domain.net.crt -noout -fingerprint +``` -# pkcs12 - public key cryptograpy standarts +## 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 diff --git a/notes/osi model.md b/notes/osi model.md index 957ab52..6669cd7 100644 --- a/notes/osi model.md +++ b/notes/osi model.md @@ -2,11 +2,13 @@ tags: [network] title: osi model created: '2020-09-03T05:22:30.643Z' -modified: '2022-02-15T10:25:04.019Z' +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` diff --git a/notes/pbcopy pbpaste.md b/notes/pbcopy pbpaste.md deleted file mode 100644 index c058900..0000000 --- a/notes/pbcopy pbpaste.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -tags: [brew, macos] -title: pbcopy pbpaste -created: '2019-07-30T06:19:49.205Z' -modified: '2020-12-24T15:09:55.018Z' ---- - -# pbcopy pbpaste - -> copy data from `stdin` to clipboard - -## usage -```sh -pbcopy [-pboard {general | ruler | find | font}] - -pbcopy < FILE - -CMD | pbcopy - - -pbpaste - -pbpaste >> FILE -``` - - -## see also -- [ss64.com/osx/pbcopy](https://ss64.com/osx/pbcopy.html) -- [[screencapture]] -- [[cp]] diff --git a/notes/pbcopy.md b/notes/pbcopy.md new file mode 100644 index 0000000..ab496e3 --- /dev/null +++ b/notes/pbcopy.md @@ -0,0 +1,40 @@ +--- +tags: [brew, macos] +title: pbcopy +created: '2019-07-30T06:19:49.205Z' +modified: '2022-04-27T09:54:48.419Z' +--- + +# pbcopy + +> copy data from `stdin` to clipboard + +## flags + +```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/sha256sum.md b/notes/sha256sum.md index d7b6964..f7dc35d 100644 --- a/notes/sha256sum.md +++ b/notes/sha256sum.md @@ -2,38 +2,40 @@ tags: [linux] title: sha256sum created: '2019-11-26T06:51:16.688Z' -modified: '2022-01-06T08:51:12.460Z' +modified: '2022-03-31T08:08:03.347Z' --- # sha256sum > compute and check sha256 message digest -## usage +## flags ```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 +-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]] -- [[openssl]] diff --git a/notes/tar.md b/notes/tar.md index c654226..765ec46 100644 --- a/notes/tar.md +++ b/notes/tar.md @@ -63,4 +63,4 @@ tar cf - "$1" -P | pv -s $(( $(du -sk "$1" | cut -f1) * 1024 )) \ - [[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) +- [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 index a4f7254..d77b370 100644 --- a/notes/tcl.md +++ b/notes/tcl.md @@ -7,21 +7,25 @@ modified: '2021-02-08T12:52:53.064Z' # tcl -> `"tickle"`/`"tee cee ell"` - `tool command language` +> `"tickle"`/`"tee cee ell"` - `tool command language` > multi-purpose `c` library which includes a powerful dynamic scripting language, high-level, general-purpose, interpreted ## install + `brew cask install tcl` ## usage + ```sh tclsh # start tcl shell ``` + ```tcl puts $tcl_version # prints tcl version puts [ls -l] # square-bracket used for command substitution ``` + ```tcl #!/usr/bin/tclsh @@ -32,6 +36,7 @@ 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]] diff --git a/notes/tcp-ip.md b/notes/tcp-ip.md index 4614b8d..7db980d 100644 --- a/notes/tcp-ip.md +++ b/notes/tcp-ip.md @@ -24,7 +24,9 @@ Layer | ``` ## osi + `Please Do Not Touch Steve's Pet Aligator` or `Please Do Not Throw Sausage Pizza Away` + ``` Layer | | -- |-- |-- diff --git a/notes/tcpdump.md b/notes/tcpdump.md index 33973cf..de50d2f 100644 --- a/notes/tcpdump.md +++ b/notes/tcpdump.md @@ -7,7 +7,7 @@ modified: '2021-10-31T14:48:28.192Z' # tcpdump -> dump traffic on a network +> dump traffic on a network ## usage @@ -99,6 +99,7 @@ ssh user@host \ ``` ## 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/) diff --git a/notes/tdnf.md b/notes/tdnf.md index 5a8ed82..c6d6415 100644 --- a/notes/tdnf.md +++ b/notes/tdnf.md @@ -10,13 +10,13 @@ modified: '2020-02-03T12:27:36.318Z' > `tiny dandified yum` ## usage + ```sh tdnf --help ``` ## see also + - [[yum]] - [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/telnet.md b/notes/telnet.md index c38c4b7..57aba42 100644 --- a/notes/telnet.md +++ b/notes/telnet.md @@ -8,7 +8,7 @@ modified: '2022-02-01T14:42:21.375Z' # telnet > user interface to the TELNET protocol -> a protocol of `internet protocol suite`/[[tcp-ip]] +> a protocol of `internet protocol suite`/[[tcp-ip]] > used to provide a bidirectional interactive text-oriented communication facility using a virtual terminal connection ## usage diff --git a/notes/terraform provider tls.md b/notes/terraform provider tls.md index 244a8b6..11330ca 100644 --- a/notes/terraform provider tls.md +++ b/notes/terraform provider tls.md @@ -7,9 +7,10 @@ modified: '2020-09-02T18:05:53.810Z' # terraform provider tls -> allow private keys, certificates and certficate requests to be created as part of a terraform deployment +> allow private keys, certificates and certficate requests to be created as part of a terraform deployment ## usage + ```sh resource "tls_private_key" "vault" { algorithm = "ECDSA" @@ -57,5 +58,6 @@ resource "null_resource" "provision_certs" { ``` ## see also + - [[terraform]] -- https://www.terraform.io/docs/providers/tls/index.html +- [terraform.io/docs/providers/tls](https://www.terraform.io/docs/providers/tls/index.html) diff --git a/notes/terraform.md b/notes/terraform.md index 147d461..7a5ab60 100644 --- a/notes/terraform.md +++ b/notes/terraform.md @@ -2,14 +2,14 @@ tags: [iac] title: terraform created: '2019-07-30T06:19:49.078Z' -modified: '2022-02-01T14:50:43.432Z' +modified: '2022-04-19T08:16:19.095Z' --- # terraform > tool for building, changing, and versioning infrastructure safely and efficiently -## usage +## environment variables ```sh TF_LOG_PATH # @@ -20,22 +20,33 @@ 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 0.13upgrade . 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 fmt -diff -check main.tf # check format configuration + terraform fmt -write main.tf # format config @@ -50,9 +61,9 @@ terraform console # startes repl-like console ## terraform console -> interactive repl for debuggin +> 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 @@ -65,11 +76,20 @@ terraform console # startes repl-like console ] 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 -```sh + +```tf resource "aws_route53_record" "example" { for_each = { for dvo in aws_acm_certificate.example.domain_validation_options : dvo.domain_name => { @@ -88,23 +108,23 @@ resource "aws_route53_record" "example" { 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 = {} -# } - +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 = {} +} ``` ## see also +- [[atlantis]] - [[tfswitch]] - [[terrascan]] - [[terraform cloud api]] @@ -113,3 +133,5 @@ resource "aws_route53_record" "example" { - [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) - [[localstack]] +- [[kbst]] +- [[tfk8s]] diff --git a/notes/terrascan.md b/notes/terrascan.md index 173a891..6718f6f 100644 --- a/notes/terrascan.md +++ b/notes/terrascan.md @@ -10,13 +10,16 @@ modified: '2021-10-29T12:45:45.967Z' > 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 0000000..69008e8 --- /dev/null +++ b/notes/tfk8s.md @@ -0,0 +1,46 @@ +--- +title: tfk8s +created: '2022-03-29T16:03:27.046Z' +modified: '2022-03-30T06:46:13.387Z' +--- + +# tfk8s + +> transform kubernetes manifst to hcl + +## install + +```sh +brew install tfk8s +``` + +## flags + +```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 index 73af47c..7607222 100644 --- a/notes/tfswitch.md +++ b/notes/tfswitch.md @@ -10,9 +10,11 @@ modified: '2021-10-29T12:45:45.993Z' > switch between different versions of terraform ## install + `brew install warrensbox/tap/tfswitch` ## usage + ```sh tfswitch --list @@ -23,5 +25,6 @@ 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 index 705d3ee..6172ef8 100644 --- a/notes/tig.md +++ b/notes/tig.md @@ -9,9 +9,11 @@ modified: '2021-05-12T19:36:29.575Z' > `tig` - text-mode interface for Git ## install + `brew install tig` ## usage + ```sh tig @@ -30,6 +32,7 @@ tig -C /repo/path # run in dir /repo/path like `git -C` ``` ## shortcuts + ```sh m # switch to main view d # switch to diff view @@ -76,6 +79,7 @@ M # Merge ``` ## see also + - [[git]] - [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 index f9dadc7..f04417c 100644 --- a/notes/time.md +++ b/notes/time.md @@ -8,7 +8,6 @@ modified: '2021-10-29T12:46:41.772Z' > 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. - ## usage ```sh diff --git a/notes/timedatectl.md b/notes/timedatectl.md index 8ca43b7..dd325c6 100644 --- a/notes/timedatectl.md +++ b/notes/timedatectl.md @@ -8,6 +8,7 @@ modified: '2020-01-16T08:07:18.431Z' # timedatectl ## usage + ```sh timedatectl | grep "Time zone" @@ -17,5 +18,6 @@ timedatectl set-timezone Europe/Kiev ``` ## see also + - [[chronyd]] - [[date]] diff --git a/notes/timeout.md b/notes/timeout.md index ffe2ca0..245fd73 100644 --- a/notes/timeout.md +++ b/notes/timeout.md @@ -10,6 +10,7 @@ modified: '2021-05-12T08:47:10.356Z' > run a command with a time limit ## usage + ```sh timeout 2 sleep 1 @@ -17,6 +18,7 @@ timeout 12h bash -c 'until ssh root@mynewvm; do sleep 10; done' ``` ## see also + - [[sleep]] - [[bash time]] - [[bash wait]] diff --git a/notes/tls ssl certificate.md b/notes/tls ssl certificate.md index 62d0db5..356d80a 100644 --- a/notes/tls ssl certificate.md +++ b/notes/tls ssl certificate.md @@ -9,19 +9,21 @@ modified: '2020-09-02T18:05:53.830Z' `certificate` = `valication Level` + `type` +## Valication Level -### Valication Level - `EV` Extended Validation Certificates - `OV` Organization Validated Certificates - `DV` Domain Validated Certificates -### Type +## 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) diff --git a/notes/tls.md b/notes/tls.md index e4dfae3..357c0da 100644 --- a/notes/tls.md +++ b/notes/tls.md @@ -11,16 +11,11 @@ modified: '2022-02-10T12:54:03.792Z' > `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) - - - +[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 diff --git a/notes/tmpfs.md b/notes/tmpfs.md index dc24673..0f77240 100644 --- a/notes/tmpfs.md +++ b/notes/tmpfs.md @@ -10,6 +10,7 @@ modified: '2021-03-19T10:42:16.213Z' > 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 @@ -17,6 +18,7 @@ cd "$(mktemp -d)" # change to random temp-dir for testing ``` ## see also + - [[filesystem hierarchy standard]] - [[df]] - [[mount]] diff --git a/notes/tmux.md b/notes/tmux.md index fd0ba3d..3d19f5a 100644 --- a/notes/tmux.md +++ b/notes/tmux.md @@ -95,7 +95,6 @@ tmux set-window-option -t $SESSION:0 automatic-rename off ## see also - [[fzf]] -- [devhints.io/tmux](https://devhints.io/tmux) +- [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) - [[macos keyboard shortcuts]] - diff --git a/notes/top.md b/notes/top.md index 547cb8c..4f2309e 100644 --- a/notes/top.md +++ b/notes/top.md @@ -8,10 +8,12 @@ modified: '2020-08-31T09:31:33.582Z' # top ## usage + ```sh top ``` ## see also + - [[free]] - [[procfs]] diff --git a/notes/tput.md b/notes/tput.md index fa2bced..b1d4a70 100644 --- a/notes/tput.md +++ b/notes/tput.md @@ -45,6 +45,7 @@ setab VALUE # set background color ``` ## usage + ```sh 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 diff --git a/notes/traceroute.md b/notes/traceroute.md index 33c5100..3d2b508 100644 --- a/notes/traceroute.md +++ b/notes/traceroute.md @@ -6,7 +6,7 @@ modified: '2022-03-09T07:31:00.296Z' # traceroute -> print the route packets trace to network host +> print the route packets trace to network host ## install diff --git a/notes/tree.md b/notes/tree.md index 7f9763e..9761f30 100644 --- a/notes/tree.md +++ b/notes/tree.md @@ -8,10 +8,12 @@ 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/tshark.md b/notes/tshark.md index 6833e35..07c05dd 100644 --- a/notes/tshark.md +++ b/notes/tshark.md @@ -15,7 +15,7 @@ modified: '2021-10-31T15:04:42.657Z' ## usage -```sh +```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 diff --git a/notes/tty.md b/notes/tty.md index f7b49ec..48cc6f5 100644 --- a/notes/tty.md +++ b/notes/tty.md @@ -11,10 +11,13 @@ modified: '2020-01-30T07:19:21.730Z' `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/typesystem.md b/notes/typesystem.md index debc50a..4a2550a 100644 --- a/notes/typesystem.md +++ b/notes/typesystem.md @@ -9,27 +9,28 @@ modified: '2020-09-02T12:45:16.259Z' > 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 ? +## 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` - +## 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 +-- |-- |-- |-- |-- +[[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/udp.md b/notes/udp.md index ae16773..d36531c 100644 --- a/notes/udp.md +++ b/notes/udp.md @@ -24,5 +24,6 @@ server->client: acknowledge ``` ## see also + - [[ipv4]] - [[osi model]] diff --git a/notes/uniq.md b/notes/uniq.md index 438e466..d7871ee 100644 --- a/notes/uniq.md +++ b/notes/uniq.md @@ -2,17 +2,40 @@ tags: [coreutils] title: uniq created: '2019-07-30T06:19:49.257Z' -modified: '2020-09-01T12:43:12.552Z' +modified: '2022-04-23T10:07:26.945Z' --- # uniq +> report or filter out repeated lines in a file + +## flags + +```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 index ae8c054..957d0f3 100644 --- a/notes/units.md +++ b/notes/units.md @@ -37,8 +37,8 @@ Value Metric Value IEC EDEC 1000^7 ZB zettabyte 1024^7 ZiB zebibyte – 1000^8 YB yottabyte 1024^8 YiB yobibyte – ``` -[Gigabyte - Wikipedia](https://en.wikipedia.org/wiki/Gigabyte) +[Gigabyte - Wikipedia](https://en.wikipedia.org/wiki/Gigabyte) ### "500 GigaByte" diff --git a/notes/unix socket.md b/notes/unix socket.md index fe66b2d..00e0334 100644 --- a/notes/unix socket.md +++ b/notes/unix socket.md @@ -10,21 +10,19 @@ modified: '2022-02-15T10:29:37.043Z' > 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 +## socket - combination of IP-Address and Port-Number - 2 types: - stream - reliable two-way connected communication streams - datagram - ## see also - [[nc]] diff --git a/notes/unlink.md b/notes/unlink.md index bfcc6a2..886f0fe 100644 --- a/notes/unlink.md +++ b/notes/unlink.md @@ -2,13 +2,21 @@ tags: [linux] title: unlink created: '2019-08-22T07:15:21.582Z' -modified: '2019-08-28T08:01:45.015Z' +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 index d84facc..c215743 100644 --- a/notes/upstart.md +++ b/notes/upstart.md @@ -7,12 +7,14 @@ 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. +> 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/url encoding.md b/notes/url encoding.md index 9da45d9..54d718c 100644 --- a/notes/url encoding.md +++ b/notes/url encoding.md @@ -12,8 +12,8 @@ modified: '2020-09-03T09:13:30.181Z' - 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` - ## encode + ```sh echo -ne 'some random\nbytes' | xxd -plain | tr -d '\n' | sed 's/\(..\)/%\1/g' @@ -21,6 +21,7 @@ curl -s -o /dev/null -w "%{url_effective}\n" --get --data-urlencode "some random ``` ## decode + ```sh url_decode () { @@ -30,6 +31,7 @@ url_decode () ``` ## see also + - [[ascii]] - [[xxd]] - [[tr]] diff --git a/notes/useradd.md b/notes/useradd.md index a3550bf..93b4607 100644 --- a/notes/useradd.md +++ b/notes/useradd.md @@ -10,6 +10,7 @@ modified: '2020-03-23T12:25:05.189Z' > 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 @@ -42,6 +43,7 @@ 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/) diff --git a/notes/userdel.md b/notes/userdel.md index 9f78755..af5b245 100644 --- a/notes/userdel.md +++ b/notes/userdel.md @@ -10,10 +10,12 @@ modified: '2019-12-30T07:57:07.569Z' > 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 index 0afef4e..1109e0c 100644 --- a/notes/usermod.md +++ b/notes/usermod.md @@ -7,9 +7,10 @@ modified: '2020-03-23T12:18:39.408Z' # usermod -> modify a user account +> modify a user account ## usage + ```sh usermod -aG docker @@ -22,6 +23,7 @@ usermod -d /home/fooadmin -m -g fooadmin -l fooadmin admin # after renaming use ``` ## see also + - [[useradd]] - [[adduser]] - [[groupadd]] diff --git a/notes/vagrant.md b/notes/vagrant.md index 0693d87..b2578a8 100644 --- a/notes/vagrant.md +++ b/notes/vagrant.md @@ -14,6 +14,7 @@ modified: '2022-01-13T14:13:06.781Z' `brew install vagrant` ## usage + ```sh vagrant init --minimal centos/7 # create minimal Vagrantfile @@ -85,7 +86,6 @@ Vagrant.configure("2") do |config| end ``` - ```ruby BOX_IMAGE = "bento/ubuntu-16.04" NODE_COUNT = 2 diff --git a/notes/varnishstat.md b/notes/varnishstat.md index 72d9ca2..3db2626 100644 --- a/notes/varnishstat.md +++ b/notes/varnishstat.md @@ -9,7 +9,7 @@ modified: '2021-10-31T14:42:35.275Z' ## usage ```sh --1 # instead continuously updated display print to stdout +-1 # instead continuously updated display print to stdout ``` ```sh diff --git a/notes/vboxmanage.md b/notes/vboxmanage.md index 308d6e0..b6f94d4 100644 --- a/notes/vboxmanage.md +++ b/notes/vboxmanage.md @@ -53,6 +53,7 @@ vboxmanage snapshot vm04-zca8 delete snap1-before-upgrade ``` ## see also + - [[qemu]] - [[vagrant]] - [[docker-machine]] diff --git a/notes/vim.md b/notes/vim.md index 63db671..3b72e6c 100644 --- a/notes/vim.md +++ b/notes/vim.md @@ -10,9 +10,9 @@ modified: '2022-02-15T10:43:27.323Z' ## usage ```sh -vim -p file1 file2 file3 # open files in tabs +vim -p file1 file2 file3 # open files in tabs -vim $(!!) # open file from last output +vim $(!!) # open file from last output vim -y # easy mode, beavese like click-and-type editore, ctrl+o -> :q to quit ``` @@ -165,9 +165,9 @@ mi ; mark current position with i :bw ; buffer wipe / delete all buffers -:tabnew filename ; load file in new tab +:tabnew filename ; load file in new tab :tabm n -:tabm 2 ; move current tab to position 2 +:tabm 2 ; move current tab to position 2 :Sexplore :Sex ; SplitExplore :Vex ; VerticalExplore @@ -184,8 +184,8 @@ mi ; mark current position with i :r :read - name "insert file content below curser - !cmd "insert cmd content below curser + name "insert file content below curser + !cmd "insert cmd content below curser :r!date # insert date @@ -197,16 +197,17 @@ mi ; mark current position with i :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 ``` ## 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'`) +- `string`: a string value (`:help 'backspace'`) ```sh :help set @@ -259,7 +260,7 @@ listchars=tab:»\ ,trail:·,nbsp:·,extends:›,precedes:‹,space:. :tabnew filename # load file in new tab :tabm n -:tabm 2 # move current tab to position 2 +:tabm 2 # move current tab to position 2 gt # pext tab gT # prev tab @@ -279,30 +280,27 @@ gT # prev tab ```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 +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 +:resize 60 " resize splits e.g. :help +:resize +5 :vertical resize 80 :vertical resize +4 ``` - -## vim script - ```sh :for i in range(2016,2020) : for j in range(1,12) diff --git a/notes/vm disk image.md b/notes/vm disk image.md index a6b51fc..80a04e4 100644 --- a/notes/vm disk image.md +++ b/notes/vm disk image.md @@ -8,6 +8,7 @@ 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, @@ -17,7 +18,8 @@ OVF - Open Virtualization Format XML based, OVA - Open Virtualization Applicance OVF + supporing file (disk-images, ..) ``` -## formats for disk images +## formats for disk images + ``` .vid - VirtualBox .vmdk - VMWare (many different versions!) @@ -30,6 +32,7 @@ raw - (.IMG,.ISO,..) 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/vsphere.md b/notes/vsphere.md index cde64ec..6f431e2 100644 --- a/notes/vsphere.md +++ b/notes/vsphere.md @@ -9,10 +9,10 @@ modified: '2022-02-02T10:03:19.271Z' > vmware vSphere is a cloud computing virtualization platform -> `VID` `vSphere Installation Bundle` -> `VUM` `vSphere Update Manager` -> `VDVS` `vSphere` -> `VMCI` `Virtual Machine Communication Interface` +- `VID` `vSphere Installation Bundle` +- `VUM` `vSphere Update Manager` +- `VDVS` `vSphere` +- `VMCI` `Virtual Machine Communication Interface` ## vm bootorder via .vmx @@ -33,7 +33,8 @@ RetrieveProductComponents -> Invoke Method -> ``` -photon-template: +photon-template: + - `https://vcenter1.domain.net/mob/?moid=vm%2d97645` - `https://vcenter1.domain.net/mob/?moid=vm%2d97645&doPath=summary%2econfig` # UUID diff --git a/notes/w3m.md b/notes/w3m.md new file mode 100644 index 0000000..d0157c3 --- /dev/null +++ b/notes/w3m.md @@ -0,0 +1,25 @@ +--- +title: w3m +created: '2022-03-23T15:11:59.376Z' +modified: '2022-03-23T15:12:24.954Z' +--- + +# w3m + +> cli browser + +## install + +```sh +brew install w3m +``` + +## usage + +```sh +w3m +``` + +## see also + +- [[lynx]] diff --git a/notes/wasm.md b/notes/wasm.md index a42774e..3bed747 100644 --- a/notes/wasm.md +++ b/notes/wasm.md @@ -1,7 +1,7 @@ --- title: wasm created: '2020-08-19T07:23:59.679Z' -modified: '2022-02-02T10:03:31.300Z' +modified: '2022-04-07T07:02:20.355Z' --- # wasm @@ -11,7 +11,7 @@ modified: '2022-02-02T10:03:31.300Z' > 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) + - 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) @@ -45,6 +45,7 @@ int sign(int x) { return (x % 2) * (2 - (x % 4)); } - [[asm]] - [[rust]] +- [[go]] - [[clang]] - [[emcc]] - [evilmartians.com/chronicles/hands-on-webassembly-try-the-basics](https://evilmartians.com/chronicles/hands-on-webassembly-try-the-basics) diff --git a/notes/whatis.md b/notes/whatis.md index 120e14d..a96f3d7 100644 --- a/notes/whatis.md +++ b/notes/whatis.md @@ -10,10 +10,12 @@ modified: '2020-02-04T12:29:40.143Z' > search the whatis database for complete words ## usage + ```sh whatis ``` ## see also + - [[man]] - [[apropos]] diff --git a/notes/which.md b/notes/which.md index 36df15e..5575c4a 100644 --- a/notes/which.md +++ b/notes/which.md @@ -24,6 +24,7 @@ which -a CMD # print all matching pathnames of each argument ``` ## see also + - [[file]] - [[bash type]] - [[bash command]] diff --git a/notes/whois.md b/notes/whois.md index 5096e83..15ea328 100644 --- a/notes/whois.md +++ b/notes/whois.md @@ -7,7 +7,7 @@ modified: '2022-02-02T10:04:55.998Z' # 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 server +> default first querying the `IANA` (=Internet Assigned Numbers Authority) whois serve ## usage diff --git a/notes/xfs.md b/notes/xfs.md index edf768e..cbf558f 100644 --- a/notes/xfs.md +++ b/notes/xfs.md @@ -7,7 +7,7 @@ modified: '2022-02-02T10:05:59.463Z' # xfs -> +> xfs ## usage diff --git a/notes/xfs_growfs.md b/notes/xfs_growfs.md index b42bba6..8eb3c30 100644 --- a/notes/xfs_growfs.md +++ b/notes/xfs_growfs.md @@ -7,15 +7,18 @@ 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]] diff --git a/notes/xfs_info.md b/notes/xfs_info.md index 9aa0a33..39a542e 100644 --- a/notes/xfs_info.md +++ b/notes/xfs_info.md @@ -10,12 +10,15 @@ modified: '2020-01-07T10:12:10.190Z' > `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]] diff --git a/notes/xfs_repair.md b/notes/xfs_repair.md index 082666f..0008cc8 100644 --- a/notes/xfs_repair.md +++ b/notes/xfs_repair.md @@ -10,6 +10,7 @@ modified: '2020-06-11T11:52:42.560Z' > repair corrupt or damaged xfs filesystem ## usage + ```sh xfs_repair -V @@ -17,10 +18,12 @@ umount /dev/sda2 xfs_repair /dev/sda2 ``` + ## see also + - [[xfs]] - [[xfs_info]] - [[xfs_growfs]] - [[growpart]] -- http://nerdbynature.de/s9y/2016/05/06/XFS-Corruption-warning-Metadata-has-LSN-ahead-of-current-LSN +- [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 index 242975f..9d53975 100644 --- a/notes/xhyve.md +++ b/notes/xhyve.md @@ -8,13 +8,16 @@ modified: '2020-09-02T18:04:27.893Z' # xhyve ## install + `brew install --HEAD xhyve` ## usage + ```sh xhyve -h ``` ## see also + - [[hyperkit]] - [[qemu]] diff --git a/notes/xkcdpass.md b/notes/xkcdpass.md index c810412..3779551 100644 --- a/notes/xkcdpass.md +++ b/notes/xkcdpass.md @@ -47,5 +47,3 @@ xkcdpass \ - [[mkpasswd]] - [pypi.org/project/xkcdpass/](https://pypi.org/project/xkcdpass/) - [[pip]] - - diff --git a/notes/xmllint.md b/notes/xmllint.md index 3a4d242..2d85f3f 100644 --- a/notes/xmllint.md +++ b/notes/xmllint.md @@ -8,19 +8,23 @@ 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 @@ -58,18 +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 + - [[xpath]] - [[mvn]] - [get-pom-xml-version-with-xmllint](https://stackoverflow.com/a/41115011/2087704) diff --git a/notes/xxd.md b/notes/xxd.md index c802735..2ad1b3d 100644 --- a/notes/xxd.md +++ b/notes/xxd.md @@ -7,7 +7,7 @@ modified: '2020-09-03T09:08:10.650Z' # xxd -> make a hexdump or do the reverse +> make a hexdump or do the reverse ## usage @@ -20,6 +20,7 @@ xxd -r <<<'0 4a' # decimal ``` ## see also + - [[url encoding]] - [[ascii]] - [[od]] diff --git a/notes/yarn.md b/notes/yarn.md index f6bd640..922f64d 100644 --- a/notes/yarn.md +++ b/notes/yarn.md @@ -10,9 +10,11 @@ modified: '2021-06-11T11:54:22.147Z' > provides a rich set of cli commands to help you with various aspects of your yarn package, including installation, administration, publishing ## install + `npm install --global yarn` ## usage + ```sh yarn --version @@ -28,6 +30,7 @@ yarn remove # removes an unused package from your current package ``` ## see also + - [[node]] - [[npm]] - [[npx]] diff --git a/notes/yes.md b/notes/yes.md index 24ac554..8f54b97 100644 --- a/notes/yes.md +++ b/notes/yes.md @@ -10,6 +10,7 @@ modified: '2020-09-01T12:43:12.188Z' > output a string repeatedly until killed ## usage + ```sh # --help display this help and exit # --version output version information and exit @@ -24,7 +25,9 @@ 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/yq.md b/notes/yq.md index f18637c..c7f71fa 100644 --- a/notes/yq.md +++ b/notes/yq.md @@ -1,7 +1,7 @@ --- title: yq created: '2019-08-20T12:05:18.926Z' -modified: '2022-01-25T13:48:28.370Z' +modified: '2022-04-23T10:01:09.407Z' --- # yq @@ -21,7 +21,6 @@ yq shell-completion bash > /etc/bash_completion.d/yq # install bach_completio ## flags ```sh -# Global Flags -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 @@ -89,6 +88,13 @@ yq e '. | select(.kind == "Service") ' FILE.yaml # print only document of kin 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 diff --git a/notes/yum.md b/notes/yum.md index fd84aff..52d306e 100644 --- a/notes/yum.md +++ b/notes/yum.md @@ -41,4 +41,3 @@ yum repolist - [[apt-get]] - [[aws]] - [[amazon-linux-extras]] - diff --git a/notes/z.md b/notes/z.md index 186d4f2..9b0188e 100644 --- a/notes/z.md +++ b/notes/z.md @@ -9,9 +9,11 @@ modified: '2021-04-17T10:52:50.735Z' > tracks most-used directories to make cd smarter ## install + `brew install z` ## usage + ```sh z # show recently used directories @@ -19,4 +21,5 @@ z DIR # changes to recently user DIR ``` ## see also + - [[bash pushd popd]] diff --git a/notes/zookeeper-shell.md b/notes/zookeeper-shell.md index 668f8e4..dd09322 100644 --- a/notes/zookeeper-shell.md +++ b/notes/zookeeper-shell.md @@ -28,4 +28,4 @@ ls / true # Watch can be set on any znode while using read o - [[consul]] - [[etcdctl]] - [[kafka]] -- https://serverfault.com/questions/801251/get-zookeeper-cluster-status +- [serverfault.com/get-zookeeper-cluster-status](https://serverfault.com/questions/801251/get-zookeeper-cluster-status) diff --git a/notes/zsh.md b/notes/zsh.md index 747d729..99d6d16 100644 --- a/notes/zsh.md +++ b/notes/zsh.md @@ -7,7 +7,7 @@ modified: '2022-03-03T15:41:07.261Z' # zsh -> `z shell` - unix shell, extended bourne shell `sh` with many improvements, including some features of [[bash]], [[ksh]], and [[tcsh]] +> `z shell` - unix shell, extended bourne shell `sh` with many improvements ## usage