Showing posts with label debian. Show all posts
Showing posts with label debian. Show all posts

Friday, August 15, 2025

Debian 13: upgrading ASUS Eee PC 1215B from Debian 11 to Debian 13

ASUS Eee PC 1215B Release April 2011
AMD E-350 dual-core 1.6 GHz
AMD Radeon HD 6310 graphics 1366x768
Ram DDR3

It is recommended to use shell, during upgrade, desktop environment may be restarting and causing screen lock.

To get into shell, after Desktop login menu appear, press Ctrl + Alt + F1. To turn back into Desktop press Ctrl + Alt + F7.

Edit /etc/apt/sources.list

#main
# 11 to 12
deb https://deb.debian.org/debian bookworm main contrib non-free-firmware non-free
# 12 to 13
#deb https://deb.debian.org/debian trixie main contrib non-free-firmware non-free

#mirror auto
# 11 to 12
deb http://mirror.unair.ac.id/debian bookworm main contrib
# 12 to 13
#deb http://mirror.unair.ac.id/debian trixie main contrib

#security
# 11 to 12
deb https://security.debian.org/debian-security bookworm-security main contrib non-free-firmware non-free
# 12 to 13
#deb https://security.debian.org/debian-security trixie-security main contrib non-free-firmware non-free

#update
# 11 to 12
deb https://deb.debian.org/debian bookworm-updates main contrib non-free-firmware non-free
# 12 to 13
#deb https://deb.debian.org/debian trixie-updates main contrib non-free-firmware non-free

#backport
# 11 to 12
deb http://deb.debian.org/debian bookworm-backports main
# 12 to 13
#deb http://deb.debian.org/debian trixie-backports main

As mention in Debian official website, you can not directly upgrade from Debian 11 to Debian 13. You need to upgrade it in sequence

Upgrade Debian 11 to Debian 12

Edit /etc/apt/sources.list, remove '#' any line containing bookworm and add '#' any line containing trixie.

  1. Update Repository
    # apt-get update
  2. Take full upgrade
    # apt full-upgrade
  3. Restart and perform clean up
    # apt-get autoclean && apt-get autoremove -y

This toke 2 hours and 30 minutes. 

This error occurred when we just perform apt upgrade --without-new-pkgs, make restart and upgrade to Debian 13

Preparing to unpack .../base-files_13.8_amd64.deb ...


******************************************************************************
*
* The base-files package cannot be installed because
* /bin is a directory, but should be a symbolic link.
*
* Please install the usrmerge package to convert this system to merged-/usr.
*
* For more information please read https://wiki.debian.org/UsrMerge.
*
******************************************************************************


dpkg: error processing archive /var/cache/apt/archives/base-files_13.8_amd64.deb
 (--unpack):
 new base-files package pre-installation script subprocess returned error exit s
tatus 1
Errors were encountered while processing:
 /var/cache/apt/archives/base-files_13.8_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Upgrade Debian 12 to Debian 13

Edit /etc/apt/sources.list, add '#' any line containing bookworm and remove '#' any line containing trixie.

  1. Update Repository
    # apt-get update
  2. Take full upgrade
    # apt full-upgrade
  3. Restart and perform clean up
    # apt-get autoclean && apt-get autoremove -y

This toke 3 hours to upgrade 1.945 packages with size 1.388 MB.

Total hours are 5 hours and 30 minutes, with all applications upgraded to latest version.

Thursday, August 14, 2025

Debian 13: Ops, something is wrong during upgrading from Debian 12 to Debian 13

If something wrong during upgrade debian 12 to debian 13, so the installation did not finish, here is my share how to solved it. 

In my case, screen got locked, so I need to manual power off and restart the Laptop.

Normal boot to linux won't work, if possible during selecting menu in grub, select "Advanced Option" and select "Recovery Mode". If you can not go into grub menu, you need to use Debian rescue CD/USB, I use minimal (net install CD),



If you use CD/USB, you will rescue your Debian using chroot. 

To repair grub using CD/USB, you need to enter your drive.



To repair broken upgrade using CD/USB, you need to select your Debian partition and mounting /boot partition.

If you using CD/USB rescue, when repair has completed, type exit from chroot

Command to repair broken upgrade process:

# dpkg --configure -a
....
# apt --fix-broken install 
....
# apt full-upgrade
...-
# grub-update
...
# grub-install /dev/sda
....

To manage boot efi using efibootmgr

# apt install efibootmgr
# efibootmgr
BootCurrent: 0002
Timeout: 5 seconds
BootOrder: 0001,3001,0002,2001,2002,2003
Boot0001* Windows Boot Manager    HD(2,GPT,41ed4da9-8f99-445d-b3dc-d37f4ad717da,0x109000,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d00000061000100000010000000040000007fff0400
Boot0002* debian    HD(2,GPT,41ed4da9-8f99-445d-b3dc-d37f4ad717da,0x109000,0x32000)/File(\EFI\debian\shimx64.efi)
Boot2001* USB Drive (UEFI)    RC
Boot2002* Internal CD/DVD ROM Drive (UEFI)    RC
Boot3000* Internal Hard Disk or Solid State Disk    RC
Boot3001* Internal Hard Disk or Solid State Disk    RC
Boot3002* Internal Hard Disk or Solid State Disk    RC
# efibootmgr --bootorder Boot0002,Boot0001

Laptop HP Model 15-af109AX, with Bios handled Boot Manager. This model may be not supported in Debian 13 (in Debian 12 there was not problem), I can not change boot order using BIOS nor efibootmgr.

If you can not switch sequence of boot loader using BIOS nor efibootmgr, you need to press F9 button to select boot loader you want to start for HP Model 15-af109AX.



 


Wednesday, August 13, 2025

Debian 13: upgrade from debian 12 bookworm to debian 13 trixie

It is recommended to use shell, during upgrade, desktop environment may be restarting and causing screen lock.

To get into shell, after Desktop login menu appear, press Ctrl + Alt + F1. To turn back into Desktop press Ctrl + Alt + F7.

Current version

# cat /etc/debian_version
12.11

Edit /etc/apt/source.list

#deb cdrom:[Debian GNU/Linux 12.0.0 _Bookworm_ - Official amd64 NETINST with firmware 20230610-10:21]/ bookworm main non-free-firmware

#main
#deb https://deb.debian.org/debian bookworm main contrib non-free-firmware non-free
deb https://deb.debian.org/debian trixie main contrib non-free-firmware non-free

#mirror auto
#deb http://httpredir.debian.org/debian bookworm main contrib
deb http://httpredir.debian.org/debian trixie main contrib

#security
#deb https://security.debian.org/debian-security bookworm-security main contrib non-free-firmware non-free
deb https://security.debian.org/debian-security trixie-security main contrib non-free-firmware non-free

#update
#deb https://deb.debian.org/debian bookworm-updates main contrib non-free-firmware non-free
deb https://deb.debian.org/debian trixie-updates main contrib non-free-firmware non-free

#backport
#deb http://deb.debian.org/debian bookworm-backports main
deb http://deb.debian.org/debian trixie-backports main

Updating repository

# apt-get update
Hit:1 https://dl.google.com/linux/chrome/deb stable InRelease                 
Hit:2 https://deb.debian.org/debian trixie InRelease                           
Hit:3 https://security.debian.org/debian-security trixie-security InRelease   
Hit:4 https://deb.debian.org/debian trixie-updates InRelease                   
Hit:5 http://deb.debian.org/debian trixie-backports InRelease                 
Hit:6 http://httpredir.debian.org/debian trixie InRelease   
Reading package lists... Done

Performing minimal upgrade

# apt upgrade --without-new-pkgs

During minimal upgrade, your system may request you to restart some services, allow it. Take some coffee.....

Restart your Debian. This is optional, just make sure system run proper minimal upgrade. 

Performing full upgrade

# apt full-upgrade

Full upgrade may takes sometimes. 

Restart your Debian and perform clean up

# apt-get autoclean && apt-get autoremove -y
...
$ cat /etc/debian_version
13.0
$ uname -an
Linux hpkakiang 6.12.38+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.38-1 (2025-07-16) x86_64 GNU/Linux



Sunday, August 10, 2025

Debian 13: trixie release


NOTE: 

  1. Debian 13 trixie does not support i386 architecture. Users running i386 systems should not upgrade to trixie.  You can run 32 bit application on Debian 13 trixie using 32 bit support. 
  2. Debian 12 bookworm does not cover any i586 processor, minimum processor requirement is i686
  3. Debian 11 bullseye is latest version support i386

Debian 13 trixie release uses Linux kernel 6.12 LTS series.

Debian 13 trixie ships with several desktop environments, such as:

  1. GNOME 48
  2. KDE Plasma 6.3
  3. LXDE 13
  4. LXQt 2.1.0
  5. Xfce 4.20


A total of seven architectures are officially supported for trixie:

  1. 64-bit PC (amd64),
  2. 64-bit ARM (arm64),
  3. ARM EABI (armel),
  4. ARMv7 (EABI hard-float ABI, armhf),
  5. 64-bit little-endian PowerPC (ppc64el),
  6. 64-bit little-endian RISC-V (riscv64),
  7. IBM System z (s390x)

Reference: www.debian.org/News/2025/20250809

Saturday, August 9, 2025

Unix like OS not base on linux

Linux is a very popular open-source Unix-like operating system. Open-source Unix-like operating systems that are not based on Linux and are still actively developed. They are

  1. FreeBSD
    Focus: Performance, advanced networking, storage
    Use Cases: Servers, firewalls, storage appliances (e.g., TrueNAS)
  2. OpenBSD
    Focus: Security, correctness, simplicity
    Known for: Secure-by-default policies, clean codebase
  3. NetBSD
    Focus: Portability — runs on almost any architecture
    Use Cases: Embedded systems, research, legacy hardware
  4. DragonFly BSD
    Focus: Performance, advanced file system (HAMMER2), scalability
  5. illumos
    Descendant of: OpenSolaris (which was derived from UNIX System V)
  6. OpenIndiana
    Goal: Desktop/server OS based on illumos
  7. SmartOS
    Focus: Cloud-native virtualization with zones, ZFS, DTrace
  8. MidnightBSD
    Fork of FreeBSD, focused on desktop use
  9. Darwin
    Apple's open-source core of macOS (not a complete OS itself)
    Basis for macOS and iOS

Most those operating system are intended to run as server connected directly to internet with advance stability and security. 

Thursday, July 17, 2025

Debian 12: KVM Virtualization - creating guest (part 3)

To show available os for guest

$ virt-install --osinfo list | grep arch
archlinux

To use bridge add /etc/qemu/bridge.conf if not available and chmod file /usr/lib/qemu/qemu-bridge-helper
# mkdir /etc/qemu
# touch /etc/qemu/bridge.conf
# echo "allow br0" >> /etc/qemu/bridge.conf
# chmod u+s /usr/lib/qemu/qemu-bridge-helper

To create guest with name=guest01, disk size 10GB, Ram 2Gb (2048), virtual processor 2, os variant debian 12 (not available, we use debian11), boot from iso file: 

$ virt-install \
  --name guest01 \
  --memory 2048 \
  --vcpus 2 \
  --disk path=/home/dedetok/guests/guest01.qcoe2,size=10,bus=virtio \
  --cdrom /home/dedetok/Downloads/debian-12.11.0-amd64-netinst.iso \
  --nonetworks \
  --os-variant debian11 \
  --virt-type kvm

Parameters:

  • --name: name to identify guest
  • --ram: guest memory in megabytes
  • --vcpus: number of cpu for guest
  • --disk: path=<path_to_disk_image>,size=<disk_size_in_gb>,bus=virtio
    virtio is standard interface for virtual machines, it improve vm network performance
  • --cdrom: install from iso file or CD/DVD/USB
  • --nonetworks: no update or install from internet 
    or
    --network bridge=br0,model=virtio to use bridge network, see part 2
    For bridge see Network Bridge section

Options:

  1. Graphics option
    • --graphics vnc: Enables VNC for graphical access. If virt-viewer is installed, it will automatically launch. If not, you'll need to manually connect using a VNC client like vinagre or remmina.
    • --graphics spice: Enables SPICE for graphical access. SPICE is generally considered more modern and efficient than VNC.
    • --graphics none: Disables graphical access and forces a text-mode installation using the serial console.
  2. Disk option
    • Default folder for virtual disk /var/lib/libvirt/images/
      qcow2 offers features that raw (or img) doesn't:
      1. Snapshots: qcow2 allows you to create snapshots of your virtual machine's disk, enabling easy rollback to previous states.
      2. Compression: It can compress the disk image, potentially saving storage space.
      3. Sparse files: qcow2 supports sparse files, meaning it only allocates disk space for used portions of the image, which can be more efficient.
    • raw format (or just img when using virt-install) has no special features:
      It simply represents the raw data of the disk, which can be less flexible and potentially wasteful of disk space.

To show version
$ virsh version
Compiled against library: libvirt 9.0.0
Using library: libvirt 9.0.0
Using API: QEMU 9.0.0
Running hypervisor: QEMU 7.2.17

Managing VM

To List guest cm
$ virsh list --all

Connect to vm
$ virsh console [vm_name]
or using virt-viewer
$ virt-viewer [vm_name]

To edit vm
$ virsh edit [vm_name]

To start vm
$ virsh start [vm_name]

to restart vm
$ virsh reboot [vm_name] --mode initctl

to force stoping vm
$ virsh destroy [vm_name]

to force shutdown vm
$ virsh shutdown [vm_name] --mode acpi

to suspend vm
$ virsh suspend [vm_name]

to resume vm after suspend
$ virsh resume [vm_name]

to reset vm (similiar to pressing reset button on physical PC)
$ virsh reset [vm_name]

Restarting KVM Daemon
# systemctl restart libvirtd

to remove vm and its storage permanently
$ virsh undefine --managed-save --remove-all-storage [vm_name]

To make vm auto run after host restart (run once)
$ virsh autostart [vm_name]

Network bridge

Network configuration file:

  1. /etc/libvirt/qemu/networks/default.xmlfir active configuration
  2. /usr/share/libvirt/networks/default.xml for template

To enable network bridge for guest:

  1. turn up bridge interface
  2. list all network using virsh net-list
  3. if list is empty, define default network and edit default network to use existing bridge
  4. start network bridge

To turn up bridge interface
# ifup br0

To show bridge interface
# brctl show
bridge name    bridge id        STP enabled    interfaces
br0        8000.9aa237b1bcc8    no        enp2s0

To show network bridge (if list empty, see define default network)
$ virsh net-list --all

To define default network
$ virsh net-define /usr/share/libvirt/networks/default.xml

To undefined default network
$ virsh net-undefine default

To edit default network
$ virsh net-edit default

Change default network using edit default netowrk
<network>
  <name>default</name>
  <uuid>84b29e1f-b2c3-4230-bc21-fba0143c026c</uuid>
  <forward mode='bridge'/>
  <bridge name='br0'/>
</network>

To start network bridge
$ virsh net-start default

To auto start network bridge
$ virsh net-autostart default

To add manually bridge network into vm edit vm and add
<domain type='kvm'>
...
 <devices>
    <interface type='bridge'>
      <mac address='52:54:00:87:65:f6'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
...

References:

  • wiki.debian.org/KVM
  • wiki.debian.org/DebianInstaller/Preseed
  • wiki.debian.org/BridgeNetworkConnections


Sunday, June 29, 2025

Debian: repair micro SD card command line

Detect your micro SD card

# dmesg
[  482.261836] scsi 1:0:0:0: Direct-Access     Multiple Card  Reader     1.00 PQ: 0 ANSI: 0
[  482.265756] sd 1:0:0:0: Attached scsi generic sg1 type 0
[  483.034812] sd 1:0:0:0: [sdb] 3911680 512-byte logical blocks: (2.00 GB/1.87 GiB)
[  483.036904] sd 1:0:0:0: [sdb] Write Protect is off
[  483.036931] sd 1:0:0:0: [sdb] Mode Sense: 03 00 00 00
[  483.038288] sd 1:0:0:0: [sdb] No Caching mode page found
[  483.038321] sd 1:0:0:0: [sdb] Assuming drive cache: write through
[  483.058653]  sdb: sdb1
[  483.066093] sd 1:0:0:0: [sdb] Attached SCSI removable disk
# lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 298.1G  0 disk
├─sda1   8:1    0 103.6G  0 part
├─sda2   8:2    0   450M  0 part
├─sda3   8:3    0     1K  0 part
├─sda5   8:5    0 120.2G  0 part
├─sda6   8:6    0     2G  0 part [SWAP]
└─sda7   8:7    0  71.8G  0 part /
sdb      8:16   1   1.9G  0 disk
└─sdb1   8:17   1   1.9G  0 part 

Repair file system micro SD card

# umount /dev/sdb1
umount: /dev/sdb1: not mounted.
# umount /dev/sdb
umount: /dev/sdb: not mounted.
# fsck.vfat -a -w /dev/sdb1

option:

  • -a : automatic repair filesystem
  • -w : write change immediately

Format if there is no data you can saved and you want fresh storage in micro SD card 

# mkfs.vfat /dev/sdb1
mkfs.fat 4.2 (2021-01-31)


Tuesday, June 24, 2025

Debian 12: KVM Virtualization - configure bridge network in host (part 2)

By default, KVM Guest will able to use host connection to connect to lan and internet, but not vice versa.

To make host, guest and lan accessible each other, on network configuration we can use is bridging.

Install bridge-util 

# apt-get install bridge-utils
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
    bridge-utils
...

Configuring bridge

create bridge interface

# brctl addbr br0

show existing infterface

# ip address show
1: lo: ...
2: enp2s0: ... -> this is lan
3: wlo1: ...-> this is wifi and not supported
4: br0: ...

add interface to bridge

# brctl addif br0 enp2s0 

make it persistence, edit /etc/network/interface

...
# The loopback network interface
auto lo
iface lo inet loopback

# set interface manually, avoid conflict with network manager
iface enp2s0 inet manual
iface wlo1 inet manual

# bridge setup
# dhcp
# avoid conflict with network manager
#auto br0
iface br0 inet dhcp
   bridge_ports enp2s0
# for manual ipv4
# iface bro inet static
#   bridge_ports enp2s0
#   address 1192.168.1.2
#   broadcast 192.168.1.255
#   netmask 255.255.255.0
#   gateway 192.169.1.1

restart networking service

# systemctl restart networking

To make NetworkManager manage your network edit  /etc/NetworkManager/NetworkManager.conf, make sure managed=true

[main]
plugins=ifupdown,keyfile

[ifupdown]
#managed=false
managed=true

Reference:
wiki.debian.org/BridgeNetworkConnections

Wednesday, June 4, 2025

Debian 12: Installing KVM (Virtualization) (part 1)

Install kvm. as a root/sudo run 

# apt install qemu-system libvirt-daemon-system
...
0 upgraded, 83 newly installed, 0 to remove and 0 not upgraded.
Need to get 143 MB/143 MB of archives.
After this operation, 971 MB of additional disk space will be used.
Do you want to continue? [Y/n]

for server or you do not need any graphical packages

# apt install --no-install-recommends qemu-system libvirt-clients libvirt-daemon-system

You need to add user into libvirt group to let the user manage your guest virtual machine

# adduser [username] libvirt
Adding user `[username]' to group `libvirt' ...
Done.

if you prefer to use graphical, install virt-manager

# apt-get install virt-manager
...
0 upgraded, 28 newly installed, 0 to remove and 0 not upgraded.Need to get 4,780 kB of archives.
After this operation, 21.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

You can exit root mode and use the user above to manage your guest virtual machine.

Tuesday, April 29, 2025

Debian 12 on HP 15-AF109AX: installing Apache, MariaDB and phpmyadmin Part 3

Installing MariaDB, Apache and phpmyadmin:

apt-get install mariadb-server mariadb-client phpmyadmin apache2 libapache2-mod-php

Set password for mariadb root

# systemctl stop mariadb
# mysqld_safe --skip-grant-tables --skip-networking &
# mysql -u root
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.006 sec)
MariaDB [(none)]> ALTER USER 'root'@'localhost' IDENTIFIED BY 'your_new_password';
Query OK, 0 rows affected (0.017 sec)
MariaDB [(none)]> quit;
Bye

# ps aux | grep mariadb
mysql       3155 ....
# kill 3155
# systemctl start mariadb

Access your phpmyadmin using browser http://localhost/phpmyadmin.

Refrence: https://www.digitalocean.com/community/tutorials/how-to-reset-your-mysql-or-mariadb-root-password

Saturday, April 19, 2025

Debian 12 on HP 15-AF109AX: fix BCM43142 wifi adapter Part 2

Connect your laptop  HP 15-AF109AX  to internet using ethernet lan port.

Update kernel

# apt-get install  linux-image-6.1.0-33-amd64 

Install tools for network and wifi tools

# apt-get install wireless-tools firmware-linux-nonfree wpagui network-manager-gnome dnsutils bluez-firmware blueman

Installing wifi BCM43142 adapter

# apt-get install linux-image-$(uname -r|sed 's,[^-]*-[^-]*-,,') linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') broadcom-sta-dkms

Check all the built DKMS kernel modules. There should be "wl.ko" in the list.

# find /lib/modules/$(uname -r)/updates 

/lib/modules/6.1.0-33-amd64/updates 

/lib/modules/6.1.0-33-amd64/updates/dkms 

/lib/modules/6.1.0-33-amd64/updates/dkms/wl.ko

Unload conflicting modules:

# modprobe -r b44 b43 b43legacy ssb brcmsmac bcma

Load the wl module: 

# modprobe wl

Check wifi adapter interface is available

# nmcli dev 

DEVICE TYPE     STATE                  CONNECTION

lo     loopback connected (externally) lo

wlo1   wifi     disconnected           -- <- found wifi xxxx 

enp3s0 ethernet unmanaged              --

Edit NetworkManager Applet -> Edit Connection -> Add -> type Wifi, fill SSID and Wifi Security WPA3 password.

Done.

Reference: https://wiki.debian.org/wl

Debian 12 on HP 15-AF109AX: Installing dual boot Debian 12 Part 1

Shrink your hard disk, make 48 GB space. 40 GB for / parition
and 8 GB for swap.

I  use DVD net install amd64 Debian 12.0 for installation without internet.

Shift restart, select DVD/CD, and follow instruction during installation. 

Note: write down your root password and user with password.

After finish and restarting, login and connect your ethernet cable into HP 15-AF109AX.

Edit /etc/apt/sources.list

#deb cdrom:[Debian GNU/Linux 12.0.0 _Bookworm_ - Official amd64 NETINST with firmware 20230610-10:21]/ bookworm main non-free-firmware

#main
deb https://deb.debian.org/debian bookworm main contrib non-free-firmware non-free

#mirror auto
deb http://httpredir.debian.org/debian bookworm main
#mirror change with your flavor
#deb https://mirror.unair.ac.id/debian bookworm main

#security
deb https://security.debian.org/debian-security bookworm-security main contrib non-free-firmware non-free

#update
deb https://deb.debian.org/debian bookworm-updates main contrib non-free-firmware non-free

#backport
deb http://deb.debian.org/debian bookworm-backports main non-free

Run dhcp client

# dhclient -v

Try to ping internet e.q

# ping 1.1.1.1 -c 4

Update your debian

# apt-get update && apt-get upgrade -y

Edit /etc/default/grub

....
GRUB_DEFAULT=2
....
GRUB_DISABLE_OS_PROBER=false
....

Run update grub

# update-grub

Edit /etc/lightdm/lightdm.conf

....
greeter-hide-users=false
....

Install light Xfce4

# apt-get install xfce4 xfce4-goodies network-manager aptitude

Run startx or restart to use GUI.



Monday, August 5, 2024

windows: disable fast start for multiple OS (dual boot)

Hibernation saves an image of your work and shuts down your computer or put your computer into sleep mode.

Fast Startup only saves an image of the system kernel and loaded drivers to reduce boot time.

Fast Startup may not suitable for System:

  1. multiple os except you never access/share data between multiple os.
  2. maintenance
  3. hardware change

Step to disable fast startup 

  1. Search -> Choose a power plan -> Choose what the power buttons do -> Change settings that are currently unavailable
  2. uncheck "Turn on fast start (recommendation)"
  3. save change and restart

 

Wednesday, July 17, 2024

Debian: using Festival to generate voice from text (Text To Speech/TTS) - AI TTS

folder voice

$ ls /usr/share/festival/voices/english/

Using command interpreter:

$ festival
...
festival> (voice.list)
(kal_diphone)
festival> (SayText "Hello")
#<Utterance 0x7f8747f99ef0>

festival> (quit)

Load text from file output direct to sound

$ festival --tts ./hello.txt 

Load text from file output direct to file

$ text2wave ./hello.txt -o text1.wav

Sunday, February 11, 2024

Openssl s_client to verify SSL

Syntax general: openssl s_client [-connect host:port] [option]

 

Get and read openssl s_client output 

$ echo "Get HTTP/1.0" | openssl s_client google.com:443
CONNECTED(00000003)
depth=2 C = US, O = Google Trust Services LLC, CN = GTS Root R1
verify return:1                        <- verification chain 2 ok
depth=1 C = US, O = Google Trust Services LLC, CN = GTS CA 1C3
verify return:1                        <- verification chain 1 ok
depth=0 CN = *.google.com
verify return:1                        <- verification chain 0 ok
---
Certificate chain
 0 s:CN = *.google.com
   i:C = US, O = Google Trust Services LLC, CN = GTS CA 1C3
   a:PKEY: id-ecPublicKey, 256 (bit); sigalg: RSA-SHA256
   v:NotBefore: Jan  9 06:25:08 2024 GMT; NotAfter: Apr  2 06:25:07 2024 GMT
 1 s:C = US, O = Google Trust Services LLC, CN = GTS CA 1C3
   i:C = US, O = Google Trust Services LLC, CN = GTS Root R1
   a:PKEY: rsaEncryption, 2048 (bit); sigalg: RSA-SHA256
   v:NotBefore: Aug 13 00:00:42 2020 GMT; NotAfter: Sep 30 00:00:42 2027 GMT
 2 s:C = US, O = Google Trust Services LLC, CN = GTS Root R1
   i:C = BE, O = GlobalSign nv-sa, OU = Root CA, CN = GlobalSign Root CA
   a:PKEY: rsaEncryption, 4096 (bit); sigalg: RSA-SHA256
   v:NotBefore: Jun 19 00:00:42 2020 GMT; NotAfter: Jan 28 00:00:42 2028 GMT
---
Server certificate
-----BEGIN CERTIFICATE-----
... <TRUNCATED> ...
-----END CERTIFICATE-----
subject=CN = *.google.com
issuer=C = US, O = Google Trust Services LLC, CN = GTS CA 1C3
---
No client certificate CA names sent
Peer signing digest: SHA256
Peer signature type: ECDSA
Server Temp Key: X25519, 253 bits
---
SSL handshake has read 6833 bytes and written 396 bytes
Verification: OK                    <- handshake verification ok
---
New, TLSv1.3, Cipher is TLS_AES_256_GCM_SHA384
Server public key is 256 bit
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)
---

Use openssl s_client to export certificate PEM into a file (output file: certfs.pem)

$ echo "Get HTTP/1.0" | openssl s_client -showcerts -connect google.com:443 </dev/null | sed -n -e '/-.BEGIN/,/-.END/ p' > certifs.pem
depth=2 C = US, O = Google Trust Services LLC, CN = GTS Root R1
verify return:1
depth=1 C = US, O = Google Trust Services LLC, CN = GTS CA 1C3
verify return:1
depth=0 CN = *.google.com
verify return:1
DONE

Get fingerprint SHA1 in byte

$ echo "Get HTTP/1.0" | openssl s_client -connect google.com:443 < /dev/null 2>/dev/null | openssl x509 -fingerprint -noout -in /dev/stdin

Fingerprint SHA256 in byte

$ echo "Get HTTP/1.0" | openssl s_client -connect google.com:443 < /dev/null 2>/dev/null | openssl x509 -fingerprint -sha256 -noout -in /dev/stdin

Fingerprint SHA256 in base64 encode

$ echo "Get HTTP/1.0" | openssl s_client -connect google.com:443 | \
    openssl x509 -pubkey -noout | \
    openssl rsa -pubin -outform der | \
    openssl dgst -sha256 -binary | \
    openssl enc -base64 

To get service sertificates

$ echo "Get HTTP/1.0" | openssl s_client -connect google.com.com:443 -showcerts

For Let's Encrypt, here is official information about compatibility platforms (operating system, browser and java virtual machine,  <https://letsencrypt.org/docs/certificate-compatibility/>

Reference:

  • https://www.openssl.org/docs/man1.0.2/man1/openssl-s_client.html
  • https://www.baeldung.com/linux/ssl-certificates


Friday, January 26, 2024

Personal mysql/mariadb sql command references

Using mysqladmin 

Set password root using mysqladmin

# mysqladmin -u root password

Sql syntax to change password 

> SET PASSWORD FOR 'bob'@localhost = PASSWORD("");

Using mysql client 

$ mysql -u [user_name] -p

Show users:

> select User from mysql.user;

Add user:

> create user `test`@`localhost`;
> SELECT User FROM mysql.user;

Set user password

> alter user [user_name] identified by [new_password];

Show database:

> show databases;

Add database: 

> create database `test`;
> SHOW DATABASES;
> grant all privileges on test.* to 'test'@'localhost` ;
> flush privileges;

Show table:

> use test;
> show tables;

create table:

> use test;
> create table product(id mediumint, name varchar(100));

Backup a single database
$ mysqldump -u [username]  -p [database_name]  > [backup_file_name].sql

Restore a single database

  1. create database, user, and password
  2. run command
    $ mysql -u [username] -p [database_name] < [backup_file_name].sql


Note: Do not use root account to create user table, use particular user to create table.
 


Monday, November 6, 2023

repair grub after windows updating bios on lenovo ideaPad gaming 3 AMD 7535h (15”)

Insert Debian installer DVD/CD or USB and change boot order

  1. Keep press shift + restart windows -> troubleshoot -> UEFI Firmware Setting -> Restart
  2. Change boot order to Debian installer media

Boot into Debian

  1. Boot into Debian installer DVD/CD or USB, then press c to enter grub command. If the screen goes blank (for CD boot older then existing grub version), press ESC until you get prompt grub>
  2. Get Debian partition using grub> ls and find Filesystem type ext* or your existing filesystem (see the picture below)
  3. Get Debian grab from Debian partition e.q grub> ls (hd0,gpt7)/boot and find Debian grub folder  (see the picture below) 
  4. Run command to start existing Debian e.q
grub> set root=(hd0,gpt7)
grub> set prefix=(hd0,gpt7)/boot/grub
grub> insmod normal
grub> normal
 
After you enter 'normal', the screen will return to GUI and your 'Debian' option will appear in boot option. Select it to run your existing debin in hard drive.

Repair grub using 

# grub-install
# update-grub

Every time you update your firmware via windows, your grub boot will lost. It's so annoying. Unfortunately, there is not much tool available to automatically check and update bios for Debian. Debian still stable using old bios, but not in windows.  

Monday, July 17, 2023

Debian Bookworm: Configure printer and scanner HP Ink 415 Wireless (all in one)

Install required packages for printer and scanner

# apt-get install system-config-printer hplip cups hplip-ppds  

To configure printer:

  1. Applications -> Settings -> Print Settings
  2. Add new printer
  3. Select Network Printer -> AppSocket/HP JetDirect and fill Enter Host with printer's IP address

Install XSane for scanning image

# apt-get install xsane sane-utils

To configure scanner:

  1. Run XSane to configure scanner
  2. After XSane detected HP Printer & Scanner, select Hewlett-Pac and press Ok.

To install driver print to pdf

# apt-get install printer-driver-cups-pdf



Wednesday, July 12, 2023

Debian Bookworm: change grub resolution on boot using grub-customizer to 640x480

Install grub customizer

# apt-get install  grub-customizer  

To change grub resolution on boot:

Applications -> Settings -> Grub Customizer -> Appearance Settings -> custom resolution 640x480

Wednesday, July 5, 2023

Debian Bookworm: installing Apache2, MariaDB and PHP 8.2 (default)

 Installing MariaDB database

# apt-get install mariadb-client mariadb-server  

Install apache2 and PHP

# apt-get install apache2 php libapache2-mod-php php8.2-mysql

By default, PHP version for Debian Bookworm is 8.2.

To disable apache2 and mariadb start during boot (to faster your PC start, not recommended for live server)

# systemctl disable apache2
# systemctl disable mariadb

You can start and stop manualy after boot.

Install additional php 8.2 required by CodeIgniter

# apt-get install php8.2-curl php8.2-imagick php8.2-gd php8.2-intl php8.2-mbstring php8.2-memcache php8.2-memcached php8.2-redis php8.2-xml php8.2-phpdbg