Skip to content

Instantly share code, notes, and snippets.

View con-f-use's full-sized avatar
💭
😱

con-f-use

💭
😱
  • A University, An IT Firm
  • Europe
View GitHub Profile
@con-f-use
con-f-use / alternate.nix
Last active September 10, 2026 22:30
basic shell app
# Build with:
# nix-build -E 'with import <nixpkgs> {}; pkgs.callPackage ./this-file.nix {}'
# Run with:
# result/bin/bunnytest
{ writeShellApplication, fetchurl, sox }:
let
sound = fetchurl {
url = "https://samplelib.com/mp3/sample-3s.mp3";
hash = "sha256-AkRZDytLy2I1K1dOeL6pQOjYnPppgjtSCO9MQ+Cry0Q=";
@con-f-use
con-f-use / parti.sh
Last active September 11, 2026 22:43
#!/usr/bin/env bash
prt:all() {
prt:part "$@"
prt:lvm
prt:fs
prt:mnt
}
prt:part() {
@con-f-use
con-f-use / misc_nix_links.md
Last active September 26, 2025 21:43
Random Nix Links
@con-f-use
con-f-use / ssh_principals.nix
Created December 27, 2023 22:23
SSH Principals nix module
{ config, lib, ... }:
{
options.users.users = lib.mkOption {
type = lib.types.attrsOf (
lib.types.submodule (
{ name, config, ... }: {
options.openssh.authorizedPrincipals = lib.mkOption {
type = lib.types.listOf lib.types.str;
example = ''[ "admins", "developers", "it-personnel" ]'';
description = lib.mdDoc ''
@con-f-use
con-f-use / auth_handler.patch
Last active April 26, 2022 13:58
If remote server runs sshd with OpenSSH<=7.7 paramiko does the wrong thing when connecting with a CA-signed ssh key (...-cert.pub). This patch fixes that.
--- a/paramiko/auth_handler.py 2022-04-26 15:37:37.433185610 +0200
+++ b/paramiko/auth_handler.py 2022-04-26 15:37:25.083111811 +0200
@@ -22,6 +22,7 @@
import weakref
import time
+import re
from paramiko.common import (
cMSG_SERVICE_REQUEST,
@con-f-use
con-f-use / dynamic_rest_client.py
Last active November 25, 2022 14:30
dynamic rest client concept (abuse python's getattr and getitem)
import urllib.parse
class Endpoint:
def __init__(self, uri, api):
self.m4ngl3 = dict(uri=uri, api=api) # prevent name collisions (with actual members called "uri" or "api", endpoints of these names couldn't be used - we can probably live without ones named "m4ngl3")
def __getitem__(self, name):
api, uri = self.m4ngl3["api"], self.m4ngl3["uri"]
key = api.canonize(uri, name)
return api._resources.setdefault(key, Endpoint(key, api))
@con-f-use
con-f-use / walldap.md
Last active September 25, 2021 13:13

LDAP behind the WALL

Let's preface this by saying, that I'm indeed a very, very evil man, and the following does not correspond in any way shape or form to a real setup in the acutal realm of living breathing things. Nor should it. Ever.

The Premise

@con-f-use
con-f-use / mcomix3.nix
Last active November 25, 2020 18:43
mcomix3 nix package (WIP)
{ stdenv
, fetchFromGitHub
, python3
, python3Packages
, wrapGAppsHook
, gobject-introspection
, gtk3
, gdk-pixbuf
# Recommended Dependencies:
, unrar
@con-f-use
con-f-use / nodrllama.cow
Created May 8, 2020 14:58
Nodrama-Llama
## Nodrama-Llama
$the_cow = <<EOC;
$thoughts
$thoughts
(\\/)
(_o |
/ |
\\ \\______
\\ )o
/|----- |
@con-f-use
con-f-use / jcgb.sh
Last active March 11, 2021 16:07
Some bash functions I like to use
#!/usr/bin/env bash
getbool() {
local in="${1:-no}"
if [[ "${in^^}" =~ ^(1|Y(ES)?|ON|T(RUE)?|ENABLE(ED)?)$ ]]; then
return 0
fi
return 1
}