Skip to content

Instantly share code, notes, and snippets.

View ericek111's full-sized avatar

Erik Bročko ericek111

View GitHub Profile
@ericek111
ericek111 / n1mm_linux.md
Last active April 10, 2026 16:10
Contesting with N1MM on Linux: a tutorial for the adventurous

Contesting with N1MM on Linux

N1MM+ has been the go-to contest logger for many hams and, thanks to its networking features, also clubs. Sadly, it's only for Windows, it's closed-source and the bugs (whether in N1MM or Wine) don't make it any more fun.

Setting up Wine

  1. Install any decently recent flavour of Wine. Usually the one provided by your distro's package manager is fine.
  2. Install winetricks.
  3. Set the required environment variables. To work inside this wineprefix (which is, in short, a self-contained "fake" "Windows" "installation"), you need to specify its path inside every newly opened terminal window.
@ericek111
ericek111 / minesweeper.html
Last active March 30, 2026 22:45
A simple Minesweeper clone -- blatantly ripped off minesweeper.one and refactored by Claude.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Minesweeper</title>
<style>
:root {
--ms-bg: #C0C0C0;
--ms-link: #00C;
--ms-menu-font: Helvetica, sans-serif;
#!/bin/bash
export LC_ALL=C
export POSIXLY_CORRECT=yes
printUsage() {
cat <<-EOF
)" Usage: $(basename "$0") [-h|--help] [FILTER] [COMMAND] [LOG [LOG2 [...]]
COMMAND:
list-tick list all tickers mentioned in the logs
profit final product of all entries (negative for a net loss)
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#define MAX_NUM_BUFFER_LEN 64
struct num_reader
@ericek111
ericek111 / std-string-back-patch.cpp
Created November 3, 2025 08:21
Work around a bug in Shared Flight (X-Plane 12 addon) on Linux that causes a crash by calling .back() on an empty string ("").
// g++ -g -Wall -shared -fPIC -ldl -D_GLIBCXX_USE_CXX11_ABI=0 std-string-back-patch.cpp -o stringbackpatch.so
// then, in Steam: LD_PRELOAD="/path/to/stringbackpatch.so" %command%
#ifndef _GNU_SOURCE
#define _GNU_SOURCE // necessary for RTLD_NEXT in dlfcn.h
#endif
#include <dlfcn.h>
#include <stdio.h>
#include <string>
@ericek111
ericek111 / xoverlay.cpp
Last active September 6, 2025 16:04
X11 overlay
/*
* Copyright (c) 2020 ericek111 <erik.brocko@letemsvetemapplem.eu>.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@ericek111
ericek111 / mpv_lsfg.c
Created August 3, 2025 13:22
Use LSFG in MPV in Linux with the interpolating factor set to the nearest value suitable for the currently used monitor.
// gcc mpv_lsfg.c -o mpv_lsfg -lX11 -lXrandr -lavformat -lavcodec -lavutil -lm
// Change the path to the Lossless.dll library in LSFG_DLL_PATH!
// You can get it by purchasing Lossless Scaling on Steam: https://store.steampowered.com/app/993090/Lossless_Scaling/
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
@ericek111
ericek111 / compton.conf
Created March 22, 2024 09:55
My picom config file
# https://gist.github.com/gaurav712/42549678b778db12fda5764f7c0757ad
backend = "glx";
# backend = "xr_glx_hybrid"; # Better performance on my 6200U ThinkPad T470s.
glx-no-stencil = true;
glx-no-rebind-pixmap = true;
glx-copy-from-front = false;
glx-use-copysubbuffermesa = true;
vsync = false;
@ericek111
ericek111 / tetra_tmux.sh
Created March 3, 2024 11:10
Launch a tmux session for tetra-kit
#!/bin/sh
ROOT=/home/erik/opt/sdrpp-tetra-kit
export DISPLAY=:0
tmux new-session -d -s sdrpptetra -n phy -c "/home/erik/Documents/foss/sdrpp-orig/build" 'bash -i'
# center freq: 424604000.0
tmux send-keys -t '=sdrpptetra:=phy' './sdrpp -r ../root_tetra --autostart' Enter
mkdir "/tmp/tetra"
for i in {0..16}; do
@ericek111
ericek111 / sdr_schedule.sh
Last active February 10, 2024 15:49
Schedule SDR recordings with a simple script.
#!/bin/bash
set -e
# This is made for libmirisdr-5, but could be adapted easily to any IQ-spewing client.
# Depends on csdr (jketterl's fork) for decimation.
if [ -z "$1" ]; then
echo "Usage: $0 (start date and time, e. g. 2024-02-10 00:10:15)"
exit 1
fi