14 May 2026

How to get inventory information of all the hosts on a network?

nmap -A -T4 -oN network_scan.txt 192.168.2.0/24

  • -A (Aggressive / Advanced Scan): This is a convenient shortcut that enables four powerful features at once:
    • OS Detection: Attempts to identify the operating system of the target.
    • Version Detection: Probes open ports to determine the exact software and version numbers running on the services.
    • Script Scanning: Runs a default set of Nmap Scripting Engine (NSE) scripts to gather extra information or spot common vulnerabilities.
    • Traceroute: Maps the network path taken from your machine to the target.
  • -T4 (Aggressive Timing): This timing template tells Nmap to run a faster, more aggressive scan. It assumes you are on a reasonably fast and reliable network and makes adjustments (like reducing the wait times between probes and capping timeouts) to speed up execution.
  • -oN (Normal Output): This tells Nmap to save the results to a text file in a human-readable format. You must follow this flag with your desired file name (e.g., -oN scan_results.txt).

  •  

    ================= 

    $ sudo nmap -sV -O -R --dns-servers 192.168.0.1 -T4 -vv -oN network_scan.txt 192.168.0.0/24

    -sV: service version detection 

    -O: OS identification

    -R: Force reverse DNS lookup for all hosts

    --system-dns: Use your system's DNS resolver (often better on home networks)

    -T4: Faster scan timing (good balance between speed and accuracy)

    -v or -vv: Increase verbosity so you see hostnames as they are discovered

    -oN: Then you can open network_scan.txt with any text editor

     

    14 April 2026

    How can I find duplicated files within a directory, please?

    Finding duplicate files on Linux is a common task, and since you are already comfortable with the terminal, there are a few ways to do this—ranging from a quick manual check to using specialized tools.

    1. The Pro Way: Using fdupes or jdupes

    This is the most efficient method. fdupes (or the faster, more modern version jdupes) scans directories for files with identical sizes and then compares their MD5 signatures to confirm they are exact duplicates.

    Installation:

    Bash
    sudo apt update
    sudo apt install jdupes
    

    How to use it:

    • To find and list duplicates:

      jdupes /home/shermanchen/my_folder

    • To see the size of space wasted by duplicates:

      jdupes -S /home/shermanchen/my_folder

    • To delete duplicates automatically (keeping the first one found):

      jdupes -dN /home/shermanchen/my_folder


    2. The Built-in Way (No installation required)

    If you don't want to install new software, you can use a combination of standard Linux tools. This command creates an MD5 hash for every file, sorts them, and highlights the ones that appear more than once.

    Bash
    find . -type f -exec md5sum {} + | sort | uniq -w32 -dD
    

    Breakdown of what this does:

    1. find . -type f: Finds all files in the current directory.

    2. -exec md5sum {} +: Calculates the unique "fingerprint" (MD5) for every file.

    3. sort: Groups identical fingerprints together.

    4. uniq -w32 -dD: Compares the first 32 characters (the hash) and prints only the lines that are duplicates.


    3. Visual Way: Using fslint or Czar

    If you prefer a GUI (Graphic User Interface) to safely look at the files before deleting them, you can use FSlint.

    Bash
    sudo apt install fslint
    

    Once installed, search for "FSlint" in your Ubuntu dashboard. It has a dedicated "Duplicates" tab that lets you search and select files to delete with a checkbox.


    A Warning for your Backup

    Since you just ran an rsync backup, be very careful when running duplicate finders on your backup drive.

    If you use a tool like jdupes with the -L (link) option, it can turn duplicates into hard links. This saves space by making two file names point to the same data on the disk, which is a great way to optimize a server without actually losing data.

    Which directory are you planning to scan? If it's a massive media folder, I highly recommend jdupes for its speed.


    13 April 2026

    How to start/stop/enable/disable manually OpenClaw, Hermes, Signal?

    Sherman: 

    Gemini, both my OpenClaw agent and Hermes agent start automatically when my laptop is turned on. Even when I kill both the processes, both start again in a few seconds.

    Could you instruct me to change it, so both do not start automatically, please? I prefer that I start either of the both manually.

     

    Gemini:

     

     

    It sounds like you're playing a game of "whack-a-mole" with your processes! The reason they keep coming back is that they are managed by systemd. When you kill a process managed this way, systemd sees the "failure" and immediately restarts it to ensure the service stays active.

    Based on your setup, here is how to stop them from starting automatically and switch to manual control.

    1. Disable the Hermes Gateway (User Service)

    Your Hermes agent is running as a user-level service. You’ll need to stop the current instance and then "disable" it so it doesn't launch at boot.

    Run these commands in your terminal:

    Bash
    # Stop the running service
    systemctl --user stop hermes-gateway.service
    
    # Prevent it from starting at boot
    systemctl --user disable hermes-gateway.service
    

    2. Disable the Signal Daemon (System Service)

    Since the Signal daemon (which supports Hermes) runs as a system-wide service, you'll need to use sudo for these:

    Bash
    # Stop the daemon
    sudo systemctl stop signal-daemon.service
    
    # Disable it from starting at boot
    sudo systemctl disable signal-daemon.service
    

    3. Regarding OpenClaw

    If you are seeing an OpenClaw-related process despite having uninstalled it previously, it might be a leftover service unit or a different script triggering it. You can check if a service still exists for it by running:

    systemctl list-unit-files | grep -i openclaw

    If it shows up, run:

    Bash
    sudo systemctl stop openclaw.service
    sudo systemctl disable openclaw.service
    

    How to start them manually from now on

    Whenever you actually want to use them, you don't need to change your configuration back. Just "start" them for that session only:

    • To start Hermes: systemctl --user start hermes-gateway.service

    • To start Signal: sudo systemctl start signal-daemon.service

    Note: Since you have "lingering" enabled for your user account, these services would normally stay running even if you logged out. Disabling them as shown above is the correct way to ensure they only run when you explicitly ask them to.

    Does that clear up the "auto-restart" headache for you?

     

    Sherman:

     

    shermanchen@serverlenovo:~$ systemctl list-unit-files | grep -i openclaw
    shermanchen@serverlenovo:~$ 
    shermanchen@serverlenovo:~$ 
    shermanchen@serverlenovo:~$ 
    shermanchen@serverlenovo:~$ 
    shermanchen@serverlenovo:~$ lsof -i :18789
    COMMAND    PID        USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
    openclaw- 4757 shermanchen   22u  IPv4  34619      0t0  TCP localhost:18789 (LISTEN)
    openclaw- 4757 shermanchen   23u  IPv6  34620      0t0  TCP ip6-localhost:18789 (LISTEN)
    shermanchen@serverlenovo:~$ 
    shermanchen@serverlenovo:~$ 
    shermanchen@serverlenovo:~$ 
    shermanchen@serverlenovo:~$ 
    shermanchen@serverlenovo:~$ sudo systemctl stop openclaw.service
    Failed to stop openclaw.service: Unit openclaw.service not loaded.
    shermanchen@serverlenovo:~$ 

     

    Gemini:

    That is definitely a bit of a "ghost in the machine" situation! Since systemctl doesn't see a service file, but the process is clearly running and listening on port 18789, it isn't being managed by a standard system-wide service.

    The fact that it restarts after being killed suggests something else is acting as a "watchdog." Here is how to track down what is actually triggering it:

    1. Check User-Level Systemd Services

    Since you are logged in as shermanchen and the process is owned by you, it might be a user-service rather than a system-service. Your previous command only checked the system level.

    Try this:

    Bash
    systemctl --user list-unit-files | grep -i openclaw
    

    If it appears there, run:

    Bash
    systemctl --user stop openclaw.service
    systemctl --user disable openclaw.service
    

    2. Check for a Crontab "Keep-Alive"

    Sometimes scripts are set to run every minute via Cron to make sure they are alive. Check your user crontab:

    Bash
    crontab -l
    

    Look for any line referencing openclaw or a script that might be starting it.

    3. Inspect the Process Parent

    To see exactly "who" is responsible for starting that PID 4757, you can look at the process tree. This will tell us if it was started by systemd, screen, tmux, or another script.

    Run:

    Bash
    ps -fjp 4757
    
    • Look at the PPID (Parent Process ID). * If the PPID is 1, it’s a daemon/systemd.

    • If the PPID leads to something like bash or python, it’s a script loop.

    4. Search for the Binary Location

    Since you thought you uninstalled it, let's find out exactly where this running version lives:

    Bash
    ls -l /proc/4757/exe
    

    This will show you the absolute path to the file that is currently running.

    5. Check "Lingering" and PM2

    If you have ever used PM2 (a common process manager for developers), it might be managing it silently. Check with:

    Bash
    pm2 list
    

    What to do next:

    If the systemctl --user command from Step 1 doesn't find it, please let me know what the PPID and the path from Steps 3 and 4 are. That will give us the smoking gun!

     

    Sherman:

    shermanchen@serverlenovo:~$ systemctl --user start hermes-gateway.service 
    shermanchen@serverlenovo:~$ sudo systemctl --user start signal-daemon.service
    Failed to connect to bus: No medium found

     

    Gemini:

    It looks like you ran into a classic systemd permissions mix-up!

    The error Failed to connect to bus: No medium found usually happens when you try to run a user command with sudo. Because sudo switches you to the "root" user, it loses track of your specific user's "bus" (the communication channel for your user-level services).

    Here is the quick fix for both services:

    1. The Correct Commands

    For Hermes, you did it perfectly the first time. For the Signal Daemon, it depends on how it was installed. If it's a system-wide service, you don't use the --user flag.

    • To start Hermes (User level):

      Bash
      systemctl --user start hermes-gateway.service
      
    • To start Signal (System level):

      Bash
      sudo systemctl start signal-daemon.service
      

      (Note: I removed --user here. If you specifically installed Signal as a user service, just run systemctl --user start signal-daemon.service without sudo.)


    2. Back to the "Ghost" OpenClaw

    Since you are still seeing OpenClaw running on port 18789, let's try one more targeted command to see exactly what is keeping it alive. Run this:

    Bash
    ps -up 4757
    

    Why this helps:

    • It will show the Command line used to start it.

    • If it says something like python3 openclaw.py or ./openclaw-linux, we’ll know the exact file location.

    One other possibility:

    Do you use Docker? Sometimes a container is set to restart: always. You can check by running:

    docker ps | grep openclaw

    If you find the path or the parent process, I can give you the exact command to kill it for good (or at least until you're ready to use it manually). What does that ps -up 4757 output look like?

     

     

    03 April 2026

    How to convert .wav files into .mp3 ones?

    Converting WAV to MP3 (Offline)
    If you need an MP3 file instead of WAV, use lame:
    1. Install Lame: sudo apt-get install lame
    2. Convert: lame -V2 output.wav output.mp3

    How can I convert a text file into an audio file without internet access on ubuntu?

    $ pip install piper-tts

     

    Since you installed it via pip, you can use the piper command directly in your terminal. Because Piper is a "neural" text-to-speech engine, it doesn't come with voices built-in; you have to provide a model file (.onnx) and its configuration file (.json).

    Here is the workflow to convert your text file:

    1. Get a Voice Model

    If you haven't already, download a voice from the official repository. You need both files for a specific voice (e.g., en_US-lessac-medium.onnx and en_US-lessac-medium.onnx.json).

    2. The Conversion Command

    To convert a text file (let's call it input.txt) into an audio file (output.wav), use the following syntax:

    Bash
    piper --model /path/to/voice.onnx < input.txt --output_file output.wav
    

    3. Practical Example

    If your text file is named script.txt and your model is in the same folder, run:

    Bash
    cat script.txt | piper --model en_US-lessac-medium.onnx --output_file speech.wav
    

    Pro Tips for Better Usage

    • Adjusting Speed: Use the --length_scale flag. A higher number makes it slower, a lower number makes it faster.

      • Example (Slower): --length_scale 1.5

    • Adding Pause/Sentence Gap: Use the --sentence_silence flag to add seconds of silence between sentences.

      • Example: --sentence_silence 0.5

    • Batch Processing: If you want to listen to the file immediately without saving it, you can pipe it to a player like aplay (built-in to Ubuntu):

      Bash
      cat script.txt | piper --model en_US-lessac-medium.onnx --output-raw | aplay -r 22050 -f S16_LE -t raw
      

    Quick Note: If you get a "command not found" error, your pip script folder might not be in your PATH. You can usually fix this by running python3 -m piper instead of just piper at the start of the command.

    Do you have a specific voice or language in mind, or are you looking for recommendations on the best-sounding models?

     

    Sorry, I open the page, but can not find en_US-lessac-medium.onnx and en_US-lessac-medium.onnx.json

     

    # Download the .onnx model file
    wget -O en_US-lessac-medium.onnx "https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_US/lessac/medium/en_US-lessac-medium.onnx?download=true"

    # Download the .json config file
    wget -O en_US-lessac-medium.onnx.json "https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_US/lessac/medium/en_US-lessac-medium.onnx.json?download=true"

     

    # Download the .onnx model file (approx. 114MB)
    wget -O en_GB-cori-high.onnx "https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_GB/cori/high/en_GB-cori-high.onnx?download=true"

    # Download the .json config file
    wget -O en_GB-cori-high.onnx.json "https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_GB/cori/high/en_GB-cori-high.onnx.json?download=true"

     

    Run the conversion

    Once those are finished, use this command to convert your text file (e.g., input.txt) to a UK-voiced audio file:

    Bash
    cat input.txt | piper --model en_GB-cori-high.onnx --output_file uk_speech.wav
    

    Other UK Options

    Gemini, could you give me the commands for downloading some other GB voice models, please? Thank you!
     

    Here are the commands for some of the most popular British (UK) voice models available for Piper. Each model has a slightly different personality and quality level.

    1. Alan (Male - Medium Quality)

    This is a standard, clear male British voice.

    Bash
    # Model
    wget -O en_GB-alan-medium.onnx "https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_GB/alan/medium/en_GB-alan-medium.onnx?download=true"
    
    # Config
    wget -O en_GB-alan-medium.onnx.json "https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_GB/alan/medium/en_GB-alan-medium.onnx.json?download=true"
    

    2. Southern English Female (Female - Low Quality)

    Despite being "low" quality, it is very fast and efficient, with a distinct southern accent.

    Bash
    # Model
    wget -O en_GB-southern_english_female-low.onnx "https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_GB/southern_english_female/low/en_GB-southern_english_female-low.onnx?download=true"
    
    # Config
    wget -O en_GB-southern_english_female-low.onnx.json "https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_GB/southern_english_female/low/en_GB-southern_english_female-low.onnx.json?download=true"
    

    3. VCTK (Multi-speaker - Medium Quality)

    The VCTK model is unique because it contains dozens of different British speakers in one file. You can switch between them using the --speaker flag (e.g., --speaker 0, --speaker 1, etc.).

    Bash
    # Model
    wget -O en_GB-vctk-medium.onnx "https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_GB/vctk/medium/en_GB-vctk-medium.onnx?download=true"
    
    # Config
    wget -O en_GB-vctk-medium.onnx.json "https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_GB/vctk/medium/en_GB-vctk-medium.onnx.json?download=true"
    

    How to use them

    Just swap the model name in your command. For example, to use the Alan voice:

    Bash
    cat temp03.txt | piper --model en_GB-alan-medium.onnx --output_file output_alan.wav
    

    Pro Tip: Automating the check

    Since you've had issues with corrupted downloads before, you can run this quick "check" after downloading to see if the file is valid:

    Bash
    # This will show the size; Alan should be ~15MB, VCTK ~45MB
    ls -lh *.onnx
    

    If you ever want to try a Northern English accent, there is also a northern_english_male model available—just let me know and I'll grab those links for you!

     

    Yes, please. Thank you!

     

    The Northern English voice is a great choice—it has a very distinct, warm character compared to the standard "Received Pronunciation" (London-style) voices.

    Here are the commands for the Northern English Male model (Medium quality):

    1. Download the Northern English Voice Files

    Bash
    # Download the .onnx model file (approx. 63MB)
    wget -O en_GB-northern_english_male-medium.onnx "https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_GB/northern_english_male/medium/en_GB-northern_english_male-medium.onnx?download=true"
    
    # Download the .json config file
    wget -O en_GB-northern_english_male-medium.onnx.json "https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_GB/northern_english_male/medium/en_GB-northern_english_male-medium.onnx.json?download=true"
    

    2. Run the conversion

    Use this command to hear the new accent:

    Bash
    cat temp03.txt | piper --model en_GB-northern_english_male-medium.onnx --output_file northern_uk.wav
    

    A Quick Tip for Your Setup

    Since you've downloaded several voices now, your folder might be getting a bit crowded. You can verify all your available models at once with:

    Bash
    ls -lh *.onnx
    

    Common Model Sizes for Comparison:

    • Cori (High): ~114 MB

    • Northern English (Medium): ~63 MB

    • Alan (Medium): ~15 MB

    If any of these files show a size of only a few KB, they didn't download correctly—just delete that specific file and run the wget command for it again.

    Enjoy the new voice! It’s one of the more unique ones in the British collection.