Friday, December 5, 2025

Pyhton: playwright to get audio url stream

There are many tool to find url audio stream from radio station's page, here are a few list:

  1. playwright
  2. Selenium
  3. Puppeteer

To use Wget to find url audo on statik and simple web  

$ wget --spider -r -l 5 -nv -w 1 --no-clobber -A .mp3,.m3u8 "https://www.example.com/audio/stations" 2>&1 | grep -E '\.(mp3|m3u8)$' | awk '{print $3}' | sort -u > out_audio_urls.txt

Install playwright on debian with virtual environment:

myuser@mypc:~$ mkdir spider_playwright
myuser@mypc:~$ cd spider_playwright/
myuser@mypc:~/spider_playwright$ python3 -m venv venv
myuser@mypc:~/spider_playwright$ source venv/bin/activate
(venv) myuser@mypc:~/spider_playwright$ pip install playwright
Collecting playwright
  Downloading playwright-1.56.0-py3-none-manylinux1_x86_64.whl.metadata (3.5 kB)
Collecting pyee<14,>=13 (from playwright)
  Downloading pyee-13.0.0-py3-none-any.whl.metadata (2.9 kB)
Collecting greenlet<4.0.0,>=3.1.1 (from playwright)
  Using cached greenlet-3.2.4-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.metadata (4.1 kB)
Collecting typing-extensions (from pyee<14,>=13->playwright)
  Using cached typing_extensions-4.15.0-py3-none-any.whl.metadata (3.3 kB)
Downloading playwright-1.56.0-py3-none-manylinux1_x86_64.whl (46.3 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.3/46.3 MB 2.5 MB/s eta 0:00:00
Using cached greenlet-3.2.4-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (610 kB)
Downloading pyee-13.0.0-py3-none-any.whl (15 kB)
Using cached typing_extensions-4.15.0-py3-none-any.whl (44 kB)
Installing collected packages: typing-extensions, greenlet, pyee, playwright
Successfully installed greenlet-3.2.4 playwright-1.56.0 pyee-13.0.0 typing-extensions-4.15.0
(venv) myuser@mypc:~/spider_playwright$ playwright install
Downloading Chromium 141.0.7390.37 (playwright build v1194) from https://cdn.playwright.dev/dbazure/download/playwright/builds/chromium/1194/chromium-linux.zip
173.9 MiB [====================] 100% 0.0s
Chromium 141.0.7390.37 (playwright build v1194) downloaded to /home/myuser/.cache/ms-playwright/chromium-1194
Downloading Chromium Headless Shell 141.0.7390.37 (playwright build v1194) from https://cdn.playwright.dev/dbazure/download/playwright/builds/chromium/1194/chromium-headless-shell-linux.zip
104.3 MiB [====================] 100% 0.0s
Chromium Headless Shell 141.0.7390.37 (playwright build v1194) downloaded to /home/myuser/.cache/ms-playwright/chromium_headless_shell-1194
Downloading Firefox 142.0.1 (playwright build v1495) from https://cdn.playwright.dev/dbazure/download/playwright/builds/firefox/1495/firefox-debian-13.zip
96.7 MiB [====================] 100% 0.0s
Firefox 142.0.1 (playwright build v1495) downloaded to /home/myuser/.cache/ms-playwright/firefox-1495
Downloading Webkit 26.0 (playwright build v2215) from https://cdn.playwright.dev/dbazure/download/playwright/builds/webkit/2215/webkit-debian-13.zip
88.1 MiB [====================] 100% 0.0s
Webkit 26.0 (playwright build v2215) downloaded to /home/myuser/.cache/ms-playwright/webkit-2215
Downloading FFMPEG playwright build v1011 from https://cdn.playwright.dev/dbazure/download/playwright/builds/ffmpeg/1011/ffmpeg-linux.zip
2.3 MiB [====================] 100% 0.0s
FFMPEG playwright build v1011 downloaded to /home/myuser/.cache/ms-playwright/ffmpeg-1011

create file myspider.py and customize to your requirements, make it executable

(venv) myuser@mypc:~/spider_playwright$ chmod u+x myspider.py 

source code myspider.py modify it to meet your requirements 

import asyncio
from playwright.async_api import async_playwright

# generated and adjust by chatgpt.com

AUDIO_HINTS = [
    ".mp3", ".aac", ".m3u8", ".ogg", ".opus", ".wav",
    "stream", "/proxy/", "/live", "radio"
]

async def scan_audio_stream(url: str, listen_seconds: int = 15):
    async with async_playwright() as p:
        browser = await p.chromium.launch(headless=False)
        page = await browser.new_page()

        # ----- Detect manual browser close -----
        browser_disconnected = asyncio.Event()

        def on_browser_disconnect():
            print("\n[BROWSER CLOSED] Exiting application.")
            browser_disconnected.set()

        browser.on("disconnected", on_browser_disconnect)
        # ---------------------------------------

        found = set()

        async def on_response(res):
            u = res.url.lower()
            ct = res.headers.get("content-type", "").lower()

            if "audio" in ct or any(k in u for k in AUDIO_HINTS):
                if u not in found:
                    print(f"[NEW AUDIO STREAM] {u}")
                    found.add(u)

        page.on("response", on_response)

        print("Opening page...")
        await page.goto(url, wait_until="domcontentloaded")
        await asyncio.sleep(2)

        # ---- Find audio player iframe ----
        candidate_frames = [
            f for f in page.frames
            if any(kw in f.url.lower() for kw in ["player", "radio", "embed"])
        ]
        if not candidate_frames:
            candidate_frames = page.frames  # fallback

        print("Attempting to click play...")
        for f in candidate_frames:
            try:
                for sel in ["button[aria-label='Play']", "button.play", ".jp-play", "button"]:
                    btn = await f.query_selector(sel)
                    if btn:
                        print(f"Clicked play in iframe → {f.url}")
                        await btn.click()
                        break
            except:
                pass

        print(f"\nListening for audio streams up to {listen_seconds} seconds...\n")

        # ----- Wait for 15 seconds OR browser close -----
        try:
            await asyncio.wait_for(browser_disconnected.wait(), timeout=listen_seconds)
        except asyncio.TimeoutError:
            print("\n[TIMEOUT] Done scanning.")
        # -------------------------------------------------

        await browser.close()
        return list(found)


if __name__ == "__main__":
    results = asyncio.run(scan_audio_stream(
        "https://www.example.com", # CHANGE HERE
        listen_seconds=15     # ← Fast scan
    ))

    print("\n===== ALL STREAMS FOUND =====")
    for s in results:
        print(s)

Enjoy

Thursday, December 4, 2025

Android java: improving application screen form factor

In AndroidManifest.xml we can define screen form factor to used.

These are the options

  1. "unspecified" : The default value. The system chooses the orientation. The policy it uses, and therefore the choices made in specific contexts, might differ from device to device.
  2. "behind" : The same orientation as the activity that's immediately beneath it in the activity stack.
  3. "landscape" : Landscape orientation (the display is wider than it is tall).
  4. "portrait" : Portrait orientation (the display is taller than it is wide).
  5. "reverseLandscape" : Landscape orientation in the opposite direction from normal landscape. Added in API level 9.
  6. "reversePortrait" : Portrait orientation in the opposite direction from normal portrait. Added in API level 9.
  7. "sensorLandscape" : Landscape orientation, but can be either normal or reverse landscape based on the device sensor. The sensor is used even if the user has locked sensor-based rotation. Added in API level 9.
  8. "sensorPortrait" : Portrait orientation, but can be either normal or reverse portrait based on the device sensor. The sensor is used even if the user has locked sensor-based rotation. However, depending on the device configuration, upside-down rotation might not be allowed. Added in API level 9.
  9. "userLandscape" : Landscape orientation, but can be either normal or reverse landscape based on the device sensor and the user's preference. Added in API level 18.
  10. "userPortrait" : Portrait orientation, but can be either normal or reverse portrait based on the device sensor and the user's preference. However, depending on the device configuration, upside-down rotation might not be allowed. Added in API level 18.
  11. "sensor" : The device orientation sensor determines the orientation. The orientation of the display depends on how the user is holding the device. It changes when the user rotates the device. Some devices, though, don't rotate to all four possible orientations, by default. To use all four orientations, use "fullSensor". The sensor is used even if the user locked sensor-based rotation.
  12. "fullSensor" : The device orientation sensor determines the orientation for any of the four orientations. This is similar to "sensor", except this allows for any of the four possible screen orientations regardless of what the device normally supports. For example, some devices don't normally use reverse portrait or reverse landscape, but this enables those orientations. Added in API level 9.
  13. "nosensor" : The orientation is determined without reference to a physical orientation sensor. The sensor is ignored, so the display doesn't rotate based on how the user moves the device.
  14. "user" : The user's current preferred orientation.
  15. "fullUser" : If the user has locked sensor-based rotation, this behaves the same as user, otherwise it behaves the same as fullSensor and allows any of the four possible screen orientations. Added in API level 18.
  16. "locked" : Locks the orientation to its current rotation, whatever that is. Added in API level 18. 

Warning: To improve the layout of apps on form factors with smallest width >= 600dp, the system ignores the following values of this attribute for apps that target Android 16 (API level 36):

  1.     portrait
  2.     landscape
  3.     reversePortrait
  4.     reverseLandscape
  5.     sensorPortrait
  6.     sensorLandscape
  7.     userPortrait
  8.     userLandscape 

To create variant for table,  Goto main activity, on your main activity dropdown select "create table qualifier", it will create copy of main activity that require to modify to match tablet out. the layout is on layout -> main_activity -> main_activity.xml (sw600dp).

In case you want to lock phone to use portrait, delete main_activity.xml (land), you need to remove android:screenOrientation from AndroidManifest.xml. To make it consistent, this is sample of code in java for your main activity

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // 1. Enable edge-to-edge for Java Activities
        // You need to import androidx.activity.EdgeToEdge;
        EdgeToEdge.enable(this);
        super.onCreate(savedInstanceState);
        // Fragment
        // layout portrait or lanscape?
        // portrait my_fragment_container
        // langsacpe fragment_config_container, fragment_main_container
        setContentView(R.layout.activity_m); // general, let system choose between portrait and landscape
        // Check if landscape (two-pane) layout is active
        View config = findViewById(R.id.fragment_config_container);
        View main = findViewById(R.id.fragment_main_container);
        isTwoPane = (config != null && main != null); // already checked not null
        // Conditional Orientation Lock
        if (!isTwoPane) {
            // If single-pane (phone), force portrait before fragment transactions
            setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        }
        if (isTwoPane) {
            // dual-pane
            setFragment(R.id.fragment_config_container, new FragmentConfig());
            setFragment(R.id.fragment_main_container, new FragmentMain());
        } else {
            // single-pane
            // all phone must use this activity_m.xml (land)
            setFragment(R.id.my_fragment_container, new FragmentMain());
        } 

Immediately, lock screen for single pane (phone) to portrait, i.e. setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); 

Wednesday, December 3, 2025

Debian 13: bash script to show nvme/ssd healthy and cpu temperature

Requirement

  1. smartmontools
  2. lm-sensors
  3. psensor 

Installation

# apt-get install smartmontools lm-sensors psensor

copy paste this script to show general temperature on nvme/ssd and cpu. It also give information about nvme/ssd healthy.

#!/bin/bash
# this code generated by chatgpt.com no sign in
# each step was interactive, output from pc will be feed to chatgpt to generate correct output

DRIVE=${1:-/dev/sda}

echo "=== SMART Drive Information ($DRIVE) ==="

sudo smartctl -H -A "$DRIVE" | awk '
/^SMART overall-health/      {print "Drive Health: " $NF}
/^194 Temperature_Celsius/   {print "Drive Temperature: " $10 "°C"}
/^190 Airflow_Temperature/   {print "Drive Temperature: " $10 "°C"}
'

echo
echo "=== CPU Temperature ==="
sensors | awk '
/k10temp/ {found=1}
/temp1:/ && found {print "CPU Temp:", $2; found=0}
'

echo
echo "=== GPU Temperature (AMDGPU) ==="
sensors | awk '
/amdgpu/ {found=1}
/edge:/ && found {print "GPU Temp:", $2; found=0}
'

echo
echo "=== ACPI Temperatures ==="
sensors | awk '
/acpitz/ {block=1}
/temp/ && block {print "ACPI " $1, $2}
/^\s*$/ {block=0}
'

Change permission

# chmod u+x ./checkme.sh

Run as sudo or root 

Tuesday, December 2, 2025

Android java: Releasing resource Activity/Fragment <-> AndroidViewModel <-> MyController

Activity/Fragment <-> AndroidViewModel <-> MyController

MyController will hold

  1. Executor
  2. MediaController 
  3. Network access
  4. Database access
  5. Application context for above operation  

Proper way to clear the resource

  1. Executor
            // MyAndroidViewModel onClear() has been reached
            if (myExecutor!=null) {
                myExecutor.shutdown();
                myExecutor = null;
            }
  2. Media Controller
            if (myMediaController!=null) {
                myMediaController.releaseMediaSession(); // MUST BE CLEAR
                myMediaController = null;
            }
  3. Network access
            myGetRadioLogo=null;
  4. Database access  
            myDBAccess=null;
  5. Application context
            appContext=null; // MUST SET NULL AT ONCLEAR

Fail to release these resources may lead to memory leak

Fail to release resource with not properly sequence may lead application crashed, this crash can be found on logcat.  

Debian 13: part 3 participate your vps, cofigure your vps as tor relay/exit

There 2 type of TOR network you an configure on VPS

  1. Relay
  2. Exit

Minimum system requirement:

  1. CPU 1 vcpu
  2. Ram 512MB (1GB Recommended)
  3. Bandwidth 10 Mbps in & out
  4. Traffic 100 GB in & out
  5. Disk 200 MB 
  6. swap not mention (better twice RAM size) 

Enable Debian 13 auto upgrade

# apt install unattended-upgrades
# systemctl enable unattended-upgrades
# systemctl start unattended-upgrades

Installing tor packages and key

  1. Install require software
    # apt install apt-transport-https gnupg
  2. Create /etc/apt/sources.list.d/tor.list with:
    deb     [signed-by=/usr/share/keyrings/deb.torproject.org-keyring.gpg] https://deb.torproject.org/torproject.org trixiemain
    deb-src [signed-by=/usr/share/keyrings/deb.torproject.org-keyring.gpg] https://deb.torproject.org/torproject.org trixie main
  3. installing key and tor
    # wget -qO- https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --dearmor | tee /usr/share/keyrings/deb.torproject.org-keyring.gpg >/dev/null
    # apt install tor deb.torproject.org-keyring
    # apt install tor

Note: you can browse using browser https://deb.torproject.org/torproject.org/ if A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc has change 

TOR relay 

TOR relay consider safer way to contribute to TOR network, It does not act as critical point entry or exit network. 

configure your tor relay /etc/tor/torrc:

Nickname    myNiceRelay  # Change "myNiceRelay" to something you like
ContactInfo your@e-mail  # Write your e-mail and be aware it will be published
ORPort      443          # You might use a different port, should you want to
ExitRelay   0
SocksPort   0 

Enable and restart tor service

# systemctl enable tor
# systemctl restart tor

TOR Exit

Exit TOR may have high security risk including breaking law. you need to carefully decide your county's rules where your vps located. Some country has aware with Exit TOR node.  

install unbound dns resolver

  1. install unbound
    # apt install unbound
  2. configure dns resolver using localhost
    # cp /etc/resolv.conf /etc/resolv.conf.backup
    # echo nameserver 127.0.0.1 > /etc/resolv.conf
  3. protect resolver from change
    # chattr +i /etc/resolv.conf
  4. edit unbound configuration
    server:    ...
        qname-minimisation: yes
        ...
  5. enable and restart unbound
    # systemctl enable unbound
    # systemctl restart unbound

Definitely do not use torproject.org as a domain name for your reverse DNS

configure your tor relay /etc/tor/torrc:

Nickname    myNiceRelay  # Change "myNiceRelay" to something you like
ContactInfo your@e-mail  # Write your e-mail and be aware it will be published
ORPort      443          # You might use a different port, should you want to
ExitRelay   1            # it is exit relay
SocksPort   0 

Enable and restart tor service

# systemctl enable tor
# systemctl restart tor

Wait until tor network recognize your node.

Done, now you are on track to run vps as tor volunteer.

Windows 11: installing windows 11 and post configuration part 2

Copy your windows iso into Ventoy USB data partition, not in boot partition. you can create folder windows and put iso file in this directory. Ventoy boot manager will find any bootable iso file in Ventoy data partition. see here to create Ventoy USB boot manager https://dedetoknotes.blogspot.com/2025/09/debian-13-using-ventoy-to-create.html

Before you starting to. install in computer/laptop, in my case axioo Hype 5 x6, download wifi driver, it does not have Ethernet port. if you have Ethernet port, download it. if those driver are zip, extract it, and put in Ventoy data directory. e.g. after you extract file in directory wifi, copy directory wifi into Ventoy data -> driver (optional you need to create). 

To start installing windows 11, insert Ventoy USB that has been prepared before and turn your laptop/pc on. it will show which iso you want to run. 

Note: you need to change UEFI boot order if you use used nvme contains working os!

installation windows is straight forward. if you use iso windows 11 24h2 or after, you need outlook account or Hotmail if you come from generation like me ☺️. when it reach internet connection, install driver that has been provided in Ventoy USB data.

if you use windows 11 iso 23h2 or before, you can bypass it by pressing shift+f10 when windows ask internet connection and run:

OOBE\BYPASSNRO

after you enter that command, it will reboot/restart. now you can choose no connection internet and create local account. 

after finish, login into windows, go to system, update and check additional update to update hardware driver. update all driver, include printer you want to use. 

if you need software/driver for printer and scanner, find it in windows store and install it. for HP printer inktank multi function, you need to update windows driver. windows said it is optional, but in my opinion it is bridge between system and HP Smart from windows store.

Tweak your windows post installation (optional)

Turning off fast boot 

turn off fast boot if you want to dual boot later. if it is turn on, windows will never unmount driver/partition they use. any files and folder created from second os will be thread as not valid. it will setback to position when windows shutdown. turn off fast boot will completely unmount any drive/partition.

I usually prefer for performance, go to control panel -> system -> advanced system settings or run sysdm.cpl. select performance.

Set fix windows virtual memory

I also use fix windows Virtual Memory / swap. from sysdm.cpl, select Virtual Memory Settings.

select custom size. if your memory less then 16GB, the value is equal twice of your physical ram. e.g physical ram 8GB, use 8GB, if ram 4GB use 8GB. if you use 16 or above, put this value 4GB. set minimum and maximum with the same value e.g 4GB in my case axioo Hype 5 x6 with ram ddr5 2x8GB.

note: there is performance penalty when you windows run out of physical ram and use swap into virtual memory, i.e your nvme. event it is fast as close to pci speed, it will slower due to overhead swap ram to disk vice versa and also reduce your nvme life! when you need bigger memory, do upgrade instead of make virtual memory bigger.

Monitor your NVME

install CrystalDiskInfo to monitor NVME, don't let run your nvme run on high temperatur for long time wihtout proper heat sink or cooling system, especially of laptop. In my option running nvme on 70°C or above on a long time may damage your nvme's chips.

Using windows encryption (bitlocker) on nvme may arise higher activity and increase temperature. if it is not urgent, don't use it.  when it bitlocker turning on or turning off, it will start encrypt or decrypt your entire harddisk. in Task manager it will show 100% harddisk utilization and at CrystalDiskInfo the temperature may arise

Adding Local Account 

for windows with link account to outlook or Hotmail, here is how you create local account.

  1. run cmd as administor 
  2. command to create local user
    > net user myname mypassword /add
  3. to set user myname as administor 
    > net localgroup administrators myname /add
  4. to verify user 
    > net user
  5. sign out and try sign in with local account.

note; you can remove account linked to outlook or Hotmail using local administrator user created before. 











Wednesday, November 26, 2025

Windows 11: clean install preparation part 1

This is documentation when I need to reinstall windows 11, because of nvme damage (overheat). It is Axioo 5 hype X6 with Ryzen 6600h. It has windows 11 installed, and this laptop does have ethernet port. 

Download ISO should I download

  1. 25h2: shift+f10 keyboard input has been disabled (download from archive.org/)
  2. 24h2: shift+f10 keyboard input has been disabled (download from archive.org/)

I did not try 23h2 version, it will take more time to install and laptop must be ready for studying.

During installation shift+f10 will bypass network configuration, you have to run

oobe\bypassnro

after terminal. it will restart installation.  

If you want to use 25h2 and 24h2, download the driver from laptop provider website. in my case download from driver.axiooworld.com, just network driver, others can be installed at the end of windows 11 installation. If you want to use only Windows skip step below, and go to part 2 installation windows.

This below instruction uses other pc/laptop to prepare nvme disk. 

Optional but recommended for dual OS, create EFI System partition (ESP) for new nvme, the minimum size is 500MB. this is step on debian using gparted.

Put a nvme, into nvme ssd/nvme external usb, and connect it your laptop.

Check your nvme

# dmesg
...
[  262.395926] scsi 0:0:0:0: Direct-Access     ADATA LE GEND 710         0213 PQ: 0 ANSI: 6
[  262.397870] sd 0:0:0:0: Attached scsi generic sg0 type 0
[  262.398189] sd 0:0:0:0: [sda] 500118192 512-byte logical blocks: (256 GB/238 GiB)
...
# lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    0 238.5G  0 disk 
# fdisk -l
...
Disk /dev/sda: 238.47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: GEND 710        
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

this is mount point /dev/sda.

I use this schema

  1. 500 MB ESP (FAT32 Flag boot and esp)
  2. 120 GB Windows system (NTFS)
  3. 30 GB Data Windows (NTFS
  4. 80 GB Debian / (ext4)
  5. 4 GB swap (swap)

 To use GParted to create partition on nvme (Be careful not select wrong disk)

  1. Open GParted
  2. Select Gparted -> devices -> /dev/sda, If it a new device (never use), you need to create parititon table, Device -> Create partition table, choose 'gpt'
  3. select unallocated space, and create EFI System Partition (ESP) for boot loader
        File System: FAT32
        Size: At least 300 MiB (recommended 500 MiB for future needs)
        Label: Optional, but you can name it "EFI". 
  4. Apply all operation 
  5. Now you can manage flag for ESP, select partition EFI,right click -> Manage Flags -> check 'boot' and 'esp' 

Note: if you try to create new partition in brand new nvme (never used), it will reported No Partition table found, it is really a new device.

Just, to create the partition, the Adata legend 710 heat sink feel a bit warmer.

You can not download windows 11 multi iso from windows https://www.microsoft.com/en-us/software-download/windows11. You can continue with windows 11 installation, it will put boot loader in EFI system partition (ESP) and next you want to install Debian.


Sunday, November 23, 2025

Using private Private DNS in Android 9 and above for more for security

Sometimes we disappointed to use isp's dns resolver. whatever the reasons, since Android 9 (Pie) and later versions, user can change his/her android phone to use Private DNS. Only one DNS server can be used, it does not support multiple DNS resolver! 

Original list was taken from https://www.geeksforgeeks.org/android/how-to-enable-private-dns-on-android/ with additional text.

Private DNS Hostname List for Android

  1. Google DNS: dns.google
  2. Quad9: dns.quad9.net
  3. Cleanbrowsing DNS: security-filter-dns.cleanbrowsing.org
  4. Open DNS: dns.opendns.com for dot, https://doh.opendns.com/dns-query for doh, 208.67.222.222 
  5. NextDNS: your-id.dns.nextdns.io 45.90.28.0 (custom IPv4) require registration to get id and proper full qualified hostname
  6. Cloudflare : cloudflare-dns.com 1.1.1.1

Please check their website or use search engine for more detail and update information.

When you use private DNS in public network, your mobile phone will use your private DNS resolver that have you define. It won't use DNS from public access point. This will prevent you from "man in the middle attack". 

Warning: You also can bypass country blocked to reach your desire web. You don't need vpn if private DNS can solved country limitation.

Saturday, November 22, 2025

Axioo Hype 5 X6 Ryzen 6600h, blank screen but laptop running

 Symptoms;

  1. laptop on, fan on, indicator on
  2. no any image nor characters appear on screen, backlight on
  3. ctl-alt-del is working
  4. can not enter bios 

Steps to diagnostic

How to remove static voltage

  1. open back cover you need screw driver + small
  2. remove all rams
  3. remove all nvme
  4. remove / unplug battery 
  5. Press and hold power button at least 15 seconds
  6. reconnect/plug battery 

Check ram

  1. clean ram connector with eraser 
  2. put in a ram in slot 1
  3. turn on laptop, and see what screen show, usually it will enter uefi/bios settings
  4. if not ram not detected, blank screen or not appear in uefi, turn of laptop and put ram into another slot. repeat until no more slot to try. if it still does not detected, ram fail/damage.
  5. If ram detected in another, it may something wrong with previous slot, check connector and clean if necessary. if still can detect, slot failure.
  6. repeat step 2 with another ram.

Check nvme (or sata)

  1. clean vnme connector with eraser 
  2. put nvme in the slot
  3. turn in laptop
  4. if it does not go to os or uefi, turn off and move vnme to another slot if available.
  5. if no more slot can detect nvme and start uefi/os, nvme is failure/demage 

Wednesday, November 19, 2025

Protokol pengisian daya cepat Dan mereka yang menggunakannya

Protocol charging usb mobile phone

  1. transsion tecno, Infinix
  2. Power Delivery (pd) apple Samsung google  xiaomi Redmi pocco baru
  3. Quick Charge (qc) Qualcomm snapdragon 
  4. Super Vooc oppo realme vivo oneplus
  5. Programmable Power Supply (pps) Samsung xiaomi Redmi pocco baru
  6. super charge protocol (scp) huawei honor
  7. MediaTek Pump Express
  8. Adaptive Fast Charging (afc)
  9. Flash Charge protocol
  10. UFCS (Universal Fast Charging)

Beberapa xiaomi Redmi pocco menggunakan qc, khususnya yang menggunakan snapdragon 

Kompatibilitas berdasarkan lama charging handphone infinix note 12, Infinix hot 40 pro, tecno spark 20 pro.

no nama harga kompatibilitas
1 Acome 18 watt n/a sesuai
2 Xiomi 33 watt Rp.30.000 tidak, charging infinix note 12, Infinix hot 40 pro, tecno spark 20 pro lebih Dari 4 jam, sebentar charge lalu stop
3 Veger VR33 33 watt Rp.89.000 tidak, charging infinix note 12, Infinix hot 40 pro, tecno spark 20 pro lebih Dari 4 jam

Belilah merek yang baik atau ditoko resmi, pastikan charger mendukung protol charging yang benar.

Baseus, Anker, Ugreen, Aukey

Tuesday, November 11, 2025

Android java: using DataLive for orientation change

I test it in Android 10 xiaomi mia2

What will happen when orientation change e.g. screen change or language change?

the object in activity will be destroyed. here is the sequence:

  • after orientation change
    V  onPause
    V  onStop
    V  onDestrouy
  • after flusing all data
    V  onCreate
    V  onCreate myClass :null
    V  MyClass constructor
    V  onCreateView myClass.getRandom
    V  onStart
    V  onResume 

At xiomi mia2, override public void onConfigurationChanged(Configuration newConfig) method did not called at all during screen orientation change, not appearred in logcat. except, you put android:configChanges in your layout.

Base on the android behave, these are the solution can be used to keep the object during configuration change:

  1. Local persistence to handle process death for complex or large data. Persistent local storage includes databases or DataStore.
  2. Retained objects such as ViewModel instances to handle UI-related state in memory while the user is actively using the app.
  3. Saved instance state to handle system-initiated process death and keep transient state that depends on user input or navigation. 

ViewModel is recommended used for today an future, These are some options:

  1. ViewModel    Holds UI data & logic    Core architecture component
  2. ComputableLiveData (Deprecated)
  3. MediatorLiveData    Combines multiple LiveData sources    Merging streams
  4. MutableLiveData    Observable, mutable data    UI updates
  5. SavingStateLiveData    LiveData with saved-state persistence    Restore after process death 

Comparison between AndroidViewModel vss ViewModel

AndroidViewModel require Context for DB, prefs, etc. gemini: Avoid if possible. Only use when you absolutely need Context. violates a core principle of good architecture: separation of concerns and testability.
ViewModel UI logic without needing Context Network requirement may use this, it does not need context

NOTE: Don’t store Activity or Fragment in VieModel nor AndroidViewModel! 

These are the java code for education, first text using direct access to object in activity, and second text using live data and AndroidViewModel. this code used AndroidViewModel, because I need application's context to access sqlite.

-- MyClass.java

package com.dedetok.testdataorientation;

import android.content.Context;
import android.util.Log;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;

import java.util.Random;

public class MyClass {
    // dummy
    Context context;

    boolean isCreated = false;
    int randomNumber=-1;

    public MyClass(Context context) {
        this.context = context;
        Log.v("deddetok", "MyClass constructor"); // debug

    }

    public String getRandom() {
        if (!isCreated) {
            Random random = new Random();
            randomNumber = random.nextInt(100);
            isCreated = true;
        }
        return String.valueOf(randomNumber);
    }

    public LiveData<String> getRandomLive() {
        if (!isCreated) {
            Random random = new Random();
            randomNumber = random.nextInt(100);
            isCreated = true;
        }
        MutableLiveData<String> returnValue = new MutableLiveData<>();
        returnValue.setValue(String.valueOf(randomNumber));

        return returnValue;
    }
}

-- MyAndroidViewModel

package com.dedetok.testdataorientation;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;

public class MyAndroidViewModel extends AndroidViewModel {
    MyClass myClass;

    public MyAndroidViewModel(@NonNull Application application) {
        super(application);
        myClass = new MyClass(application);
    }

    public LiveData<String> getData() {
        return myClass.getRandomLive();
    }
}

-- MainActivity.java

package com.dedetok.testdataorientation;

import android.content.Context;
import android.content.res.Configuration;
import android.os.Bundle;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import androidx.activity.EdgeToEdge;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.lifecycle.ViewModelProvider;

public class MainActivity extends AppCompatActivity {

    MyClass myClass = null;

    AppCompatTextView myTextView1, myTextView2;

    MyAndroidViewModel myAndroidViewModel;

    /* to preserve myclass
     * 1. Local persistence to handle process death for complex or large data. Persistent local storage includes databases or DataStore.
     * 2. Retained objects such as ViewModel instances to handle UI-related state in memory while the user is actively using the app.
     * 3. Saved instance state to handle system-initiated process death and keep transient state that depends on user input or navigation.
     */

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_main);
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            return insets;
        });

        Log.v("dedetok", "onCreate"); // debug


        myTextView1 = findViewById(R.id.textView1);
        myTextView2 = findViewById(R.id.textView2);

        Log.v("dedetok", "onCreate myClass :"+myClass); //
        // myTextView1
        if (myClass==null) {
            myClass = new MyClass(this);
        }
        myTextView1.setText(myClass.getRandom()); // work, created in memory

        // ✅ Get ViewModel (it survives rotation)
        // myTextView2
        myAndroidViewModel = new ViewModelProvider(this).get(MyAndroidViewModel.class);
        myAndroidViewModel.getData().observe(this, value -> {
            // 'value' is a plain String here
            myTextView2.setText(value);
        }); //

    }

    @Nullable
    @Override
    public View onCreateView(@Nullable View parent, @NonNull String name, @NonNull Context context, @NonNull AttributeSet attrs) {
        Log.v("dedetok", "onCreateView"); // debug
        //Log.v("dedetok", "onCreateView myClass.getRandom"); // debug
        //myTextView.setText(myClass.getRandom()); // crash textview not ready
        return super.onCreateView(parent, name, context, attrs);
    }

    /*
     * ## activity life cycle 2 ##
     */
    @Override
    protected void onStart() {
        super.onStart();
        Log.v("dedetok", "onCreateView myClass.getRandom"); // debug
        //myTextView1.setText(myClass.getRandom()); // work, view has been created
        myAndroidViewModel.getData().observe(this, value -> {
            // 'value' is a plain String here
            myTextView2.setText(value);
        }); // this is fine place

        Log.v("dedetok", "onStart"); // debug

    }

    /*
     * ## activity life cycle 3 ##
     */
    @Override
    protected void onResume() {
        super.onResume();

        Log.v("dedetok", "onResume"); // debug


    }

    /*
     * ## activity life cycle 4 ##
     */
    @Override
    protected void onPause() {
        Log.v("dedetok", "onPause"); // debug
        super.onPause();

    }

    /*
     * ## activity life cycle 5 ##
     */
    @Override
    protected void onStop() {
        Log.v("dedetok", "onStop"); // debug
        super.onStop();

    }

    /*
     * ## activity life cycle 6 ##
     */
    @Override
    protected void onDestroy() {
        Log.v("dedetok", "onDestrouy"); // debug

        super.onDestroy();
    }

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        Log.v("dedetok", "onConfigurationChanged"); // debug
    }
}

-- activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <androidx.appcompat.widget.AppCompatTextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="TextView"
        android:minHeight="50dp"
        android:textSize="24sp"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        />
    <androidx.appcompat.widget.AppCompatTextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="TextView2"
        android:minHeight="50dp"
        android:textSize="24sp"
        app:layout_constraintTop_toBottomOf="@+id/textView1"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        />
</androidx.constraintlayout.widget.ConstraintLayout>

Some of parts of this content generated by ChatGPT and Gemini with some modification.

Wednesday, November 5, 2025

Android Studio: using Logcat and filter

 

LevelPriorityUse Case
Log.v()Verbose (V)Everything. Detailed tracing of functions, variable values, lifecycle events.
Log.d()Debug (D)General debugging messages useful for development.
Log.i()Info (I)Important business logic messages, typical user actions, system state changes.
Log.w()Warn (W)Use of deprecated APIs, non-critical errors that can be recovered.
Log.e()Error (E)Critical errors that cause a failure or stop a feature from working.
Log.wtf()Assert (A)What a Terrible Failure. Reserved for conditions that should never happen.

Option to filter in Andorid Studio Logcat

  1. tag: Filters messages by a specific log tag.
    Example: tag:MyActivity
  2. level: Filters messages at the specified log level or higher. Levels include VERBOSE (V), DEBUG (D), INFO (I), WARN (W), ERROR (E), and ASSERT (A).
    Example: level:ERROR (shows ERROR and ASSERT logs)
  3. process: Filters messages by the process name or process ID (PID).
    Example: process:1234 or process:com.example.app
  4. age: Filters messages by how recent they are. The value is a number followed by a unit of time: s (seconds), m (minutes), h (hours), or d (days).
    Example: age:5m (shows messages from the last 5 minutes)
  5. is: Can be used with crash to filter only crash logs.
    Example: is:crash
  6. package: A convenient shortcut to filter logs only from the currently running application's package. 

Logical operation can be use in Logcat Filter

  1. && (AND): Requires both conditions to be true.
    Example: package:mine && level:WARN
  2. | (OR): Requires at least one condition to be true.
    Example: tag:Tag1 | tag:Tag2
  3. - (NOT/Exclude): Excludes logs matching the condition. Place the hyphen before the key.
    Example: -tag:ExcludedTag

Example usage Logcat filter:

  1. package:mine level:INFO "user data" -tag:network
  2. tag:MyTag && level:DEBUG || is:crash 

Credit: Table conversion to html online http://the-mostly.ru/online_html_table_generator.html

Tuesday, November 4, 2025

Java Netbeans: using opencsv from url

Create a new Project Java with Maven project name e.g. TestOpenCSV

At Project Files, open pom.xml and add

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.dedetok</groupId>
    <artifactId>TestOpenCSV</artifactId>
    <version>1.0</version>
    <packaging>jar</packaging>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.release>17</maven.compiler.release>
        <exec.mainClass>com.dedetok.testopencsv.TestOpenCSV</exec.mainClass>
    </properties>
    <dependencies>
    <dependency>
        <groupId>com.opencsv</groupId>
        <artifactId>opencsv</artifactId>
        <version>5.9</version> <!-- or latest -->
    </dependency>
</dependencies>
</project>

You can use beans to map the result, or manually process the csv files. for data size bigger then 1 millions, there is deference about 1 second, it is better to manually process. Here are code to test, before you use it in production. Feel free to change any the code to meet your requirement.

Classs Radio

/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.dedetok.testopencsv;

import com.opencsv.bean.CsvBindByName;

/**
 *
 * @author dedetok
 */
public class Radio {
    @CsvBindByName(column = "country")
    private String country;

    @CsvBindByName(column = "city")
    private String city;

    @CsvBindByName(column = "radioname")
    private String radioname;

    @CsvBindByName(column = "url_logo")
    private String url_logo;

    @CsvBindByName(column = "url_stream")
    private String url_stream;

    public String getCountry() { return country; }
    public String getCity() { return city; }
    public String getRadioname() { return radioname; }
    public String getUrl_logo() { return url_logo; }
    public String getUrl_stream() { return url_stream; }
}

Main class

/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 */

package com.dedetok.testopencsv;

import com.opencsv.CSVParser;
import com.opencsv.CSVParserBuilder;
import com.opencsv.CSVReader;
import com.opencsv.CSVReaderBuilder;
import com.opencsv.exceptions.CsvValidationException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.opencsv.bean.CsvBindByName;
import com.opencsv.bean.CsvToBean;
import com.opencsv.bean.CsvToBeanBuilder;
import java.util.List;

/**
 *
 * @author dedetok
 */
public class TestOpenCSV {

    static String urlString = "https://raw.githubusercontent.com/dedetok/myradiolist/refs/heads/main/myradio_radiolist.csv";
    
    public static void main(String[] args) throws CsvValidationException {
        System.out.println("Hello World!");
        
        // start function

        try {
            URL url = new URL(urlString);
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod("GET");
            // Check response
            int status = connection.getResponseCode();
            if (status == 200) {
                // Configure parser: semicolon separator, double-quote as quote char
                InputStreamReader reader = new InputStreamReader(connection.getInputStream());
                // Start For parsing manual
                CSVParser parser = new CSVParserBuilder()
                        .withSeparator(';')
                        .withQuoteChar('"')
                        .build();
                //CSVReader csvReader = new CSVReader(reader);
                CSVReader csvReader = new CSVReaderBuilder(reader)
                        .withCSVParser(parser)
                        //.withSkipLines(1) // skip header if needed
                        .build();
                String[] nextLine;
                int i=1;
                while ((nextLine = csvReader.readNext()) != null) {
                    for (String cell : nextLine) {
                        System.out.print(cell + " | ");
                    }
                    i++;
                    System.out.println();
                    if (i==5) {
                        break;
                    }
                }
                // End For parsing manual
                // start convert directly to list<Radio> using opencsv beans
                /*
                CsvToBean<Radio> csvToBean = new CsvToBeanBuilder<Radio>(reader)
                    .withType(Radio.class)
                    .withSeparator(';')
                    .withQuoteChar('"')
                    .withIgnoreLeadingWhiteSpace(true)
                    .build();
                List<Radio> radios = csvToBean.parse();
                System.out.println("Loaded " + radios.size() + " radios!");
                
                // debug
                for (int i = 0; i < Math.min(5, radios.size()); i++) {
                    Radio r = radios.get(i);
                    System.out.println(
                        r.getCountry() + " | " +
                        r.getCity() + " | " +
                        r.getRadioname() + " | " +
                        r.getUrl_logo() + " | " +
                        r.getUrl_stream()
                    );
                }
                */
                // end convert directly to list<Radio> using opencsv beans

            }
        } catch (MalformedURLException ex) {
            Logger.getLogger(TestOpenCSV.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(TestOpenCSV.class.getName()).log(Level.SEVERE, null, ex);
        }      
    }
}

 Code is write with collaboration with chatgpt 

 

Thursday, October 23, 2025

Debian 13: increase nvme life time, and how to check its health with additional ssd sata

We move some mount point to cheaper device sata ssd (sata ssd is cheaper then nvme)

  1. /home
  2. /var
  3. /tmp 

for small ram consider to move swap disk into sata ssd. for big ram (equal or more then 16GB), you may keep it on nvme, in case the os require to use swap, it will use nvme for best performance. It is for Debian or other linux distribution, not for windows.

nvme

install nvme-cli to check nvme lifetime

# apt-get install nvme-cli

To list nvme device

# nvme list

To view nmve information

# nvme smart-log -v /dev/nvme0n1
Smart Log for NVME device:nvme0n1 namespace-id:ffffffff
critical_warning            : 0
temperature                : 93 °F (307 K)
available_spare                : 100%
available_spare_threshold        : 5%
percentage_used                : 3%
endurance group critical warning summary: 0
Data Units Read                : 13440652 (6.88 TB)
Data Units Written            : 11259034 (5.76 TB)
host_read_commands            : 204366865
host_write_commands            : 182401866
controller_busy_time            : 3981
power_cycles                : 1399
power_on_hours                : 1106
unsafe_shutdowns            : 32
media_errors                : 0
num_err_log_entries            : 0
Warning Temperature Time        : 0
Critical Composite Temperature Time    : 0
Temperature Sensor 1            : 93 °F (307 K)
Thermal Management T1 Trans Count    : 0
Thermal Management T2 Trans Count    : 0
Thermal Management T1 Total Time    : 0
Thermal Management T2 Total Time    : 0

To view nmve error information 

# nvme error-log -v /dev/nvme0n1

You can copy paste the result to AI for analyzing. Gemini said: 

"Low Usage. This is the total amount of data written to the drive. For a modern consumer or enterprise SSD, 5.76 TB is a very low amount of lifetime writes." 

ssd sata

install smartmontools to check ssd sata

# apt-get install smartmontools

To find ssd

# smartctl --scan
/dev/sda -d scsi # /dev/sda, SCSI device

To check /dev/sda health

# smartctl -H /dev/sda
smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.12.48+deb13-amd64] (local build)
Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

To view information from /dev/sda

# smartctl -a /dev/sda

To show all information in /dev/sda with filter Error

# smartctl -x /dev/sda | grep Error
Error logging capability:        (0x01)    Error logging supported.
  1 Raw_Read_Error_Rate     -O--CK   100   100   050    -    0
199 UDMA_CRC_Error_Count    -O--CK   100   100   050    -    0
0x10       GPL,SL  R/O      1  NCQ Command Error log
SMART Extended Comprehensive Error Log Version: 1 (1 sectors)
Device Error Count: 6 (device log contains only the most recent 4 errors)
    ER     = Error register
Error 6 [1] occurred at disk power-on lifetime: 1 hours (0 days + 1 hours)
Error 5 [0] occurred at disk power-on lifetime: 1 hours (0 days + 1 hours)
Error 4 [3] occurred at disk power-on lifetime: 1 hours (0 days + 1 hours)
Error 3 [2] occurred at disk power-on lifetime: 0 hours (0 days + 0 hours)

to test ssd on /dev/sda 

# smartctl -t long /dev/sda
smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.12.48+deb13-amd64] (local build)
Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Extended self-test routine immediately in off-line mode".
Drive command "Execute SMART Extended self-test routine immediately in off-line mode" successful.
Testing has begun.
Please wait 4 minutes for test to complete.
Test will complete after Thu Oct 23 15:35:03 2025 WIB
Use smartctl -X to abort test.

You can use option -t short. After 4 minutes run this command to see the result.

# smartctl -x /dev/sda
smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.12.48+deb13-amd64] (local build)
Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model:     RX7 2.5 240GB
Serial Number:    AA000000000000002178
LU WWN Device Id: 0 000000 000000000
Firmware Version: FW201105
User Capacity:    240,057,409,536 bytes [240 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    Solid State Device
Form Factor:      2.5 inches
TRIM Command:     Available
Device is:        Not in smartctl database 7.3/5528
ATA Version is:   ACS-2 T13/2015-D revision 3
SATA Version is:  SATA 3.2, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Thu Oct 30 22:15:22 2025 WIB
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
AAM feature is:   Unavailable
APM feature is:   Unavailable
Rd look-ahead is: Enabled
Write cache is:   Enabled
DSN feature is:   Unavailable
ATA Security is:  Disabled, frozen [SEC2]
Wt Cache Reorder: Unavailable

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00)    Offline data collection activity
                    was never started.
                    Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0)    The previous self-test routine completed
                    without error or no self-test has ever 
                    been run.
Total time to complete Offline 
data collection:         (  120) seconds.
Offline data collection
capabilities:              (0x5d) SMART execute Offline immediate.
                    No Auto Offline data collection support.
                    Abort Offline collection upon new
                    command.
                    Offline surface scan supported.
                    Self-test supported.
                    No Conveyance Self-test supported.
                    Selective Self-test supported.
SMART capabilities:            (0x0002)    Does not save SMART data before
                    entering power-saving mode.
                    Supports SMART auto save timer.
Error logging capability:        (0x01)    Error logging supported.
                    General Purpose Logging supported.
Short self-test routine 
recommended polling time:      (   2) minutes.
Extended self-test routine
recommended polling time:      (   4) minutes.

SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAGS    VALUE WORST THRESH FAIL RAW_VALUE
  1 Raw_Read_Error_Rate     -O--CK   100   100   050    -    0
  5 Reallocated_Sector_Ct   -O--CK   100   100   050    -    0
  9 Power_On_Hours          -O--CK   100   100   050    -    643
 12 Power_Cycle_Count       -O--CK   100   100   050    -    476
160 Unknown_Attribute       -O--CK   100   100   050    -    0
161 Unknown_Attribute       -O--CK   100   100   050    -    0
163 Unknown_Attribute       -O--CK   100   100   050    -    880
164 Unknown_Attribute       -O--CK   100   100   050    -    85
165 Unknown_Attribute       -O--CK   100   100   050    -    118
166 Unknown_Attribute       -O--CK   100   100   050    -    50
167 Unknown_Attribute       -O--CK   100   100   050    -    81
168 Unknown_Attribute       -O--CK   100   100   050    -    0
169 Unknown_Attribute       -O--CK   100   100   050    -    100
175 Program_Fail_Count_Chip -O--CK   100   100   050    -    184549376
176 Erase_Fail_Count_Chip   -O--CK   100   100   050    -    355223
177 Wear_Leveling_Count     -O--CK   100   100   050    -    2488567
178 Used_Rsvd_Blk_Cnt_Chip  -O--CK   100   100   050    -    0
181 Program_Fail_Cnt_Total  -O--CK   100   100   050    -    0
182 Erase_Fail_Count_Total  -O--CK   100   100   050    -    0
192 Power-Off_Retract_Count -O--CK   100   100   050    -    15
194 Temperature_Celsius     -O--CK   100   100   050    -    30
195 Hardware_ECC_Recovered  -O--CK   100   100   050    -    21
196 Reallocated_Event_Count -O--CK   100   100   050    -    0
197 Current_Pending_Sector  -O--CK   100   100   050    -    0
198 Offline_Uncorrectable   -O--CK   100   100   050    -    0
199 UDMA_CRC_Error_Count    -O--CK   100   100   050    -    0
232 Available_Reservd_Space -O--CK   100   100   050    -    0
241 Total_LBAs_Written      -O--CK   100   100   050    -    82732
242 Total_LBAs_Read         -O--CK   100   100   050    -    76686
249 Unknown_Attribute       -O--CK   100   100   050    -    105586
                            ||||||_ K auto-keep
                            |||||__ C event count
                            ||||___ R error rate
                            |||____ S speed/performance
                            ||_____ O updated online
                            |______ P prefailure warning

General Purpose Log Directory Version 1
SMART           Log Directory Version 1 [multi-sector log support]
Address    Access  R/W   Size  Description
0x00       GPL,SL  R/O      1  Log Directory
0x01       GPL,SL  R/O      1  Summary SMART error log
0x02       GPL,SL  R/O      1  Comprehensive SMART error log
0x03       GPL,SL  R/O      1  Ext. Comprehensive SMART error log
0x04       GPL,SL  R/O      8  Device Statistics log
0x06       GPL,SL  R/O      1  SMART self-test log
0x07       GPL,SL  R/O      1  Extended self-test log
0x09       GPL,SL  R/W      1  Selective self-test log
0x10       GPL,SL  R/O      1  NCQ Command Error log
0x11       GPL,SL  R/O      1  SATA Phy Event Counters log
0x30       GPL,SL  R/O      9  IDENTIFY DEVICE data log
0x80-0x9f  GPL,SL  R/W     16  Host vendor specific log
0xa0       GPL,SL  VS      16  Device vendor specific log
0xe0       GPL,SL  R/W      1  SCT Command/Status
0xe1       GPL,SL  R/W      1  SCT Data Transfer

SMART Extended Comprehensive Error Log Version: 1 (1 sectors)
Device Error Count: 6 (device log contains only the most recent 4 errors)
    CR     = Command Register
    FEATR  = Features Register
    COUNT  = Count (was: Sector Count) Register
    LBA_48 = Upper bytes of LBA High/Mid/Low Registers ]  ATA-8
    LH     = LBA High (was: Cylinder High) Register    ]   LBA
    LM     = LBA Mid (was: Cylinder Low) Register      ] Register
    LL     = LBA Low (was: Sector Number) Register     ]
    DV     = Device (was: Device/Head) Register
    DC     = Device Control Register
    ER     = Error register
    ST     = Status register
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.

Error 6 [1] occurred at disk power-on lifetime: 1 hours (0 days + 1 hours)
  When the command that caused the error occurred, the device was in an unknown state.

  After command completion occurred, registers were:
  ER -- ST COUNT  LBA_48  LH LM LL DV DC
  -- -- -- == -- == == == -- -- -- -- --
  04 -- a0 00 01 00 00 4f 00 c2 c0 51 00  Device Fault

  Commands leading to the command that caused the error were:
  CR FEATR COUNT  LBA_48  LH LM LL DV DC  Powered_Up_Time  Command/Feature_Name
  -- == -- == -- == == == -- -- -- -- --  ---------------  --------------------
  b0 00 d5 00 01 00 00 4f 00 c2 c0 a0 00     00:00:00.430  SMART READ LOG
  ec 00 00 00 00 00 00 00 00 00 00 a0 00     00:00:00.430  IDENTIFY DEVICE
  67 b6 c2 97 32 21 61 7b 60 cf ba 1f ff     00:00:00.360  [RESERVED FOR SERIAL ATA]

Error 5 [0] occurred at disk power-on lifetime: 1 hours (0 days + 1 hours)
  When the command that caused the error occurred, the device was in an unknown state.

  After command completion occurred, registers were:
  ER -- ST COUNT  LBA_48  LH LM LL DV DC
  -- -- -- == -- == == == -- -- -- -- --
  04 -- a0 00 01 00 00 4f 00 c2 c0 51 00  Device Fault

  Commands leading to the command that caused the error were:
  CR FEATR COUNT  LBA_48  LH LM LL DV DC  Powered_Up_Time  Command/Feature_Name
  -- == -- == -- == == == -- -- -- -- --  ---------------  --------------------
  b0 00 d5 00 01 00 00 4f 00 c2 c0 a0 00     00:00:00.430  SMART READ LOG
  ec 00 00 00 00 00 00 00 00 00 00 a0 00     00:00:00.430  IDENTIFY DEVICE
  67 b6 82 97 32 21 69 79 60 cf ba 3f ff     00:00:00.360  [RESERVED FOR SERIAL ATA]

Error 4 [3] occurred at disk power-on lifetime: 1 hours (0 days + 1 hours)
  When the command that caused the error occurred, the device was in an unknown state.

  After command completion occurred, registers were:
  ER -- ST COUNT  LBA_48  LH LM LL DV DC
  -- -- -- == -- == == == -- -- -- -- --
  04 -- a0 00 01 00 00 4f 00 c2 c0 51 00  Device Fault

  Commands leading to the command that caused the error were:
  CR FEATR COUNT  LBA_48  LH LM LL DV DC  Powered_Up_Time  Command/Feature_Name
  -- == -- == -- == == == -- -- -- -- --  ---------------  --------------------
  b0 00 d5 00 01 00 00 4f 00 c2 c0 a0 00     00:00:00.410  SMART READ LOG
  ec 00 00 00 00 00 00 00 00 00 00 a0 00     00:00:00.410  IDENTIFY DEVICE
  67 b6 8a 97 b2 21 6b 7b 60 cf ba 3e ff     00:00:00.360  [RESERVED FOR SERIAL ATA]

Error 3 [2] occurred at disk power-on lifetime: 0 hours (0 days + 0 hours)
  When the command that caused the error occurred, the device was in an unknown state.

  After command completion occurred, registers were:
  ER -- ST COUNT  LBA_48  LH LM LL DV DC
  -- -- -- == -- == == == -- -- -- -- --
  04 -- a0 00 01 00 00 4f 00 c2 c0 51 00  Device Fault

  Commands leading to the command that caused the error were:
  CR FEATR COUNT  LBA_48  LH LM LL DV DC  Powered_Up_Time  Command/Feature_Name
  -- == -- == -- == == == -- -- -- -- --  ---------------  --------------------
  b0 00 d5 00 01 00 00 4f 00 c2 c0 a0 00     00:00:00.410  SMART READ LOG
  ec 00 00 00 00 00 00 00 00 00 00 a0 00     00:00:00.410  IDENTIFY DEVICE
  67 b6 c2 97 32 21 69 79 60 cf ba 1e ff     00:00:00.360  [RESERVED FOR SERIAL ATA]

SMART Extended Self-test Log Version: 1 (1 sectors)
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Offline             Completed without error       00%       641         -
# 2  Offline             Self-test routine in progress 10%       641         -
# 3  Offline             Self-test routine in progress 10%       641         -
# 4  Offline             Self-test routine in progress 10%       641         -
# 5  Offline             Self-test routine in progress 10%       641         -
# 6  Offline             Self-test routine in progress 10%       641         -
# 7  Offline             Self-test routine in progress 10%       641         -
# 8  Offline             Self-test routine in progress 10%       641         -
# 9  Offline             Self-test routine in progress 10%       641         -
#10  Offline             Self-test routine in progress 10%       641         -
#11  Offline             Self-test routine in progress 10%       641         -
#12  Offline             Self-test routine in progress 10%       641         -
#13  Offline             Self-test routine in progress 10%       641         -
#14  Offline             Self-test routine in progress 10%       641         -
#15  Offline             Self-test routine in progress 10%       641         -
#16  Offline             Self-test routine in progress 10%       641         -
#17  Offline             Self-test routine in progress 10%       641         -
#18  Offline             Self-test routine in progress 10%       641         -
#19  Offline             Self-test routine in progress 10%       641         -

SMART Selective self-test log data structure revision number 0
Note: revision number not 1 implies that no selective self-test has ever been run
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

SCT Commands not supported

Device Statistics (GP Log 0x04)
Page  Offset Size        Value Flags Description
0x01  =====  =               =  ===  == General Statistics (rev 1) ==
0x01  0x008  4             476  ---  Lifetime Power-On Resets
0x01  0x010  4             643  ---  Power-on Hours
0x01  0x018  6      5421924352  ---  Logical Sectors Written
0x01  0x020  6        85241306  ---  Number of Write Commands
0x01  0x028  6      5025693696  ---  Logical Sectors Read
0x01  0x030  6        74355305  ---  Number of Read Commands
0x01  =====  =               =  ===  == General Statistics (rev 1) ==
0x01  0x008  4             476  ---  Lifetime Power-On Resets
0x01  0x010  4             643  ---  Power-on Hours
0x01  0x018  6      5421924352  ---  Logical Sectors Written
0x01  0x020  6        85241306  ---  Number of Write Commands
0x01  0x028  6      5025693696  ---  Logical Sectors Read
0x01  0x030  6        74355305  ---  Number of Read Commands
0x01  =====  =               =  ===  == General Statistics (rev 1) ==
0x01  0x008  4             476  ---  Lifetime Power-On Resets
0x01  0x010  4             643  ---  Power-on Hours
0x01  0x018  6      5421924352  ---  Logical Sectors Written
0x01  0x020  6        85241306  ---  Number of Write Commands
0x01  0x028  6      5025693696  ---  Logical Sectors Read
0x01  0x030  6        74355305  ---  Number of Read Commands
0x01  =====  =               =  ===  == General Statistics (rev 1) ==
0x01  0x008  4             476  ---  Lifetime Power-On Resets
0x01  0x010  4             643  ---  Power-on Hours
0x01  0x018  6      5421924352  ---  Logical Sectors Written
0x01  0x020  6        85241306  ---  Number of Write Commands
0x01  0x028  6      5025693696  ---  Logical Sectors Read
0x01  0x030  6        74355305  ---  Number of Read Commands
0x01  =====  =               =  ===  == General Statistics (rev 1) ==
0x01  0x008  4             476  ---  Lifetime Power-On Resets
0x01  0x010  4             643  ---  Power-on Hours
0x01  0x018  6      5421924352  ---  Logical Sectors Written
0x01  0x020  6        85241306  ---  Number of Write Commands
0x01  0x028  6      5025693696  ---  Logical Sectors Read
0x01  0x030  6        74355305  ---  Number of Read Commands
0x01  =====  =               =  ===  == General Statistics (rev 1) ==
0x01  0x008  4             476  ---  Lifetime Power-On Resets
0x01  0x010  4             643  ---  Power-on Hours
0x01  0x018  6      5421924352  ---  Logical Sectors Written
0x01  0x020  6        85241306  ---  Number of Write Commands
0x01  0x028  6      5025693696  ---  Logical Sectors Read
0x01  0x030  6        74355305  ---  Number of Read Commands
0x01  =====  =               =  ===  == General Statistics (rev 1) ==
0x01  0x008  4             476  ---  Lifetime Power-On Resets
0x01  0x010  4             643  ---  Power-on Hours
0x01  0x018  6      5421924352  ---  Logical Sectors Written
0x01  0x020  6        85241306  ---  Number of Write Commands
0x01  0x028  6      5025693696  ---  Logical Sectors Read
0x01  0x030  6        74355305  ---  Number of Read Commands
0x01  =====  =               =  ===  == General Statistics (rev 1) ==
0x01  0x008  4             476  ---  Lifetime Power-On Resets
0x01  0x010  4             643  ---  Power-on Hours
0x01  0x018  6      5421924352  ---  Logical Sectors Written
0x01  0x020  6        85241306  ---  Number of Write Commands
0x01  0x028  6      5025693696  ---  Logical Sectors Read
0x01  0x030  6        74355305  ---  Number of Read Commands
                                |||_ C monitored condition met
                                ||__ D supports DSN
                                |___ N normalized value

Pending Defects log (GP Log 0x0c) not supported

SATA Phy Event Counters (GP Log 0x11)
ID      Size     Value  Description
0x0001  4            0  Command failed due to ICRC error
0x0009  4          764  Transition from drive PhyRdy to drive PhyNRdy
0x000a  4          221  Device-to-host register FISes sent due to a COMRESET
0x000b  4            0  CRC errors within host-to-device FIS
0x000d  4            0  Non-CRC errors within host-to-device FIS

Sample Device Model: RX7 2.5 240GB 

The result required knowledge to interpret it. Copy paste this to AI and what are they suggesting.

Gemini recommendation for "smartctl -x /dev/sda | grep Error" (copy paste only error messages), may misleading recommendation:

"Recommendation: Since the error occurred so early, it's highly likely to be a dead-on-arrival (DOA) or early life failure. The drive should be considered unreliable and immediately replaced under warranty. Do not store critical data on this device."

Gemini recommendation for "smartctl -x /dev/sda" (copy paste all output):

 "The drive's SMART overall-health self-assessment test result: PASSED and the zero count on critical wear-related attributes (like Reallocated Sector Count) suggest the media is physically healthy and not currently failing due to wear.

However, the high number of "Device Fault" errors that occurred early in the drive's life, combined with the anomalous self-test log, indicates a potential instability issue."

Chatgpt.com commenting for the output:

"Verdict: Your RX7 240 GB SSD is fully healthy and nowhere near worn out.

Your RX7 240 GB SSD is healthy, low-wear (~2.8 TBW), and has ~95 % lifespan remaining." 

 Chatgpt.com explanation about the errors:

"What those “Errors” really are

  • These are entries in the SMART Extended Error Log, not current hardware problems.
  • Your log shows 6 errors, all at power-on lifetime: 0–1 hours.
    That means: they happened right when the drive was brand new or initializing — years ago.
  • Since then (643+ hours of runtime), no new errors have been logged."