Ubuntu 管理心得

搜尋此網誌

2026年6月15日 星期一

Wipe m2 ssd where the M.2 SSD is installed in an external USB-M2 and appears as a USB external drive

Make sure disk using lsblk, say, /dev/sdc 

sudo dd if=/dev/zero of=/dev/sdc bs=64M status=progress

 

restore clonezilla files

All the followings are in root shell or using sudo:
 
mkdir /mnt/decrypt
mount -t ecryptfs /media/chiao/MyBook_sdx7_2.4T/clonezilla/2026-06-15-08-img_M2SSD1TB_MyOffice_kpci7_anbsty/ /mnt/decrypt
 
Suppose we want to open some files in sdc11.ext4-ptcl-img.zst:
Inside krusader, uncompress /mnt/decrypt/sdc11.ext4-ptcl-img.zst to /vmware, then
get /vmware/sdc11.ext4-ptcl-img.

partclone.restore --restore_raw_file -C -s /vmware/sdc11.ext4-ptcl-img -o /vmware2/sdc11.img
 
Inside krusader, disk mount /vmware2/sdc11.img, and all the files of sdc11.img are in /media/chiao/9b7d3fd8-9727-4fb5-abd6-88178044dc4b
 

 

2026年5月24日 星期日

Configure Sudo Without Password on Ubuntu 26.04

 cf: https://linuxconfig.org/how-to-configure-sudo-without-password-on-ubuntu-26-04

 

$ sudo visudo -f /etc/sudoers.d/chiao-nopasswd
chiao ALL=(ALL) NOPASSWD: ALL 
$ sudo chmod 0440 /etc/sudoers.d/chiao-nopasswd 


2026年5月9日 星期六

Open WebUI: Server Connection Error

cf: https://github.com/open-webui/open-webui#troubleshooting

 

Open WebUI: Server Connection Error

If you're experiencing connection issues, it’s often due to the WebUI docker container not being able to reach the Ollama server at 127.0.0.1:11434 (host.docker.internal:11434) inside the container . Use the --network=host flag in your docker command to resolve this. Note that the port changes from 3000 to 8080, resulting in the link: http://localhost:8080.

Example Docker Command:

docker run -d --network=host -v open-webui:/app/backend/data -e OLLAMA_BASE_URL=http://127.0.0.1:11434 --name open-webui --restart always ghcr.io/open-webui/open-webui:main

2026年5月8日 星期五

yt-dlp subtitle 字幕

yt-dlp --embed-subs --sub-langs "zh-Hant,zh-TW" --write-subs -o <output fname> -f 'bestaudio+bv' --merge-output-format mp4 <https://some/web> 

 

2026年2月1日 星期日

Boshiamy in macos

  1. cp my.cin ~/Library/Input\ Methods/
  2. 打開「系統偏好設定」的「鍵盤」,在「輸入方式」頁籤點選左下角的「+」
  3. 在「簡體中文」找到「嘸蝦米」,將它加入

 

2026年1月8日 星期四

Google Drive under rclone

Setting up
Google Drive with
rclone config involves creating a "remote" connection through an interactive terminal wizard. 
 
Step 1: Start the Configuration
Open your terminal and run the following command:
bash
rclone config
Step 2: Create a New Remote
  1. Type n for New remote and press Enter.
  2. Name: Enter a name for your drive (e.g., gdrive) and press Enter.
  3. Storage Type: You will see a long list of providers. Find Google Drive (often listed as drive) and enter its corresponding number or type drive. 

Step 3: API Credentials (Optional but Recommended) 
  • Client ID & Client Secret: You will be prompted for a client_id and client_secret.
    • Recommended: Create your own via the Google API Console to avoid rate limits and improve performance.
    • Quick Start: If you are in a hurry, leave these blank and press Enter to use rclone's default shared credentials. 

Step 4: Configure Access Scope 
Select the level of access rclone should have. 
  1. Type 1 for Full access to all files (recommended) and press Enter.
  2. Root Folder ID: Leave this blank and press Enter to use your main Drive directory.
  3. Service Account File: Leave this blank and press Enter. 

Step 5: Authentication
  1. Edit advanced config? Type n and press Enter.
  2. Use auto config?
    • Type y if you are on a computer with a web browser. A browser window will open; log in to your Google account and click Allow.
    • Type n if you are on a headless server (SSH). Rclone will provide a link to open on another computer and a code to paste back into the terminal. 

Step 6: Finalize
  1. Configure as a Shared Drive? Type n for a personal drive.
  2. Verify: Rclone will show a summary. Type y to confirm the settings.
  3. Type q to Quit the config wizard. 

Step 7: Test the Connection
Verify it works by listing the files in your Drive: 
bash
rclone ls gdrive:
(Do not miss : )
 
 
Using Rclone (Recommended for Stability)
  1. Install & Configure: Install rclone and run rclone config to set up your Google Drive as a "remote" (e.g., named gdrive).
  2. Mount to a Local Folder: Create a folder and mount the drive to it:
    bash
    mkdir ~/google_drive
    rclone mount gdrive: ~/google_drive &
     

One more thing: Inside krusader, it is easy to access google_drive just like an ordinary folder. That means, I can sync, copy, delete ... files in google_drive. 

However, sync indside krusader is slow. 

 

 

網誌存檔