Skip to content

Instantly share code, notes, and snippets.

View fuzzy's full-sized avatar

Mike 'Fuzzy' Partin fuzzy

View GitHub Profile
@fuzzy
fuzzy / xcompiler.py
Created March 28, 2025 22:18
Crawl Gentoo mirror for .*CONTENTS.gz files and extract all the unique architecture quads, then use crossdev to build a full suite of cross compilers.
#!/usr/bin/env python3
import os
import re
import sys
import copy
import gzip
import urllib.request as request
from html.parser import HTMLParser
from urllib.parse import urlparse, urljoin
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/stat.h>
#include <dirent.h>
#include <time.h>
#include <sys/types.h>
#include <sys/wait.h>
#!/bin/sh
comp=${COMPRESSOR:-$(which gzip 2>/dev/null)}
flags=""
case "${1}" in
(compress) shift ;;
(decompress) op="d"; flags="-d"; shift ;;
(*) echo "Usage: ${0} (compress|decompress) [-vjJzZc] <...>" ; exit 1 ;;
esac
@fuzzy
fuzzy / kbpw.sh
Last active January 8, 2021 15:42
Keybase secret management tool
#!/bin/sh
KBPW_IS_USER=0
KBPW_TEAMNAME=
KBPW_NAMESPACE="kbpw"
test -z "$(which jq 2>/dev/null)" && (
printf "\033[1;31mERROR\033[0m: This scripts depends on jq being installed."
exit 1
)
allow.chflags; # allow setuid inside the jail
allow.mount; # allow mounting filesystems
allow.mount.devfs;
allow.mount.fdescfs;
allow.mount.fusefs;
allow.mount.nullfs;
allow.mount.procfs;
allow.mount.linprocfs;
allow.mount.linsysfs;
allow.mount.tmpfs;
@fuzzy
fuzzy / box.sh
Created May 28, 2020 06:23
drawing text boxes with Sh and printf
#!/bin/sh -e
clr="\033[0m"
pad=" "
spad=" "
setbg() {
echo "\033[1;${1};${2}m"
}

Keybase proof

I hereby claim:

  • I am fuzzy on github.
  • I am fuzzyoni (https://keybase.io/fuzzyoni) on keybase.
  • I have a public key ASDbCi6Ql9dCX55peTJPnWDtROfp28awlehEcP25o2tsnQo

To claim this, I am signing this object:

@fuzzy
fuzzy / vstatd.v
Last active August 1, 2019 06:22
// Copyright (c) 2019 Mike 'Fuzzy' Partin
// Usage of this source code is governed by the 3 clause BSD License
// that can be found in the LICENSE.md file
module main
// link in the libc for network sockets. This is only temporary until the vlib bugs get ironed out
import os
// Copyright (c) 2019 Mike 'Fuzzy' Partin
// Copyright (c) 2019 Neal Zerby
// Usage of this source code is governed by the 3 clause BSD License
// that can be found in the LICENSE.md file
module main
import sync
import time
#!/usr/bin/env python2
import sys
class Line(object):
average = 0
minimum = 0
maximum = 0
host = None