Skip to content

Instantly share code, notes, and snippets.

View barser's full-sized avatar
☺️

Sergey Baranov barser

☺️
View GitHub Profile
@barser
barser / start_docker_registry.bash
Created July 8, 2017 13:42 — forked from PieterScheffers/start_docker_registry.bash
Start docker registry with letsencrypt certificates (Linux Ubuntu)
#!/usr/bin/env bash
# install docker
# https://docs.docker.com/engine/installation/linux/ubuntulinux/
# install docker-compose
# https://docs.docker.com/compose/install/
# install letsencrypt
# https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04
set langmap=ёйцукенгшщзхъфывапролджэячсмитьбюЁЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ;`qwertyuiop[]asdfghjkl\\;'zxcvbnm\\,.~QWERTYUIOP{}ASDFGHJKL:\\"ZXCVBNM<>
nmap Ж :
" yank
nmap Н Y
nmap з p
nmap ф a
nmap щ o
nmap г u
nmap З P
@barser
barser / cloudera-docker.md
Created January 30, 2021 12:55 — forked from davideicardi/cloudera-docker.md
Running Cloudera with Docker for development/test
@barser
barser / 00-OozieWorkflowShellAction
Created March 3, 2021 13:46 — forked from airawat/00-OozieWorkflowShellAction
Oozie workflow with a shell action - with CaptureOutput Counts lines in a glob provided and writes the same to standard output. A subsequent email action emails the output of the shell action
This gist includes components of a oozie workflow - scripts/code, sample data
and commands; Oozie actions covered: shell action, email action
Action 1: The shell action executes a shell script that does a line count for files in a
glob provided, and writes the line count to standard output
Action 2: The email action emails the output of action 1
Pictorial overview of job:
--------------------------
@barser
barser / docker-swarm-ports.md
Created January 16, 2022 10:43 — forked from BretFisher/docker-swarm-ports.md
Docker Swarm Port Requirements, both Swarm Mode 1.12+ and Swarm Classic, plus AWS Security Group Style Tables

Docker Swarm Mode Ports

Starting with 1.12 in July 2016, Docker Swarm Mode is a built-in solution with built-in key/value store. Easier to get started, and fewer ports to configure.

Inbound Traffic for Swarm Management

  • TCP port 2377 for cluster management & raft sync communications
  • TCP and UDP port 7946 for "control plane" gossip discovery communication between all nodes
  • UDP port 4789 for "data plane" VXLAN overlay network traffic
  • IP Protocol 50 (ESP) if you plan on using overlay network with the encryption option

AWS Security Group Example

@barser
barser / add_CA_on_linux.md
Created January 16, 2022 19:40 — forked from hamburghammer/add_CA_on_linux.md
Add CA cert to local trust store on CentOS, Manjaro, Debian or Ubuntu
  • Open a webpage that uses the CA with Firefox
  • Click the lock-icon in the addressbar -> show information -> show certificate
  • the certificate viewer will open
  • click details and choose the certificate of the certificate-chain, you want to import to CentOS
  • click "Export..." and save it as .crt file
  • Copy the .crt file to /etc/pki/ca-trust/source/anchors on your CentOS machine
  • run update-ca-trust extract
  • test it with wget https://example.com

On Manjaro (arch) the location for the certificates is: /usr/share/ca-certificates/trust-source/anchors (low priority) or /etc/ca-certificates/trust-source/anchors/ (high priority) and the command to update is update-ca-trust extract.

@barser
barser / README.md
Created January 16, 2022 22:57 — forked from 62mkv/README.md
How to add a custom trusted certificate for making HTTP requests against external sites

Thoughts on how to add trusted store for connection to external sites that use that certificate for HTTPS

Option 1: global configuration

One can just provide the -Djavax.net.ssl.trustStore=<path/to/store> -Djavax.net.ssl.trustStorePassword=<password> options when running the Java application

However, this is not always possible (for example, when run in the cloud).

And if you want to use server.ssl.trust-store/server.ssl.trust-store-password options from Spring Boot, be aware that with those you also have to provide key-store options as well. And, basically that would be an abuse, because this configuration is specifically for server side of your application.

@barser
barser / docker-api-port.md
Created May 11, 2022 21:03 — forked from styblope/docker-api-port.md
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
@barser
barser / microk8s
Created June 29, 2023 05:36 — forked from caglar10ur/microk8s
microk8s setup with istio
snap install microk8s --classic
sudo ufw default allow routed
sudo iptables -P FORWARD ACCEPT
microk8s.enable dns dashboard metrics-server
# grafana/dashboard
# http://IP:8080/api/v1/namespaces/kube-system/services/monitoring-grafana/proxy/
# http://IP:8080/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/pod?namespace=default
microk8s.enable istio
# after the virtual disk has already been expanded (e.g. in proxmox)
apk add --no-cache cfdisk e2fsprogs-extra
# choose partition then "Resize" > "Write" (to finalize)
cfdisk
# replace * with partition you are resizing
resize2fs /dev/*