Skip to content

Instantly share code, notes, and snippets.

@ctsrc
ctsrc / 00_install_fbsd_14_1_hetzner.md
Last active March 26, 2025 22:31
Install FreeBSD 14.1 on Hetzner

Install FreeBSD 14.1 on Hetzner server

Hetzner no longer offers direct install of FreeBSD, but we can do it ourselves. Here is how :)

Boot the server into rescue mode

Boot the Hetzner server in Hetzner Debian based rescue mode. ssh into it.

The Hetzner rescue image will tell you hardware details about the server in the login banner. For example, with one of my servers I see:

@oantolin
oantolin / contrast.c
Last active October 19, 2024 12:09
Find most luminous contrasting color
#include <math.h>
#include <stdio.h>
double f(int c) {
double x = c / 255.0;
return x<=0.03928 ? x/12.92 : pow((x + 0.055)/1.055, 2.4);
}
double rellum(int r, int g, int b) {
return 0.2126*f(r) + 0.7152*f(g) + 0.0722*f(b);
(ql:quickload "cl-ppcre")
(ql:quickload "anaphora")
(defpackage :ini-parser
(:use :common-lisp :anaphora)
(:export :read-config-from-file))
(in-package :ini-parser)
(defparameter +empty-line+ (format nil "~%"))
@lispm
lispm / queens.lisp
Last active February 3, 2020 17:58
;;; Paper: https://arxiv.org/pdf/2001.02491.pdf
;;; Code: https://github.com/cvlab-epfl/n-queens-benchmark
;;; Lisp Code: https://github.com/cvlab-epfl/n-queens-benchmark/blob/master/code/queens.lisp
;;; Changes/extensions to the original Common Lisp code: Rainer Joswig, [email protected], 2020
;; * using bitvectors is faster than 'boolean' arrays (which typically aren't supported in CL)
;;; In Common Lisp
;;; * use Quicklisp
;;; * compile and load this file
@priyadarshan
priyadarshan / README.md
Last active January 3, 2020 16:36
Install WSL/Debian and tools

To select Debian as default distro:

wslconfig /s debian
@phoe
phoe / package-local-nicknames.md
Last active March 27, 2025 15:53
Package-local nicknames in Common Lisp - a semishitpost about PLNs

Package-local nicknames in Common Lisp

Warning: this is a rant.

Warning: you have been warned.

Note: actually worthwhile content starts in the second subsection. You are free to skip the first one.

Story time

@Goheeca
Goheeca / init.slime
Last active August 29, 2022 11:01
Clean SLIME REPL
(ql:quickload "agnostic-lizard")
@Goheeca
Goheeca / shared.lisp
Last active November 17, 2019 18:45
Multiprocess multithreaded computation with SBCL
#!/usr/bin/sbcl --script
(require :sb-posix)
(require :sb-bsd-sockets)
;;; Globals
;; IPC
(defvar *pid* nil)
(defvar *socket-path* "/tmp/socket")
(defvar *socket* nil)
;; MT
@Goheeca
Goheeca / braille-pixels.lisp
Last active November 17, 2019 18:36
Braille pixels images using cl-charms (@ SBCL)
#!/usr/bin/sbcl --script
#|
Usage
=====
$ ./braille-pixels.lisp [path]
Main
====
@Goheeca
Goheeca / ambiguous.pyjs
Last active November 17, 2019 18:52
Common Lisp ≡ ⊤
#||| Python or JS that is the question. |#
#|| Let's define a JS function, provided we're in JS. |#
#+moody-js"
function fact(n) {
if (n == 0) return 1
else return n * fact(n - 1)
}
"