Skip to content

Instantly share code, notes, and snippets.

View lsjostro's full-sized avatar
:shipit:

Lars Sjöström lsjostro

:shipit:
View GitHub Profile
config.color_scheme = scheme_for_appearance(wezterm.gui.get_appearance())
-- config.font = wezterm.font({ family = "IosevkaShelman Nerd Font" })
-- config.font_rules = {
-- {
-- italic = false,
-- intensity = "Half",
-- font = wezterm.font("IosevkaShelman Nerd Font", { weight = "Light" }),
-- },
-- {
-- italic = true,
apiVersion: v1
kind: Service
metadata:
labels:
app: kube-prometheus-stack-coredns
app.kubernetes.io/instance: kube-prometheus-stack
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/part-of: kube-prometheus-stack
app.kubernetes.io/version: 55.0.0
chart: kube-prometheus-stack-55.0.0
packer {
required_plugins {
proxmox-iso = {
version = ">= 1.1.5"
source = "github.com/hashicorp/proxmox"
}
}
}
variable "pve_node" {
doas docker run --privileged --rm tonistiigi/binfmt --install all
doas docker run --rm -it --platform linux/arm64 --privileged -v $PWD:/vyos --sysctl net.ipv6.conf.lo.disable_ipv6=0 -e GOSU_UID=$(id -u) -e GOSU_GID=$(id -g) vyos/vyos-build:current-arm64 bash
$ ./build-vyos-image iso --architecture arm64 --build-by "Shelman group" --custom-apt-entry "deb [arch=arm64] https://repos.influxdata.com/debian bullseye stable" --custom-apt-key $PWD/influxdata-archive_compat.key --custom-package "cloud-utils vyos-linux-firmware"
@lsjostro
lsjostro / talos-geniso-nocloud.sh
Last active May 6, 2023 17:22
talos iso convert to nocloud platform
docker run --rm -i -w /work -v "$PWD":/work --entrypoint sh ghcr.io/siderolabs/imager:v1.4.0 -c '
installer iso --arch amd64 --output . &&
xorriso -osirrox on -indev ./talos-amd64.iso -extract / /tmp &&
rm -f ./talos-amd64.iso &&
sed -i 's/talos.platform=metal/talos.platform=nocloud/g' /tmp/boot/grub/grub.cfg &&
grub-mkrescue --compress=xz --output=./talos-amd64-nocloud.iso /tmp'
@lsjostro
lsjostro / buf-protoc-plugin-local-exec.sh
Last active February 7, 2023 20:49
buf.build protoc local exec using container images from custom registry
#!/usr/bin/env bash
# Symlink this script as ./protoc-gen-<plugin-name>.
# container images should be built as protoc-gen-<plugin-name>
# make sure `buf` is installed and available in your PATH as well
# as this script and the symlinks. Works both with docker and podman.
# podman is preferred if both are available. (podman is preferred in CI environments)
#
# Example buf.gen.yaml:
# ---
# version: v1
#!/usr/bin/env bash
set -e -o pipefail
gdbus call --session --dest org.gnome.Shell.Screenshot --object-path /org/gnome/Shell/Screenshot --method org.gnome.Shell.Screenshot.PickColor |
sed 's#.*: <(\([0-9].[0-9]*\), \([0-9].[0-9]*\), \([0-9].[0-9]*\).*#{"r":\1, "g":\2, "b":\3 }#' |
jq -r '{r:(.r*255),g:(.g*255),b:(.b*255)}| join(" ")' |
xargs printf "#%x%x%x\n" | xclip -selection clipboard
#!/usr/bin/env bash
#
# Summary: Create pyright config file in current directory
#
set -e
[ -n "$PYENV_DEBUG" ] && set -x
PYRIGHT_FILENAME='pyrightconfig.json'
create_new_file() {
@lsjostro
lsjostro / gcb-slack-notifty-cloud-function.go
Created December 8, 2021 08:30
Cloud function listening on a pubsub cloud-build pubsub topic for GCB run events and notify on slack
package main
import (
"context"
"encoding/base64"
"encoding/json"
"fmt"
"net/http"
"strings"
@lsjostro
lsjostro / config.gateway.json
Created May 18, 2021 19:07
Unifi custom gateway to allow google ip ranges through on https
{
"firewall": {
"group": {
"address-group": {
"google_ip_ranges": {
"description": "google ip ranges",
"address": [
"8.8.4.0/24",
"8.8.8.0/24",
"8.34.208.0/20",