Skip to content

Instantly share code, notes, and snippets.

@timothyham
timothyham / ipv6guide.md
Last active June 29, 2024 23:50
A Short IPv6 Guide for Home IPv4 Admins

A Short IPv6 Guide for Home IPv4 Admins

This guide is for homelab admins who understand IPv4s well but find setting up IPv6 hard or annoying because things work differently. In some ways, managing an IPv6 network can be simpler than IPv4, one just needs to learn some new concepts and discard some old ones.

Let’s begin.

First of all, there are some concepts that one must unlearn from ipv4:

Concept 1

@Chubek
Chubek / POSIX-Shell.ebnf
Last active April 6, 2024 18:48
The POSIX Shell Grammar
# Lexical and Syntactic EBNF Grammar for POSIX Shell (Non-Attributed)
# Authored by Chubak Bidpaa (chubakbidpaa@riseup.net)
# Written For the Marsh Shell (https://github.com/Chubek/Marsh)
# This grammar is based on POSIX specs (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html)
# This document is released under `Unlicense` Public Domain License Agreement | (C) 2024 Chubak Bidpaa | No Warranty
# A: Lexical Grammar for POSIX Shell
@schappim
schappim / just_f-ing_ping.md
Last active February 17, 2024 06:15
Just F-ing Ping - Because sometimes you just want to f-ing ping!

Just F-ing Ping

Because sometimes you just want to f-ing ping!

Modern browsers, believing they are being clever, hide the protocol in the URL bar.

image

However, even if you only select the hostname, when you paste that URL into your terminal, you will encounter the following:

image

@brokenpylons
brokenpylons / dual.ml
Last active January 4, 2023 12:07
Direct implemention of the extended dual regular expressions due to Alexander Okhotin
(* Extended dual regular expressions (Alexander Okhotin: The dual of concatenation).
The dual of constants is their complement.
The dual of the union is the intersection defined as DualUnion (x, y) = (Comp (Union (Comp x) (Comp y))).
The dual of the concatenation is defined analogously as DualConcat (x, y) = (Comp (Concat (Comp x) (Comp y))).
Other dual operations are constructed out of these duals in the customary way.
The duals are essentially just the "upside-down" versions of the operations.
The derivatives of the dual operations are constructed out of the duals in the customary way.
import java.io.InputStream
import java.util.LinkedList
const val EOF_SYMBOL = -1
const val ERROR_STATE = 0
const val SKIP_VALUE = 0
const val EOF_VALUE = -1
const val A_VALUE = 1
const val B_VALUE = 2
import java.io.File
import java.io.InputStream
import java.util.LinkedList
const val EOF_SYMBOL = -1
const val ERROR_STATE = 0
const val SKIP_VALUE = 0
const val NEWLINE = '\n'.code
@adisbladis
adisbladis / podman-shell.nix
Last active May 12, 2024 09:21
Use podman within a nix-shell
{ pkgs ? import <nixpkgs> {} }:
let
# To use this shell.nix on NixOS your user needs to be configured as such:
# users.extraUsers.adisbladis = {
# subUidRanges = [{ startUid = 100000; count = 65536; }];
# subGidRanges = [{ startGid = 100000; count = 65536; }];
# };
@jahkeup
jahkeup / configuration.nix
Created April 21, 2018 22:17
NixOS qcow2 build
{ hostName, pkgs, ... }:
{
imports = [
./hardware.nix
];
networking.hostName = hostName;
time.timeZone = "America/Los_Angeles";
system.copySystemConfiguration = true;
@corpix
corpix / numbers.nix
Last active February 7, 2024 01:42
pow, decimal to hex, hex to decimal in nix language
{ lib }:
with lib; rec {
pow =
let
pow' = base: exponent: value:
# FIXME: It will silently overflow on values > 2**62 :(
# The value will become negative or zero in this case
if exponent == 0
then 1
else if exponent <= 1
@meskarune
meskarune / vimrc
Last active November 3, 2023 07:58
simple functional vim status line - jellybeans theme colors
" status bar colors
au InsertEnter * hi statusline guifg=black guibg=#d7afff ctermfg=black ctermbg=magenta
au InsertLeave * hi statusline guifg=black guibg=#8fbfdc ctermfg=black ctermbg=cyan
hi statusline guifg=black guibg=#8fbfdc ctermfg=black ctermbg=cyan
" Status line
" default: set statusline=%f\ %h%w%m%r\ %=%(%l,%c%V\ %=\ %P%)
" Status Line Custom
let g:currentmode={