Skip to content

Instantly share code, notes, and snippets.

@freitzzz
freitzzz / adb-uninstall-apps
Created February 22, 2025 18:22
adb-uninstall-apps
#!/usr/bin/env bash
# Ensure ADB is connected
echo "Checking ADB connection..."
adb devices | grep "device$" > /dev/null
if [ $? -ne 0 ]; then
echo "No device found. Ensure USB debugging is enabled and try again."
exit 1
fi
@freitzzz
freitzzz / move-forks
Created February 20, 2025 08:56
Move personal forks to org
#!/usr/bin/env bash
# Set your GitHub username and token
GITHUB_USER="freitzzz"
GITHUB_TOKEN=""
ORG="fforks"
# Get a list of all forked repositories
forks=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/users/$GITHUB_USER/repos?per_page=100" | jq -r '.[] | select(.fork) | .name')
@freitzzz
freitzzz / commands.md
Created December 10, 2024 08:02
Linux commands

systemd

Print time taken to init systemd

systemd-analyse

List time taken to init each service

from krita import *
import random
application = Krita.instance()
currentDoc = application.activeDocument()
currentDocWidth = currentDoc.width()
currentDocHeight = currentDoc.height()
# gets layers that are not nested
adb root
adb remount
adb reboot
adb root
adb remount
@freitzzz
freitzzz / list-gradle-dependencies-java-version.sh
Last active February 15, 2024 11:31
(Gradle) List all dependencies Java version
tmpd=$(mktemp -d); (cd $tmpd; (find ~/.gradle/caches/transforms-3/ -name "*.jar" -print0 | xargs -0 -I F cp F .); (for i in *.jar; do unzip "$i" -d "${i%%.jar}"; done); (find . -name "*.class" -print0 | xargs -0 file > ~/Desktop/classes.txt); cd -; rm -rf $tmpd)
https://5c65286fc6ace.streamlock.net/cancaonova/CancaoNova/playlist.m3u8
#!/usr/bin/env python3
import sys
import json
formatted = list(map(lambda x: x.replace('"', '\"'), sys.stdin.read().splitlines()))
print(json.dumps(formatted, indent=2))
@freitzzz
freitzzz / clear_pass_configure.bash
Last active August 18, 2023 14:57
(debian/ubuntu) One click Clear Pass configuration script
#!/usr/bin/env bash
# This is an one-click install script to configure ClearPass OnGuard. This script is intended to be run on Debian / Ubuntu based systems.
banner="
__
____/ /__ ___ _____ ___ ___ ____ ___
/ __/ / -_) _ `/ __/ / _ \/ _ `(_-<(_-<
\__/_/\__/\_,_/_/ / .__/\_,_/___/___/
/_/
@freitzzz
freitzzz / scrcpy_install.bash
Created August 15, 2023 15:25
(debian/ubuntu) One click Scrcpy Install script
#!/usr/bin/env bash
# This is an one-click install script using the instructions listed on the official scrcpy repo: https://github.com/Genymobile/scrcpy/blob/master/doc/linux.md
# This script is intended to be run on Debian / Ubuntu based systems.
banner="
____________ __________ __
/ __/ ___/ _ \/ ___/ _ \ \/ /
_\ \/ /__/ , _/ /__/ ___/\ /
/___/\___/_/|_|\___/_/ /_/