Skip to content

Instantly share code, notes, and snippets.

View rama982's full-sized avatar
💤
zzzz

Rama Bondan Prakoso rama982

💤
zzzz
  • Indonesia
View GitHub Profile
Devices that have been tested, may require the latest firmware
▪️ Infinix NOTE 30 (X6833B)
▪️ Infinix NOTE 30 Pro (X678B)
▪️ Infinix NOTE 12 2023 (X676C)
▪️ POVA 4 (LG7n)
▪️ POVA 4 Pro (LG8n)
▪️ POVA 5 (LH7n)
@rama982
rama982 / touch_patch.sh
Last active January 13, 2024 17:08
Script to patch the file "transsion_touch.ko" to fix the touchscreen in TWRP. Maybe only applicable for Transsion MT6789 devices. credit: https://github.com/Shivelight
#!/bin/bash
# Set the input file
file="transsion_touch.ko"
# Define patterns for replacement
pattern1='0000004a'
pattern2='patched_get_boot_mode'
# Patching the file
@rama982
rama982 / push.sh
Last active April 11, 2024 23:30 — forked from Yash089610/push.sh
remote: fatal: pack exceeds maximum allowed size
step_commits=$(git log --oneline --reverse refs/heads/android14-6.1-2023-11 | awk 'NR % 500000 == 0')
echo "$step_commits" | while read commit message; do git push -f rama $commit:refs/heads/android14-6.1-2023-11; done
@rama982
rama982 / chg.sh
Last active January 5, 2022 01:06
Infinix Note 10 Pro Charging Monitor
# Charging monitor Infinix Note 10 Pro
# usage: watch bash chg.sh
# get values from kernel
current=$(cat /sys/devices/platform/tran_battery/Pump_Express_ICharger)0
volt=$(cat /sys/devices/platform/tran_battery/Pump_Express_VCharger)
temp=$(cat /sys/class/thermal/thermal_zone20/temp)
# return 0 if not charging
if [ ${#current} -le 4 ]; then curr=$current; else curr=0; fi
#!/bin/bash
# kernel build script (kanged from somewhere i forgot)
# fill the vars yourself
DEFCONFIG=lancelot_defconfig
AK=https://github.com/rama982/AnyKernel3
ZIPNAME="Genom-OSS-lancelot-BETA"
# telegram env
@rama982
rama982 / imgopti.sh
Last active September 9, 2020 14:19
optimize image files with PNGOUT
#/bin/bash
# optimize image files with PNGOUT
# usage: bash imageopti.sh dir 4
# images directory
DIR=$1
# threads
N=$2
for images in $DIR/*
import sys, os, time
from telethon.sync import TelegramClient
from telethon.tl.functions.messages import GetAllChatsRequest
from telethon import errors
import math
def callback(current, total):
curr = convert_size(current)
tot = convert_size(total)
print('Downloaded', curr, 'out of', tot,
#!/usr/bin/env bash
# --slave /usr/bin/$1 $1 /usr/bin/$1-\${version} \\
function register_clang_version {
local version=$1
local priority=$2
update-alternatives \
--install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-${version} ${priority} \
@rama982
rama982 / gdcurl.sh
Last active April 11, 2022 20:56
Script to download large files from google drive using curl
#!/bin/bash
# Script to download large files from google drive using curl
# Source https://stackoverflow.com/a/38937732
# Edited by rama982
# Usage example: bash gdcurl.sh 1WPyPIX07W4diry8ZifQWZlPpDa4UWg2s cookies.txt
# google file ID
ggID=$1
# google url
@rama982
rama982 / hosts_miui.txt
Last active January 17, 2024 13:09
Hosts for blocking MIUI from calling back home
0.0.0.0 10.235.124.13
0.0.0.0 10.99.168.145
0.0.0.0 10.99.184.96
0.0.0.0 a.stat.xiaomi.com
0.0.0.0 abtest.mistat.intl.xiaomi.com
0.0.0.0 abtest.mistat.xiaomi.com
0.0.0.0 account.jetbrains.com
0.0.0.0 account.preview.n.xiaomi.net
0.0.0.0 account.xiaomi.com
0.0.0.0 ad.mi.com