Skip to content

Instantly share code, notes, and snippets.

View dln's full-sized avatar
🚀

Daniel Lundin dln

🚀
View GitHub Profile
@dln
dln / fixfonts.sh
Created November 8, 2019 09:52
Subpixel rendering and proper font hints on Arch
yay -Sy freetype2-cleartype
mkdir -p ~/.config/fontconfig/conf.d
ln -s /etc/fonts/conf.avail/10-sub-pixel-rgb.conf ~/.config/fontconfig/conf.d/
ln -s /etc/fonts/conf.avail/11-lcdfilter-default.conf ~/.config/fontconfig/conf.d/
cat <<EOF >~/.Xresources
Xft.dpi: 96
Xft.antialias: true
Xft.hinting: true
@dln
dln / ingressgateway_probes.yaml
Created September 17, 2019 07:46
kustomize from istio helm chart + gke ingress health checks
apiVersion: apps/v1
kind: Deployment
metadata:
name: istio-ingressgateway
spec:
template:
spec:
containers:
- name: istio-proxy
readinessProbe:
@dln
dln / pwenv
Last active September 4, 2019 14:49
Run a program with an environment variable containing a secret. Use kernel keyring to cache this value to avoid having to re-enter credentials.
#!/bin/bash
set -eu
purge=0
ttl=600
usage() { echo "Usage: $0 [-t SECONDS] [-f]" 1>&2; exit 1; }
while getopts ":ft:" o; do
case "${o}" in
#!/bin/sh
set -e
args=(
## Machine
-smp 20
-m 16G
# -machine type=q35,accel=kvm
-enable-kvm
@dln
dln / swenglish.ahk
Last active December 17, 2018 09:23
Autohotkey script to allow input swedish åäöÅÄÖ while holding Alt(Gr) ... https://www.autohotkey.com/
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#InstallKeybdHook
#Persistent
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
~!SC027::
Send, ö
" Theme setup
hi clear
syntax reset
let g:colors_name = "dln-dark"
let s:red_50 = "#ffebee"
let s:red_100 = "#ffcdd2"
let s:red_200 = "#ef9a9a"
let s:red_300 = "#e57373"
#define __ int
#define _ main
__ a[]={0x61724708, 0x73697474,
0x20e57020, 0x6564f666,
0x6465736c, 0x6e656761,
0x614c202c, 0x21657373,
0xa212100,0x0};
/*------------+-----+----.
\ \ \
#!/bin/bash
set -e
libhack=$(mktemp --tmpdir libhack_XXXXX.so)
trap "rm -f ${libhack}" EXIT
gcc -O3 -fPIC -shared -Wl,-soname,libnumcpus.so -o ${libhack} -x c - <<EOF
#include <stdlib.h>
#include <unistd.h>
#! /usr/bin/gawk -f
#
# Unified diff htmlizer/colorifier
# Daniel Lundin <daniel@codefactory.se>
#
# Copyright (c) 2002 Daniel Lundin
# Copyright (c) 2002 CodeFactory AB
#
# All rights reserved.
#

Keybase proof

I hereby claim:

  • I am dln on github.
  • I am dln (https://keybase.io/dln) on keybase.
  • I have a public key whose fingerprint is AF7C 88A2 C08D 90A1 32C8 4827 7902 0DB0 2638 5D4C

To claim this, I am signing this object: