Skip to content

Instantly share code, notes, and snippets.

View siredmar's full-sized avatar

Armin Schlegel siredmar

View GitHub Profile
@siredmar
siredmar / toRFC3339.tpl
Last active October 12, 2023 18:06
Helm Template - Convert Unix timestamp to RFC3339 string
Usage:
```
expiration: {{ template "toRFC3339" (dict "timestamp" 2067915966) }}
expiration: {{ template "toRFC3339" (dict "timestamp" (now | unixEpoch)) }}
```
```
{{/*
Create a Helm template function to add seconds to the current time.
Usage: {{ addSeconds currentTime secondsToAdd }}
@siredmar
siredmar / kubectl-remove_finalizers
Last active September 26, 2023 12:45
kubectl remove finalizers plugin
#!/bin/bash
# Check if at least the resource type is provided
if [ "$#" -lt 1 ]; then
echo "Usage: $0 <resource_type> [<resource name>] [kubectl get args ...]"
exit 1
fi
RESOURCE_TYPE=$1
shift 1 # Shift the arguments to remove the first
@siredmar
siredmar / edge-networking-macvlan.md
Created September 1, 2023 09:41
edgefarm edge node networking

To make edge networking working with a kind cluster (macvlan network - 192.168.1.192/27) and a physical edge node (192.168.1.100) one need to create a virtual device edgefarm0 and perform some routing

#!/bin/bash

echo 1 > /proc/sys/net/ipv4/ip_forward

IFACE=eth0
DUMMY_IP=192.168.2.1
@siredmar
siredmar / eventhub_and_avro.go
Created March 9, 2021 12:16
eventhub_and_avro.go
package main
import (
"bytes"
"context"
"fmt"
"log"
"os"
"os/signal"
"time"
@siredmar
siredmar / eventhub_subscribe.go
Created March 9, 2021 11:56
eventhub_subscribe.go
package main
import (
"context"
"fmt"
"os"
"os/signal"
"time"
eventhub "github.com/Azure/azure-event-hubs-go/v3"
@siredmar
siredmar / avro.go
Last active March 9, 2021 11:56
avro.go
package main
import (
"bytes"
"fmt"
"log"
"os"
"time"
"github.com/linkedin/goavro"
@siredmar
siredmar / repos_revisions.sh
Created December 10, 2020 15:48
Get all revisions of git repos recursively
#!/bin/bash
# Update all git directories below current directory or specified directory
# Skips directories that contain a file called .ignore
HIGHLIGHT="\e[01;34m"
NORMAL='\e[00m'
function update {
local d="$1"
if [ -d "$d" ]; then
/*
sdlgui/example1.cpp -- C++ version of an example application that shows
how to use the various widget classes.
Based on NanoGUI by Wenzel Jakob <wenzel@inf.ethz.ch>.
Adaptation for SDL by Dalerank <dalerankn8@gmail.com>
All rights reserved. Use of this source code is governed by a
BSD-style license that can be found in the LICENSE.txt file.
*/
@siredmar
siredmar / fetchall.sh
Last active July 24, 2020 07:34
Script that fetches and pulls all remote branches of a bunch of git repositories
#!/bin/bash
#usage: ./fetchall.sh <dir-containing-several-git-repos>
input=$1
for git in $(find $input -maxdepth 1 -mindepth 1 -type d -printf '%f\n')
do
git -C $input/$git branch -r | grep -v '\->' | while read remote; do git -C $input/$git branch --track "${remote#origin/}" "$remote"; done
git -C $input/$git fetch --all
/*============================================+
I Struktur FILECHUNK! I
+=============================================*/
typedef struct {
char name[16];
long lengh;
} TCHUNK;
/*========================================+
I Structur Erzberg !! I