Skip to content

Instantly share code, notes, and snippets.

View dragid10's full-sized avatar

Alex Oladele dragid10

View GitHub Profile
@dragid10
dragid10 / gist:fb81b30eabcfa7777d35e058b6d519a9
Created December 17, 2023 17:20
Garmin Developer set 12-hr time
On my watch the 12/24 hour setting is in
Settings->System->Time->Time-Format
You can use it for example like this:
var time = Gregorian.info(Time.now(), Time.FORMAT_SHORT);
var deviceSettings = System.getDeviceSettings();
var is24Hour = deviceSettings.is24Hour;
var hour = is24Hour ? time.hour : 1 + (time.hour + 11) % 12;
@dragid10
dragid10 / fix-libfprint.py
Last active March 31, 2024 05:01
Clear Fingerprints (Framework)
# Import PyGObject
# PyGObject is a Python package which provides bindings for GObject based libraries such as GTK, GStreamer, WebKitGTK, GLib, GIO and many more.
from gi import require_version
# for arguments
from sys import argv
from os import geteuid
if geteuid() != 0:
exit("You need to have root privileges to run this script.\nPlease try again, this time using 'sudo'. Exiting.")
@dragid10
dragid10 / zfs-destroy-snapshots.py
Created September 27, 2022 14:35 — forked from onlime/zfs-destroy-snapshots.py
Helper script to remove old ZFS snapshots
#!/usr/bin/env python3
"""
Helper script to remove old ZFS snapshots
Copyright (c) Onlime GmbH, https://www.onlime.ch
"""
import argparse
from re import compile
from datetime import datetime, timedelta
from subprocess import check_output
import sys
@dragid10
dragid10 / ansible.cfg
Created August 25, 2022 19:55
default ansible config
[defaults]
# (boolean) By default Ansible will issue a warning when received from a task action (module or action plugin)
# These warnings can be silenced by adjusting this setting to False.
;action_warnings=True
# (list) Accept list of cowsay templates that are 'safe' to use, set to empty list if you want to enable all installed templates.
;cowsay_enabled_stencils=bud-frogs, bunny, cheese, daemon, default, dragon, elephant-in-snake, elephant, eyes, hellokitty, kitty, luke-koala, meow, milk, moofasa, moose, ren, sheep, small, stegosaurus, stimpy, supermilker, three-eyes, turkey, turtle, tux, udder, vader-koala, vader, www
# (string) Specify a custom cowsay path or swap in your cowsay implementation of choice
;cowpath=
#!/bin/sh
for path; do
sed -i 's/\bapple\b/banana/g' "$path"
sed -i 's/\bmaster\b/primary/g' "$path"
sed -i 's/\bslave\b/worker/g' "$path"
sed -i 's/\bblacklist\b/blocklist/g' "$path"
sed -i 's/\bblack list\b/blocklist/g' "$path"
sed -i 's/\bwhite list\b/allowlist/g' "$path"
sed -i 's/\bblack hat hacker\b/attacker/g' "$path"
sed -i 's/\bblack-hat hacker\b/attacker/g' "$path"
@dragid10
dragid10 / install-toolbox.sh
Created July 21, 2022 00:13 — forked from greeflas/install-toolbox.sh
JetBrains Toolbox installation script for Ubuntu - https://www.jetbrains.com/toolbox/app/
#!/bin/bash
set -e
if [ -d ~/.local/share/JetBrains/Toolbox ]; then
echo "JetBrains Toolbox is already installed!"
exit 0
fi
echo "Start installation..."
def get_project_root() -> Path:
"""Returns project root folder."""
return Path(__file__).parent.parent
nc -vz <IP> <PORT> -w 4