Tuesday, October 21, 2025

Debian 13: upgrading hp ink tank 315 configuration

chatgpt "when you upgraded from Debian 12 → 13, your printing stack also got a major bump (Debian 13 uses CUPS 2.5+ and newer ipp-usb / cups-filters packages). These prefer driverless (IPP Everywhere) printing — and your HP 415 does support that mode."

These steps are generated by chatgpt, but I follow it step by step. 

Identify both printer URIs

# lpstat -v
device for HP-Ink-Tank-Wireless-415: socket://x.x.x.x:9100
device for HP_Ink_Tank_Wireless_410_series_1BAF5D: implicitclass://HP_Ink_Tank_Wireless_410_series_1BAF5D/
device for PDF: cups-pdf:/

"The implicitclass:// scheme comes from cups-browsed, which discovers and manages driverless IPP printers automatically.
In your case, that printer (HP_Ink_Tank_Wireless_410_series_1BAF5D) is a modern, IPP Everywhere version of your HP Ink Tank 415.
It’s the correct, future-proof configuration — and it’s why your test print worked even without the old socket:// driver."

Remove the legacy driver and clean up your setup 

# lpadmin -x HP-Ink-Tank-Wireless-415

Optional to make your new driver as default printer

# lpadmin -d HP_Ink_Tank_Wireless_410_series_1BAF5D

Note: option -d to choose default printer

 Check your scanner 

# scanimage -L
device `v4l:/dev/video0' is a Noname Integrated Camera: Integrated C virtual device
device `escl:https://x.x.x.x:443' is a HP Ink Tank Wireless 410 series [1BAF5D] platen scanner
device `hpaio:/net/ink_tank_wireless_410_series?ip=x.x.x.x&queue=false' is a Hewlett-Packard ink_tank_wireless_410_series all-in-one
device `airscan:e0:HP Ink Tank Wireless 410 series [1BAF5D]' is a eSCL HP Ink Tank Wireless 410 series [1BAF5D] ip=x.x.x.x, xx:xx:xx:xx::1

This is upgrade from previous post Debian Buster: install all in one hp ink tank 315   

Thursday, October 16, 2025

How to create apache2 alias myapp to directing to user myuser under directory /home/myuser/public

Note: FOR DEVELOPMENT NOT PRODUCTION!

Use root or sudo for sign with #

Use user myuser for sign $

Enable alias module

# a2enmod

Edit /etc/apache2/sites-available/000-default.conf

....
/etc/apache2/sites-available/000-default.conf
    Alias "/myapp" "/home/myuser/public"
    <Directory "/home/myuser/public">
        Options Indexes FollowSymLinks MultiVIews
        AllowOverride None
        Require all granted
    </Directory>
</VirtualHost>

Create directory public

$ mkdir public

Change the group ownership 

# chown -R myuser:www-data /home/myuser/public

Give the www-data group read and execute permissions. 

# chmod -R g+rx /home/myuser/public

Adjust the permissions for the home directory itself (not recommended for production, use ACL)

# chmod a+x /home/myuser

Test configuration

# apache2ctl configtest
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Syntax OK

Restart service

# systemctl reload apache2

Open in your browser http://localhost/myapp 

Tuesday, October 14, 2025

Android Studio 2024.1.4: backup and how you migrate your old project

Android Studio move so fast, the developer and ide tools are racing each other.

These are must you backup: 

  1. Project name
  2. Your key file i.e jks for your project
  3. your project source
    1. <root_app> remove folders .gradle .idea and build, remove file .gitignore
    2. <root_app>/app remove folders build, libs and release, remove file .gitignore
    3. <root_app>/gradle remove file ./gradle/wrapper/gradle-wrapper.jar

For upgrading from old project, and your project does not have libs.versions.toml file:

  1. Create it (see below) or copy from other project <root_app>/gradle/libs.versions.toml.
  2. change build.gradle.kts (:app)
    plugins {
        id("com.android.application")
    }
    into 
    plugins {
        alias(libs.plugins.android.application)
    }
    Change dependency 
    dependencies {

        implementation("androidx.appcompat:appcompat:1.7.1")
        implementation("com.google.android.material:material:1.12.0")
        implementation("androidx.constraintlayout:constraintlayout:2.2.1")
        testImplementation("junit:junit:4.13.2")
        androidTestImplementation("androidx.test.ext:junit:1.2.1")
        androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
        implementation("com.google.android.gms:play-services-ads-lite:24.0.0")

    }
    into
    dependencies {

        implementation(libs.appcompat)
        implementation(libs.material)
        testImplementation(libs.junit)
        androidTestImplementation(libs.ext.junit)
        androidTestImplementation(libs.espresso.core)

        // admob
        implementation(libs.play.services.ads)
    }
  3. Update your libs.versions.toml, revise the version if necessary:
    [versions]
    agp = "8.13.0"
    junit = "4.13.2"
    junitVersion = "1.3.0"
    espressoCore = "3.7.0"
    appcompat = "1.7.1"
    material = "1.13.0"
    playServicesAds = "24.7.0"

    [libraries]
    junit = { group = "junit", name = "junit", version.ref = "junit" }
    ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
    espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
    appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
    material = { group = "com.google.android.material", name = "material", version.ref = "material" }
    play-services-ads = { module = "com.google.android.gms:play-services-ads", version.ref = "playServicesAds" }

    [plugins]
    android-application = { id = "com.android.application", version.ref = "agp" }

Note: if you have other external dependency, keep the library first, and migrate after common library successfully upgraded.

To create libs.versions.toml, at left side Project Files -> gradle -> New -> File, name it with: libs.versions.toml. Continue step 2 above.

This is example of external library, how to move jsoup into libs.versions.toml

Change build.gradle.kts (:app) from  

dependencies {
    ...
    implementation("org.jsoup:jsoup:
1.21.2") // jsoup

}

change into

dependencies {
    ....
    implementation(libs.jsoup)
}

And add into libs.versions.toml

[versions]
...
# Define the version number
jsoup = "1.21.2"
...
[libraries]
...
# Define the library coordinates, referencing the version above
jsoup = { group = "org.jsoup", name = "jsoup", version.ref = "jsoup" }
...

 

Friday, October 10, 2025

Debian 13: Configure NVidia in dual gpu - hybrid mode and how to utilize it in Android Studio

List your VGA: 

# lspci | grep -E "VGA|3D"
01:00.0 VGA compatible controller: NVIDIA Corporation GA107 [GeForce RTX 2050] (rev a1)
05:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Rembrandt [Radeon 680M] (rev 0b)

Installation

# apt-get install firmware-nvidia-graphics nvidia-detect nvidia-driver linux-headers-$(uname -r) vulkan-tools

Warning "Conflicting nouveau kernel module loaded" may appear.

Check your nvidia

# nvidia-detect
Detected NVIDIA GPUs:
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA107 [GeForce RTX 2050] [10de:25ad] (rev a1)

Checking card:  NVIDIA Corporation GA107 [GeForce RTX 2050] (rev a1)
Your card is supported by all driver versions.
Your card is also supported by the Tesla 535 drivers series.
It is recommended to install the
    nvidia-driver

Chek your nvidia software

# nvidia-smi
Fri Oct 10 23:07:14 2025       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.163.01             Driver Version: 550.163.01     CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 2050        On  |   00000000:01:00.0 Off |                  N/A |
| N/A   40C    P0              7W /   45W |       9MiB /   4096MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

Note: run glxinfo in "xfce terminal", not "terminal emulator"  

GLX information

$ glxinfo | grep "OpenGL renderer"
OpenGL renderer string: AMD Radeon 660M (radeonsi, rembrandt, LLVM 19.1.7, DRM 3.61, 6.12.31-amd64)

The desktop will utilize AMD GPU, we want to run Android Studio and utilize GeForce RTX 2050. Create a bash script to run Android Studio using NVidia Geforce RTX2050 instead build in AMD gpu, e.q 

#!/bin/bash
# Launch Android Studio using the NVIDIA GPU (Prime Render Offload)

APP_PATH="$HOME/AndroidStudio/android-studio/bin/studio.sh"

if [ ! -f "$APP_PATH" ]; then
    echo "Error: Android Studio not found at $APP_PATH"
    exit 1
fi

# Run Android Studio with NVIDIA GPU offload
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia "$APP_PATH" &

Usefull command if any systemd error during boot 

# journalctl -b -u systemd-modules-load.service


Using nextdns.io as parental control for home user

This summary is not available. Please click here to view the post.