# README

My personal Wiki with information that I find interesting, useful, or curious.

The wiki can be found on [GitHub](https://github.com/baileye/knowledge)


# Meta

Below you will find all the notes I made. I continuously update them and I use them myself for my own reference. I try to write things and structure them so everyone can benefit from reading them or even reference what I know easily and quickly.

Each folder is a [topic that can include other topics](https://github.com/baileye/knowledge/blob/main/SUMMARY.md) under it related to the parent topic.

If this is your first time visiting this wiki, you can just start reading from the top entry down and see what sparks your interest.

I will be updating this wiki quite often as I use it myself daily both to keep an account of things I know as well as things I want to know and everything in-between.

If you find a mistake, especially if something that I say is plain wrong, please fork [this repository](https://github.com/baileye/knowledge) and make a PR with correct changes. Or [open an issue](https://github.com/baileye/knowledge/issues/new) saying what you think is wrong.

Aside from GitBook search above, you can also use GitHub [file](https://github.com/baileye/knowledge/find/main) & [text](https://github.com/baileye/knowledge/search?q=azure\&unscoped_q=azure) searches.

## Content Structure

Each topic will have a title, some description of it, usually my own thoughts and knowledge on it as well as referencing some resources or links I have liked or used that helped me either understand the topic or gain appreciation of it.

The structure of each of the posts will often look roughly like this:

1. Title
2. Description - My thoughts on the topic.
3. Subtopics - Various subtopics related to the main topic.
4. Notes - My own personal notes on the matter as well as things I found interesting on the internet regarding the topic. I often give a link of where I got things from.
5. Code - Code snippets.
6. Links - Links related to the topic.

If you are interested in how I maintain and write this wiki, I wrote about it in detail [here](https://github.com/baileye/knowledge/blob/main/other/wiki-workflow.md).

## Attribution

Heavily inspired by this wiki: <https://github.com/nikitavoloboev/knowledge>, super awesome work and a great starting point for my own workflow.


# Reference

Below will be common acronyms, and other common formatting that I use through the wiki. Since I'm starting out, this is empty today.


# Docusaurus

GitBook is handy and does a lot of the heavy lifting converting these markdown files to a useful Wiki. But it looks like they are moving to an increasingly paid product.

For that reason keeping [https://docusaurus.io/docs/deployment](https://github.com/baileye/knowledge/blob/main/meta/Docusaurus/README.md) noted and available as an option for the future seems a good idea.


# Windows


# Chocolatey

Chocolatey is a Powershell tool to install programs. As they say themselves:

> Chocolatey is software management automation.

## Key Commands

* `choco upgrade all`
  * Upgrade all install packages (and Chocolatey itself)
* `choco install <package name>`
* `choco list --local-only`
  * List local installed packages
  * (DEPRECATED: will be default for list in v2.0.0)

## Packages

* git
* poshgit
* powertoys
* terraform
* firefox
* python3
* sourcodepro
* jq
* whois
* sysinternals
* 7zip

## Links

* [Chocolatey](https://chocolatey.org/)
* [Choco packages](https://community.chocolatey.org/packages)
* [.install, .portable package differences](https://docs.chocolatey.org/en-us/faqs#what-is-the-difference-between-packages-no-suffix-as-compared-to.install.portable)
* [Choco compares to Scoop](https://dev.to/bowmanjd/chocolatey-vs-scoop-package-managers-for-windows-2kik)


# Scoop

Scoop is similar to Chocolatey, key differences being it installs to the local user directory, is more scriptable, and more 'linux-like', i.e. designed to be easy to use if you already use bash.

## Key Commands

* `scoop install <PACKAGE NAME>`
* `scoop update`

## Packages

* ruby

## Links

* [Scoop](https://github.com/ScoopInstaller/Scoop)
* [ScoopSearch](https://scoopsearch.github.io/#/apps)


# WSL(2)

WSL lets you install Linux terminal and run it within Windows. It's not 100% identical to running a dedicated Linux box, but it's super iseful and helpful for day-to-day tasks when in Windows and doens't require a VM. I run Ubuntu and Debian.

## Set up Ubuntu

The [WSL Docs](https://docs.microsoft.com/en-us/windows/wsl/about) will contain the latest set up and isntall steps to get Ubuntu on your machine. Personal to me I like to set up the following:

* Git
  * `git config --global user.name = "Me"`
  * `git config --global user.email = "me@example.org"`
  * New SSH key: `ssh-keygen -t ed25519 -C "me@example.org"`
* Oh-my-zsh
  * Install zsh
  * Install oh-my-zsh
  * [zsh autosuggestions](https://github.com/zsh-users/zsh-autosuggestions)
  * [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting)
  * [Powershell 10k (zsh)](https://github.com/romkatv/powerlevel10k)
* rbenv
  * [Install](https://github.com/rbenv/rbenv#installation)
  * `rbenv install -l` (list lasted ruby versions)
  * `rbenv global 3.1.1`
* tfenv
  * [Install](https://github.com/tfutils/tfenv#installation)
  * `sudo apt install unzip`
  * `tfenv install 1.1.8`
  * `tfenv use 1.1.8`

## Notify-Send replacement

notify-send is a little tool to send a notification from your terminal. Stuart Leeks has written a [tool](https://github.com/stuartleeks/wsl-notify-send) to get this working in WSL2 and sending a notification to the Windows Toast notification.

Handy for long-running processes, when I want to know if they're finished, e.g.:

`terraform apply --auto-approve; notify-send "Terraform apply complete"`

## Links

* [WSL Docs](https://docs.microsoft.com/en-us/windows/wsl/about)
* [New SSH key - add to SSH agent](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)
* [Oh-mh-zsh](https://github.com/ohmyzsh/ohmyzsh)
* [rbenv Digital Ocean guide](https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-ubuntu-20-04)


# Git

Git is one of this tools I constantly have to learn. This doc is going to help with that!

The next time I make mistakes and figure out the right way, it will appear here and this doc will grow.


# GitHub

Shortcuts, tips, tricks when using GitHub.

## GitHub.dev

To open up an editor in your browser for an of your repos, just press '.' when in the repo. Visual Studio Code in your browser will open and let you create, edit, delete files and then commit your changes. You can also get to the same location by replacing '.com' in the URL with '.dev'.

## GitHub Pages

Host a web page for your repo, living in your repo. Can be on a GitHub domain or self-hosted, e.g. eb.ie is hosted in a repo in my personal GitHub.

## Links

* [GitHub.dev](https://github.com/github/dev)
* [GitHub Pages](https://docs.github.com/en/pages)


# Recipes


# Buttermilk Waffles

I love waffles - but usually when I make them they're not great. This recipe makes delicious waffles.

Credit: [BBC GoodFood](https://www.bbcgoodfood.com/recipes/belgian-waffles)

## Ingredients

* 240ml buttermilk
* 60g unsalted butter , melted
* ½ tsp vanilla extract
* 1 large egg
* 240g plain flour
* ½ tsp salt
* 1 tbsp caster sugar
* ½ tsp baking powder
* ¼ tsp bicarbonate of soda
* oil , for greasing

## Steps

1. Whisk the buttermilk, melted butter and vanilla together in a large bowl. Separate the egg and whisk the yolk into the buttermilk mixture. Whisk the egg white in a clean bowl until it forms stiff peaks – this will keep your waffles light and fluffy.
2. Weigh all the other dry ingredients into a bowl. Whisk in the wet ingredients to create a smooth batter then carefully but decisively fold through the egg white – don’t worry if you are left with a few small lumps. Cover with cling film and leave the batter to sit for 30 mins, if you have time.
3. Lightly oil then heat your waffle maker (or see the tip below). Heat the oven to low, so you can keep each waffle warm while the next one cooks. Pour enough batter for one waffle (about a quarter) into the waffle maker, close the lid and cook until the waffle is golden brown on both sides and will come away from the maker easily, about 2 mins. Repeat with the remaining batter, then top with whatever you fancy.


# Chocolate Fudge Cake

I've been wanting to recreate what to me is the perfect Chocolate Fudge Cake for several years. The original of this cake came from a baker in The Farm Gate Cafe in Midleton, County Cork. After trying multiple recipes that didn't cut it, my Mum found the baker (she runs a shop in Midleton now) and asked for the recipe. This is that recipe!

## Ingredients

| Ingredient         | 7” ROUND  | 9” ROUND  |
| ------------------ | --------- | --------- |
| Sugar              | 3 oz      | 5 oz      |
| Butter             | 3.5       | 6         |
| Plain flour        | 6         | 10        |
| Eggs               | 1         | 2         |
| Cocoa/cacao        | 1         | 2 scant   |
| Golden Syrup/agave | 2.5 fl oz | 4 oz      |
| Milk               | 4.5 fl oz | 7.5 fl oz |
| Bicarb             | ½ tsp     | 1 tsp     |

Melt fat, stir in cocoa, sugar and syrup. Add apprpx 2/3 liquid and stir well.\
Pour mixture into flour, beating in, add lightly whisked egg.\
Dissolve bicarb in remaining 1/3 liquid warmed and add. Ladle mixture into base-lined tin and bake approx 45-55 minutes @ 160 degrees. Slice cake when cold and fill with choc butter icing.

## Cover with fudge icing

7” round cake; Melt I.5 oz butter in 1.5 tbsp milk, stir in cocoa and beat in 6 oz icing sugar. Add extra liquid if required. Best if left to settle and reheated to melt and use.

All above measurements are fairly elastic as the recipe is very forgiving. Age shown by ignorance of metric measures!


# Kids Banana Pancakes

I usually make a double batch! Can add chocolate chips too :)

## Ingredients

* 1/4 cup oat (or plain, or wholemeal) flour
* 1 medium ripe banana
* 1 egg
* 1 tsp vanilla extract
* pinch sea salt

## Steps

1. Mix everything together
2. Place a non-stick pan on a medium heat
3. Cook small pancakes for roughly 1 minute each side
4. Serve warm (or cold later, whatever works.)


# Sociology

## Edelman Trust Barometer

The 2022 Edelman Trust Barometer is the 22nd annual trust and credibility survey.

## Extracts

> Recent academic studies suggest that social media is indeed corrosive to trust in governments, news media, and people and institutions in general.

> When our public square is governed by mob dynamics unrestrained by due process, we don’t get justice and inclusion; we get a society that ignores context, proportionality, mercy, and truth.

> John Stuart Mill said, “He who knows only his own side of the case, knows little of that,”

From HN:

> 1. "The human mind avoids nothing as much as thinking." -- Unknown, quoted by my dad
> 2. "We used to agree on the facts, and than argue about what do do. Now we simple disagree on the facts" -- Friend of Mine
> 3. "The quickest way to release stress hormones from the brain, unfortunately, is to 'beat' up someone else." -- My therapist
>
> (1) Leads to humans always gravitating towards an explanation that reliefs them from thinking. Simple, short, populist messages are perfect for that.
>
> (2) Has us end discussions before we even get to talk about what to do.
>
> (3) Has us make feel good when we can "beat" up someone else on social media.

## Links

* [Why the Past 10 Years of American Life Have Been Uniquely Stupid](https://www.theatlantic.com/magazine/archive/2022/05/social-media-democracy-trust-babel/629369/)
* [Hacker News Discussion on above article](https://news.ycombinator.com/item?id=30992322)
* [Edelman Trust Barometer 2022](https://www.edelman.com/trust/2022-trust-barometer)
* [Working Paper: Digital Media and Democracy: A Systematic Review of Causal and Correlational Evidence Worldwide](https://osf.io/preprints/socarxiv/p3z9v/)


# Bugs


# WSL2

WSL2 has an issue with Terraform and DNS.

Issue is [detailed here](https://www.cryingcloud.com/blog/2022/2/21/terraform-and-wsl2-issue) and [here](https://github.com/microsoft/WSL/issues/8022). A workaround fix is on [GitHub](https://github.com/microsoft/WSL/issues/5420#issuecomment-646479747)


# Crypto


# Flash Loans

A flash loan is borrowing cryptocurrency for a very short period, sub-minutes to several seconds. No collatoral is required, but you pay back a 0.09% fee.

Used for arbitrage, and also [attacks](https://www.theverge.com/2022/4/18/23030754/beanstalk-cryptocurrency-hack-182-million-dao-voting)

## Links

* [What is Aave Lend](https://www.kraken.com/en-us/learn/what-is-aave-lend)


