Skip to content

Instantly share code, notes, and snippets.

Avatar
🐢
slow day

Karim Vergnes Thesola10

🐢
slow day
View GitHub Profile
@Thesola10
Thesola10 / nixos-spawn.sh
Last active May 1, 2022
Build and spin up a NixOS configuration.nix as a systemd-nspawn container on non-NixOS systems.
View nixos-spawn.sh
#!/bin/sh
# nixos-spawn (c) Karim Vergnes <me@thesola.io>
# This script launches systemd-nspawn in an empty root, with an overlay of the
# host's Nix Store. This takes advantage of the NixOS stage 2 init's ability to
# populate an empty system automatically.
# By default, no changes are persisted anywhere -- use an additional bind mount
# to add permanent storage.
if [[ $UID != 0 ]]
then
@Thesola10
Thesola10 / reboot.sh
Last active Mar 22, 2022
Reboot to an arbitrary UEFI entry
View reboot.sh
#!/bin/bash
# Reboot-EFI (c) Karim Vergnes <me@thesola.io>
# Wrapper to reboot to a set UEFI entry
# Requires efibootmgr and fzy
rebootcmd="shutdown -r now"
trap _exit KILL INT TERM
_exit() {
@Thesola10
Thesola10 / bwrap-nix.sh
Last active May 11, 2022
It's Nix in a Box!
View bwrap-nix.sh
#!/bin/sh
# bwrap-nix (c) Karim Vergnes <me@thesola.io>
# It's Nix in a Box! (useful for an unprivileged Nix environment)
if [[ $# < 2 ]]
then
>&2 echo "usage: $0 <nix directory> <command> [args]..."
exit 1
fi
@Thesola10
Thesola10 / francais.h
Last active Nov 12, 2021
Vous aussi, programmez en fran-C !
View francais.h
#define vide void
#define si if
#define sinon else
#define retourner return
#define pour for
#define tantque while
#define faire do
#define booleen bool
#define entier int
#define caractere char
@Thesola10
Thesola10 / lib.mk
Created May 30, 2021
Useful resources for pretty makefiles.
View lib.mk
GREEN := $(shell tput setaf 2 2>/dev/null)
YELLOW := $(shell tput setaf 3 2>/dev/null)
BOLD := $(shell tput bold 2>/dev/null)
RESET := $(shell tput sgr0 2>/dev/null)
define rich_echo
printf "${BOLD}$(1)${RESET}\t$(2)\n"
endef
@Thesola10
Thesola10 / mk302.py
Created May 18, 2021
Generate a static redirect page. Can be useful on IPFS for link shortening for instance.
View mk302.py
#!/usr/bin/env python3
# mk302 by Karim Vergnes <me@thesola.io>
# License: CC0 1.0 Universal
# Requires Jinja2
'''<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="REFRESH" content="0;url={{ href }}"" />
<script>window.location.href="{{ href }}"</script>
@Thesola10
Thesola10 / duckduckgo.user.css
Last active May 28, 2022
Replaces the default DuckDuckGo icon with Virtual Youtuber Oozora Subaru from Hololive.
View duckduckgo.user.css
/* ==UserStyle==
@name DuckDuckGo Oozora Subaru Edition
@namespace thesola10
@version 1.0.0
@license MIT
@updateURL https://gist.githubusercontent.com/Thesola10/a7cbfd9cc7c7b8a697a0c08472d06b98/raw/duckduckgo.user.css
@author thesola10
==/UserStyle== */
@-moz-document domain("duckduckgo.com") {
@Thesola10
Thesola10 / pixbat.py
Last active Jan 26, 2022
Wrapper around bat and pixcat to display images in the bat command
View pixbat.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This script is designed to be installed in ~/.local/bin/bat or equivalent
from os import execvp
import sys
import subprocess
if __name__ == "__main__":
try:
@Thesola10
Thesola10 / chasm.patch
Last active Apr 3, 2021
Patch to build a Flatpak from Escaped Chasm game folder
View chasm.patch
diff --color -ruN Escaped_Chasm/io.itch.tuyoki.EscapedChasm.yaml Escaped_Chasm_New/io.itch.tuyoki.EscapedChasm.yaml
--- Escaped_Chasm/io.itch.tuyoki.EscapedChasm.yaml 1970-01-01 01:00:00.000000000 +0100
+++ Escaped_Chasm_New/io.itch.tuyoki.EscapedChasm.yaml 2020-08-07 18:58:58.059750271 +0200
@@ -0,0 +1,47 @@
+app-id: "io.itch.tuyoki.EscapedChasm"
+runtime: org.freedesktop.Platform
+runtime-version: '19.08'
+sdk: org.freedesktop.Sdk
+command: "/app/bin/EscapedChasm"
+
@Thesola10
Thesola10 / dweller.patch
Last active Oct 9, 2021
Patch to build a Flatpak from Dweller's Empty Path game folder
View dweller.patch
diff --color -ruN "Dwellers Empty Path/io.itch.tuyoki.DwellersEmptyPath.yaml" DwellerNew/io.itch.tuyoki.DwellersEmptyPath.yaml
--- "Dwellers Empty Path/io.itch.tuyoki.DwellersEmptyPath.yaml" 1970-01-01 01:00:00.000000000 +0100
+++ DwellerNew/io.itch.tuyoki.DwellersEmptyPath.yaml 2020-08-08 21:08:21.619488035 +0200
@@ -0,0 +1,47 @@
+app-id: "io.itch.tuyoki.DwellersEmptyPath"
+runtime: org.freedesktop.Platform
+runtime-version: '19.08'
+sdk: org.freedesktop.Sdk
+command: "/app/bin/Dweller"
+