Skip to content

Instantly share code, notes, and snippets.

View laur89's full-sized avatar

laur89

  • Spain, Estonia, Gibraltar
View GitHub Profile
#!/bin/sh
# tmux-ls.sh - render active tmux sessions as a box-drawn table sorted by recent activity.
#
# Features
# --------
# * Width-adaptive rendering.
# Width is probed via `tput cols`, falling back to $COLUMNS then 80.
# cols >= 70 -> "full" tier: full status word, mm/dd(wkd) for old dates.
# cols < 70 -> "narrow" tier: session name truncated to 8 chars + a trailing
# "0" marker; status shown as A / D; dates as mm/dd;
"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
name: base
clearenv: true
dieWithParent: true
unsharePid: true
newSession: true
mounts:
/proc: proc
/dev: dev
/tmp: tmpfs
/etc: {bind: {path: /etc, readOnly: true}}

How to Access LUKS-Encrypted Drives on Windows

This guide provides step-by-step instructions on how to install Windows Subsystem for Linux 2 (WSL 2), set up Debian, and mount LUKS-encrypted drives on a Windows system.

Prerequisites

  • A LUKS-encrypted drive that you want to access.
  • Windows 10 (version 2004 and later) or Windows 11 with support for WSL 2.
  • Administrator privileges on your Windows system.
  • Basic knowledge of command-line operations in PowerShell and Linux.
@mariusrugan
mariusrugan / build-image.yaml
Last active March 25, 2026 23:17
Gitea self-hosted runner
# Inspired by:
# https://blog.gitea.com/creating-go-actions/
# https://gitea.com/Zettat123/test-simple-go-action/src/branch/main/.gitea/workflows/call-username.yml
# https://gitea.com/actions/release-action
# https://gitea.com/gitea/runner-images
# https://github.com/vegardit/docker-gitea-act-runner
# https://github.com/catthehacker/docker_images
#
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
@sloonz
sloonz / sandbox.py
Last active May 28, 2026 03:31
Sandboxing wrapper script for bubblewrap ; see https://sloonz.github.io/posts/sandboxing-3/
#!/usr/bin/python
import argparse
import os
import shlex
import sys
import tempfile
import yaml
config = yaml.full_load(open(os.path.expanduser("~/.config/sandbox.yml")))
@sebastiancarlos
sebastiancarlos / toggle_jobs.bash
Last active September 20, 2025 20:59
Toggle between the last two jobs in Bash by pressing "Ctrl-Z Ctrl-Z" (Or toggle between the shell and your single job by pressing "Ctrl-Z")
# All my gist code is licensed under the terms of the MIT license.
# Video demo: https://www.youtube.com/shorts/0zx4uSBUt_k
# Add this somewhere in your ~/.bashrc
# Use bash-preexec.sh (https://github.com/rcaloras/bash-preexec) to:
# - disable the Ctrl-Z keybinding before printing the prompt
# - enable the Ctrl-Z keybinding before executing a command
#
@GhostofGoes
GhostofGoes / pyproject.toml
Last active March 21, 2026 08:00
Example pyproject.toml
# This example pyproject.toml is for a basic pip+setuptools setup.
# If you use a project management tool (like Poetry), then
# those tools will have slightly different configurations or additions.
# I highly recommend using a project management tool for your project.
# Project management is a highly opinionated subject.
# There are a lot of good, robust tools in this space now (as of 2023)
# Two that I've used and recommend are Poetry and PDM.
# Poetry is more mature, PDM is recent, both work well.
# - Poetry: https://python-poetry.org/
@wedesoft
wedesoft / deps.edn
Last active May 23, 2023 08:04
Clojure/Java matrix library comparison core.matrix vs EJML vs vectorz-clj vs fastmath
{:deps {org.clojure/clojure {:mvn/version "1.11.1"}
net.mikera/core.matrix {:mvn/version "0.63.0"}
net.mikera/vectorz-clj {:mvn/version "0.48.0"}
org.ejml/ejml-all {:mvn/version "0.43"}
criterium/criterium {:mvn/version "0.4.6"}
generateme/fastmath {:mvn/version "2.2.2-SNAPSHOT" :exclusions [com.github.haifengl/smile-mkl org.bytedeco/openblas]}}}
@neverkas
neverkas / fzf-advanced.md
Created April 30, 2023 22:45
Command-line fuzzy finder - Advanced examples

Advanced fzf examples

  • Last update: 2023/02/15
  • Requires fzf 0.38.0 or above