2022-07-09

IT basic course základní kurz


Základní kurzy IT

Fakt základ, ukázky, nic pro profíky!


Keywords:

IT basic course 

IT základní kurz


Content:

Odkazy, poznámky, příklady základních úvodů do IT, programování, správy systémů atd.

Občas se mě lidi ptají, jak se naučit něco z IT, tak shromažďuji pár základních poznámek, klíčových slov a odkazů.


Články:

Základy programování v JavaScriptu (můj příklad v JavaScriptu)

Úvody do SQL (česky a s příkladama)


Algoritmy:

Fibonacci heap - Fibonacci heap CZ


2022-02-02

Spring Hibernate Microservices cheat sheet

Spring Hibernate Microservices 

Unsorted notes

Cheat sheet



REST:

REST tut

- Spring HATEOAS - no links, no REST

- Simple HATEOAS

Query Parameter vs URI Path - RequestParam vs PathVariable

- Optional values

RequestParam

- Map all params

NotFoundAdvice

- exception translation



DB:

mappedBy - reason, value

 - mappedBy example

without mapped - it will use a relation table

EntityManager

- Transactional

JDBCTemplate

- named param queriess

- exceptions

- dataSource

- exception translation



MQ

RabbitMQ

amqp



Configuration

- define configuration


Etc

- ThreadPoolTaskExecutor = async exec

- Autowired Qualifier

- paid - overview Getting Started With Spring 5

- testing - Mockito how to do in java - Mockito baeldung crossroads - Mockito baeldung

- Good guides - crossroads

2021-09-27

Git unplugged notes

Git unplugged notes



Rebase issue

# If someone rebases on public branch, after pull all others could see:

Your branch and 'origin/branch1' have diverged,

and have 2 and 3 different commits each, respectively.

Solution

git fetch origin

git reset --hard origin/main

src stackoverflow



Rebase issue

Your branch is ahead of 'origin/master' by 3 commits

Solution

git fetch -p # clean up local branches

git pull --rebase # pull and rebase my local commits on top of incoming

Better solution (unchecked)

Step 1 : git checkout branch1

Step 2 : git pull -s recursive -X theirs # merge strategies

Step 3 : git reset --hard origin/branch1



Rebase issue explained (long)

git rev-list --count --left-right branch1...upstream

git rev-list --count --left-right origin/master...HEAD

*

# to see if the local repository is ahead, push needed:

git rev-list origin..HEAD

# to see if the local repository is behind, pull needed:

git rev-list HEAD..origin

# if you have numbers for both, then the two repositories have diverged:

git rev-list --count --left-right origin/master...HEAD

src: stackoverflow

src: https://stackoverflow.com/a/40990959

src-long: https://stackoverflow.com/a/66981730



# squash - reset soft:

#git reset --soft master

git reset --soft origin/master

git add -A

git commit

git push --force



# squash - reset to merge-base:

git checkout branch1

git reset $(git merge-base master $(git branch --show-current))

git add -A

git commit

git push --force

# src: https://stackoverflow.com/questions/25356810/git-how-to-squash-all-commits-on-branch

# Note: git merge-base branch2 branch3



Squash

# squash - merge squash:

git checkout origin/master

git merge --squash origin/branch1

git commit

git push --force



Git branch_name vs refs

git show-ref origin/main

1. If $GIT_DIR/<refname> exists, that is what you mean (this is usually useful only for HEAD, FETCH_HEAD, ORIG_HEAD, MERGE_HEAD and CHERRY_PICK_HEAD);

2. refs/<refname> if it exists;

3. refs/tags/<refname> if it exists;

4. refs/heads/<refname> if it exists;

5.  refs/remotes/<refname> if it exists;

6. refs/remotes/<refname>/HEAD if it exists.

src: stackoverflow.com

Long aside: how this all works (read only if sufficiently curious) :

src: stackoverflow.com



Git server repository (docker git repo)

RockStorm Git server on DockerHub - GitHub

Alpine Git client

JKarlos Docker Git server

Gogs and Podman Git server

Gogs Git server

Gogs by Pirates - GitHub like Git server

Gitea in Docker - demo - github

GitColony docker server - obsolete



Git server:

Google it:

https://www.google.com/search?q=gnu+gpl+git+server

Git server list - wiki:

https://en.wikipedia.org/wiki/Git#Git_server

Gerrit:

Home: https://www.gerritcodereview.com/

Wiki: https://en.wikipedia.org/wiki/Gerrit_(software)

GitOlite:

https://gitolite.com/gitolite/index.html

Wiki says: External projects like gitolite, which provide scripts on top of git software to provide fine-grained access control.

*

FLOSS:

Gogs

Gitea = fork of Gogs



Git Web interface self-hosted:

https://www.google.com/search?q=git+web+interface+self-hosted

Options – list – good overview:

https://www.cyberciti.biz/open-source/github-alternatives-open-source-seflt-hosted/

GitLab = web git, “Confluence” wiki, “Jira” tracker

https://gitlab.com/gitlab-org/gitlab-foss

Gitea – community fork of Gogs:

https://gitea.io/

Savannah = GNU = free software foundation (FSF)

http://savannah.gnu.org/projects/administration

GitBucket – Open source

https://github.com/gitbucket/gitbucket

Gogs - self hosted Git:

https://gogs.io/

*

Awesome Selfhosted:

https://github.com/awesome-selfhosted/awesome-selfhosted

GitWeb:

https://git-scm.com/book/en/v2/Git-on-the-Server-GitWeb

*

BitBucket.org

GitHub.com


Git web UI – including proprietary and closed-source:

https://www.slant.co/topics/1440/~best-self-hosted-web-based-git-repository-managers

https://www.slant.co/topics/425/~best-git-web-interfaces



Static web hosting on GitHub using Jekyll

(other Jekyll hostings, free-included)

GitHub is ready to host your static web site using Jekyll

Read  GitHub Pages intro.

Create public GitHub repo in format:

username.github.io

Exec:

git clone https://github.com/username/username.github.io

cd username.github.io

echo "Hello World" > index.html

git add --all

git commit -m "Initial commit"

git push -u origin main

Go to: https://username.github.io

*

Custom Domain and Domain Verification:

(sign in to your domain administration, i.e. ForPsi Domain Admin)

Verify ownership of example.com (on GitHub called apex domain):
Click your avatar on right-top corner
Settings
Pages
Verified domains
Click "Add a domain"

Then at GitHub pages level, following "domains" are yours:

www.example.com (custom sub domain)
blog.example.com
web.example.com
*.example.com
is only yours.

Warning: anything.web.example.com can be still used on GitHub Pages by any other user.

*

Configure Apex Domain

Steps:
Open GitHub
Go to your repo
Settings
Code and automation
Pages
Custom domain
type example.com (new CNAME file is created)
click Save (verification in progress)
-

Domain config:

Go to your domain administration, i.e. ForPsi Domain Admin
Create DNS records - either ALIAS, ANAME, or A (opt. AAAA for IPv6)
Test
dig example.com +noall +answer -t A
dig example.com +noall +answer -t AAAA

*

Configure SubDomain

*

GitHub Pages usage rules

See also:

Google search for Jekyll Hyde Web

Jekyll home


2021-08-12

Lodě Sázava 2021 (FAV)


KDY / WHEN:

Neděle / Sunday

15. 8. 2021

9:00 – 18:00



TRASA / ROUTE:

Sázava

Sázava - mapy

*

VLAK / TRAIN:

from destination to start for car drivers

Kácov (dest) - Zruč n. S (start)

Kácov (dest) - Zruč n. S (start) - Friday 22

TRAIN WALK:

Zruc NS from Train to start Camp Rakosi

*

START:

Výdej lodí / issuing canoes: 9.00–10.00

Zruč nad Sázavou

Kemp Rákosí

Start - Google maps point

bisport premise ZrucNS

*

PŘESKOČIT / AVOID (pomalí / slow service):

Tůmův Chabeřický mlýn

*

ODBOČKA / FORK (suggested):

Želivka fork, short break, refreshment, crystal clear cold water

*

BREAK (doporučený / suggested):

Kemp Omaha - gallery

nice weir

good kiosk - sausages, local beer, pancakes, coffee

it was perfect on last summer, I hope they keep the quality

*

CÍL / END:

Kácov

Kácov rental - Google maps point

Sběr lodí / return canoes: 15.00–19.00

bisport premise Kacov



KDO / WHO:

2 MarS single

2 MaD + Smita

3 Petr + Tamara + Ráša

2 Jiří + tatínek



PÚJČOVNA / RENTAL:

Bisport Kácov s.r.o., Kácov 158

https://www.bisport.cz/pujcovna-lodi

Mail: info@bisport.cz

Tel: + 420 777 335 618



PLATBA / PAYMENT:

Č.Ú. / Account: ***

Zpráva / Message: Your Name, Sazava 2021

*

ČÁSTKA / AMOUNT:

MarS: 399 CZK

MaD: 399 CZK

Jiri 2-seats: 399 CZK

Petr 3-seats: 555 CZK

*

PÚV CENA / ORIG PRICE:

Vydra 2 seats: 420 CZK / 1 canoe

Rivera 3 seats: 585 CZK / 1 canoe

sleva / discount: 5%



PÚJČOVNA / RENTAL – others:

Dronte (na Sázavě outsourcuje přes BiSport)

Samba (Ohře Ondra K a Anička letos, asi i loni a dříve)

Půjčovna Samba – stejná



KEYWORDS:

Canoe kanoe kánoe Sázava Sazava 2021 FAV



2021-07-11

Docker networking


Create bridge

docker network create -d bridge mars_bridge


Run container inside specific network (i.e. Redis and Redis CLI)

docker run --name some-redis --network mars_bridge --rm -d redis

docker run -it --network mars_bridge --rm redis redis-cli -h some-redis


Connect container to network

docker network connect mars_bridge some-redis


Disconnect container from network

docker network disconnect mars_bridge some-redis


List Docker networks

docker network ls


Remove Docker network

docker network rm mars_bridge


Remove all unused networks

docker network prune


Inspect Docker network

docker network inspect mars_bridge


Inspect with formatted output

docker inspect --format='{{json .NetworkSettings.Networks}}'  some-redis

docker inspect --format="{{json .NetworkSettings.Networks}}" some-redis

docker inspect --format="{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" some-redis


Sources

Docker - networking containers

Docker Hub - Redis (as an example of Docker-networked container)


Docker notes unplugged

 My Docker notes - crossroads



Docker orchestration with Kubernetes k8s

My Docker Kubernetes k8s notes



Docker memory CPU limits (Windows)

My Docker limits - cpu memory notes



Docker network configuration

My Docker networking notes

src: docs.docker.com



Docker Swarm stack deploy

My Docker Swarm stack deployment notes

src: docs.docker.com



See also

My AWS - Amazon Web Services - notes

DockerCon 2021 - conference

PlayWithDocker - play, 101tut, lab, get started, training


2021-07-06

AWS - Amazon Web Services - notes

AWS - Amazon Web Services - notes

My unsorted notes about AWS


AWS general xroad

Home

Console

* console FFT Frankfurt

CLI

Sign in

Trainings all

Trainings and Certifications blog post

aws.training site


10 miutes tutorials crossroad

10 min tut xroad

WordPress, ServerLess, React, Linux VM, MySQL, Static S3, PostgreSQL


Popular AWS - services crossroads

Free Tier, Elastic Beanstalk, DynamoDB, RDS (Relational Database Service), CloudFront, Glacier


LightSail

 - servers and services management console

 -  easily setup your service

LightSail tutorials home

LightSail home page


EC2

- Elastic Compute Cloud

EC2 pricing

EC2 get started - LAMP, Elastic, WordPress, etc

* WordPress 10 min tut


S3

- Simple Storage Service

S3 home

S3 get started



Lambda

 - serverless computing

Lambda home

Lambda - get started - crossroad

Lambda - resources

Lambda - build basic web app

* Lambda - ServerLess web app tutorial

* ServerLess with Lambda, API GateWay, Amplify, DynamoDB, Cognito