Skip to content

Instantly share code, notes, and snippets.

View dezren39's full-sized avatar
🕵️‍♂️
Processing..

Drewry Pope dezren39

🕵️‍♂️
Processing..
View GitHub Profile

Nixpkgs Pivots

We have a number of problems that currently require full rebuilds of nixpkgs:

  • glibc needs to find third-party nss modules
  • cacerts needs to contain custom CA's from enterprises
  • tzdata just changed frequently
  • locales

Interestingly, Nix's deep pinning of cacerts and tzdata gets in the way of Nix's promise of packages working over the long term in an archival sense:

@alane019
alane019 / clear-watch-later-playlist.js
Last active January 18, 2025 21:42
Delete remove all videos from Youtube "Watch Later" playlist (working as of 12/14/2020)
// This script can be used to clear all videos from youtube's built-in "watch later" playlist which has a limit of 5,000 videos.
// Without this, you would need to click the remove button on each video in the list.
// Youtube made changes recently that caused errors for a previously working script.
// Script written by: janthedeveloper (https://github.com/JanTheDeveloper)
// Bookmark wrapper added by: shelldonhull (https://github.com/sheldonhull)
// Full conversation here: https://gist.github.com/astamicu/eb351ce10451f1a51b71a1287d36880f#file-readme-md
// 1. Save the javascript text below as a bookmark in google chrome(Simply replace the URL field in any existing bookmark, and give the bookmark any name)
@WeebDataHoarder
WeebDataHoarder / Z_dpdk_fm10k.example.conf
Last active September 12, 2022 01:42
Sets up DPDK + Silicom FM10K patches and Open vSwitch withd DPDK support, with inline Switch Managers that supports, between others, Silicom PE3100G2DQiRM-QX4 cards.
# Tell how many PF ports are bound in DPDK.
# Driver will check the number when initializes.
dpdk.bind.pf.number int 4
# Set external port speed, 40 means 40G, 100 means 100G.
extern.port.speed int 40
/* So how does this work?
I'm using ANSI escape sequences to control the behavior of the terminal while
cat is outputting the text. I deliberately place these control sequences inside
comments so the C++ compiler doesn't try to treat them as code.*/
//
/*The commands in the fake code comment move the cursor to the left edge and
clear out the line, allowing the fake code to take the place of the real code.
And this explanation uses similar commands to wipe itself out too. */
//
#include <cstdio>
@graninas
graninas / What_killed_Haskell_could_kill_Rust.md
Last active April 18, 2025 23:05
What killed Haskell, could kill Rust, too

At the beginning of 2030, I found this essay in my archives. From what I know today, I think it was very insightful at the moment of writing. And I feel it should be published because it can teach us, Rust developers, how to prevent that sad story from happening again.


What killed Haskell, could kill Rust, too

What killed Haskell, could kill Rust, too. Why would I even mention Haskell in this context? Well, Haskell and Rust are deeply related. Not because Rust is Haskell without HKTs. (Some of you know what that means, and the rest of you will wonder for a very long time). Much of the style of Rust is similar in many ways to the style of Haskell. In some sense Rust is a reincarnation of Haskell, with a little bit of C-ish like syntax, a very small amount.

Is Haskell dead?

@mbillow
mbillow / consul-firewalld.md
Last active September 12, 2024 14:20
Consul FirewallD Service Definition

Consul FirewallD Service Definition

A simple service definition for Consul agents; meant to simplify the installation process of Consul.

This is based on the information provided by Hashicorp in the Consul Docs.

Installation

  1. Download the XML file:
  • Either wget {raw_url} consul.xml
@dezren39
dezren39 / 01-directory-structure.md
Created July 20, 2020 16:37 — forked from tracker1/01-directory-structure.md
Anatomy of a JavaScript/Node project.

Directory structure for JavaScript/Node Projects

While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.

Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.

Directories

  • lib/ is intended for code that can run as-is
  • src/ is intended for code that needs to be manipulated before it can be used
@jonico
jonico / dynamic-runner-selection.yaml
Last active July 8, 2024 13:30
Dynamic selection of GitHub Runners - as GitHub Action matrix builds currently do not allow dynamic values
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
@djfdyuruiry
djfdyuruiry / README.md
Last active October 8, 2024 04:54
WSL 2 - Enabling systemd

Enable systemd in WSL 2

NOTE: If you have Windows 11 there is now an official way to do this in WSL 2, use it if possible - see MS post here (WINDOWS 11 ONLY)

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh:

@kmcquade
kmcquade / brick-aws.sh
Last active September 26, 2023 22:52
One-liner to brick AWS accounts from the Master Payer
aws organizations attach-policy \
--policy-id $(aws organizations create-policy --name pwn \
--type SERVICE_CONTROL_POLICY \
--description "pwn"
--content '{"Version": "2012-10-17","Statement": [{"Effect": "Deny", "Action": "*", "Resource": "*"}]}' \
| jq ".Policy.PolicySummary.Id"\
) \
--target-id $(aws organizations list-roots | jq ".Roots | .[0].Id")