Skip to content

Instantly share code, notes, and snippets.

View weibeld's full-sized avatar

Daniel Weibel weibeld

View GitHub Profile
@weibeld
weibeld / 03-release-asset-creator.yml
Created July 29, 2020 09:22
GitHub Actions example workflow — Release Asset Creator
name: release-asset-creator
on:
release:
types: [published]
jobs:
my-job:
runs-on: ubuntu-latest
env:
ARCHIVE_NAME: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}
steps:
@weibeld
weibeld / 02-issue-greeter.yml
Last active November 27, 2020 07:50
GitHub Actions example workflow 2 — Issue Greeter
name: issue-greeter
on:
issues:
types: [opened]
jobs:
my-job:
runs-on: ubuntu-latest
steps:
- name: my-step
env:
@weibeld
weibeld / 01-hello-world.yml
Last active February 14, 2025 16:02
GitHub Actions example workflow 1 — Hello World!
name: hello-world
on: push
jobs:
my-job:
runs-on: ubuntu-latest
steps:
- name: my-step
run: echo "Hello World!"
@weibeld
weibeld / gha-01-hello.yml
Created July 24, 2020 13:59
GitHub Actions example: hello world
name: hello-world
on: push
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: hello-world
run: echo "Hello World"
@weibeld
weibeld / cover.pdf
Last active July 10, 2020 15:49
Render Markdown to PDF for ebooks
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
[[ "$1" = -v || "$1" = --version ]] && { echo "0.1.2"; exit; }
for d in jq watch curl kubectl; do which "$d" >/dev/null || { echo "Missing dependency: $d"; exit 1; }; done
ns=${1:-default}; res=${2:-pods}
c() { echo -e "\033[$1m"; }
cc() { echo -e "\033[$1;1m"; }
printf Loading && while true; do printf . && sleep 0.1; done &
@weibeld
weibeld / main.go
Last active July 10, 2020 15:54
Webhook service for Kubernetes LDAP authentication (referenced from https://itnext.io/implementing-ldap-authentication-for-kubernetes-732178ec2155)
package main
import (
"encoding/json"
"fmt"
"github.com/go-ldap/ldap"
"io/ioutil"
"k8s.io/api/authentication/v1"
"log"
"net/http"
@weibeld
weibeld / decode-json-01-to-string.go
Last active February 26, 2020 17:09
Decoding JSON to Go values
// Decode JSON to a string
package main
import (
"encoding/json"
"fmt"
"log"
)
var j []byte = []byte(`"foo"`)
@weibeld
weibeld / create-json-01-from-string.go
Last active February 26, 2020 16:36
Encoding Go values to JSON
// Create JSON from a string
package main
import (
"encoding/json"
"fmt"
"log"
)
func main() {
@weibeld
weibeld / kubernetes-books.md
Last active November 8, 2022 21:37
List of Kubernetes books