diff --git a/compose.yml b/compose.yml index 8198edf..2e934c0 100755 --- a/compose.yml +++ b/compose.yml @@ -1,13 +1,23 @@ services: app: + container_name: blog build: args: - DEBUG_MODE=1 - obsidian_vault_url=https://git.riverrooks.dev/Personal-Wiki - obsidian_vault_token=bd8cd9301ae2c1c5bacfb3340492acb5e862686a - - ports: - - '8188:80' volumes: - ./content:/content #public - ./public-vault:/vault #private + labels: + - "traefik.enable=true" + - "traefik.http.routers.blog.rule=Host(`riverrooks.dev`)" + - "traefik.http.routers.blog.entrypoints=websecure" + - "traefik.http.routers.blog.tls.certresolver=myresolver" + - "traefik.http.services.blog.loadbalancer.server.port=80" + networks: + - proxy + +networks: + proxy: + external: true diff --git a/content/AWK cheatsheet.md b/content/AWK cheatsheet.md new file mode 100644 index 0000000..f98486e --- /dev/null +++ b/content/AWK cheatsheet.md @@ -0,0 +1,171 @@ +--- +tags: + - AI + - notes + - coding-notes + - docs + - public +--- +### 1. Basic Syntax + +The standard structure of an `awk` command: + +Bash + +``` +awk [options] 'BEGIN { initialization } pattern { action } END { finalization }' file +``` +commands +- **`BEGIN { ... }`**: Runs _once_ before the first line is read. Great for setting variables or printing headers. + +- **`pattern`**: A condition (regex or math) that must be met for the action to run. + +- **`{ action }`**: The command(s) executed on each line that matches the pattern. + +- **`END { ... }`**: Runs _once_ after the last line is processed. Great for printing totals or summaries. + + +--- + +### 2. Common Command-Line Flags + +|**Flag**|**Description**|**Example**| +|---|---|---| +|`-F`|Defines the field separator (default is space/tab)|`awk -F"," '{print $1}' file.csv`| +|`-v`|Assigns an external variable to use inside AWK|`awk -v max=100 '$1 > max' file`| +|`-f`|Reads AWK commands from a script file|`awk -f script.awk input.txt`| +|`-i inplace`|Edits the file in place (requires GNU awk)|`gawk -i inplace '{print $1}' file`| + +--- + +### 3. Built-in Variables + +|**Variable**|**Meaning**|**Example Use Case**| +|---|---|---| +|`$0`|The entire current line|`print $0`| +|`$1, $n`|The 1st, 2nd... _n_th field (column)|`print $2, $4`| +|`NR`|Number of Records (Current line number)|`NR > 1` (Skip headers)| +|`NF`|Number of Fields (Total columns in current line)|`print $NF` (Print the last column)| +|`FS`|Input Field Separator (Same as `-F`)|`BEGIN { FS=":" }`| +|`OFS`|Output Field Separator|`BEGIN { OFS="," }`| +|`RS`|Input Record Separator (Default: newline)|`BEGIN { RS="" }` (Paragraph mode)| +|`ORS`|Output Record Separator (Default: newline)|`BEGIN { ORS="\n\n" }` (Double space)| + +--- + +### 4. Operators & Conditionals + +**Relational & Logical Operators:** + +- `==`, `!=`, `<`, `>`, `<=`, `>=` (Standard math comparisons) + +- `~` (Matches regular expression) + +- `!~` (Does not match regular expression) + +- `&&` (AND), `||` (OR), `!` (NOT) + + +**Control Structures (used inside action blocks):** + +``` +# If/Else Statement +{ if ($1 > 50) print "Pass"; else print "Fail" } + +# For Loop +{ for (i=1; i<=NF; i++) print $i } + +# While Loop +{ i=1; while (i<=NF) { print $i; i++ } } +``` + +--- + +### 5. Essential Built-in Functions + +|**Function**|**Description**|**Example**| +|---|---|---| +|`length(str)`|Returns the length of a string|`length($0) > 80`| +|`tolower(str)`|Converts string to lowercase|`print tolower($1)`| +|`toupper(str)`|Converts string to uppercase|`print toupper($1)`| +|`substr(s,p,l)`|Extracts substring from _s_ starting at _p_ with length _l_|`print substr($1, 1, 3)`| +|`gsub(r,s,t)`|Globally replaces regex _r_ with string _s_ in target _t_|`gsub(/apple/, "orange", $0)`| + +--- + +### 6. Handy Everyday One-Liners + +**Printing & Filtering:** + +- **Print the last column of every line:** + + Bash + + ``` + awk '{ print $NF }' file.txt + ``` + +- **Print lines longer than 80 characters:** + + Bash + + ``` + awk 'length($0) > 80' file.txt + ``` + +- **Print lines matching "Error" or "Warning":** + + Bash + + ``` + awk '/Error|Warning/' file.log + ``` + + +**Math & Summaries:** + +- **Sum the values in the first column:** + + Bash + + ``` + awk '{ sum += $1 } END { print sum }' numbers.txt + ``` + +- **Calculate the average of the first column:** + + Bash + + ``` + awk '{ sum += $1 } END { print sum / NR }' numbers.txt + ``` + +- **Count the number of empty lines:** + + Bash + + ``` + awk '/^$/ { count++ } END { print count }' file.txt + ``` + + +**Text Manipulation:** + +- **Remove duplicate consecutive lines (simulates `uniq`):** + + Bash + + ``` + awk 'a != $0; { a = $0 }' file.txt + ``` + +- **Number each line (simulates `cat -n`):** + + Bash + + ``` + awk '{ print NR, $0 }' file.txt + ``` + + +--- \ No newline at end of file diff --git a/content/C++.md b/content/C++.md new file mode 100644 index 0000000..0e41701 --- /dev/null +++ b/content/C++.md @@ -0,0 +1,42 @@ +--- +tags: + - code + - notes + - docs + - School + - coding-notes + - CS-101 + - public +--- +# overview +OOP language +C code runs *almost* unchanged from C +```embed +title: "cplusplus.com" +image: "https://cplusplus.com/favicon.ico" +description: "" +url: "https://cplusplus.com/" +favicon: "" +``` +```embed +title: "W3Schools.com" +image: "https://www.w3schools.com/images/w3schools_logo_436_2.png" +description: "W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more." +url: "https://www.w3schools.com/cpp/cpp_intro.asp" +favicon: "" +aspectRatio: "52.293577981651374" +``` + +```cpp +#include +#include +class Vector{ + private: + T* data: + size_t sz; + size_t cap; +} +``` +$\approx$ diff --git a/content/Capture The Flag.md b/content/Capture The Flag.md new file mode 100644 index 0000000..7535af6 --- /dev/null +++ b/content/Capture The Flag.md @@ -0,0 +1,15 @@ +#public + +all non-osint CTF challenges can be solved through recursive steps until a flag is found +# 1. Explore +Analyze any data in plain text for a flag, or for the next command to run such as the results of a program. +>`cat problem.txt` +> `xxd -d asdasd238uasdkh` +> `curl challenge.org/asd` + +Either solve the challenge with the flag, or determine the next program to execute +# 2 replicate +Build an isolated environment to replicate only the next program, and solve that step locally +# 3 Inject +Inject the payload that works on in the isolated environment +repeat Step 1 \ No newline at end of file diff --git a/content/Cyber-Crime.md b/content/Cyber-Crime.md index 787d479..9a04203 100644 --- a/content/Cyber-Crime.md +++ b/content/Cyber-Crime.md @@ -1,7 +1,7 @@ #public - **Cyber Crime**: Use computer/digital device to further illegal ends > "nothings black and white in what we do, everything's got some gray" -## Types of crime +# Types of crime - **Crimes Against People**: A digital crime where the victim is a person - **Crimes Against Property**: A digital crime that damages, or illegally interacts with property - **Crimes Against Government**: A digital crime to undermine the efficacy of a government @@ -41,7 +41,7 @@ Nation-state attacks on power grids before Wars - **Sneaker Net**: Moving information across barriers physicality > proving an attack is one of the hardest questions to answer # U.S. National cyber strategy - - **U.S. National cyber strategy**: anually updated policy document from the white house detailing the national cyber objectives + - **U.S. National cyber strategy**: annually updated policy document from the white house detailing the national cyber objectives > it has been similar last few years @@ -55,13 +55,14 @@ Nation-state attacks on power grids before Wars - Shaping adversary behavior - regulatory environment - Federal government security - - criticial infrastructure security + - critical infrastructure security - cyber skills workforce gap - - - - +> How can you deter people outside of your country and laws? [[attack back]] +> number of cyber jobs in US is increasing faster than the rate of new PHD grads + +# Identity Theft + - **Identity Theft**: Unlawful use of another's [Personally Identifiable Information][Definitiona/Personally Identifiable Information] diff --git a/content/Discord ICS.md b/content/Discord ICS.md new file mode 100644 index 0000000..5ea3caa --- /dev/null +++ b/content/Discord ICS.md @@ -0,0 +1,8 @@ +People submit week-at-a-galnce screenshots, or some form of their calendar. +Turn that into an ICS +Plugin discord bot that recognizes +>/schedule @p1 @p2 + +And finds available times to select. Then sends dm to users, emails them, and optional creates discord event + +#public \ No newline at end of file diff --git a/content/Formulas.md b/content/Formulas.md new file mode 100644 index 0000000..7d37021 --- /dev/null +++ b/content/Formulas.md @@ -0,0 +1,45 @@ +#public +# Work and energy +| Formula | equation | Usage | +| -------------------------------------- | ----------------------------------------------- | ----------------------------------- | +| Gravitational Potential Energy ($U_g$) | $U_g=mgh$ | Changes in height | +| Kinetic Energy | $K=\frac{1}{2}mv^2$ | Energy of motion | +| Work-Energy Theorem | $\Delta E_{mec} = \Delta K+\Delta U=W_{other}*$ | calculating the effects of friction | + + +| Variable | Symbol | SI Unit | Notes | +| --- | --- | --- | --- | +| Mass | m | kg | Convert from grams (g) if necessary. | +| Height / Distance | h,d | m | Measures vertical or horizontal displacement. | +| Velocity / Speed | v | m/s | Convert from km/h by dividing by 3.6.+3 | +| Gravity | g | m/s2 | Earth's standard is approximately 9.8 m/s2. | +| Energy / Work | $U_g$,K,W | J | 1 Joule = 1 kg⋅m2/s2. | + +# Center Of Mass (CM) +| Formula | equation | Usage | +| -------------------------------------- | ----------------------------------------------- | ----------------------------------- | +| Position of COM X| $x_{com}=\frac{1}{M}\sum_{i=1}^{n}M_ix_i$ | find COM X| +| Position of COM Y| $y_{com}=\frac{1}{M}\sum_{i=1}^{n}M_iy_i$ | find COM Y| +| velocity of COM | $v_{com}=\frac{\sum m_iv_i}{M}$ | find the Velocity of COM | + +| Variable | Symbol | SI Unit | Notes | +| --- | --- | --- | --- | +| Position (X or Y) | $x_{com},y_{com}$ | m | Coordinates on the Cartesian plane.+ 1| +| Total Mass | M | kg | The sum of all individual masses (m1​+m2​+…) | +| Velocity of CM | vcom​ | m/s | The speed at which the entire system's balance point moves | +# Linear Momentum and impulse +| Formula | equation | Usage | +| -------------------------------------- | ----------------------------------------------- | ----------------------------------- | +| Linear Momentum | p = mv | find linear momentum | +| Impulse | $J=\Delta p=F_{avg}\Delta t=\int F(t)dt$ | change in momentum. Also area under Force-time graph | +| Conservation Law | $P_{initial}=P_{final}$ | if net external force is 0, totoal momentum is constant | +| Elastic Collisions (1D) | $v_{1f}=(\frac{m_1-m_2}{m_1+m_2})v_i+(\frac{2m_2}{m_1+m_2})v_2i$| momentum and kinetic energy are conserved | +| completely inelastic collisions | $m_1v_{1i}+m_2v_{2i}=(m_1+m_2)v_f$ | find situation where the objects stick together | + + +| Variable | Symbol | SI Unit | Notes | +| --- | --- | --- | --- | +| Momentum | p | kg⋅m/s | Calculated as mass × velocity. | +| Impulse | J | N⋅s | Also equivalent to kg⋅m/ s.| +| Force | F | N | 1 Newton = 1 kg⋅m/s2.+2 | +| Time | t,$\Delta$t | s | The duration of the force application.+1| diff --git a/content/Index.md b/content/Index.md new file mode 100644 index 0000000..0de02fc --- /dev/null +++ b/content/Index.md @@ -0,0 +1,9 @@ +--- +tags: + - public +--- +# River Rooks.dev +## Home for all of my creations ... eventually +# Check out my notes + +# See [my git server](https://git.riverrooks.dev/venus) for all of my projects and dotfiles diff --git a/content/Malware and cybersecurity.md b/content/Malware and cybersecurity.md new file mode 100644 index 0000000..7017f2f --- /dev/null +++ b/content/Malware and cybersecurity.md @@ -0,0 +1,57 @@ +#public +## Malware +Malicious software: +> Software written to Do [[Harm]] +## Harm +- Devices +- Data + - Alter + - Modify + - Delete + - Corruption +# Limit Access To Information +## Privacy +Limit the amount you permit to be shared +### Healthcare +I don't want public access to my info +Choose certain info to release or not +A trip to a crisis center is private +### Personally Identifiable Information (PII) +- Info that points Directly to you +- Protect as Cyber Prof. + +## CIA Triad +### Confidentiality +Keep data hidden from those who should not access it +- Encryption + - People who can see it, can't understand if there not supposed to +- Hiding Existence +Not the same as [[Malware and cybersecurity#Privacy|Privacy]] +**Keep those who don't have access from having access** +### Integrity +Ensuring that Data and System Resources are trustworthy. +Eliminate unauthorized tampering +Eliminate accidental or malicious modifications. +Examples: + Financial Records + Medical Records +Can be more important than Confidentiality. + Banking must be accurate, may be public +#### 3 Categories of integrity +##### Data Integrity +Ensuring that the data is trustworthy +##### Origin Integrity +Understanding the author and verifying the source +The author created data and it has not been changed +##### System Integrity +Securing the processes that modify the data + Eliminate Accidental, deliberate, or malicious modifications of data through systems controlling that data +### Availability +Dealing with systems and data being available for use when needed + +## Secrecy +Information that should not be disclosed outside of an in-group + `Maximum Secrecy = Minimun Availability` + + + diff --git a/content/Malware.md b/content/Malware.md index 499a96e..370523b 100644 --- a/content/Malware.md +++ b/content/Malware.md @@ -9,13 +9,27 @@ flowchart TD ``` > Greatest Vulnerability is People ## Malware types - - **virus:** program to modify other programs - **Worm**: program that spreads itself > diff b/t virus and worm is method of movement - - **Trojan**: an innocent program that hides malware inside - **Ransomware**: require payment to remove (often in exchange for decryption key) - **Phishing**: Faking identity in order to build trust to encourage specific user behavior - **DOS/DDOS**: (distributed) denial of service to overwhelm services and prevent legitimate activity from getting through +## Virus + - **Virus:** program to modify other programs +### Trojan + - **Trojan**: an innocent program that hides malware inside + looks benign and can be anything from a bad link to a malicious PDF file. + Can contain any kind of other malware such as + - key loggers + - webcams +### Examples +#### I love you + [wiki](https://en.wikipedia.org/wiki/ILOVEYOU) +- $10 billion in damages, +- 10% of worldwide competition +- attacked other computers after spreading +> at it's height, a third of the worlds computers were infected + # Threat Actors | Group | Motivations | diff --git a/content/Public test 2.md b/content/Public test 2.md deleted file mode 100644 index 047744d..0000000 --- a/content/Public test 2.md +++ /dev/null @@ -1,2 +0,0 @@ -if this is there, the site live updates from wh -#public \ No newline at end of file diff --git a/content/odo-test.md b/content/odo-test.md new file mode 100644 index 0000000..4091064 --- /dev/null +++ b/content/odo-test.md @@ -0,0 +1,3 @@ +#public +this is a doc +# Md rendered to html \ No newline at end of file diff --git a/content/test.md b/content/test.md deleted file mode 100644 index 2e4465f..0000000 --- a/content/test.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -public: "true" -tags: - - public ---- -# This is a test -and this is p -[https://localhost/test]() -[asd](https://localhost/test) - -