Skip to content

Instantly share code, notes, and snippets.

View bulletmark's full-sized avatar

Mark Blakeney bulletmark

  • Brisbane Australia
View GitHub Profile
@bulletmark
bulletmark / patch-gnome-shell-finger-count.py
Last active October 29, 2024 23:26
Patch gnome-shell to change GESTURE_FINGER_COUNT
#!/usr/bin/env python3
# Since GNOME 47, 4-finger gestures are mapped to the same standard
# GNOME gestures as 3-finger gestures. See
# https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3275.
#
# This script patches gnome-shell to disable 3-finger gestures and only
# enable 4-finger gestures for standard GNOME, so you can assign
# 3-finger gestures to your own custom actions (e.g. using
# libinput-gestures). Simply run this as sudo/root then log out and back
# in, or restart. You will have to run it again if gnome-shell is
@bulletmark
bulletmark / p03
Last active December 6, 2023 22:10
#!/usr/bin/env python3
import math
from dataclasses import dataclass
import fileinput
@dataclass
class NUMBER:
value: int
length: int
coords: tuple[int, int]
@bulletmark
bulletmark / PKGBUILD
Last active August 16, 2023 22:44
Arch Linux patch for mutter 44.3-1 to revert commit 3ac82a58 to fix issue https://gitlab.gnome.org/GNOME/mutter/-/issues/2690
# Maintainer: Jan Alexander Steffens (heftig) <[email protected]>
# Contributor: Ionut Biru <[email protected]>
# Contributor: Michael Kanis <mkanis_at_gmx_dot_de>
# Contributor: Mark Blakeney <mark dot blakeney at bullet dash systems dot net>
pkgbase=mutter
pkgname=(
mutter
)
pkgver=44.3+r0+g99d83f298
@bulletmark
bulletmark / archclean.sh
Created February 26, 2023 23:18
Arch Linux script to clean system
PROGARGS="$*"
JTIME="2weeks"
# First AUR helper found in this list will be used
AURHELPERS="yay paru trizen pacaur"
usage() {
echo "Usage: $(basename $PROG) [options]"
echo "Clean system and user package caches and prune journal."
echo "Options:"
@bulletmark
bulletmark / day04.py
Created December 5, 2021 01:47
AOC 2021 Day 4
#!/usr/bin/python3
import numpy as np
DATA = 'data/day04'
def total(board):
return np.sum(board[board > 0])
def main():
boards = []
@bulletmark
bulletmark / PKGBUILD
Last active February 25, 2022 02:58
borg-standalone-arm-bin
Maintainer: mark.blakeney at bullet-systems dot net
pkgname=borg-standalone-arm-bin
pkgver=1.2.0
pkgrel=1
pkgdesc="Borg backup - prebuilt standalone ARM binary"
url="https://borgbackup.readthedocs.io/en/stable/installation.html#standalone-binary"
license=("BSD")
arch=("armv8h" "armv7h" "armv6h" "armv5h")
replaces=("borg-arm-bin")
provides=("borg" "borgbackup")
@bulletmark
bulletmark / PKGBUILD
Last active August 21, 2022 05:20
borg-standalone-bin
# Maintainer: mark.blakeney at bullet-systems dot net
pkgname=borg-standalone-bin
pkgver=1.2.2
pkgrel=1
pkgdesc="Borg backup - prebuilt standalone binary"
url="https://borgbackup.readthedocs.io/en/stable/installation.html#standalone-binary"
license=("BSD")
arch=("x86_64" "i686")
replaces=("borg-bin")
provides=("borg" "borgbackup")
@bulletmark
bulletmark / wifi-switcher
Last active June 11, 2024 10:16
Small program to switch wifi off/on when wired connection goes on/off
#!/usr/bin/env python3
# If you are using Linux NetworkManager then this program toggles your
# wifi radio on whenever all your wired connections are not connected,
# or turns the wifi radio off when any wired connection is connected.
# Simply copy this to /etc/NetworkManager/dispatcher.d/99-wifi and
# ensure it is executable
# (i.e. `sudo chmod 755 /etc/NetworkManager/dispatcher.d/99-wifi`).
# No other configuration is required. Get the latest version from
# https://gist.github.com/bulletmark/8e051a0a9ffdce689d86988c528e7764
# Author: Mark Blakeney, Jun 2020.
@bulletmark
bulletmark / sumbench
Created July 4, 2018 07:53
Program to benchmark set of checksum commands
#!/usr/bin/python3
'Program to benchmark set of checksum commands.'
# Author: M.Blakeney, Jul 2018.
import os, argparse, time, tempfile, subprocess, statistics
import collections, platform
# Default set of commands to execute
CMDS = 'md5sum,sha1sum,sha256sum'
@bulletmark
bulletmark / sumbench.sh
Created July 4, 2018 07:39
Script to run given first argument command across given machines
!/bin/bash
# Run given first argument command across given machines
# M.Blakeney, Jul 2018.
script=$1
shift
hosts=$*
bscript=$(basename $script)
for h in $hosts; do
rsync -a $script $h:/tmp/