Skip to content

Instantly share code, notes, and snippets.

View frebib's full-sized avatar

Joe Groocock frebib

View GitHub Profile

Keybase proof

I hereby claim:

  • I am frebib on github.
  • I am frebib (https://keybase.io/frebib) on keybase.
  • I have a public key ASBqORK6I2rqEB6ZwEPaJpqjtb7ohGIWLtFmVGiQ4QqCpgo

To claim this, I am signing this object:

@frebib
frebib / systemd-in-docker.yml
Last active June 11, 2017 11:58
An example of running systemd in docker, using archlinux. This example has no reliance on --privileged
version: "3.1"
services:
systemd-test:
image: finalduty/archlinux
restart: always
entrypoint: /lib/systemd/systemd
environment:
- container=docker
tmpfs:
@frebib
frebib / hibereboot
Last active March 11, 2024 06:10
hibereboot: A 'hibernate & reboot' one-shot hack script for systemd-based hosts
#!/bin/sh
set -e
# hibereboot: A 'hibernate & reboot' one-shot hack script for systemd-based hosts
#
# Place this script somewhere in your $PATH and run it (as root) to hibernate and reboot.
# For full automation, allow the script to be run with passwordless-sudo:
#
# > /etc/sudoers
# yourusername ALL=(ALL) SETENV:NOPASSWD: /path/to/hibereboot
@frebib
frebib / todo.sh
Created January 30, 2018 22:38
Generate a markdown TODO list from project source files.
#!/bin/sh
set -e
# This script requires ripgrep and sed.
# Save as .git/hooks/pre-commit for automatic TODO list updates when committing to git.
echo "Updating TODO list"
rg \
--heading \
@frebib
frebib / ppwd.sh
Last active July 3, 2018 19:33
Pretty-pwd, from the fish shell, in POSIX sh
#!/bin/sh
set -e -o pipefail
# This sed expression is POSIX compliant and provides 99.9% the same functionality as the previous revision
# The only caveat is with paths that contain % (percent) characters. This can be changed for # or something else if desired
pwd | sed -E 's|^'$HOME'|~|;s|(.*)/|\1%|;s|((^\|/)\.?[^/%]{1})[^/%]*|\1|g;s|(.*)%|\1/|'
@frebib
frebib / rofi-emoji.sh
Last active April 12, 2018 02:21 — forked from NearHuscarl/rofi-emoji.sh
Rofi emoji picker
#!/usr/bin/env bash
# Source: https://gist.github.com/Tadly/0741821d3694deaec1ee454a95c591fa
#
# Use rofi to pick emoji because that's what this
# century is about apparently...
#
# Requirements:
# rofi, xclip, xdotool, curl, xmllint
#
# Usage:
@frebib
frebib / dpi
Last active November 20, 2018 15:56
#!/bin/sh
set -e
# Based on https://github.com/vincentbernat/awesome-configuration/blob/master/bin/xsettingsd-setup
dpi=$1
if [ -z "$1" ]; then
>&2 printf "Usage\n\t%s: <dpi>" "$(basename "$0")"
exit 1
#!/bin/sh
set -e
NOTIFY_APPNAME="$(basename "$0")"
NOTIFY_ICONPATH="/usr/share/icons/Xenlism-Wildfire/Apps/screenshot.svg"
SCROT_CMD="maim -m 10 -us %"
FILENAME="$(date '+%s%N' | sha256sum | head -c7).png"
DIRECTORY="$HOME/pictures/screenshots"
#!/bin/sh
set -e
dir=${1:-"${HOME}/git/"}
since=${2:-"yesterday.midnight"}
author=${3:-"$(git config user.email)"}
repos=$(find "$dir" -mindepth 1 -maxdepth 1 -type d)
for project in ${repos}; do
frebib@frebib-Cf ~> mtr google.com -rwz
Start: 2019-07-06T23:40:35+0100
HOST: frebib-Cf Loss% Snt Last Avg Best Wrst StDev
1. AS13037 2a02:8010:64b4:3:: 0.0% 10 2.2 5.7 1.8 35.1 10.3
2. AS13037 lo-0.cor1.lond2.ptn.zen.net.uk 0.0% 10 6.3 11.4 5.8 29.9 8.1
3. AS??? ??? 100.0 10 0.0 0.0 0.0 0.0 0.0
4. AS13037 ae-3.agg1.lond1.ptn.zen.net.uk 0.0% 10 9.1 9.8 5.5 27.9 6.6
5. AS15169 2001:4860:1:1:0:32ed:0:1 0.0% 10 18.5 8.9 4.7 18.9 5.5
6. AS15169 2001:4860:0:1101::1 0.0% 10 5.8 7.0 5.8 11.3 1.7
7. AS15169 2001:4860:0:1::2f81 0.0% 10 5.7 6.6 5.4 11.0 2.0