This repository has been archived by the owner on Mar 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://[email protected]/zzzamyatin/langu…
…ages
- Loading branch information
Showing
24 changed files
with
420 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Create diagram | ||
|
||
on: | ||
workflow_dispatch: {} | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
get_data: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@master | ||
- name: Update diagram | ||
uses: githubocto/repo-visualizer@main | ||
with: | ||
excluded_paths: "ignore,.github" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Business Intelligence | ||
|
||
* Code-based BI https://evidence.dev/ | ||
|
||
## Open source BI | ||
Apache Superset | ||
Metabase | ||
Yandex DataLens |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
# Docker | ||
|
||
* https://docker-curriculum.com/ | ||
* https://docs.docker.com/get-started | ||
* https://github.com/veggiemonk/awesome-docker | ||
* course https://www.udemy.com/course/learn-docker/ | ||
* https://www.smarthomebeginner.com/best-docker-containers-for-home-server/ | ||
* https://www.smarthomebeginner.com/docker-media-server-2022/ | ||
|
||
## reverse proxy | ||
* caddy https://github.com/lucaslorentz/caddy-docker-proxy | ||
* traefik https://github.com/traefik/traefik | ||
* auth https://t.me/c/1675809627/2662 | ||
|
||
## orchestration | ||
Kubernetes: https://www.udemy.com/course/learn-kubernetes | ||
Portainer: https://github.com/portainer/portainer | ||
|
||
## automatic update | ||
* https://containrrr.dev/watchtower/ | ||
|
||
## dashboard | ||
https://github.com/pawelmalak/flame | ||
|
||
|
||
|
||
## Images | ||
$ docker search postgres | ||
$ docker pull postgres | ||
$ docker images | ||
|
||
## Volumes | ||
$ docker volume create postgres-data | ||
$ docker volume ls | ||
|
||
## Start a container | ||
$ docker run postgres # run an image and exit | ||
$ docker run postgres echo "Hello, world!" # run an image and the command in it and exit | ||
$ docker run -it postgres sh # run an image with the shell and attach to it | ||
|
||
$ docker run \ | ||
--name p1 \ | ||
-e POSTGRES_PASSWORD=lovesexgod # set environment variable \ | ||
-P # publish all opened ports random \ | ||
-p 5432:5432 # publish a specific port ext:int \ | ||
-v postgres-data:/var/lib/postgresql/data # mount a volume ext:int \ | ||
--net MYNETWORK # put in the specific network \ | ||
-d # detached mode \ | ||
-it # interactive terminal \ | ||
--rm # rm container after stop \ | ||
postgres # which image to run. If an image is not pulled, it will be pulled automatically | ||
|
||
$ docker stack deploy -c stack.yml postgres | ||
|
||
## Dockerfile | ||
Dockerfile is the list of instructions to build an image | ||
|
||
# define the parent image, to be inherited | ||
FROM python:3.8 | ||
MAINTAINER Name Surname <[email protected]> | ||
# mount a volume | ||
ADD flask-app /opt/flask-app | ||
WORKDIR /usr/src/app | ||
# copy all the files to the container | ||
COPY . . | ||
# install dependencies | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
EXPOSE 5000 | ||
CMD ["python", "./app.py"] | ||
|
||
$ docker build -t USERNAME/IMAGENAME IMAGEROOTDIR # Dockerfile must be in IMAGEROOTDIR | ||
|
||
## Distributing containers | ||
$ git clone https://github.com/prakhar1989/FoodTrucks | ||
$ cd FoodTrucks | ||
$ ./setup-docker.sh | ||
|
||
setup-docker.sh: | ||
|
||
#!/bin/bash | ||
|
||
# build the flask container | ||
docker build -t yourusername/foodtrucks-web . | ||
|
||
# create the network | ||
docker network create foodtrucks-net | ||
|
||
# start the ES container | ||
docker run -d --name es --net foodtrucks-net -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:6.3.2 | ||
|
||
# start the flask app container | ||
docker run -d --net foodtrucks-net -p 5000:5000 --name foodtrucks-web yourusername/foodtrucks-web | ||
Now imagine you are distributing your app to a friend, or running on a server that has docker installed. You can get a whole app running with just one command! | ||
|
||
|
||
|
||
|
||
|
||
## Docker Compose | ||
see [Docker Compose](docker-compose.md) | ||
|
||
## Work with containers | ||
$ docker ps # running containers only === $ docker container ls | ||
$ docker ps -a # all available containers | ||
$ docker port p1 # see exposed ports | ||
|
||
$ docker exec -it p1 psql -U postgres | ||
$ docker exec -it p1 psql -U postgres -c "create database scores" | ||
|
||
$ docker logs p1 | ||
|
||
## Networks | ||
see [docker-network](docker-network.md) | ||
|
||
## Cool examples | ||
$ docker run -it --rm alpine # start fast & simple linux to try | ||
$ docker run --rm alpine ping ya.ru # run command and exit | ||
|
||
|
||
|
||
## Clean up | ||
$ docker stop p1 | ||
$ docker rm p1 | ||
$ docker container prune # rm all stopped containers | ||
$ docker rmi postgres | ||
$ docker volume rm postgres-data | ||
$ docker network rm NETWORKNAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Docker Compose | ||
see [Docker](README.md) | ||
|
||
https://docs.docker.com/compose/overview | ||
https://docs.docker.com/compose/compose-file | ||
https://github.com/docker/awesome-compose | ||
|
||
## build images | ||
|
||
$ docker-compose build | ||
|
||
|
||
## run | ||
|
||
step by step: | ||
|
||
$ cd dir_with_docker-compose_yml | ||
$ docker compose up | ||
|
||
oneliner: | ||
|
||
$ docker compose | ||
[ -f docker-compose.yml ] # YAML file location if not in PWD | ||
-d # detached mode | ||
up | ||
|
||
## clean up | ||
$ docker compose down \ | ||
-v # for verbose output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# docker network | ||
see [Docker](README.md) | ||
|
||
https://docs.docker.com/engine/userguide/networking/dockernetworks/ | ||
|
||
Linux create docker network interface **docker0** | ||
macOS and in Win hides docker in a VM behind the NAT | ||
|
||
|
||
$ docker networks ls | ||
bridge | ||
host | ||
none | ||
macvlan | ||
ipvlan | ||
overlay # docker swarm | ||
|
||
|
||
## bridge | ||
* an internal network | ||
* by default | ||
* the default bridge has no dns | ||
* multiple *bridge* networks are possible | ||
* manually created bridge networks becomes dns support | ||
* :star: containers communicate within a bridge network | ||
* :warning: containers in different networks can't communicate | ||
|
||
|
||
$ docker network create [--drive bridge] MYNET | ||
$ docker network create --subnet 192.168.10.0/24 --gateway 192.168.0.1 myCustomNet192 | ||
$ docker run --rm -it --name container1 --net MYNET -d nicolaka/netshoot | ||
$ docker run --rm -it --name container2 --net MYNET nicolaka/netshoot /bin/bash | ||
container2# ping container1 | ||
|
||
$ docker network connect MYNET2 container2 # one container can be connected to multiple networks (eg. proxy) | ||
$ docker network disconnect container2 | ||
|
||
## host | ||
* fixed ip address | ||
* with communication between containers | ||
* only one *host* network is allowed | ||
|
||
$ docker network create --drive host MYNETWORK | ||
$ docker run nginx --network=host | ||
|
||
|
||
## none | ||
* no ip address | ||
* no communication between containers | ||
* only one *none* network is allowed | ||
|
||
$ docker run nginx --network=none | ||
|
||
## macvlan | ||
* own physical mac-address for each container | ||
|
||
## ipvlan | ||
* own physical ip-address for each container | ||
|
||
|
||
|
||
|
||
## clean up | ||
$ docker network rm NAME|ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Exasol operators | ||
https://docs.exasol.com/db/latest/sql_references/predicates/overview.htm | ||
https://docs.exasol.com/db/latest/sql_references/operators/overview.htm | ||
|
||
## Predicates precedence | ||
1. =, !=, <, <=, >, >= | ||
2. [NOT] BETWEEN, EXISTS, [NOT] IN, IS [NOT] NULL, [NOT] REGEXP_LIKE, [NOT] LIKE, IS [NOT] JSON | ||
3. NOT | ||
4. AND | ||
5. OR | ||
|
||
## Operators precedence | ||
1. +, -, PRIOR, CONNECT_BY_ROOT (unary) | ||
2. || | ||
3. *, / | ||
4. +, - (binary) | ||
|
||
## NULL in AND and OR | ||
-- symmetric behaviour | ||
-- https://docs.exasol.com/db/latest/sql_references/predicates/logicaljoinpredicates.htm | ||
|
||
|
||
select * from ( | ||
|
||
select null as "EXPRESSION", null as "RESULT" | ||
union select 'TRUE and NULL', TRUE and NULL -- = NULL | ||
union select 'FALSE and NULL', FALSE and NULL -- = FALSE | ||
union select 'NULL and TRUE', NULL and TRUE -- = NULL | ||
union select 'NULL and FALSE', NULL and FALSE -- = FALSE | ||
union select 'NULL and NULL', NULL and NULL -- = NULL | ||
union select 'TRUE or NULL', TRUE or NULL -- = TRUE | ||
union select 'FALSE or NULL', FALSE or NULL -- = NULL | ||
union select 'NULL or TRUE', NULL or TRUE -- = TRUE | ||
union select 'NULL or FALSE', NULL or FALSE -- = NULL | ||
union select 'NULL or NULL', NULL or NULL -- = NULL | ||
union select 'not NULL', not NULL -- = NULL | ||
|
||
) | ||
where EXPRESSION is not null | ||
order by 2,1 | ||
; | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.