Skip to content

Instantly share code, notes, and snippets.

View dln's full-sized avatar
🚀

Daniel Lundin dln

🚀
View GitHub Profile
@dln
dln / daemonset.yaml
Last active December 28, 2022 12:54
Daemonset to automatically stripe all local ssd disks and mount for use in GKE workloads.
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: local-ssd-init
labels:
app: local-ssd-init
spec:
template:
spec:
@mikesparr
mikesparr / terraform-example-memcache.tf
Last active November 24, 2020 16:35
Example Terraform GCP org with Memcache in service project
terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 3.37"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 3.37"
}
@p7cq
p7cq / SSH_Authentication_TPM2_PKCS11_Arch_Linux.md
Last active January 17, 2024 03:30
SSH Authentication with TPM 2.0 and PKCS#11 on Arch Linux

SSH Authentication with TPM 2.0 and PKCS#11 on Arch Linux

Hardware: a TPM 2.0 module based on Infineon SLB9665 cryptographic processor available in the system as /dev/tpmrm0.

Installation

Required software:

# pacman -S tpm2-tools tpm2-pkcs11
echo -e '\e[0mnormal\e[0m'
echo -e '\e[2mdim\e[0m'
echo -e '\e[1mbold\e[0m'
echo -e '\e[3mitalic\e[0m'
echo -e '\e[2;3mdim italic\e[0m'
echo -e '\e[1;3mbold italic\e[0m'
echo
@dln
dln / smb.conf
Created August 5, 2020 10:31
Minimal samba config with some perf tunings for throughput
[global]
workgroup = WORKGROUP
log file = /var/log/samba/log.%m
max log size = 1000
server role = standalone server
security = user
map to guest = Bad Password
server multi channel support = yes
load printers = no
printing = bsd
@bangpound
bangpound / vault-token-helper.sh
Created September 9, 2018 15:13
Vault Token helper for the Linux key retention service
#!/usr/bin/env bash
# Vault Token helper for the Linux key retention service.
#
# Since version 2.6, the Linux kernel has included a efficiently store
# authentication data on a per thread, per process, per user, or per session
# bases.
#
# Linux Key Management Utilities (keyutils) provides `keyctl` to control
# the facility from the shell.
@nahall
nahall / connecting_to_a_ubiquiti_unifi_vpn_with_a_linux_machine.txt
Last active November 10, 2023 03:53
Connecting to a Ubiquiti Unifi VPN with a Linux machine
This guide assumes that you have already set up a Ubiquiti Unifi VPN following the guide:
https://help.ubnt.com/hc/en-us/articles/115005445768-UniFi-L2TP-Remote-Access-VPN-with-USG-as-RADIUS-Server
To configure a Linux machine to be able to connect remotely I followed these steps. This guide was written for Debian 8.
- In Debian install the "xl2tpd" and "strongswan" packages.
- Edit /etc/ipsec.conf to add the connection:
conn YOURVPNCONNECTIONNAME

Generated private key

openssl genrsa -out server.key 2048

To generate a certificate

openssl req -new -x509 -key server.key -out server.pem -days 3650

https

@mariusae
mariusae / recordaddr.scala
Created January 28, 2015 20:15
A demonstration of using Stack to implement per-endpoint behavior.
/*
* We're going to demonstrate how to use Finagle's Stack facilities to inject behavior
* deep down in Finagle's stack. Namely, we want to capture the address of a remote
* server in that server's response.
*
* While retrieving a client address is something that perhaps deserves a first-class
* API, it's nevertheless interesting to exercise the flexbility of the Stack mechanism.
*
* This code uses only public APIs.
*
@dln
dln / jellohack.c
Created June 2, 2014 20:50
Hack for xscreensaver I did a long time ago.
/* A screen saver hack to display the CodeFactory logotype
* in a jiggling fashion with a lil bit o bounce... *grin*
*
* Daniel Lundin <daniel@codefactory.se>
*
* Copyright 2001 Seven relatively short dudes and a pale chick
*
* This software is released under Disgruntled Catholic License v6.66
* Redistribution prohibited without authorization from the pope.
* Under special circumstances under which should such authorization