Skip to content

Instantly share code, notes, and snippets.

@Kiwi
Kiwi / net.nix
Created February 18, 2021 13:54 — forked from duairc/net.nix
IP address arithmetic and validation in Nix
{ lib ? null, ... }:
let
net = {
ip = {
# add :: (ip | mac | integer) -> ip -> ip
#
# Examples:
#!/usr/bin/env sh
# Simple script to create a buildVimPlugin drv for NixOs
# JagaJaga 2014
# Usage ./vim2nix.sh repoOwner/repoName (only github is supported)
# Deps: nix-prefetch-scripts
rep="https://github.com/"$1".git"
homepage="https://github.com/"$1
rev=$(git ls-remote "$rep" | head -1 | cut -f1)
name=$(echo "$1" | sed 's/\(.*\)\/\(.*\)/\2/g' | sed 's/vim-\(.*\)/\1/g' | sed 's/\(.*\)\.vim/\1/g')
@Kiwi
Kiwi / arch_keyring_fix.sh
Created August 15, 2021 05:01 — forked from kickhad/arch_keyring_fix.sh
Fix keyring errors.
#!/usr/bin/env bash
# Thanks to G3NSVRV
# https://github.com/yuk7/ArchWSL/issues/91#issuecomment-506806989
sudo rm -R /etc/pacman.d/gnupg/
sudo rm -R /root/.gnupg/
sudo rm -R /var/cache/pacman/pkg/
sudo gpg --refresh-keys
sudo pacman-key --init
sudo pacman-key --populate archlinux
@Kiwi
Kiwi / hex_grid.scad
Created July 5, 2022 15:51 — forked from lorennorman/hex_grid.scad
learning me some openscad by playing with a hexagonal grid
module hexagon(radius)
{
circle(r=radius,$fn=6);
}
module shell(radius)
{
difference()
{
hexagon(radius*1.2); // base
Home/Core TX9XD-98N7V-6WMQ6-BX7FG-H8Q99
Home/Core (Country Specific) PVMJN-6DFY6-9CCP6-7BKTT-D3WVR
Home/Core (Single Language) 7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH
Home/Core N 3KHY7-WNT83-DGQKR-F7HPR-844BM
Professional W269N-WFGWX-YVC9B-4J6C9-T83GX
Professional N MH37W-N47XK-V7XM9-C7227-GCQG9
Professional Enterprise
Professional Workstation
Enterprise NPPR9-FWDCX-D2C8J-H872K-2YT43
Enterprise N DPH2V-TTNVB-4X9Q3-TJR4H-KHJW4