Skip to content

Instantly share code, notes, and snippets.

View pkutaj's full-sized avatar

pavol kutaj pkutaj

View GitHub Profile
NR Type Description Volume Example
1 alias shell alias 0/varies alias ls='ls -l'
2 keyword shell reserved word 19/constant for, if, while, case
3 function shell function 0/varies function hello() { echo 'Hello, world!'; }
4 builtin shell builtin 58/constant cd, echo, read
5 file disk file hundreds/varies /bin/ls, /usr/bin/python
NR Command Description Example
01 . Executes commands from a file. .bashrc (loads the bash configuration file)
02 : Does nothing (useful as a placeholder). true ; echo "This will be printed" (only the second command executes)
03 [ (or test ) Evaluates expressions for conditional statements. [ -f filename ] && echo "File exists" (checks if a file exists)
04 alias Creates or manages aliases (shorter names for commands). `alias l
NR Keyword Description Example
01 if Introduces a conditional statement to execute code based on a condition. if [ $x -gt 0 ]; then echo "Positive number"; fi (checks if x is positive)
02 then Follows the if keyword and marks the beginning of the code to execute if the condition is true. Refer to if example.
03 else Provides an optional block of code to execute if the condition in the if statement is false. if [ $x -gt 0 ]; then echo "Positive"; else echo "Non-positive"; fi (prints based on x value)
04 elif Introduces an additional condition to check within an if state
NR Full Name Shortcut default Description
01 allexport -a off Export all variables to the environment when a new shell is started.
02 braceexpand -B on Enable brace expansion (e.g., {a,b} expands to a b).
03 emacs -e on Use Emacs-style line editing (default).
04 errexit -e off Exit immediately if any command fails (also known as "set -e").
05 errtrace -E off Trap errors in functions and subshells.
pkutaj /
Created October 18, 2023 09:13
Kafka AWS Kinesis
Operational Model System of brokers (servers that store and process messages) Managed service provided by AWS
Data Writing Writes data to disk, I/O operations carried out by OS Synchronously brokers data streams, writes and replicates ingested data into three different AWS machines
Configurability More control to the operator Machine configuration is ab
pkutaj /
Created October 5, 2023 08:12
#1 aws_instance.nginx remove > empty id-8675366
#2 aws_instance.nginx empty add_additional => id-8675366, id-314777
#3 aws_instance.nginx add > aws_instance.nginx = id-314777 id-8675366, id-314777
pkutaj /
Created October 5, 2023 08:12
manual remove > empty aws_instance.nginx = id-8675366 id-8675366
apply #1 empty aws_instance.nginx = id-8675366 destroy => empty
apply #2 empty remove => empty empty
pkutaj /
Created October 5, 2023 08:12
manual aws_instance.nginx aws_instance.nginx = id-314122 destroy > no resource
apply #1 aws_instance.nginx aws_instance.nginx = id-314122 add > id-8675366
apply #2 aws_instance.nginx change > aws_instance.nginx = id-8675366 id-8675366
pkutaj /
Created October 5, 2023 08:11
manual add > aws_instance.nginx empty no resource
apply #1 aws_instance.nginx empty add id-314122
apply #2 aws_instance.nginx add aws_instance.nginx = id-314122 id-314122
pkutaj /
Created August 16, 2023 14:03
Policy Type Description
1. Identity-based Attached to an IAM identity (user, group, or role). Specifies what that identity can do.
2. Resource-based Attached to a resource. Specifies who has access to the resource and what actions they can perform on it.
3. Permissions Boundary Uses a managed policy to set the maximum permissions that an identity-based policy can grant to an IAM entity.
4. Organizations SCPs Defines the maximum permissions for account members of an organization or organizational unit (OU).
5. ACLs Controls which principals in sother accounts can access the resource to which the ACL is attached.
6. Session Policies Passes ad