Skip to content

Instantly share code, notes, and snippets.

@Ridhookas
Ridhookas / index.html
Last active May 26, 2023 03:59
Ridhokurs
<body>
<canvas id="canvas" width="1400" height="600"></canvas>
</body>
@d3nd3
d3nd3 / patch.sh
Created April 15, 2023 18:07
Exagear License for pi-legacy
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
@mihow
mihow / send_get_as_post.py
Created March 14, 2023 01:16
Send a GET request as a POST to overcome 414 Request-URI Too Large
# 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)
@DavidBuchanan314
DavidBuchanan314 / widevine_fixup.py
Last active September 13, 2024 21:45
Patch aarch64 widevine blobs from ChromeOS to work on non-ChromeOS linux, including platforms with 16K page size like Apple Silicon / Asahi Linux
"""
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
@BH1SCW
BH1SCW / git-rpm-changelog.sh
Created February 24, 2023 12:41 — forked from jflemer-ndp/git-rpm-changelog.sh
generate a rpm spec compatible changelog from git history
#!/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'
@BH1SCW
BH1SCW / rpmgpgsign.sh
Created February 24, 2023 12:36 — forked from jflemer-ndp/rpmgpgsign.sh
Wrapper for non-interactive signing of RPMs
#!/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
# ----
@tropicbliss
tropicbliss / archcheck.sh
Last active April 3, 2024 18:02
Checks your linux architecture. Code taken from rustup installation script, and emits an arch code that corresponds to what rustc expects. Useful for checing cross compilation arch.
#!/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
@evindunn
evindunn / get_firewalld_state.py
Last active December 20, 2023 19:41
Poll Firewalld State as JSON
#!/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"
@pmarreck
pmarreck / wh_darktide_quote.bash
Created January 29, 2023 21:19
Bash function to generate a random Warhammer Darktide loading screen quote
warhammer_quote() {
local whquotes
whquotes=(
"A coward's only reward is to live in fear another day"
"A dagger in the dark is worth a thousand swords at dawn"
"A pity it is that we can die but once in the Emperor's service"
"A small mind is a tidy mind"
"A suspicious mind is a healthy mind"
"A swift execution is worth a hundred interrogations"
"Abhor the mutant"
@panzi
panzi / rekey.py
Last active August 9, 2024 13:12
Re-key all the embedded vaults in an Ansible vars file.
#!/usr/bin/env python3
# derived from https://stackoverflow.com/a/67161907/277767
# Changes to the StackOverflow version:
# * delete temporary files that contain vaults!
# * prompt for passwords instead of passing them as program argument
# * more precise vault replacement
# * a bit nicer error messages that points at the line where re-keying failed
# * decryption if no password is provided