Skip to content

Instantly share code, notes, and snippets.

View developer-guy's full-sized avatar
🐾
Every artifact can be verifiably traced to Source Code and Hardware

Batuhan Apaydın developer-guy

🐾
Every artifact can be verifiably traced to Source Code and Hardware
View GitHub Profile
@developer-guy
developer-guy / KIND_Networking.md
Created October 21, 2020 10:00 — forked from aojea/KIND_Networking.md
Use KIND to emulate complex network scenarios

Networking scenarios [Linux Only]

KIND runs Kubernetes cluster in Docker, and leverages Docker networking for all the network features: port mapping, IPv6, containers connectivity, etc.

Docker Networking

KIND uses a docker user defined network.

It creates a bridge named kind

@developer-guy
developer-guy / update-asdf-plugins.sh
Last active April 22, 2024 02:06
Update asdf plugins to their latest versions if necessary
#!/usr/bin/env sh
function update() {
for i in `asdf plugin list`
do
CURRENT_VERSION=`asdf current $i | awk '{print $2}'`
LATEST_VERSION=`asdf latest $i`
echo "Working with $i current version $CURRENT_VERSION but latest version is $LATEST_VERSION"
if [[ $(semver_check $LATEST_VERSION $CURRENT_VERSION) -lt 0 ]]; then
echo "Needs to update"
@developer-guy
developer-guy / config.yaml
Created December 30, 2020 19:08
Enable Audit Logging in KinD cluster
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
extraMounts:
- hostPath: /tmp/audit
containerPath: /tmp/audit
- role: worker
kubeadmConfigPatches:
- |
@developer-guy
developer-guy / main.go
Last active March 14, 2024 17:57
execve syscall in go
package main
import (
_ "embed"
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
"os/signal"

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@developer-guy
developer-guy / zot-kind-helm-skopeo.md
Created December 6, 2022 09:39 — forked from scottrigby/zot-kind-helm-skopeo.md
Inspect OCI artifact locally (Zot, kind, Helm, and Skopeo)
  1. setup

    $ kind create cluster
  2. install zot with minimal image for security-minded dist-spec-only

    $ helm upgrade zot zot/zot --set image.repository=ghcr.io/project-zot/zot-minimal-linux-amd64
@developer-guy
developer-guy / registry.go
Created October 26, 2022 20:31
A registry server impl using google/go-containerregistry pkg
package main
import (
"context"
"fmt"
"net/http/httptest"
"os"
"os/signal"
"strings"
"syscall"
@developer-guy
developer-guy / registry.go
Created October 25, 2022 09:02
Programmatically run container registry based on Docker's reference implementation distribution/distribution
package main
import (
"context"
"fmt"
"os"
"os/signal"
"syscall"
"time"
@developer-guy
developer-guy / kubernetes-containerd.sh
Created September 22, 2022 14:34 — forked from saiyam1814/kubernetes-containerd.sh
kubernetes-containerd.sh
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
echo "step1"
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
echo "kubeadm install"
sudo apt update -y
sudo apt -y install vim git curl wget kubelet=1.24.3-00 kubeadm=1.24.3-00 kubectl=1.24.3-00
echo "memory swapoff"
sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
sudo swapoff -a
sudo modprobe overlay
@developer-guy
developer-guy / go-ssh-encrypted-pem.go
Created September 22, 2022 14:13 — forked from stefanprodan/go-ssh-encrypted-pem.go
Using golang ssh client with an encrypted private key
package main
import (
"crypto/x509"
"encoding/pem"
"errors"
"fmt"
"golang.org/x/crypto/ssh"
"io/ioutil"
"net"