Skip to content

Instantly share code, notes, and snippets.

View lukaszraczylo's full-sized avatar
🎯
Focusing

Lukasz Raczylo lukaszraczylo

🎯
Focusing
View GitHub Profile
name: Test and release
on:
workflow_dispatch:
push:
paths-ignore:
- '**.md'
branches:
- "main"
#!/bin/bash
# This script sets the token for all repositories within organisation.
set -e
organisationName=$1
if [ -z "$organisationName" ]; then
echo "Please provide organisation name"
exit 1
apiVersion: jobsmanager.raczylo.com/v1beta1
kind: ManagedJob
metadata:
labels:
name: data-import
spec:
retries: 3
params:
env:
- name: "FOO"
@lukaszraczylo
lukaszraczylo / 0_traefik_mirror_lab.md
Created April 9, 2023 01:40 — forked from neoakris/0_traefik_mirror_lab.md
Reproducible Demo of Traefik 2.0 Traffic Mirroring on EKS

Reproducible Demo of Traefik 2.0 Traffic Mirroring

Overview

What to expect in this doc:

  • Traefik 2.0 has traffic mirroring functionality that should work on generic Kubernetes, but there's no good how-to guides, let this be the first.
  • This is a how-to guide, that's optimized for understanding
@lukaszraczylo
lukaszraczylo / archive-old-repositories.sh
Created April 13, 2023 16:34
Archive old github repositories for user/organisation
#!/bin/bash
# This script will archive all repositories on github where
# the last commit was more than 2 years ago.
# It takes one argument, the github username / organisation name.
organisationName=$1
if [ -z "$organisationName" ]; then
echo "Please provide organisation name"
@lukaszraczylo
lukaszraczylo / convert.go
Created April 16, 2023 00:51
Convert json value into desired type using Golang generics
// Function:
func ConvertReplyType[T any](desiredType T, reply *[]byte) T {
if reply == nil {
return interface{}(nil).(T)
}
// reflect type of desired type
desiredTypeType := reflect.TypeOf(desiredType)
v := reflect.New(desiredTypeType).Interface()