Calculate ETA of swapoff


while true; do
start=$(free | grep Swap | awk '{print $2}')
sleep 1
end=$(free | grep Swap | awk '{print $2}')
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."

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>


And if you are not able to unlock System UI using your password, just execute this command over adb:

rm /data/system/locksettings.db*

This will take down the lockscreen settings.

Welcome to the yet another IT blog!

Previous version of this blog was created few years ago, a lot of things changed from that time, and because of that, and because I moved to new server recently, I decided to reactivate it.

This blog will be my notepad. I think it’s a good place to put some notes about IT (mostly Linux and programming) stuff I am currently dealing with, so you will find here some explanations how thing works, bunch of useful links and command line snippets etc.