Skip to content

Instantly share code, notes, and snippets.

@ahungry
ahungry / gist:0965a4efea7d0946d2dcc981d9a06fb3
Last active November 19, 2022 17:28
DAOC Eden on GNU/Linux
#/bin/bash
# Tested with Arch Linux
# Customize as desired - duh (should match where you plan to play Eden)
export WINEPREFIX=/mnt/windows/daoc/eden
# Used to create initial prefix - maybe run "winecfg" and set windows 7 after
wineboot
@ahungry
ahungry / janet.ctags
Created April 22, 2020 21:15 — forked from sogaiu/janet.ctags
~/.ctags.d/janet.ctags -- for indexing top-level things in janet code -- usage: `ctags -R <dir>` or for emacs, `ctags -e -R <dir>` -- sorry, no destructuring support
--exclude=.git
--langdef=Janet
--langmap=Janet:.janet
--regex-janet=/^\([ \t]*def[ \t]+([^0-9:#][^ \t\[{(]+)/\1/D,def/
--regex-janet=/^\([ \t]*def-[ \t]+([^0-9:#][^ \t\[{(]+)/\1/d,private def/
--regex-janet=/^\([ \t]*defglobal[ \t]+([^0-9:#][^ \t\[{(]+)/\1/g,defglobal/
--regex-janet=/^\([ \t]*defmacro[ \t]+([^0-9:#][^ \t\[{(]+)/\1/M,macro/
--regex-janet=/^\([ \t]*defmacro-[ \t]+([^0-9:#][^ \t\[{(]+)/\1/m,private macro/
--regex-janet=/^\([ \t]*defn[ \t]+([^0-9:#][^ \t\[{(]+)/\1/N,function/
--regex-janet=/^\([ \t]*defn-[ \t]+([^0-9:#][^ \t\[{(]+)/\1/n,private function/
#!/bin/sh
# install needed curl package
sudo apt install --no-install-recommends curl -y
# install kubectl
# https://github.com/kubernetes/minikube/issues/3437#issuecomment-449408316, maybe use https://storage.googleapis.com/minikube/releases/v0.30.0/docker-machine-driver-kvm2
curl -Lo /tmp/kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \
chmod +x /tmp/kubectl && \
sudo mv /tmp/kubectl /usr/local/bin/kubectl
# kubectl tab completion
sudo sh -c 'echo "source <(kubectl completion bash)" > /etc/bash_completion.d/kubectl'
@ahungry
ahungry / arch-linux-install-encryption
Created June 27, 2019 00:43 — forked from dust321/arch-linux-install-encryption
Minimal instructions for installing Arch Linux on an DOS/BIOS system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system, for BIOS. Dustin dut n ex 5 a t g ma il
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
@ahungry
ahungry / arch-linux-install
Created June 27, 2019 00:42 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
cat /etc/systemd/system/backlight.service
[Unit]
Description=Fix the laptop backlight
[Service]
ExecStart=/usr/local/bin/brightfix.sh
[Install]
WantedBy=multi-user.target
@ahungry
ahungry / etter.el
Created August 30, 2016 16:06
Etter
# -*- mode: snippet -*-
# name: typed getter/setter/property of class
# key: tetter
# --
/** @var $2 */
private $$1;
/**
* @return $2 Return the set value
*/
@ahungry
ahungry / Get-TLS-Fingerprint.sh
Created June 7, 2016 16:51 — forked from r35krag0th/Get-TLS-Fingerprint.sh
Get Pandora TLS Fingerprint
#!/bin/bash
##
## A simple little shell script that will return the current
## fingerprint on the SSL certificate. It's crude but works :D
##
## Author: Bob Saska (r35krag0th) <[email protected]>
openssl s_client -connect tuner.pandora.com:443 < /dev/null 2> /dev/null | \
openssl x509 -noout -fingerprint | tr -d ':' | cut -d'=' -f2
@ahungry
ahungry / stumpwmrc.lisp
Created June 2, 2016 06:07
send in special unicode chars np
(defcommand wss (string) ()
"Send a string of characters, including non-ascii ones (needs work for more than 1 char at a time)"
(map nil (lambda (ch)
(let* ((char-code (char-code ch))
(keysym (+ char-code (if (>= char-code #x100) #x01000000 0)))) ;; Only applicable if code >= #x100
(xlib:change-keyboard-mapping
*display*
(make-array '(1 1) :initial-element keysym)
;;#2A(
;;#(16778171) ;; λ in slot 8
@ahungry
ahungry / _reader-macros.md
Created May 19, 2016 01:21 — forked from chaitanyagupta/_reader-macros.md
Reader Macros in Common Lisp

Reader Macros in Common Lisp

This post also appears on lisper.in.

Reader macros are perhaps not as famous as ordinary macros. While macros are a great way to create your own DSL, reader macros provide even greater flexibility by allowing you to create entirely new syntax on top of Lisp.

Paul Graham explains them very well in [On Lisp][] (Chapter 17, Read-Macros):

The three big moments in a Lisp expression's life are read-time, compile-time, and runtime. Functions are in control at runtime. Macros give us a chance to perform transformations on programs at compile-time. ...read-macros... do their work at read-time.