Skip to content

Instantly share code, notes, and snippets.

@avoidik
avoidik / README.md
Last active January 31, 2025 16:40
Plain simple alternative to Docker Desktop

Multipass

It works both with VirtualBox and Hyper-V on Windows, it also support MacOS including M1

Install

Configure virtualization driver

If you want VirtualBox (works on Linux, Windows, and MacOS)

@avoidik
avoidik / README.md
Last active January 30, 2022 19:05
systemd service with dynamic user
cat > /etc/default/step-ca <<'EOF'
STEPPATH="/etc/step-ca"
PASSWORD_FILE="/etc/step-ca/passwd"
CONFIG_FILE="/etc/step-ca/config/ca.json"
STEP_CA_TOKEN="..."
EOF

cat > /etc/systemd/system/step-ca.service <<'EOF'
[Unit]
@avoidik
avoidik / README.md
Last active March 24, 2022 07:24
Host plain simple Docker Registry on Raspberry Pi with MinIO storage backend

Host plain simple Docker Registry on Raspberry Pi with MinIO storage backend

Install golang

curl -fsSLO https://go.dev/dl/go1.17.8.linux-armv6l.tar.gz
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf go1.17.8.linux-armv6l.tar.gz
rm -f go1.17.8.linux-armv6l.tar.gz
cat <<'EOF' | tee -a ~/.profile > /dev/null
@avoidik
avoidik / README.md
Created January 4, 2022 14:05
Mikrotik, add rules over API

Prerequisites:

  • Mikrotik API is enabled (IP > Services > API, enabled on port 8728 and/or 8729)
  • Mikrotik API ports are allowed (IP > Firewall > Filter Rules, input chain has both TCP ports allowed)
  • Mikrotik management interface IP address is reachable
  • Linux (VM or real hardware)

Steps

@avoidik
avoidik / cloudtrail-template-elasticsearch.json
Created December 27, 2021 07:33 — forked from kesor/cloudtrail-template-elasticsearch.json
An ElasticSearch Index template for CloudTrail events
PUT _template/cloudtrail
{
"index_patterns": ["cloudtrail-*"],
"settings": {
"number_of_shards": 1,
"mapping": {
"total_fields": {
"limit": 10000
}
}
@avoidik
avoidik / policy.sentinel
Created December 9, 2021 15:46
Vault Sentinel sample policy
import "sockaddr"
import "strings"
#
# allow update secrets under secret/ path only to clients coming from 10.0.0.0/8 CIDR range
#
precond = rule {
request.operation in ["update"] and
strings.has_prefix(request.path, "secret/")
@avoidik
avoidik / .conkyrc
Last active November 19, 2022 20:58
conky configuration
conky.config = {
alignment = 'top_right',
background = false,
border_width = 1,
cpu_avg_samples = 2,
default_color = 'white',
default_outline_color = 'white',
default_shade_color = 'white',
draw_borders = false,
draw_graph_borders = true,
@avoidik
avoidik / README.md
Last active November 27, 2021 17:07
Linkerd with Ambassador as gateway

Prepare two K8s clusters

Context east

Create cluster on GCP

$ gcloud container clusters create multi-cluster-demo --preemptible
@avoidik
avoidik / README.md
Last active November 25, 2021 16:20
Install ECR credentials helper

How to install & configure ECR credentials helper

Download

$ sudo curl -fsSL https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com/0.5.0/linux-amd64/docker-credential-ecr-login -o /usr/local/bin/docker-credential-ecr-login
$ sudo chmod +x /usr/local/bin/docker-credential-ecr-login

Configure

@avoidik
avoidik / Vagrantfile
Last active November 17, 2021 19:14
K3S on Vagrant with MetalLB
DEFAULT_BOX = 'ubuntu/focal64'
WORKER_NODES = 2
Vagrant.configure(2) do |config|
config.vm.define 'master' do |master|
master.vm.box = DEFAULT_BOX
master.vm.hostname = 'master'
master.vm.synced_folder '.', '/vagrant', type: 'virtualbox'
master.vm.network 'private_network', ip: '192.168.0.200'
master.vm.provider 'virtualbox' do |v|