Skip to content

Instantly share code, notes, and snippets.

View jozko's full-sized avatar
:octocat:
YAML && 🤦‍♂️

Jozko Skrablin jozko

:octocat:
YAML && 🤦‍♂️
View GitHub Profile
@jozko
jozko / restore-rkestate-file.md
Created May 21, 2024 08:31 — forked from superseb/restore-rkestate-file.md
Recover cluster.rkestate file from controlplane node

Recover cluster.rkestate file from controlplane node

RKE

Run on controlplane node, uses any found hyperkube image

k8s 1.19 and higher

docker run --rm --net=host -v $(docker inspect kubelet --format '{{ range .Mounts }}{{ if eq .Destination "/etc/kubernetes" }}{{ .Source }}{{ end }}{{ end }}')/ssl:/etc/kubernetes/ssl:ro --entrypoint bash $(docker inspect $(docker images -q --filter=label=org.opencontainers.image.source=https://github.com/rancher/hyperkube.git) --format='{{index .RepoTags 0}}' | tail -1) -c 'kubectl --kubeconfig /etc/kubernetes/ssl/kubecfg-kube-node.yaml -n kube-system get configmap full-cluster-state -o json | jq -r .data.\"full-cluster-state\" | jq -r .' > cluster.rkestate
@jozko
jozko / README.md
Last active November 17, 2021 08:07
Traefik redirect only configuration

Traefik as a redirect service only

Because sometimes you really just need to redirect some subdomains/URL to new ones, with full SSL support. And with copy/pastabale examples above it takes less time to get it up and running that would take to start using some external redirect service (and it's not always possible to do so anyway).

Configuration above was compiled from several sources listed in the Links section below. It seems to be working ok with Traefik version 2.5.4. Whoever finds this useful - use it.

Links

@jozko
jozko / vagrant-cheat-sheet.md
Created May 25, 2021 12:21 — forked from wpscholar/vagrant-cheat-sheet.md
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@jozko
jozko / gist:a244a3d2651670fe292285bb33bab73e
Last active May 18, 2021 12:47
Working Digitalocean DNS-01 challenge for Letsencrypt certs
version: "3.3"
# Domain DNS should obviously be hosted with DO.
services:
traefik:
image: "traefik:v2.4"
container_name: "traefik"
command:
To convert Virtualbox VMs to VMware VMs, the state of the art is still not a "simple export and import".
Am surprised that it doesn't still work thst way. My VMWare player would quit without even errors. Linux, VMware & Tools ... Still long way to go.. Why can't something fail appropriately ?
Some commands need to be typed in the command lines. Here is the procedure that worked for me:
From Virtualbox, Export the VM to a folder. It could be saved either in the .OVA or .OVF formats.
In the command line, execute :
ovftool -tt vmx --lax soureVMfileaname.ova .
@jozko
jozko / pbm_install_replicaset_tldr.md
Last active March 30, 2021 08:11
PBM install TLDR for simple MongoDB replicaset
#!/usr/bin/env bash
# Interpolation to {} is not possible in bash
# see https://www.gnu.org/software/bash/manual/html_node/Shell-Expansions.html#Shell-Expansions
# So using a counter and an array may come handy sometimes
MAX_COUNT=6
arr=()
while true; do
@jozko
jozko / install-comodo-ssl-cert-for-nginx.rst
Created December 7, 2018 15:16 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@jozko
jozko / CRF250L_drivetrain.md
Last active November 12, 2018 16:18
CRF250L drivetrain