Skip to content

Instantly share code, notes, and snippets.

@thesamesam
thesamesam / xz-backdoor.md
Last active September 17, 2024 08:32
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Background

On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that

@plmercereau
plmercereau / raspberry-pi-zero-2.nix
Last active January 10, 2024 13:46
Nix module to create SD images for Rasperry Pi Zero 2 W
{ config, lib, pkgs, ... }:
{
imports = [
<nixpkgs/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix>
./sd-image.nix
];
system.stateVersion = "23.11";
# Pi Zero 2 struggles to work without swap
sdImage.swap.enable = true;
@Ladicle
Ladicle / README.org
Last active July 24, 2024 05:14
Emacs Configuration ver. 2022

Ladicle’s Emacs Configuration ver.2022

https://user-images.githubusercontent.com/1159133/156761456-4be104ae-4cb3-420e-81c7-8abd00497d51.png

Outline

Package Management (link)

  • leaf-keywords
    • el-get
    • hydra
  • package-utils
@udf
udf / write_up.md
Last active September 10, 2024 12:07
A Trick To Use mkMerge at The Top Level of a NixOS module

The Setup

I wanted to write a module that generates multiple systemd services and timers to scrub some zfs pools at certain intervals. The default scrub config does not support individual scrub intervals for each pool.

I want the config to look like this:

{
  services.zfs-auto-scrub = {
 tank = "Sat *-*-* 00:00:00";
@robertodr
robertodr / configuration.nix
Created September 13, 2021 13:37
Caddy on NixOS
{ config, pkgs, options, ... }:
let
baseConfig = {
allowUnfree = true;
};
unstable = import <nixos-unstable> { config = baseConfig; };
in
{
imports = [
@inscapist
inscapist / flake-direnv.md
Last active August 9, 2024 17:24
Nix Flakes and Direnv on Mac OSX (Catalina)

Development environment with Nix Flakes and Direnv

This document is targeted at those who seek to build reproducible dev environment across machines, OS, and time.

It maybe easier for remote teams to work together and not spending hours each person setting up asdf/pyenv/rbenv, LSP servers, linters, runtime/libs. Nix is probably the closest thing to Docker in terms of development environment.

Flake is used here because it provides hermetic build, with absolutely no reliance on system environment (be it Arch/Catalina/Mojave). Also it freezes dependencies in flake.lock so builds are reproducible.

This gist provides the setup to develop Java/Clojure/Python applications on Nix. But it can be easily adapted to ruby, nodejs, haskell.

@zajdee
zajdee / Digital-Green-Certificate-Dump.py
Last active November 5, 2021 19:15
A simple tool to dump the European Union's COVID passports (Digital Green Certificates)
#!/usr/bin/env python3
# install dependencies:
# pip install base45 cbor2 (cwt - not used here)
import sys
import zlib
from base45 import b45decode
from cbor2 import loads
@tobert
tobert / otel-cli-ideas.sh
Last active August 18, 2022 11:58
span & event ideas for otel-cli
#!/bin/bash
# otel-cli-ideas.sh - some ideas I'm playing with for otel-cli to cover some
# use cases where manual spans or exec don't quite do the trick
#
# another cool outcome is you could run this without the collector in some
# cases without spamming your OTLP endpoint...
#
# I hope to OSS otel-cli under Apache 2 in early April 2021.
# maybe it could background itself and wait for events on a unix socket?
@lithdew
lithdew / benchmark.zig
Last active February 6, 2021 17:03
zig: open-addressing robinhood hashmap w/ backward shift deletion
// zig run benchmark.zig -lc -O ReleaseFast
const std = @import("std");
usingnamespace @import("hashmap.zig");
pub fn main() !void {
const allocator = std.heap.c_allocator;
var map = try HashMap(
@f41gh7
f41gh7 / victoria_metrics_push_gw.py
Created January 17, 2021 02:08
VictoriaMetrics as push gateway.
from prometheus_client import Counter, start_http_server
from threading import Thread
import requests as re
import time
JOB_NAME = 'test'
INSTANCE = 'localhost'
def scrape_and_send(local_url: str, vm_url: str, scrape_interval: int):