Skip to content

Instantly share code, notes, and snippets.

View samueljon's full-sized avatar

Samúel Jón Gunnarsson samueljon

View GitHub Profile
@Dazage
Dazage / fussh.sh
Last active February 26, 2025 11:27
fuzzy find ssh host
#!/usr/bin/env bash
# Generate list from ~/.ssh/config
list=$(grep -i "^Host " ~/.ssh/config | awk '{print $2}' | sort -u)
target=$(echo "$list" | fzf --prompt="Select a host: ")
if [[ -n $target ]]; then
echo "Connecting to $target..."
ssh "$target"
@admun
admun / setup_democratic_csi_rke_1_20_4.md
Last active April 1, 2025 11:24
My journey migrating off nfs-client-provisioner, since it's deprecated and broken in k8s 1.20.4...

I recently upgraded my rancher RKE cluster to 1.20.4, and found that nfs-client-proisioner is broken. It failed to create new PVC with an "unexpected error getting claim reference: selfLink was empty, can't make reference" error.

After some google search I found this. However, there is no documentation on how to migrate from nfs-client-provisioner, even it seems to fixed the issue.

When asking around in #sig-storage, @thansen suggested to give democratic-csi a try, which has a crude yet simple implementation of nfs-client as a CSI driver.

Here's capture how I get it to work, after helps from @thansen

My setup: RKE cluster on k8s v1.20.4, 3x Fedora 33 node, managed by Rancher 2.5.6, NFS server on a Thecus N5550, nfs-client-provisioner used for dynamic PVC provisioning.

@f41gh7
f41gh7 / api-server.yaml
Last active August 21, 2023 10:31
vm operator configuration examples
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMServiceScrape
metadata:
name: apiserver
namespace: monitoring-system
spec:
endpoints:
- bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
bearerTokenSecret:
key: ""
@mtrimarchi
mtrimarchi / 6to4.rsc
Created May 30, 2020 23:08
Working 6rd/6to4 script for modems without native IPV6 in firmware operating on native IPV6 network - https://forum.mikrotik.com/viewtopic.php?t=134621
# 6to4.rsc
# Notes
# We cannot use variables here, somehow the router rejects them.
/interface 6to4
# The first value to replace here is your WAN IPv4 address (the one you get when you type "my ip" in google search
# The second value is the one called "IPv4 Relay" in the calculator.
add clamp-tcp-mss=yes disabled=no dont-fragment=no dscp=inherit local-address=<WAN_IP_HERE> mtu=1480 name=6rd remote-address=<IPV4_RELAY_ADDRESS_HERE>
# "IPv6 6RD Adress"
@GavinRay97
GavinRay97 / index.md
Last active April 12, 2024 18:31
Hasura organization permissions

Introduction

This document outlines how to model a common organization-based permission system in Hasura. Let's assume that you have some table structure like the following:

Table Name Columns Foreign Keys
User id, name, email
Organization User id, user_id, organization_id user_id -> user.id, organization_id -> organization.id
Organization id, name
@geerlingguy
geerlingguy / molecule-3-up.sh
Last active January 15, 2021 13:52
Molecule 3.0 update script with all the little changes I had to make.
#!/bin/bash
#
# Update things to be compatible with Molecule 3.0.
#
# This script is NOT idempotent, and should never be run again.
exit 1
export LINT_STRING="lint: |
set -e
yamllint .
@olafz
olafz / tweak_6rd.rsc
Created January 8, 2020 19:37
Tweak IPv6 mikrotik RouterOS (6RD)
# Dutch ISP Tweak offers IPv6 via 6rd. The commands below configure a mikrotik
# RouterOS with 6rd. This was tested with RouterOS 6.46.1.
#
# First, you'll have to request IPv6 information from Tweak. You'll receive
# a fixed IPv4 address and some other information. For the rest of this guide,
# I assume the following information is received from Tweak:
#
# ===
# IPv4 address: 185.227.123.123
# IPv4 mask length: 22
@Mau5Machine
Mau5Machine / docker-compose.yml
Last active January 18, 2025 00:17
Traefik Configuration and Setup
version: "3.3"
services:
################################################
#### Traefik Proxy Setup #####
###############################################
traefik:
image: traefik:v2.0
restart: always
# Pollenvarsel for Home Assistant - Oppdatert 29.04.2021 grunnet endret URL/struktur hos Pollenkontroll.no
- platform: rest
name: pollen_json
resource: https://pollenkontroll.no/api/middleware/pollen/b5bb4856-2117-433d-bf18-53504ef2f101
scan_interval: 21600
value_template: 'OK'
json_attributes:
- "forecast"
@hhromic
hhromic / tradfri.sh
Last active April 16, 2023 21:06
Show information about IKEA Tradfri devices firmware from the official IKEA servers in Linux
#!/usr/bin/env bash
# Show information about IKEA Tradfri devices firmware from the official IKEA servers
# script by github.com/hhromic
# optional filter
declare -r FILTER=$1
# URLs for firmware channels
declare -r -A CHANNEL_URLS=(
[CURRENT]=http://fw.ota.homesmart.ikea.net/feed/version_info.json