Skip to content

Instantly share code, notes, and snippets.

View lukateras's full-sized avatar
🖤
Power to *you* <:

Luka Teras lukateras

🖤
Power to *you* <:
View GitHub Profile
-module(choir).
-export([start/0, start_world/0, say/1, say/3]).
start() -> register(?MODULE, spawn(fun loop/0)).
loop() ->
receive {Message, Voice} ->
os:cmd(io_lib:format("say -v '~s' '~s'", [Voice, Message])),
loop()
end.
@lukateras
lukateras / fizzbuzz.c
Last active November 29, 2021 01:24
Overengineered fizzbuzz in C
#include <stdio.h>
#include <string.h>
#define BUFLEN 9
int main() {
char buf[BUFLEN];
FILE *stream = fmemopen(&buf, BUFLEN, "w");
if (stream == NULL) {
FILE "example.bin" BINARY
TRACK 01 MODE2/2352
INDEX 01 00:00:00
@lukateras
lukateras / hq9+.rb
Last active January 29, 2019 16:57
@accumulator = 0
@beer = ''; 97.times do |n|
@beer << "
#{99-n} bottles of beer on the wall,
#{99-n} bottles of beer.
Take one down and pass it around,
#{98-n} bottles of beer on the wall.
"
end; @beer << "
2 bottles of beer on the wall,
diff -r 59f916c737be keydb.ml
--- a/keydb.ml Tue Oct 23 00:56:31 2018 +0000
+++ b/keydb.ml Tue Jan 22 14:09:31 2019 +0300
@@ -1166,6 +1166,12 @@
try
if has_hash hash then [] else
let keyid = Fingerprint.keyid_from_key ~short:true key in
+ let keyid_long = Fingerprint.keyid_to_string ~short:false (Fingerprint.keyid_from_key ~short:false key) in
+ plerror 4 "considering keyid %s" keyid_long;
+ if List.mem keyid_long [
@lukateras
lukateras / default.nix
Last active October 26, 2019 09:39
Pleroma derivation that leverages http://gitlab.com/transumption/mix-to-nix
with import <nixpkgs> {};
let
inherit (callPackage (fetchGit {
url = https://gitlab.com/transumption/mix-to-nix;
rev = "b70cb8f7fca80d0c5f7539dbfec497535e07d75c";
}) {}) mixToNix;
# Fake config, required for compilation
prodSecret = writeText "prod.secret.exs" ''
@lukateras
lukateras / cljack-in
Last active February 1, 2019 07:57
Project-independent nREPL setup for Clojure CLI
#!/bin/sh
exec clj -Sdeps '{:deps {cider/cider-nrepl {:mvn/version "0.20.0"}}}' \
-e '(require `cider-nrepl.main)
(cider-nrepl.main/init ["cider.nrepl/cider-middleware"])'
#!/bin/sh
STEAM_PATH=$HOME/.steam/debian-installation
cd "$STEAM_PATH/steamapps/common/Divinity Original Sin 2"
rm -r bin
ln -s DefEd/bin .
rm bin/SupportTool.exe
@lukateras
lukateras / config.seed
Last active April 11, 2019 03:12
OpenWrt .config for Zyxel Keenetic (w/ LuCI)
CONFIG_TARGET_ramips=y
CONFIG_TARGET_ramips_rt305x=y
CONFIG_TARGET_ramips_rt305x_DEVICE_kn=y
CONFIG_CLEAN_IPKG=y
CONFIG_LUCI_SRCDIET=y
# CONFIG_PACKAGE_kmod-ppp is not set
CONFIG_PACKAGE_libiwinfo-lua=y
CONFIG_PACKAGE_liblua=y
CONFIG_PACKAGE_liblucihttp=y
CONFIG_PACKAGE_liblucihttp-lua=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c
index 33c4f53133..c4cf5f12a8 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c
@@ -266,6 +266,7 @@ static void __init rb951g_setup(void)
return;
ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
+ AR934X_ETH_CFG_RXD_DELAY |
AR934X_ETH_CFG_SW_ONLY_MODE);