# Second brain

## Links

* [An article in Medium what is second brain](https://medium.com/swlh/how-i-use-my-second-brain-b5300d68e83a) – the article contains why second brain is needed and tips about first implementation


# AI - Artificial Intelligent

## Links

* [ChatGPT Cheatsheet](https://www.kdnuggets.com/publications/sheets/ChatGPT_Cheatsheet_Costa.pdf)
* [Another ChatGPT Cheatsheet](https://github.com/dmmax/Knowledge/blob/main/ai/chat-gpt-cheat-sheet.pdf)


# AI-labeling

In AI, labeling means assigning a category or class label to a piece of data. It's used to train machine learning models to recognize similar data. Accurate labeling is important for effective AI applications.

## Links

* [Application: Universal Data Tool - for editing and annotating images, text, audio, documents and to view and edit any data defined in the extensible .udt.json and .udt.csv standard.](https://github.com/UniversalDataTool/universal-data-tool)


# AI-training

## Links

* [Python Library: for image degradation](https://github.com/NVlabs/ocrodeg) - this is especially useful when you want to prepare training/test datasets


# Books

## Self-development

* [Atomic habits](https://github.com/dmmax/Knowledge/blob/main/books/self-development/atomic-habits.md)


# Code


# Linux

## Links monitoring

![Linux monitoring](/files/OeJPhq6KY4743Rg2sMvE)

## Links

* [The Linux System Administrator's Guide](https://tldp.org/LDP/sag/html/index.html)


# Gradle

## Links

* [How to use Gradle api vs. implementation dependencies with the Java Library plugin](https://tomgregory.com/how-to-use-gradle-api-vs-implementation-dependencies-with-the-java-library-plugin/)


# Company


# Interview

## Links

* [E-Book: The Hiring manager's complete interviewing guide](https://hr.cofc.edu/supervisor/assets/career-builder-e-book.pdf)
* [Behavioral interviews for Software Engineers: How to prepare](https://www.techinterviewhandbook.org/behavioral-interview/)


# Computer science


# Data Structures

## Links

* [Java HashMap](https://www.baeldung.com/java-hashmap)
* [Bloom Filter](http://llimllib.github.io/bloomfilter-tutorial/)


# Algorithms

## Links

* [Coursera: Algorithms Part 1 by Robert Sedgewick and Kevin Wayne](https://www.coursera.org/learn/algorithms-part1)
* [Article. Baeldung: Java Two Pointer Technique](https://www.baeldung.com/java-two-pointer-technique)
* [Grouped articles about algorithms and data structures](https://docs.google.com/document/d/1yMBDTeM49rm8Yni-BYzxakwSW3Ce_MKum65s6wEPQic/edit)


# Concurrency

## Links

* \[Deadlock Empire. Simukation of concurrency issues]\[<https://deadlockempire.github.io/#T1-Interface>]


# Container

## Links

* [Cgroups, namespaces, and beyond: what are containers made from?](https://www.youtube.com/watch?v=sK5i-N34im8\&ab_channel=Docker)
* [Exploring Default Docker Networking Part 1](https://blogs.cisco.com/learning/exploring-default-docker-networking-part-1)


# Docker

## Help articles

* [Dealing with Private Docker Registry](/container/docker/private-docker-registry)


# Docker | Private Docker Registry

## Push image

```shell
docker tag {image_id} {registry_host}:{registry_port}/{image_name}:{image_tag}
docker push {registry_host}:{registry_port}/{image_name}:{image_tag}
```

## Pull image

```shell
docker pull {registry_host}:{registry_port}/{image_name}:{image_tag}
```

## Links

* [Documentation: docker tag](https://docs.docker.com/engine/reference/commandline/tag/)


# Kubernetes

## Links

* [Article: Spring Cloud Kubernetes with Spring Boot 3](https://piotrminkowski.com/2023/06/08/spring-cloud-kubernetes-with-spring-boot-3/) - it is a great article with an example of integration Spring Boot 3 into Kubernetes
* [kubectl Cheat Sheet](https://kubernetes.io/docs/reference/kubectl/cheatsheet/)
* [Table: Kubernetes Ingress Controller](https://docs.google.com/spreadsheets/d/191WWNpjJ2za6-nbG4ZoUMXMpUK8KlCIosvQB0f-oq3k/edit?usp=sharing)


# Distributed systems


# Akka

## Links

* [Circular Breaker in Akka Actor](https://doc.akka.io/docs/akka/current/common/circuitbreaker.html)


# Analytics

## Links

* [Zipkin](https://zipkin.io/) – is a distributed tracing system


# Delivery guarantee

## At most once

This guarantee ensures that a message is delivered at most once, but there is a possibility that it may not be delivered at all.

## At least once

This guarantee ensures that a message is delivered at least once, but it may be delivered multiple times.

## Exactly once

This guarantee ensures that a message is delivered exactly once, and not more or less.

## Links

* [Article by Tyler Treat: You Cannot Have Exactly-Once Delivery](https://bravenewgeek.com/you-cannot-have-exactly-once-delivery/)


# Kafka

## Links

* [Article by Sedef Tulum: Rebalance & Partition Assignment Strategies in Kafka](https://medium.com/trendyol-tech/rebalance-and-partition-assignment-strategies-for-kafka-consumers-f50573e49609)
* [Article by Confluent: 5 things every Kafka developer should know](https://www.confluent.io/blog/5-things-every-kafka-developer-should-know/)


# Rebalancing

## Links

* [Video by ByteByteGo: Consistent Hashing](https://youtu.be/UF9Iqmg94tk)


# RPC


# gRPC

## Links

* [Official website](https://grpc.io/)
* [Introducing gRPC to our Hotels.com Platform — Part 1](https://medium.com/expedia-group-tech/introducing-grpc-to-our-hotels-com-platform-part-1-61716af50b13)
* [Introducing gRPC to our Hotels.com Platform — Part 2](https://medium.com/expedia-group-tech/introducing-grpc-to-our-hotels-com-platform-part-2-8024a1dda0aa)
* [Awesome gRPC](https://github.com/grpc-ecosystem/awesome-grpc)
* [Libraries for gRPC services](https://www.bugsnag.com/blog/libraries-for-grpc-services)
* [Proto files lint](https://github.com/ckaznocha/protoc-gen-lint)
* [Article: Understanding Protobuf Compatibility by Robert Yokota](https://yokota.blog/2021/08/26/understanding-protobuf-compatibility/)


# Food


# Recipes

## Links

* [Very tasty Cinnamon Rolls, the only cons point is time consuming](https://www.youtube.com/watch?v=_Q0FYoCl4Cs\&ab_channel=Tasty)


# Tiramisu

## Tiramisu ingredients

1. Yolks – 5 pieces
2. Mascarpone – 250g
3. [Savoiardi(Ladyfinger)](https://en.wikipedia.org/wiki/Ladyfinger_\(biscuit\)) – 18-20 pieces
4. [Icing Sugar](https://en.wikipedia.org/wiki/Powdered_sugar) – 80g
5. Espresso coffee (or filter) – 125g
6. Amaretto (or any other alcohol)
7. Сocoa powder

## Tiramisu steps

1. Prepare coffee and add alcohol (optional)
2. Regularly mix Yolks with Icing sugar on a steam bath until it has 60 degree
3. When it has enough temperature, take off from the steam bath and use a mixer with mid-level speed to make it light airy texture (for me it takes about 15 minutes)
4. Now, need to add Mascarpone to the container with Yolks and Icing sugar and mix it until common texture. Your sauce is ready
5. The next step will be to add to the form Savoiardi and sauce: each ladyfinger put into the coffee for 1-2 seconds and move to the form, repeat it until you have a full layer of Savoiardi. On top of it add the sauce as a second layer. Add one more layer with Savoiardi and sauce
6. So, now you need to put your form into the refrigerator for 10-12 hours
7. After refrigerator you need use sieve to add Cocoa powder to the form as last layer
8. Your cake is ready ;)

## Links

* [Original recipe](https://birosss.livejournal.com/43378.html)


# Git

## Git create branch

```bash
git checkout -b "<new_branch_name>" "<from_branch>"
git checkout -b feature_x main
git checkout -b feature_x
```

* `new_branch_name` – is a name of your branch
* `from_branch` – is a name of branch from which need to create new branch, could be empty, in that case will be used the current branch

## Git delete branch

### Git delete local branch

Syntax

```bash
git branch -D "<branch_name>"
```

Example

```bash
git branch -D feature_x
```

### Git delete remote branch

Syntax

```bash
git push "<remote_name>" --delete "<branch_name>"
```

Example

```bash
git push origin --delete feature_x
```

## Git pipeline to rebase

If you're on the branch `feature_x` and you need to pull changes from the `main` branch, then the next example will be useful

```bash
git fetch origin main # pull the latests changes from remote
git checkout feature_x
git rebase origin/main
git push --force
```

## Git squash my last commits

```bash
git reset --soft HEAD~<number_of_commits_to_squash>
git commit -m "Squash commit meesage"
git push --force
```

## Links

* [About squashing](https://stackoverflow.com/questions/5189560/squash-my-last-x-commits-together-using-git)


# GH CLI

## GH CLI installation

```bash
brew install gh
```

## GH CLI authentication

You authentication via browser

```bash
gh auth login
```

or using prepared access token

```bash
gh auth login --with-token < path_to_token.txt
```

## Other options

The CLI also allows to work with [PullRequests](broken://pages/gddJvscNOposZhqP3qd1)

## Links

* [GH CLI | Manual](https://cli.github.com/manual/)
* [GH CLI | Repository](https://github.com/cli/cli)


# GH CLI | Pull Request

## GH CLI create a pull request

The next command will create a PR using a default branch as base branch, and also will fill title and comment of the PR depends on commit messages

```bash
gh pr create -f -a "@me"
```

Command options:

* `-a`/`--assignee` – assignee by their usernames
* `-b`/`--body` - body for the pull request
* `-r`/`--reviewer` - request reviews from people or teams by their user(group) names
* `-d`/`--draft` – mark pull request as a draft
* `-B`/`--base` - the base branch, in this branch your code will be merged

## GH CLI open pull request in browser

```bash
gh pr view --web
```

## Links

* [GH CLI | Create Pull Request](https://cli.github.com/manual/gh_pr_create)
* [GH CLI | View Pull Request](https://cli.github.com/manual/gh_pr_view)


# SSH


# SSH bastion | SSH Jump host

## Description

If you don't have access to an instance in a private network but you have a jump host (bastion) with public ip address within the same private network, then this jump host could be a bridge between you and an an instance

## Syntax to use jump host

```bash
ssh -i "<ssh_pem_file>" \
  -o "ProxyCommand ssh -i "<ssh_pem_file>" -W %h:%p <jump_host_user>:<jump_host_ip>" \
  <instance_user>:<instance_host>
```

*NOTE*: Be sure, you've added \<ssh\_pem\_file> to the jump host and private instances

## Example of using Bastion host to SSH

The next command will connect to the address 10.120.10.160 via jump host 34.240.210.182

```bash
ssh -i "aws_ireland.pem" \
  -o "ProxyCommand ssh -i "aws_ireland.pem" -W %h:%p ec2-user@34.240.210.182" \
  ubuntu@10.120.10.160
```

## SSH command options

* `-i` – a path to a file (private key)
* `-v` – verbose mode
* `-q` – quiet mode


# SCP

## Syntax

```bash
scp [OPTION] [user@]SRC:]file1 [user@]DEST:]file2
```

where is

* OPTION – options which accept the command: ssh configuration, recursively, etc
* SRC – is a source source host
* DEST – is a destination host

## SCP copy local file to remote system

### SCP copy local file to remote with output path

```bash
scp /mnt/test/test.txt ubuntu@10.130.10.10:/home/ubuntu/test_folder/myfile.txt
```

This command will copy `test.txt` to the remote file, you could provide another name filename for remote system

### SCP copy local file under remote folder

```bash
scp /mnt/test/test.txt ubuntu@10.130.10.10:/home/ubuntu/test_folder
```

This command will copy the `test.txt` under the `test_folder` on remote machine with the same filename as original

## SCP copy local folder to remote folder

```bash
scp /mnt/test ubuntu@10.130.10.10:/home/ubuntu/test_folder
```

All files from `/mnt/test` will be copied recursively under the `test_folder`

## SCP copy remote file to local system

```bash
scp ubuntu@10.130.10.10:/home/ubuntu/test_folder/myfile.txt /mnt/test/remote_file.txt
```

## SCP copy files between two remote systems

```bash
scp ec2-user@18.135.23.123:/opt/my_folder/test.txt ubuntu@10.130.10.10:/home/ubuntu/myfile.txt
```

## SCP options

* `-r` – copy recursively
* `-P` – specifying the SSH port (default: 22)


# Learning

## Links

* [Wikipedia: Deliberate Practice](https://en.wikipedia.org/wiki/Practice_\(learning_method\)#Deliberate_practice)


# Management

## Links

* [Teamlead Roadmap](https://tlroadmap.io/)


# Reactive systems

## Links

* [Reactive Manifesto](https://www.reactivemanifesto.org/)
* [Video by Caitie McCaffrey: Applying the Saga Pattern | GOTO 2015](https://youtu.be/xDuwrtwYHu8)


# System Design

## Learning

* [Scalability & System Design for Developers](https://www.educative.io/path/scalability-system-design)

## Links

* [High Scalability](http://highscalability.com/)
* [Github Repo: System design Primer](https://github.com/donnemartin/system-design-primer)
* [RESTful API Design. Best Practices in a Nutshell](https://phauer.com/2015/restful-api-design-best-practices/)
* [Anemic Domain Model](https://martinfowler.com/bliki/AnemicDomainModel.html)
* [System Design Cheatsheet](https://gist.github.com/vasanthk/485d1c25737e8e72759f)
* [Video: Perfect Scalability by Michael Nash](https://www.youtube.com/watch?v=NFvf8b6SbGE)
* [Article: System Design — Sharding / Data Partitioning by Peng Yang](https://medium.com/must-know-computer-science/system-design-sharding-data-partitioning-b7201596aafa)
* [Article by NGINX: Reverse Proxy vs Load Balancer](https://www.nginx.com/resources/glossary/reverse-proxy-vs-load-balancer/)
* [Article by NGINX: NGINX Reverse Proxy](https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/)
* [Video: Your tests also need some architecting By Jonas Geiregat](https://youtu.be/T0p4FAJdYOQ?si=29UwARP4_QqSKMRA)


# CAP Theorem

CAP is acronym for Consistency, Availability, and Partition Tolerance. It is a theorem that states that it is impossible for a distributed data store to simultaneously provide more than two out of the following three guarantees:

* CA (Consistency and Availability) - All nodes see the same data at the same time. This guarantee is not applied for distributed systems because they have to be Partition Tolerance
* AP (Availability and Partition Tolerance) - Every request receives a (non-error) response, without the guarantee that the data is the most recent.
* CP (Consistency and Partition Tolerance) - Every request receives a (non-error) response, with the guarantee that the data is the most recent.

## Consistency

**Strong Consistency** - during the write operation, all replicas in the system should be updated before the write operation is acknowledged as performed. In other words, any read operation always returns the most recent write. Achieving strong consistency requires a high level of coordination and synchronization between nodes, which can affect availability.

**Eventual Consistency** – during the write operation, the replicas in the system are updated asynchronously. In that case, replicas in the system could return stale data for a period of time until the change is propagated to all replicas.

## Links

* [Video by IBM Technology: What is CAP Theorem?](https://youtu.be/eWMgsk7mpFc)
* [Video by ByteByteGo: CAP Theorem Simplified | System Design Fundamentals](https://youtu.be/BHqjEjzAicA)
* [Video by Studying with Alex: Friendly Intro To the CAP Theorem (Consistency vs Availability vs Partition Tolerance)](https://youtu.be/gkg-FAEXIkY) – I liked the examples which were used to explain the CAP theorem.
* [Article by Vivek Kumar Singh: Eventual Consistency vs Strong Consistency](https://medium.com/system-design-blog/eventual-consistency-vs-strong-consistency-b4de1f92534d)
* [Article by Peter Bailis: Linearizability versus Serializability](http://www.bailis.org/blog/linearizability-versus-serializability/)


# Domain Driven Design

## Links

* [Article by Martin Fowler: Bounded Context](https://martinfowler.com/bliki/BoundedContext.html)
* [Article by Martin Fowler: Ubiquitous Language](https://martinfowler.com/bliki/UbiquitousLanguage.html)
* [Article by Martin Fowler: DDD Aggregate](https://martinfowler.com/bliki/DDD_Aggregate.html)
* [Pat Helland’s paper, "Data on the Outside versus Data on the Inside", talks about guidelines for designing consistency boundaries. It is essential reading for anyone building microservices-based systems](https://www.cidrdb.org/cidr2005/papers/P12.pdf)


# System Design Interview

## Links

* [System Design Interview Cheat Sheet](https://vahid.blog/post/2022-05-05-system-design-interview-cheat-sheet/)
* [Using the TERA approach to solve algorithm and technical interview questions](https://vahid.blog/post/2020-10-05-using-the-tera-approach-to-solve-algorithm-and-technical-interview-questions/)
* [Article: Load Balancer system design interview questions](https://www.geeksforgeeks.org/load-balancer-system-design-interview-question/?ref=rp)
* [Article: System Design Pastebin](https://systemdesign.one/system-design-pastebin/#how-does-pastebin-work) - very detailed example of a system design interview
* [Article: Wechat Architecture That Powers 1.67 Billion Monthly Users](https://newsletter.systemdesign.one/p/chat-application-architecture)


# Load Balancing

The main purpose of load balancing is to optimize resource utilization, maximize throughput, minimize response time, and avoid overloading any single resource.

## OSI L4 vs OSI L7 load balancing

L4 load balancing is focused on network-level traffic distribution, while L7 load balancing is focused on application-level traffic distribution and can perform advanced functions such as SSL offloading, content-based routing, and application-layer security. L7 load balancers are typically more feature-rich and complex than L4 load balancers, but may also be slower and more resource-intensive.

## Links

* [Video: Load Balancing](https://www.youtube.com/watch?v=sCR3SAVdyCc\&ab_channel=IBMTechnology)


# CDN

## Pros of using CDN

* Faster website performance and load times
* Reduced server load and improved reliability
* Better security and protection against cyber attacks
* Global reach and better user experience
* Efficient handling of traffic spikes

## Cons of using CDN

* Can be expensive for high-traffic websites
* Setting up and configuring a CDN can be complex
* Issues with cache consistency may arise
* Potential privacy concerns and data collection by CDNs
* Possible introduction of latency or other performance issues

## Links

* [Video by ByteByteGo: What Is A CDN? How Does It Work?](https://youtu.be/RI9np1LWzqw)


# OCR

## Links

* [Extract text from PDF and convert to excel](https://docparser.com/blog/convert-pdf-to-excel/)
* [OCR documents structure](https://medium.com/geekculture/tesseract-ocr-understanding-the-contents-of-documents-beyond-their-text-a98704b7c655)
* [Tesseract Page Segmentation Modes (PSMs) Explained: How to Improve Your OCR Accuracy](https://pyimagesearch.com/2021/11/15/tesseract-page-segmentation-modes-psms-explained-how-to-improve-your-ocr-accuracy/)


# Productivity


# Alfred

## Links

* [Alfred forum](https://www.alfredforum.com/)
* [Alfred site](https://www.alfredapp.com/)
* [List of awesome Alfred workflows](https://github.com/alfred-workflows/awesome-alfred-workflows)


# Health


# Teeth

## Links

* [Как пользоваться ирригатором: советы и рекомендации](https://doctorslon.ru/company/articles/sovety-po-ispolzovaniyu-irrigatora/)


# Devops

## Links

* [Publishing artifacts with AWS Codeartifact and GitHub Packages](https://medium.com/reachnow-tech/publishing-artifacts-with-aws-codeartifact-and-github-packages-ca6102e87a47)


# Data stores


# Elasticsearch

## Links

* [Video: What is Elasticsearch?](https://youtu.be/ZP0NmfyfsoM)


# Mongo

## Links

* [Cheat sheet. MongoDb](https://github.com/dmmax/Knowledge/blob/main/database/mongo/MongoDB-cheat-sheet-Red-Hat-Developer.pdf)
* [What The Heck Are You Actually Using NoSQL For?](http://highscalability.com/blog/2010/12/6/what-the-heck-are-you-actually-using-nosql-for.html)
* [List of NoSQL database management systems](http://nosql-database.org/)


# Germany


# Berlin


# Where is to buy Christmas trees in Berlin

## Where is to buy?

There are a lot of places, to find it you can can just type `Weihnachtsbäume` in google maps. Mostly they are opened from the end of Novemeber.

If you want to buy it earlier you need to go to Bauhaus or Hellweg

## Links


# Internet in Germany

The internet in Germany is pretty stable except the codvid time because it has had a lot of overloads. But at the same time it's pretty expensinve compare to Russian internet providers ;)

For now I used two internet providers:

* Vodafone – it was pretty good but after 2 years I had to pay around 40 euros\
  per month and I decided to switch to another provider
* Telekom – it is my current provider and I would say it works the same as Vodafone but paying per month with all bonuses will be less than with Vodafone. Unfortunately, I faced an [ugly issue with installing my router](https://github.com/dmmax/Knowledge/blob/main/germany/internet/telekom-install-custom-router/README.md)


# Install custom router for telekom

I use my tp-link router Archer C80

## Select connection type

You will need to select the PPPoE connection type

![PPPoE connection type](/files/fqhoYEqgPUMB5U5P2OF1)

## Provide username and password

Template of username is: `<Anschlusskennung><Zugangsnummer><Mitbenutzernummer>@t-online.de` NOTE: symbols `<`, `>` do not need to add

Template password: `Persönliche Kennwort`

You can find `Anschlusskennung`, `Zugangsnummer`, `Mitbenutzernummer`, and `Persönliche Kennwort` in your contract

## Additional settings \[for me it was a game changer]

I had to select the special ISP Settings (IPTV/VLAN) with a profile for Telekom ![Special ISP settings](/files/uFLWEblUVMPNWKQ3WUjD)

## Links

* [PPPoE username and password settings](https://telekomhilft.telekom.de/t5/Alles-andere/Wo-finde-ich-die-Zugangsdaten-fuer-eine-PPPOE-verbindung/td-p/1428228)


# Transport


# Bikes

## Links

* [Reddit discussion about the way how to communicate with a partner during the ride trip](https://www.reddit.com/r/Brompton/comments/11uk3ab/best_way_to_communicate_with_each_other_on_road/)


# Travel


# Russia


# Moscow

[Moscow food places](https://goo.gl/maps/ekfUDxtHLuip7kzv6)

## Links

* [Театр наций](https://theatreofnations.ru/events)
* [Театр Ленком](https://teatr-lenkom.ru/)
* [Московский академический театр сатиры](https://satire.ru/)
* [Московский художественный театр имена А.П. Чехова](https://mxat.ru/timetable/)
* [Третьяковская галерея](https://www.tretyakovgallery.ru/)
* [Парк Горького](https://www.park-gorkogo.com/)
* [Парк Горького | Нескучный сад](https://www.park-gorkogo.com/ns)
* [Союзмультфильм](https://souzmultclub.ru/programs/excursions/kinostudiya2/)
* [Мосфильм](https://www.mosfilm.ru/fans/excursion/)


# Moscow Attractions

## Vecherniy Urgant

You can visit the most popular show in Russia TV offline. There're not difficult things to do, you just need to send a request via email, where is

* Email to – <welcome.urgantshow@gmail.com>
* Subject – a date when you plan to go, e.g. April 16 (or you can even write it in Russian `Апрель 16`)
* Body – Your full name, passport number and how old are you, in addition, you will need to attach your photo and QR code (if there are still limitations because of the corona)

So, if you want to visit the show with your friends, you can write all names within the same email.

For more details go to the [description](https://vk.com/topic-37008294_35774519)

## Links

* [Вечерний Ургант](https://www.1tv.ru/shows/vecherniy-urgant) – передача


# United Kingdom

## Links

* [UK Places to visit](https://goo.gl/maps/HcZKxnYFY5bQF5QL6)
* [UK Cafes](https://goo.gl/maps/PNg2MbECrhACVqrA7)


# Writing

## Links

* [Write Like You Talk](http://www.paulgraham.com/talk.html)
* \[<https://www.quora.com/What-is-the-best-way-to-take-notes/answer/S%C3%B6nke-Ahrens?ch=10\\&share=e1efd8f9\\&srid=uJBsW]\\(An> answer how to use method Zettelkasten to take notes and uset them later)


# Markdown

* [How-to use Markdown tables](/writing/markdown/tables)

## Links

* [How to build graph of local markdown links](https://github.com/tchayen/markdown-links)


# Markdown Tables

## How to align Markdown tables

After the header row, you can one more row with triple-dash.

triple-dash – align-left

```md
---
```

adding a colon after triple-dash – right-align

```md
---:
```

adding a color before and after triple-dash – center-align

```md
:---:
```

```md
| Header 1    | Header 2      | Header 3    |
| ---         | :---:         |   ---:      |
| Left-align  |  Center-align | Right-align |
```

| Header 1   |   Header 2   |    Header 3 |
| ---------- | :----------: | ----------: |
| Left-align | Center-align | Right-align |

## Links

* [Table-cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#tables)


# Programming languages


# Java

## Learning

### Akka

* [Reactive Architecture(1): Introduction to Reactive Systems](https://academy.lightbend.com/courses/course-v1:lightbend+LRA-IntroToReactive+v1/about)
* [Lightbend Akka for Java - Professional](https://academy.lightbend.com/courses/course-v1:lightbend+LAJ-P+v1/about)
* [Lightbend Akka Cluster - Sharding (Java)](https://academy.lightbend.com/courses/course-v1:lightbend+LAC-Sharding-Java-Classic+v1/about)
* [Lightbend Akka Streams for Java - Professional](https://academy.lightbend.com/courses/course-v1:lightbend+LTJ-P+v1/about)

## Links

* [Regular expressions in Java - Tutorial](https://www.vogella.com/tutorials/JavaRegularExpressions/article.html)
* [Akka – toolkit to write reactive, concurrent, and distributed application on the JVM](https://akka.io/)
* [Lightebend – a company to help with solutions based on Akka but also they have Akka courses and certifications](https://www.lightbend.com/)
* [Guice - Dependency Injection framework, supports JSR-330](https://github.com/google/guice)
* [Vaadin - web application platform for Java](https://vaadin.com/)
* [Apache PDFBox – open source Java tool for working with PDF documents](https://pdfbox.apache.org/)
* [Easytable - a library build on Apache PDFBox to build tables](https://github.com/vandeseer/easytable)
* [pdfbox-layout – a library to work with text, paragraphs, pagination, etc](https://github.com/ralfstuckert/pdfbox-layout)
* [How to Use Github Packages for Deploying Jars](https://betterprogramming.pub/how-to-use-github-packages-for-deploying-jars-b6e9fdb5e23c)
* [Detect or Remove Lines From Image Using OpenCV With Spring Boot](https://heinhtetzawycc.medium.com/detect-or-remove-lines-from-image-using-opencv-with-spring-boot-ca076c4ad128)
* [Article by Jakob Jenkov: Java Concurrency and Multithreading Tutorial](https://jenkov.com/tutorials/java-concurrency/index.html) - great overview of concurrency in Java. It has a lot of useful sub links to understand the topic in more details.
* [Article by Lars Vogel: Java concurrency (multi-threading)](https://www.vogella.com/tutorials/JavaConcurrency/article.html)
* [Article by Baelding: Java equals() and hashCode() Contracts](https://www.baeldung.com/java-equals-hashcode-contracts)
* [Video: JIT Compilation with Graal: Java source to Assembly by Swapnil Gaikwad](https://youtu.be/qNJbLyCGtuA)
* [Video: Java Observability with OpenTelemetry By Andrzej Kubik](https://youtu.be/vrVL0Ws2eV4?si=NvyAYYo-Dr-erPyu) - great overview of specification and existing solutions for observability in Java


# Java | OCR

## Setup

```bash
brew install tesseract
```

for support of other languages

```bash
brew install tesseract-lang
```

## Using custom tessdata

Download [trained tessdata](https://github.com/tesseract-ocr/tessdata) for several languages and put them under folder, it could be located under resource folder or any other path outside of the application If folder is located under resource folder, use the next code

```java
var tesseract = new Tesseract();
var tessdata = LoadLibs.extractTessResources("tessdata");
tesseract.setDatapath(tessdata.getAbsolutePath());
```

or if you know the absolute path, just write it in the `setDataPath`

```java
var tesseract = new Tesseract();
tesseract.setDataPath("/opt/ocr/tessdata");
```

Under the folder you will have files with the next names:

* deu.traineddata
* eng.traineddata
* osd.traineddata

the first part of the name is important, we will use for setting languages

## Set language

The image that you will OCRing could contain one or multiple languages, in that case you will need to define which language is expected, by default `eng` is enabled

```java
var tesseract = new Tesseract();
tesseract.setDataPath("/opt/ocr/tessdata");
// It means we expect that Deutschland or English languages will appear in the image
tesseract.setLanguage("deu+eng");
```

## Get OCR result

The library `tess4j` supports multiple options to work with input content, it could be `File` or `BufferedImage` or `ByteBuffer`, also you could define do you want to extract the text from the whole file, or a concrete Bounding Box

```java
var tesseract = new Tesseract();
tesseract.setDataPath("/opt/ocr/tessdata");
tesseract.setLanguage("deu+eng");
var inputImage = new File("/opt/exmaples/images/multi-language.png")
String fullPageResult = tesseract.doOcr(inputImage);
String rectangleResult = tesseract.doOcr(inputImage, new Rectangle(100, 100, 100, 100));
```

## Troubleshooting

### Unable to load library 'tesseract'

This one was resolved by providing the path to jna libraries system property

```java
String libPath = "/usr/local/lib";
File libTess = new File(libPath, "libtesseract.dylib");
if (libTess.exists()) {
  String jnaLibPath = System.getProperty("jna.library.path");
  if (jnaLibPath == null) {
    System.setProperty("jna.library.path", libPath);
  } else {
    System.setProperty("jna.library.path", libPath + File.pathSeparator + jnaLibPath);
  }
} else {
  throw new RuntimeException(String.format("OCR: validate: Tesseract library not in /usr/local/lib"));
}
```

## Links

* [Baeldung article](https://www.baeldung.com/java-ocr-tesseract)
* [Tesseract User Manual](https://tesseract-ocr.github.io/tessdoc/Home.html)
* [Best tessdata](https://github.com/tesseract-ocr/tessdata_best)
* [Fast tessdata](https://github.com/tesseract-ocr/tessdata_fast)
* [Combined (Best + Fast) tessdata](https://github.com/tesseract-ocr/tessdata)
* [Hint to resolve the issue with not loaded libraries](https://github.com/RaiMan/SikuliX1/commit/49f1bf3e5330365c97085b9533050bd538119c62)
* [How to provide more than one language to the tesseract](https://stackoverflow.com/questions/24379781/how-can-i-run-tesseract-with-multiple-languages-one-time)
* [How to OCR with Tesseract, OpenCV and Python](https://nanonets.com/blog/ocr-with-tesseract/)
* [Tesseract Page Segmentation Modes (PSMs) Explained: How to Improve Your OCR Accuracy](https://pyimagesearch.com/2021/11/15/tesseract-page-segmentation-modes-psms-explained-how-to-improve-your-ocr-accuracy/)
* [All OCR options](https://muthu.co/all-tesseract-ocr-options/)


# Java | Spring

## Links

* [Article: Spring-Modulith by Baeldung](https://www.baeldung.com/spring-modulith) - it is a good way how to limit yourself with writing coupled code


# JAVA | How to install multiple Java versions on macOS

## Preconditions

* you're running on macOS
* [brew](https://brew.sh/) is installed

## Step 1: Instal JDK(s)

Search for available JDKs

```shell
brew search --formulae openjdk.java
```

install a required version, e.g.

```shell
brew install openjdk@8
brew install openjdk@11
```

## Step 2: Make JDK searchable

For the system, Java wrappers to find this JDK, symlink it with. Instead of `openjdk@8` use your version.

```shell
sudo ln -sfn /usr/local/opt/openjdk@8/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-8.jdk
```

## Step 3: Add Java paths to environment variables

Add to the end of your file which is used to be running by default when the shell session is started. E.g. to the `~/.bashrc` or `~/.zshrc`

```shell
# Defining Java home
export JAVA_8_HOME=$(/usr/libexec/java_home -v1.8)
export JAVA_11_HOME=$(/usr/libexec/java_home -v11)
export JAVA_17_HOME=$(/usr/libexec/java_home -v17)

alias java8='export JAVA_HOME=$JAVA_8_HOME'
alias java11='export JAVA_HOME=$JAVA_11_HOME'
alias java17='export JAVA_HOME=$JAVA_17_HOME'

#default java17
export JAVA_HOME=$JAVA_17_HOME
```

## Step 4: Conclusion and example of usage

Now by default, you will have Java 17 available

```shell
java --version
openjdk 17.0.8 2023-07-18
OpenJDK Runtime Environment Homebrew (build 17.0.8+0)
OpenJDK 64-Bit Server VM Homebrew (build 17.0.8+0, mixed mode, sharing)
```

and to switch to other versions, you can simply call `java8` or `java11`

```shell
java11
java --version
openjdk 11.0.20 2023-07-18
OpenJDK Runtime Environment Homebrew (build 11.0.20+0)
OpenJDK 64-Bit Server VM Homebrew (build 11.0.20+0, mixed mode)
```

## Links

* [Stackoverflow: Mac OS X and multiple Java versions](https://stackoverflow.com/questions/26252591/mac-os-x-and-multiple-java-versions)
* [Medium: Installing & switching between multiple JDK on macOS](https://medium.com/@manvendrapsingh/installing-many-jdk-versions-on-macos-dfc177bc8c2b)


# Go

## Links

* [Github repository: Awesome-Go](https://github.com/avelino/awesome-go)
* [Cobra is a library for creating powerful modern CLI applications](https://github.com/spf13/cobra)
* [A progressbar library for command line tools](https://github.com/schollz/progressbar)
* [A library to make output colorized](https://github.com/fatih/color)


# Kotlin

## Kotlin Frameworks

* [Koin](https://insert-koin.io/docs/reference/introduction) – a dependency injection framework for Kotlin developers

## Kotlin Libraries

* [Exposed](https://github.com/JetBrains/Exposed/wiki/Getting-Started) – a JetBrains SQL library on top of JDBC driver for Kotlin language

## Links

* [Tutorial: Simple Kotlin REST API with Ktor, Exposed and Kodein](https://bettercoding.dev/kotlin/ktor-rest-api-exposed/)


# Python

## Links

* [Deep dive: Create and publish your first Python library](https://towardsdatascience.com/deep-dive-create-and-publish-your-first-python-library-f7f618719e14)
* [Article by Jajula Ramesh: Install or Download Python Package Using Nexus repositories](https://rameshjajula.medium.com/install-or-download-python-package-using-nexus-repositories-e24d2f4e904d)


# Optimization

## Links

* [How to convert a HEIF/HEIC image to JPEG in macOS?](https://apple.stackexchange.com/questions/297134/how-to-convert-a-heif-heic-image-to-jpeg-in-macos)
* [How to block website on your computer](https://www.wikihow.com/Block-a-Website-on-Your-Computer)


# Email


# Zero inbox

## Purpose

To understand better, what are the current emails you need to work on.

## Pipeline

When you can see new e-mails in your box, you can define what it is a category

* Category 1: important and need to answer
* Category 2: important and need to keep \[bills, copy of books, promo code, etc]
* Category 3: not important and need to answer in some time
* Category 4: not important and do not need to answer

Depending on each category you will need to do the next concrete action

* For Category 1: if the answer will take less than 2 minutes, just answer and if you do not need to await a response, archive the mail. If the answer will take a significant amount of time, then you need to keep it unread and add a task to your to-do list to answer ASAP.
* For Category 2: for emails that are needed for history, you need to move them in separate folders/categories with meaningful names. Use filters to move them automatically.
* For Category 3: if you can delegate this mail, just do it. Otherwise, you need to create one more task in your to-do list but probably with a lower priority than for Category 1.
* For Category 4: archive it immediately and if you have such emails on regular basis, create a filter to archive them automatically

## Links

* [How to do zero-inbox + interviews](https://blog.doist.com/inbox-zero/)


# Finance


# Investment

## Steps to do

1. Prepare emergency fund for 3-6 months
2. Pay off debt
3. Invest in retirement \[e.g. 401k]
4. Find [online broker](/finance/investment/online-brokers)
5. Invest regularly

## Index funds

* S\&P 500
* Vanguard

## Links

* [How to Start Investing for Beginners | Tips For Your 20’s](https://youtu.be/u4Adtp04JxI)
* [Fear & Greed Index](https://edition.cnn.com/markets/fear-and-greed)
* [Buffett Indicator: Where Are We with Market Valuations?](https://www.gurufocus.com/stock-market-valuations.php)
* [Shiller PE Ratio](https://www.multpl.com/shiller-pe)
* [A guide to investing in ETFs while living in Germany](https://indexfundinvestor.eu/a-guide-to-investing-in-etfs-while-living-in-germany/)


# Online brokers

|                                                 | Trade Republic          | Scalable Capital     | capital.com          |
| ----------------------------------------------- | ----------------------- | -------------------- | -------------------- |
| English Website or App                          | Yes                     | Yes                  | Yes                  |
| Cost per saving plan                            | Free                    | 1 free each extra €1 | Free (need to check) |
| Cost per order (mostly for trading)             | €1                      | $0.99 or flat rate   | Free (need to check) |
| Allowed for non-permanent resistance in Germany | No (To check)           | Yes                  |                      |
| Deposit fees                                    | €0                      | €0                   | Free (need to check) |
| Withdrawal fees                                 | €0                      | €0                   | Free (need to check) |
| Payment options                                 | Cards, Apple/Google Pay | Only bank transfer   | Bank transfer, cards |
| Minimum deposit                                 | €0                      | €1                   | €20                  |

## Links

* [Best Online Broker In Germany (2022 English Guide)](https://www.simplegermany.com/best-online-broker-germany/)
* [Best Online Broker Germany – 5 platforms comparison](https://www.mylifeingermany.com/best-online-broker-germany/)


# People

## Links

* [Personality type](https://www.myersbriggs.org/my-mbti-personality-type/mbti-basics/)


# Security

## Links

* \[<https://ocw.mit.edu/courses/6-858-computer-systems-security-fall-2014/video\\_galleries/video-lectures/]\\(MIT> course about computer systems security)


# SaaS Security

## Potential Risks and Threats

* Access risk
  * SaaS apps are always on that is why anyone can reach them on internet
  * Credential stuffing & password spraying are common attacks
* Misconfiguration risk
  * Too many administrators
  * Lack of visibility into SaaS security settings and changes
* Shadow SaaS
  * deployed application in the same cloud account as the main SaaS application
  * the deployed service was done without the security approval

## Evaluation of SaaS Security (SANDPIT)

* **S** - Scalability and Resiliency
  * Provider's ability to scale and recover from failure
* **A** - Access Control
  * Who has access to the app?
  * Authentication and Authorization
* **N** - Network and Boundary Controls
  * North-South traffic
    * ingress and egress controls
    * control traffic in and out of the network
  * East-West traffic
    * segmentation
    * Understanding how data isolated or commingled
* **D** - Data Protection
  * Encryption
  * Managed certificates and keys
  * Use unique keys for each instance
* **P** - Privacy
  * The infrastructure should be compliant with any laws are important for your business
* **I** - Incident Response
  * When something is happened, the monitoring tools should be able to detect it and show to customers when and what happened
* **T** - Third-Party Attestation
  * Annual assessment and report of cloud service provider
  * Conducted by an external auditor (e.g. SOC2)

## Links

* [LinkedIn Learning - Securing SaaS](https://www.linkedin.com/learning-login/share?forceAccount=false\&redirect=https%3A%2F%2Fwww.linkedin.com%2Flearning%2Fsecuring-software-as-a-service-saas%3Ftrk%3Dshare_ent_url%26shareId%3D8fj613EJQMmPlYGFLCd%252B9A%253D%253D)


# Unix


# Shell


# ZSH

## Links

* [iTerm2](https://iterm2.com/) - good replacement for build-in terminal of MacOS. It has opensource plugins which is easy to install
* [Oh My ZSH!](https://ohmyz.sh/) - managing zsh configurations, it has tons of community-driven plugins
* [fzf](https://github.com/junegunn/fzf) - command-line fuzzy finder


# Work

## Links

* [Book by Kim Scott: Radical Candor](https://amzn.to/3INQCsY)
* [Radical Candor – Summary and Insights](https://wilselby.com/2020/07/radical-candor-summary-and-insights/)


# Feedback

## SBI framework (Situation -> Behaviour -> Impact)

By using the SBI framework, the person giving feedback can provide specific and constructive feedback that helps the person receiving the feedback understand the impact of their behaviour and how they can improve it in the future. It is processing in 3 steps:

* the situation you saw
* the behavior (what the person did)
* the impact you observed


