This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# hyperlink.sh | |
# | |
# Generate clickable hyperlinks to files in the terminal using OSC-8 standard ANSI. | |
# | |
# Usage: | |
# hyperlink.sh [-t text] [-r relative_folder] [-s] [--help] file | |
# | |
# Many terminals that support OSC-8 hyperlinks including: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Split a JSON into multiple files. Uses jq. | |
# Usage | |
# ./split_json.sh /path/to/json/file | |
file="$1" | |
jq -cr 'keys[] as $k | "\($k)\t\(.[$k])"' "$file" | awk -F\\t '{ file=$1".json"; print $2 > file; close(file); }' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<canvas id="canvas" width="1400" height="600"></canvas> | |
</body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rmdir '/opt/exagear/lic' | |
rm '/opt/exagear/bin/actool' | |
# non legacy versions | |
printf '\x00\xf0\x20\xe3\x01\x00\xa0\xe3' | dd of='/opt/exagear/bin/ubt_x32a32_al_mem2g' bs=1 seek=866740 count=8 conv=notrunc 2> /dev/null | |
printf '\x00\xf0\x20\xe3\x01\x00\xa0\xe3' | dd of='/opt/exagear/bin/ubt_x32a32_al_mem3g' bs=1 seek=996256 count=8 conv=notrunc 2> /dev/null | |
# legacy version (pi0 armv6) | |
printf '\x01\x00\xa0\xe3\x01\x00\xa0\xe3' | dd of='/opt/exagear/bin/ubt_x32a32_al' bs=1 seek=1071816 count=8 conv=notrunc 2> /dev/null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Submit a "GET" request via POST so we can send | |
# more data than fits in a URL | |
resp = requests.post( | |
url, | |
headers = {'X-HTTP-Method-Override': 'GET'}, | |
data=params) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
MIT License | |
Copyright (c) 2023 David Buchanan | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
merge_commit() { | |
git show --no-patch --format='%P' "$@" | head -1 | grep -q ' ' | |
} | |
commit_meta() { | |
git show --no-patch --format="* %cd %aN <%ae> - %H" --date=local "$@" | \ | |
head -1 | \ | |
sed -E 's/^(\* [a-z0-9 ]{9,10}) \d{2}:\d{2}:\d{2}/\1/i' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
############################################################################## | |
# Wrapper for non-interactive signing of RPMs. | |
# | |
# _NOTE: This uses environment variables for sensitive information (the GPG | |
# passphrase), so should not be used on an untrusted or shared host._ | |
# | |
# Prep | |
# ---- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ "$KSH_VERSION" = 'Version JM 93t+ 2010-03-05' ]; then | |
# The version of ksh93 that ships with many illumos systems does not | |
# support the "local" extension. Print a message rather than fail in | |
# subtle ways later on: | |
echo 'archcheck does not work with this ksh93 version; please try bash!' >&2 | |
exit 1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import dbus | |
import json | |
FIREWALLD_BUS = "org.fedoraproject.FirewallD1" | |
FIREWALLD_RUNTIME_OBJ = "/org/fedoraproject/FirewallD1" | |
FIREWALLD_CONFIG_OBJ = "/org/fedoraproject/FirewallD1/config" |