Sunday, May 10, 2026

Disable USB charging

I bought a laptop recently.  It has not wrong to write home about.  However, its battery is a bit funny.  It keeps draining when it is off from the main.  It turns out this is normal in new laptops.  New laptops have this "useful" feature called Power-off USB charging which allows devices like phones to use the laptops battery as a powerbank.  In order to do this, the laptop is kind of "always on", and slowly drains the battery.

I don't know about others, but I personally dislike this features.  With this feature, if I don't use my laptop for a a day or two, and the laptop is off the main, the battery will become flat. This won't be the case with my old laptop.  Although the battery will still become flat eventually, it will be in a much much slower rate.

Luckily, this feature can be turned off.  Though you may need to do a bit "hunting"/research as I did.  My laptop is an Acer.  Firstly, some geniuses over at Acer decided this feature should be hidden in BIOS.  To reveal the hidden options you need to press the CTRL+S when you are in the bios.  Then, look for a very obvious option called "TBT Wake from S4 Support", and turned it off.  It is so obvious, isn't it.


 

 

 

Last step, launch "Quick Access" as an admin, then disable "Power-off USB charging" from there.

 

 

My laptop battery behaves like it "should be now. 

While we are on the topic of hidden options.  The reason I found the hidden menu was because I reset my laptop BIOS, and then Windows lost my NVMe drive.  It turned out this was because the reset re-eabled the VMD Intel feature. With this enabled, Windows needs a special driver to "see" the drive.  Once I found the option, and turned it back off, my Windows boots as it should be.

  

Saturday, February 28, 2026

Slow RTL8188FTV in Debian/Ubuntu

Since the RTL8188FTV usb WiFi chipset is natively supported by Ubuntu/Debian, I got few for my Ubunut machinies.  The WiFi dongle is indeed detected and works straight away, however it is very slow.

A quick search on Google shows this may be caused by its aggressive power management.  After applying the below to disable its power management feature, its connection/speed is noticeable better.


sudo mkdir -p /etc/modprobe.d/

echo "options rtl8188fu rtw_power_mgnt=0 rtw_enusbss=0" | sudo tee /etc/modprobe.d/rtl8188fu.conf


Friday, February 20, 2026

Useful tools for Windows Laptops

It is my second time that comes across a Windows laptop that only has WiFi.  It is fine if you don't ever need to re-install Windows.  If you do, you may have a problem especially if you are dealing with the Home Edition.  With the Home Edition, you have to have Internet connection to complete the installation.  If you are like me, whose laptop comes with an unsupported WiFi card then you may be stuck at the installation.  Luckily, I have an old WiFi dongle and a USB Gbps NIC that are natively supported by Windows.  They allow me to get pass the "connection" stage and let me successfully re-install Windows.

With laptops that only come with WiFi is becoming a norm, it may be worth to add some natively supported USB WiFi/ NIC to your toolbox in case you are running into a similar situation like mine.

The WiFi dongle I was using is a RTL8188 based dongle.  I believe the RTL8153 based USB Ethernet NIC works too.

Thursday, February 12, 2026

Windows VM notes.

 Despite how much you dislike Windows, especially Windows 11, there are still times which you can't escape from it.  Like many people, I have a virtualbox VM for it, and here are few things I would do to make it "better".

 1) Debloating.  It is not a secret Windows 11 is not lean even with a fresh installed.  Especially if you are unfrotunately having the joy of using its Home edition.  So, the first thing you may want to do is to trim it down.  Win11Debloat may be a good start.

 https://github.com/Raphire/Win11Debloat

 

 

 

 



2) Compact the VDI image. There are times you either just want to keep the VDI file size in control or you want to export the VM as OVA for backup. For both instance, you may want o compact your VDI first. Here are steps I would take.

a) run Windows' Cleaner tool to delete any obsolete/residue files left from Windows updates.

b) run sdelete to "zero" the empty spaces after the deletion in (a)

sdelete c: /z
sdelete is a power toy tool that can be obtained at: https://learn.microsoft.com/en-us/sysinternals/downloads/sdelete

c) run the Windows defrag tool to defragment the drive, so all empty spaces are in continuous blockss.

d) optional. I often run the (b) again, to zero the empty space once more before the compacting.

e) shutdown the VM, and run the below command on the host machine to the VDI file to compact the file.

 vboxmanage modifyhd <your vdi file> --compact 

 If you get the erorr below, try switch to cmd and try again.

  


 

How to get my public IP in Linux with cmd?



There are times when you are on a cmd only set up and you want to know your current public IP. This little command may help you.

curl ifconfig.co

 If you specifically want IPv4 address, you add -4 switch to the command as below.

 curl -4 ifconfig.co

 

Debian 13 Installation notes

Recently, I have started to use Debian instead of Ubuntu for my computers.  There are a lot to like in Ubuntu, the cleaner default install is more favourable for virtual machines.

Here are few notes that I took while I was setting up my Debian.  They are reminders to myself, but they may also be useful to others.

1) Use the Advanced Graphical Install option found under Advanced Options instead.  Most Debian derived distributions disable the root user by default, but Debian does NOT do this with its default option, "Graphical Install".  However, if you use the advanced options, you can choose to disable the root user during the installation time.

 

 

2) Make ext4 more SSD friendly by add mount options: "discard,noatime,nodiratime".  

sudo findmnt --verify --verbose

 Since it is a pain to fix the fstab if a mistake was made.  Use the below to verify your changes!

sudo findmnt --verify --verbose

 

 

3) Reduce swappiness.  By default, Linux can be a bit too aggressive in using your hard drive for virtual memory.  By reducing its aggressiveness can make your system performs better as well as prolonging the life of your hard drive.  This achieves by adding a conf file to /etc/sysctl.d with the content below.  I named mine 99-swappiness.conf.

 vm.swappiness=1

 

 4) Improve system responsiveness during USB drive writing.  It is a bit beyond my capabilities to explain this in details.  If you want to know more, you can try this link, https://forum.manjaro.org/t/the-pernicious-usb-stick-stall-problem/52297 and https://www.reddit.com/r/linux4noobs/comments/1p9h136/copyingmoving_files_to_usb_media_weirdness/

With the default installation, if you are copying a large file to your pen drive, you are likely to end up with a very sluggish if not irresponsive system.  This issue can be mitigated by adding another conf file to /etc/sysctl.d/ with the lines below.  I named mine 99-usb-drive.conf

vm.dirty_ratio = 3
vm.dirty_background_ratio = 3
vm.dirty_expire_centisecs=3000
vm.dirty_writeback_centisecs=1500
vm.min_free_kbytes=59030

 

You can use "sudo sysctl --system" to apply the change without a reboot.

 

Here is what Google AI said about the ratio. 

   

 

4) Add NetBIOS supports.  By default, if you are trying to referencing another machine in your network by its name, you are likely to get an error.  This is because the default set up does not understand NetBIOS.  To make your new install aware other Windows machines in your network better, you need to add the winbind support by:


apt install libnss-winbind winbind

Then, update your /etc/nsswitch to inlcude wins, i.e.



5) Add fonts support to CKJ and Thai characters.

apt install fonts-noto* fonts-thai-tlwg*

6) Add "Open in Terminal" to the context menu.
 sudo apt install caja-open-terminal

 

 

That is it.  I hope you found this useful. 

Sunday, February 2, 2025

OpenWRT and VLAN

I use a NanoPi R2S as my back up router.  Another day, I was setting it up from scratch.  I set up VLANs on it as I did before, however, I couldn't get an IP from any of the newly created VLAN networks.  I have checked the VLAN set up over and over again, and compare it with setups found in YouTube videos.  Everything seems in order.  Then, I check my switch, and again everything seems right too.  I was puzzling for a few days.









Few days later, I looked at the settings again, still couldn't see anything wrong.  Then it dawned on me to check the firewall settings, and the problem was indeed an firewall issue.  I may be wrong, but I think the own default was

input -> accept
output -> accept
forward -> reject

where as the new default is 

input -> reject
output -> accept
forward -> reject

As I highlighted, the culprit for my problem is the change to the input default setting.

INPUT governs traffic originating from devices in the zone that has its final destination on the router. Examples for this would be DHCP requests or DNS lookups

With input set to reject, computers on the network cannot talk to the router, i.e. getting access to the DHCP etc.  Hence, my computer appeared as having problem to join the network.




Simply change the input to accept, the problem fixes.