Skip to content

Instantly share code, notes, and snippets.

View benley's full-sized avatar
🐈

Benjamin Staffin benley

🐈
View GitHub Profile
@s1341
s1341 / freeipa-server.nix
Created May 29, 2023 04:08
working freeipa config
{
config,
lib,
...
}: let
cfg = config.services.freeipa-server;
in {
options.services.freeipa-server = {
enable = lib.mkEnableOption "freeipa service";
router = lib.mkOption {
@plembo
plembo / upnper4dont.md
Last active August 29, 2024 16:11
UPnP with EdgeRouter: Don't do it! Ubiquiti. ER-4.

Want to configure UPnP on EdgeRouter-4?

Don't do it!

Introduction

As a former sysadmin that once helped ride herd over around 1,000 servers, of which around 10% were Internet-facing, I've never been a fan of autoconfiguation when it comes to punching holes through the firewall. I've seen the tripwire logs, and it's sobering.

The Problem

So enabling UPnP on my EdgeRouter-4 wasn't something I had on the roadmap, but when I ran into difficulty getting DLNA to work on the default VLAN, I thought it was worth looking into (never mind that, as I later learned, having UPnP turned on wasn't going make a bit of difference on my local network: another reason that mastering theory should always come before practice).

@rummik
rummik / curl-gnutls-3.patch
Created March 15, 2020 23:00
Immersed VR NixOS package
--- a/lib/libcurl.vers.in 2020-03-12 05:33:59.367082951 +0000
+++ b/lib/libcurl.vers.in 2020-03-12 05:33:59.368082948 +0000
@@ -11,3 +11,8 @@
global: curl_*;
local: *;
};
+CURL_@CURL_LT_SHLIB_VERSIONED_FLAVOUR@3
+{
+ global: curl_*;
+ local: *;
@mokoshalb
mokoshalb / Office_kms
Created July 4, 2019 05:36 — forked from CHEF-KOCH/KMS_office.cmd
KMS server Windows
cd\Program Files\Microsoft Office\Office16
cd\Program Files (x86)\Microsoft Office\Office16
cscript OSPP.VBS /sethst:kms.digiboy.ir
cscript OSPP.VBS /actcscript OSPP.VBS /dstatus
slmgr.vbs /ckms
@MatrixFrog
MatrixFrog / google-lgbt-issues.md
Last active May 1, 2020 01:16
anti-LGBT actions by Google and YouTube: A brief and probably incomplete history

I assembled this list from memory, and tried to fill in the details by skimming some the news articles I could find about each event. I'm sure there are things missing from this list, and facts I've gotten wrong, so please send corrections. You can DM me on Twitter or add comments on this gist. Eventually I'd like to expand this to include key quotes from Google leadership, and indications of how incidents were or weren't resolved, and maybe make it fancy and infographic-y like this one.

2008

Proposition 8, which ultimately took away the right to marry, from same-sex couples, is on the ballot in California. Despite the fact that Google officially opposed it, the "yes" campaign got special attention and assistance from the Google ads team. _I couldn't find much news coverage or official reporting on

@smoser
smoser / README.md
Last active November 4, 2024 18:19
qemu to linux mapping of smbios / dmi information

Mappings for DMI/SMBIOS to Linux and dmidecode

Information can be put into dmi tables via some qemu-system hosts (x86_64 and aarch64). That information is exposed in Linux under /sys/class/dmi/id and can be read with dmidecode. The names are very annoyingly inconsistent. The point of this doc is to map them.

Mappings

Example qemu cmdline:

qemu-system-x86_64 -smbios type=<type>,field=value[,...]

qemu-system-x86_64 -smbios type=0,vendor=superco,version=1.2.3
@ekimekim
ekimekim / jsonnet_lazy_proxy.py
Last active March 13, 2019 23:54
A very hacky way of creating a python object which lazily looks up keys of a jsonnet object as needed, without re-evaluating the entire jsonnet each time.
import collections
import json
import threading
from Queue import Queue
import _jsonnet as jsonnet
class LazyExecutor(threading.Thread):

gif-from-tweet

There are so many great GIFs out there and I want to have copies of them. Twitter makes that harder than it should be by converting them to MP4 and not providing access to the source material. To make it easier, I made a bash pipeline that takes a tweet URL and a filename, extracts the MP4 from that tweet and uses ffmpeg to convert back to GIF.

Dependencies

  • ffmpeg
    • macOS: brew install ffmpeg
    • Ubuntu/Debian: apt install ffmpeg
@edolstra
edolstra / nix-lang.md
Last active October 30, 2024 00:36
Nix language changes

This document contains some ideas for additions to the Nix language.

Motivation

The Nix package manager, Nixpkgs and NixOS currently have several problems:

  • Poor discoverability of package options. Package functions have function arguments like enableFoo, but there is no way for the Nix UI to discover them, let alone to provide programmatic ways to