Posts

Showing posts from June, 2019

Unbrick or Recover Xiaomi Redmi 10A and other MTK devices

Case: Your Redmi 10A (probably other MTK devices too) is not turning on and doesn't react to any button pressed nor cable connection. Requisites:   Dead phone USB Cable  You tried tons of tutorials to unbrick the phone and didn't work This image Willingness to even use Linux to fix it (it's not hard) Steps: Create a bootable USB using the image downloaded. Make sure your computer allows booting from USB. Boot the computer from the bootable USB. When booting, a list of options will be shown. Pick the first one: Boot Live system. Once the system is loaded, go to the right-upper corner to connect to Wi-Fi. Once you have internet, use the Firefox browser (click on the icon in the left-upper corner) and download the Linux version of this tool (SP Flash) and save it in the desktop. Unzip the tool downloaded. Download the fastboot version of the stock ROM . Unzip the ROM, to have the folder and files. Click on 'MTK' icon that is in the desktop. In the command line opene

Notifying When Battery is Full in Linux

Image
Case: I want to be notified by a sounding popup when the battery of my laptop is fully charged. I'm using Debian Linux and Gnome 3 . Requisites: The following applications are installed: sh, upower, paplay, notify-send. Steps: Open a text editor and put this code (adapted from here ): #!/usr/bin/env bash while true do export DISPLAY=:0.0 battery_percent=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -P -o 'percentage: [0-9]+(?=%)' | grep -P -o [0-9]*) if on_ac_power; then echo $on_ac_power if [ "$battery_percent" -gt 92 ]; then paplay /usr/share/sounds/freedesktop/stereo/suspend-error.oga notify-send --urgency CRITICAL "Battery full" "Level: ${battery_percent}% " fi fi sleep 60 # done Save the file with .sh extension in the user's home directory, choice an understandable name, for example: /home/ronald/BatteryCharged.sh