Skip to content

Instantly share code, notes, and snippets.

View althafvly's full-sized avatar
😄
If I were a writer, I’d have a better status.

Mohammed Althaf Thayyil althafvly

😄
If I were a writer, I’d have a better status.
View GitHub Profile
@althafvly
althafvly / beryllium_usb2.sh
Created June 9, 2023 15:28
Script to enable USB 2.0 compatibility mode for POCO F1 and other xiaomi phones in fastboot mode
#!/bin/bash
#
# Script to install or uninstall USB 2.0 compatibility mode for Xiaomi devices
#
# Usage: ./script.sh [install|uninstall]
#
# Function to install the USB 2.0 compatibility mode
install_usb_compatibility() {
# Read USB details from lsusb
@althafvly
althafvly / pixeldrain.sh
Created May 8, 2023 19:08
Script to upload to pixeldrain.com and return url
#!/bin/bash
# Check if filename argument was provided
if [ $# -eq 0 ]; then
echo "Usage: $0 <filename>" # Print usage message
exit 1 # Exit with error code
fi
# Upload file to PixelDrain
response=$(curl -s -X PUT https://pixeldrain.com/api/file/ -T "$1" -H 'Content-Type: application/zip')
#!/bin/bash
#############################################################################################################
#Changelog #
#############################################################################################################
#Added prompts for user input to configure script instead of relying on hardcoded settings.
#Added a lot of errorchecking
#The script is now optionally compatible with dash (this is the reason for there being a sed command at the end of every echo -e instance, dash liked to print the -e part when I was testing.)
#Vastly improved compatibility across distributions
#Special thanks to everyone who contributed here: https://gist.github.com/i3v/99f8ef6c757a5b8e9046b8a47f3a9d5b
#Also extra special thanks to BAGELreflex on github for this: https://gist.github.com/BAGELreflex/c04e7a25d64e989cbd9376a9134b8f6d it made a huge difference to this improved version.
@althafvly
althafvly / jksgenerator.sh
Last active February 6, 2023 10:14
eg: bash jksgenerator.sh platform
#!/bin/bash
if [ "$#" -eq "0" ]; then
echo "No arguments supplied"
exit 1
elif [ $# -eq 1 ]; then
if test -f "$1.pk8"; then
checkPass=$(grep "ENCRYPTED" "$1.pem" &>/dev/null)
if [ $? -eq 0 ]; then
openssl pkcs8 -in $1.pk8 -inform DER -outform PEM -out $1.priv.pem
else
@althafvly
althafvly / AdbCommands
Created September 19, 2022 08:16 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
{
"id": null,
"response": [
{
"incremental": "eng.root.20240319.121924",
"api_level": "33",
"url": "https://pixeldrain.com/api/file/tsWtmHwA?download",
"timestamp": 1710850687,
"md5sum": "0b64c33f0e20abc36c7c69e917744be6",
"changes": "",