Monday, August 18, 2025

Extending battery life in Linux

Extending battery life in Linux:

So, you want to extend your laptop battery life as much as possible.
One way is to avoid 100% charging of the battery.

We can easily configure this in Linux(my default OS) using tlp.

In case of RedHat distributions(Fedora, CentOS, RHEL):
sudo dnf install tlp tlp-rdw

Install tlp package:  (for Debian/Ubuntu distributions)
sudo apt install tlp tlp-rdw)

Enable and start it:
sudo systemctl enable tlp --now


Edit the config:
sudo vi /etc/tlp.conf

Find and set these values (ensure it is uncommented):
START_CHARGE_THRESH_BAT0=75
STOP_CHARGE_THRESH_BAT0=80

(This means charging will stop at 80%, and only resume if it drops below 75%.)

Restart tlp
sudo systemctl restart tlp

Verify the new values:
sudo tlp-stat -b
(This should display updated values).

Now, you can check how the discharge/recharge changes in your laptop battery.

Use Settings -> Power and enable % value for battery to check the values.

Thursday, August 14, 2025

Microsoft Gen AI course for beginners

https://microsoft.github.io/generative-ai-for-beginners/#/

https://github.com/microsoft/generative-ai-for-beginners/tree/main?tab=readme-ov-file#%EF%B8%8F-lessons