Skip to content

Instantly share code, notes, and snippets.

View zenofile's full-sized avatar

zenofile zenofile

View GitHub Profile
@zenofile
zenofile / firebog.sh
Created September 27, 2020 15:11
Populates a pi-hole group with adlists from firebog
#!/bin/bash
# This idempotent script populates a pi-hole group with adlists
# from firebog (https://v.firebog.net/hosts/lists.php)
#
# By default, 'nocross' is used, unless specified otherwise by the
# first argument (tick, nocross, all).
# The group is created and enabled automatically and each script
# invocation will update this group.
@zenofile
zenofile / make_current_arm64_rpi_kernel_debs.sh
Last active February 3, 2021 14:40 — forked from satmandu/make_current_arm64_rpi_kernel_debs.sh
Make arm64 deb packages for the offical Raspberry Pi Foundation arm64 kernels + NOW INSTALLS headers package too.
#!/bin/bash -x
# make_arm64_rpi_kernel_debs.sh
# Builds arm64 debian packages from the CURRENT rpi firmware repository kernel which is installed by:
# sudo rpi-update
# This runs on an arm64 host with arm64 compilation tools...
# or with some sort of cross-compilation setup.
# Debs are put in $workdir/build
#
# This will NOT work in Raspbian unless you have an arm64 compilation
# environment setup. Appears to work on
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
@zenofile
zenofile / bench.rs
Last active June 22, 2020 09:10
Crude zerofill benchmark
use std::io::Write;
use std::fs::OpenOptions;
use std::time::Instant;
fn allocate_chunk(src: &[u8], size: usize) -> Result<(), std::io::Error> {
let mut file = OpenOptions::new()
.read(false)
.write(true)
.create(true)
.open("/tmp/testfile")?;
@zenofile
zenofile / doom.txt
Created June 18, 2020 09:28 — forked from hjertnes/doom.txt
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
@zenofile
zenofile / gpg-wkd.md
Created May 8, 2020 08:33 — forked from kafene/gpg-wkd.md
Setting up WKD for self-hosted automatic key discovery

I just got this working so I figured I'd share what I found, since there's hardly any information about this anywhere online except an RFC, the GPG mailing list and one tutorial from the GnuPG blog.

You can use automatic key discovery with WKD (Web key directory) to make it easy for users to import your key, in GPG since version 2.1.12. Since this feature is fairly new, it isn't yet available in the current LTS release of Ubuntu (16.04; xenial), however it is available in Debian stable (stretch).

I couldn't add a DNS CERT or DANE / OPENPGPKEY record through my email service (which also hosts my nameservers). I tried making the PKA record - a foo._pka.example.com TXT record but GPG doesn't seem to recognize it and fails; I'm still investigating why.

So the last option for self-hosted auto-discovery was WKD.

First thing I had to do was add an email address to my key. My primary UID is just my name so the key represents my identity rather

@zenofile
zenofile / fritzdump.sh
Created February 6, 2020 11:29
ntopng AVM fritzbox live traffic snooping
#!/bin/bash
# This is the address of the router
FRITZIP=http://fritz.box
# This is the WAN interface
IFACE="2-0"
# Lan Interface
#IFACE="1-lan"
@zenofile
zenofile / myweechat.md
Created December 5, 2019 21:30 — forked from pascalpoitras/1.md
My always up-to-date WeeChat configuration (weechat-dev)

WeeChat Screenshot

You need at least WeeChat 2.7-dev

Enable mouse

/mouse enable

@zenofile
zenofile / self-signed-certificate-with-custom-ca.md
Created November 16, 2019 03:41 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@zenofile
zenofile / ubuntu-tweak.sh
Created May 19, 2019 18:29 — forked from salaros/ubuntu-tweak.sh
My tweaks for Ubuntu + Dell Inspiron 5567
#!/usr/bin/env bash
# Require root to run
if [ "$EUID" -ne 0 ]; then
echo "Please run as root"
exit 0
fi
# [PlayOnLinux] - disables protection against the usage of Ptrace
# https://www.playonlinux.com/en/topic-10534-Regarding_ptrace_scope_fatal_error.html