Skip to content

Instantly share code, notes, and snippets.

View tytydraco's full-sized avatar
🦆
Quack!

Tyler Nijmeh tytydraco

🦆
Quack!
View GitHub Profile
@tytydraco
tytydraco / sched_hz_calc.py
Last active May 24, 2019 19:31
Find the ideal HZ rate for the assumed data.
import math
import decimal
### BEGIN USER TUNABLS ###
tolerance = 14 # max ms for scheduling
tasks = 8 # avg tasks occurring at any instance
cores = 8 # cores allowed to contain tasks
hz_min = 1 # min hz allowed
hz_max = 2000 # max hz allowed
inc = 1 # hz increment
@tytydraco
tytydraco / interp.py
Created May 7, 2019 00:30
Cubic + Linear Interpolation + Extrapolation for QCOM Energy Model Porting
#!/usr/bin/python
# Tyler Nijmeh <tylernij@gmail.com>
from scipy import interpolate
# P.S.: The default target values are from sdm660
# P.S.: The default source values are from sdm632
# Target frequencies
target_cluster0_freqs = [633600, 902400, 1113600, 1401600, 1536000, 1747200, 1843200]
@tytydraco
tytydraco / covid.py
Created April 15, 2020 23:47
Cubic Spline of current data from WHO
import urllib.request, json
import matplotlib.pyplot as plt
import numpy
from scipy.interpolate import *
with urllib.request.urlopen("https://pomber.github.io/covid19/timeseries.json") as url:
data = json.loads(url.read().decode())
date = []
@tytydraco
tytydraco / defconfig_differ.py
Created June 21, 2020 17:41
Script do get all changes that differ from the original base defconfig, ideally to apply the changes to another device config in the future.
import re, sys
if len(sys.argv) != 3:
print(f"""Usage: {sys.argv[0]} <base_defconfig> <custom_defconfig>
For best results, use savedefconfig generated configs.""")
exit(1)
cfg_base = sys.argv[1]
cfg_custom = sys.argv[2]
@tytydraco
tytydraco / charch_install.sh
Last active September 17, 2020 04:02
Setup ChArch for Linux machines in /usr/bin/.
#!/bin/bash
# Written by Draco (tytydraco) @ GitHub
# Check for root permissions
if [[ `id -u` -ne 0 ]]
then
echo "[!] No root permissions. Exiting."
exit 1
fi
@tytydraco
tytydraco / charch_wrapper.sh
Last active July 16, 2020 23:02
A wrapper for easy portable ChArch usage.
# Written by Draco (tytydraco) @ GitHub
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# ChArch local bin path
BINPATH="$SCRIPTPATH/bin"
# Options to pass to ChArch commands
CHARCH_OPTS="-d $SCRIPTPATH"
@tytydraco
tytydraco / fakeroot-tcp.sh
Created July 24, 2020 23:41
Setup fakeroot-tcp without SystemV IPC support.
#!/bin/bash
cd /tmp
wget http://ftp.debian.org/debian/pool/main/f/fakeroot/fakeroot_1.24.orig.tar.gz
tar xvf fakeroot_1.24.orig.tar.gz
cd fakeroot-1.24/
./bootstrap
./configure --prefix=/opt/fakeroot \
--libdir=/opt/fakeroot/libs \
--disable-static \
@tytydraco
tytydraco / cmdpatch.sh
Created August 6, 2020 04:19
An Android Linux Kernel command line patch tool using Magisk's magiskboot binary.
#!/system/bin/sh
# Written by Draco (tytydraco @ GitHub)
set -e
MAGISKBOOT="/data/adb/magisk/magiskboot"
err() {
echo -e "\e[91m[!] $@\e[39m"
exit 1
@tytydraco
tytydraco / list.txt
Last active May 5, 2022 03:34
URLs for TubeSlave
Music | https://music.youtube.com/playlist?list=PLteo-8G34juksaL5jodAym7o46QBtTSiy
Creepypastas (2018) | https://www.youtube.com/playlist?list=PL376vJF9hLjiy1c4k_FxbOB8KmVb2n8n2
Creepypastas (2017) | https://www.youtube.com/playlist?list=PL376vJF9hLjhcrPjDIii4OVnTzQ1KSJYA
Creepypastas (2016) | https://www.youtube.com/playlist?list=PL376vJF9hLjgpYBHyKFuIP6QBCWBwlnG7
Creepypastas (2015) | https://www.youtube.com/playlist?list=PL376vJF9hLjiUAxsxe3MoNCVnORuMBXOn
Creepypastas (2014) | https://www.youtube.com/playlist?list=PL376vJF9hLjirE-Hj-oCqy2jWZsncR4Gz
Creepypastas | https://youtube.com/c/CreepsMcPasta
H3 Podcast | https://www.youtube.com/channel/UCLtREJY21xRfCuEKvdki1Kw
Forehead Fables | https://www.youtube.com/playlist?list=PL0AyYv4PjzJ6vGxDjrfzSbWTj3Vgjd4mh
Game Grumps Compilations | https://www.youtube.com/channel/UCNEBRUhjGcQB6fYzBfDaq0w
@tytydraco
tytydraco / cleaner.sh
Last active June 4, 2021 23:52
Clear data and cache of disabled pacakges
#!/usr/bin/env bash
disabled_pks="$(pm list packages -d | sed 's/package://')"
for pkg in $disabled_pks
do
echo "----- $pkg -----"
pm uninstall "$pkg" &> /dev/null
echo "- UNINSTALLED UPDATES"
pm disable-user "$pkg" &> /dev/null
echo "- DISABLED AGAIN"