Skip to content

Instantly share code, notes, and snippets.

View DaniAsh551's full-sized avatar
🏠
Working from home

Dani DaniAsh551

🏠
Working from home
View GitHub Profile
@DaniAsh551
DaniAsh551 / build-n-sign.sh
Created May 18, 2022 05:19
Generate a signed apk from decompiled smali sources (with a tool like apktool)
#!/bin/sh
BUILD_TOOLS=$HOME/Android/Sdk/build-tools/32.1.0-rc1
PATH="$PATH:$BUILD_TOOLS"
KEY="$PWD/key.jks"
if [ ! -f $KEY ]; then
echo "No keystore found in Working Directory. Creating a new one. Please fill the prompts, or cancel and copy your keystore file to $KEY."
keytool -genkey -v -keystore key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias apk
fi
@DaniAsh551
DaniAsh551 / activity_gov.py
Last active March 9, 2025 12:07
Automatic governor switching in linux userspace based on mouse and keyboard activity.
#!/usr/bin/env python3
import asyncio
import glob
import os
from time import time
import signal
# Configuration parameters, read from environment variables with defaults.
IDLE_THRESHOLD = int(os.environ.get("IDLE_THRESHOLD", "30")) # Time in seconds before considering the system idle.
ACTIVE_GOVERNOR = os.environ.get("ACTIVE_GOVERNOR", "performance") # CPU governor to use when active.