Calculate ETA of swapoff

#!/bin/bash COUNTER=0 SUM=0 while true; do start=$(free | grep Swap | awk ‘{print $2}’) sleep 1 end=$(free | grep Swap | awk ‘{print $2}’) SUM=$((SUM+start-end)) COUNTER=$((COUNTER+1)) AVG_SPEED=$((SUM/COUNTER)) ETA=$((end/AVG_SPEED)) echo “Current speed: $((start-end))/kbps || Freed total: $SUM || Left: $end || Averate speed: $AVG_SPEED/kbps || ETA: $(($ETA / 3600))h $(($ETA / 60))m $(($ETA % 60))s.” done

Recovering OnePlus3, when you are not able to decrypt the device from TWRP or CM13 complains, that the password is wrong

To make TWRP work again, you need to change the encryption password using following commands: supolicy –live ‘allow vdc devpts chr_file {read write getattr ioctl}’ vdc cryptfs changepw password (the UI you want) <CURRENT_PIN(PASSWORD/PATTERN)> <NEW_PASSWORD> Verify your password using vdc cryptfs verifypw <NEW_PASSWORD> Source: And if you are not able to unlock System UI using […]