Service | Implementation |
---|---|
K8s | K3s (lightweight, no need to use docker -> containerd by default) |
Ingress Controller (Reverse proxy) | Traefik Ingress Controller (preinstalled with k3s by default, could be disabled) |
Distributed File storage | Longhorn |
Canary deployment | stackset-controller |
Config editor / Web IDE | Code server |
Lets Encrypt Certificates | cert manager |
DNS propagation | external-dns |
K8s cli | k9s |
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: marzban | |
spec: | |
replicas: 1 | |
strategy: | |
type: Recreate | |
selector: | |
matchLabels: |
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
#!/bin/bash | |
VAULT_URL="http://localhost:8200/v1" | |
TOKEN="s.BfRUIKOyrWtVIJX0rBN1AiSW" | |
res=$(curl -s \ | |
--header "X-Vault-Token: $TOKEN" \ | |
--request LIST \ | |
$VAULT_URL/pki/certs) | |
keys=$(echo $res | jq -r '.data.keys[]') |
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
#FIND | |
apt-show-versions | grep newer | awk '{ print $1 }' | xargs -I {} apt-show-versions -a {} | grep $(lsb_release -sc) > repo_versions.log | |
#DOWNGRADE | |
cat repo_versions.log | awk '{ print $1 "=" $2 }' | xargs -I {} sudo DEBIAN_FRONTEND=noninteractive apt install --reinstall {} -y --allow-downgrades | |
#CHECK | |
apt-show-versions | grep newer |
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
dd if=/dev/zero of=test.img bs=4k count=60000 | |
#240 Mb | |
mkfs.ext4 test.img | |
tune2fs -c0 -i0 test.img | |
mount -o loop test.img /mnt/ |
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
# Generated by Powerlevel10k configuration wizard on 2020-09-04 at 19:59 CEST. | |
# Based on romkatv/powerlevel10k/config/p10k-classic.zsh, checksum 42402. | |
# Wizard options: compatible, classic, unicode, dark, flat heads, flat tails, 1 line, | |
# sparse, fluent, transient_prompt, instant_prompt=verbose. | |
# Type `p10k configure` to generate another config. | |
# | |
# Config for Powerlevel10k with classic powerline prompt style. Type `p10k configure` to generate | |
# your own config based on it. | |
# | |
# Tip: Looking for a nice color? Here's a one-liner to print colormap. |
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
echo "Input version number to install [e.g. 5.4.23]:" | |
read version | |
wget http://dl.ui.com/unifi/$version/unifi_sysvinit_all.deb -O unifi_$version\_sysvinit_all.deb | |
sudo apt install -f ./unifi_$version\_sysvinit_all.deb |
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
#[cfg(test)] | |
mod test { | |
#[test] | |
fn word() { | |
let board = vec![ | |
vec!['A','B','C','E'], | |
vec!['S','F','C','S'], | |
vec!['A','D','E','E'] | |
]; | |
let board2 = vec![ |
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
kubectl get crd | sed -n '1!p' | awk '{print $1}' | xargs -I {} sh -c 'echo "Saving {}"; kubectl get crd {} -o yaml > {}.yaml' |
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
#!/bin/bash | |
# download a file https://pritunl-host/key/kUcPewwukHSXxONlf9NJq7KdcUsMuRwR.tar | |
echo "Enter url to tar with profile:" | |
read tar_url | |
mkdir vpn | |
wget -O- ${tar_url} | tar x -C vpn | |
docker run -d \ | |
--net=host \ |
NewerOlder