- create minio user: useradd -s /sbin/nologin -d /opt/minio minio
- create /opt/minio folder
- download minio from the https://min.io/download#/linux : wget https://dl.minio.io/server/minio/release/linux-amd64/minio
- check auto_install.sh steps
This file contains hidden or 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
# Remove sparce space from qcow image | |
# https://serverfault.com/questions/432119/is-there-any-way-to-shrink-qcow2-image-without-converting-it-raw | |
qemu-img convert -O qcow2 source.qcow2 shrunk.qcow2 | |
# show progress bar for tar | |
# https://superuser.com/questions/168749/is-there-a-way-to-see-any-tar-progress-per-file | |
# note: it requires "pv" package to be installed | |
_folder=./folder |
This file contains hidden or 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
nets/kvm.conf | |
------------- | |
LANID="150" | |
LANGROUP="239.1.1.1" | |
LANDEV="eth0" | |
LINKIP="10.235.0.1/24" | |
LAN_MTU=1550 | |
# in case if dynamic VxLAN groups work unstable, use direct remotes assigment | |
#REMOTES="" |
This file contains hidden or 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
#!/bin/bash | |
# Put the file to: /etc/profile.d/ | |
port-forward(){ | |
local port=\$1 | |
local to_ip=\$2 | |
if [ -z \${port} ] || [ -z \${to_ip} ]; then | |
echo "Usage: port-forward [port] [destination ip]" | |
return |
This file contains hidden or 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
!!!!!!!!!!!!!!! | |
!!!! WARNING -> Ubuntu 20.10 require WSL2 kernel 5.7+, to build one please follow instructions in build-wsl-kernel.sh | |
!!!!!!!!!!!!!!! | |
Step 1. Install/Upgrade WSL2 to Ubuntu 20.10 + | |
source /etc/os-release | |
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" | |
wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_${VERSION_ID}/Release.key -O- | sudo apt-key add - | |
apt install podman | |
Step 2. Install Podman |
This file contains hidden or 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
[alias] | |
find = log --pretty=\"format:%Cgreen%H %Cblue%s\" --name-status --grep |
This file contains hidden or 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
#!/bin/bash | |
#require lxcfs | |
podman run --rm -it --memory=100M \ | |
-v /var/lib/lxcfs/proc/cpuinfo:/proc/cpuinfo:rw \ | |
-v /var/lib/lxcfs/proc/diskstats:/proc/diskstats:rw \ | |
-v /var/lib/lxcfs/proc/meminfo:/proc/meminfo:rw \ | |
-v /var/lib/lxcfs/proc/stat:/proc/stat:rw \ |
This file contains hidden or 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
Guide requires | |
=============== | |
- iptables | |
- ipset | |
- sshguard with ipset backend | |
Steps: | |
- put/modify service files below in the directory /etc/systemd/system | |
- adjust sshguard.conf file with settings mentined below | |
- adjust iptables settings by adding the following lines at the BEGGINIG of INPUT filter |
This file contains hidden or 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
#!/us/sbin/env python3 | |
def read_single_keypress(): | |
"""Waits for a single keypress on stdin. | |
This is a silly function to call if you need to do it a lot because it has | |
to store stdin's current setup, setup stdin for reading single keystrokes | |
then read the single keystroke then revert stdin back after reading the | |
keystroke. |
This file contains hidden or 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
def terminal_width(): | |
""" | |
refactor/reassebly of https://gist.github.com/jtriley/1108174 | |
""" | |
import platform | |
import struct | |
import os | |
current_os = platform.system() | |
if current_os == 'Windows': |