/images/avatar.png

Import and export MongoDB collections

Tested on: Ubuntu 22.04 Prepare a mongo server instance: 1 2 3 docker run --rm --name mongo -d mongo:6 docker exec -it -w /root mongo bash apt update && apt -y install curl less jq We are in the container, so all command will run from root! Import MongoDB is one of the most popular NoSQL database engines. For our test we can take the most popularsample MongoDB database about restaurants:

How to use ssh and scp in Windows

| Windows Server 2019 Run Powershell as an administator and generate private and public keys 1 ssh-keygen -trsa -b2048 Check that files exists 1 ls $env:USERPROFILE\.ssh Add public key 1 type $env:USERPROFILE\.ssh\id_rsa.pub | ssh root@192.168.131.10 "cat >> .ssh/authorized_keys" Check connect without password 1 ssh root@192.168.131.10 Check that commands are runned 1 ssh root@192.168.131.10 "cat /etc/*release" Put the file into /tmp 1 scp "$env:USERPROFILE\.ssh\id_rsa.pub" "root@192.168.131.10:/tmp/" Put several files into /tmp 1 2 3 scp -r "C:\tmp" "root@192.

Run Windows bin as a service

Tested on: Windows Download zss-file nssm from http://nssm.cc/download, unpack it into C:\nssm Run C:\nssm\win64\nssm.exe and choose, any binary, for example traefik.exe Open these ports in windows firewall Powershell commands for widnows firewall 1 2 3 4 5 6 7 New-NetFirewallRule -Name 'tcp80' -DisplayName 'tcp80' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 80 New-NetFirewallRule -Name 'tcp443' -DisplayName 'tcp443' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 443 Get-NetFirewallRule -DisplayName tcp80 Get-NetFirewallRule -Name tcp80 Get-NetFirewallPortFilter | Where-Object -Property LocalPort -EQ 80 Remove-NetFirewallRule -Name tcp80

Traefik simple using

Tested on: CentOS 7.9 Ok, let’s start with linux. I’m using a bin file, so I want to check using traefik’s options in yaml files. Get a binary and run it: 1 2 3 4 5 6 7 8 curl -LO https://github.com/traefik/traefik/releases/download/v2.9.8/traefik_v2.9.8_linux_amd64.tar.gz tar -zxf traefik_v2.9.8_linux_amd64.tar.gz traefik ./traefik version Version: 2.9.8 Codename: banon Go version: go1.19.6 Built: 2023-02-15T15:23:25Z OS/Arch: linux/amd64 Traefik releases Disable selinux: 1 2 3 4 5 getenforce Enforcing sudo setenforce 0 grep SELINUX= /etc/sysconfig/selinux | grep -v "^#" SELINUX=disabled Install nginx and apache.

Minio: local start

Run for Windows: Minio wrote on golang, so we need only get binary file and run it, according official docs: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 .\minio.exe server C:\minio --console-address :9001 Formatting 1st pool, 1 set(s), 1 drives per set. WARNING: Host local has more than 0 drives of set. A host failure will result in data becoming unavailable.

Ingress on Minikube

Ingress on minikube First off, remove our minikube: 1 minikube delete --profile minikube And install minikube: 1 2 3 # https://minikube.sigs.k8s.io/docs/faq/#how-can-i-access-a-minikube-cluster-from-a-remote-network minikube start --nodes 3 --profile=minikube --driver=docker --listen-address=0.0.0.0 minikube addons enable metrics-server Get container id of minikube and check ports (--listen-address): 1 2 3 4 5 6 7 8 9 10 11 12 docker ps --filter name=minikube -q 9bafec0763c9 6bec57ee7992 6090eadfd27f docker port 9bafec0763c9 docker port 6bec57ee7992 docker port 6090eadfd27f 22/tcp -> 0.