2026年8月2日 星期日

Dbeaver Community 26.1.3

Connections, Bookmarks, Dashboards, Diagrams, Scripts

在 DBeaver 中,這五個專案組件(Connections, Bookmarks, Dashboards, Diagrams, Scripts)並沒有工具內定的強制執行順序,但從專案開發與管理的高效邏輯來看,確實存在一個最佳的「先後順序」。

建立專案時,建議遵循以下四大階段的優先順序:

1. 核心基礎(必須最先執行)

  • Connections(資料庫連線):這是所有操作的起點。沒有連線,你就無法讀取資料、儲存腳本或產生圖表。

2. 結構探索與設計(第二階段)

  • Diagrams(ER 圖/結構圖):連線成功後,先透過 Diagrams 產生或設計實體關係圖。這能幫你快速理解資料庫結構、資料表之間的關聯(Foreign Keys),為後續寫 SQL 奠定基礎。

3. 開發與常用操作(第三階段)

  • Scripts(SQL 腳本):理解結構後,開始撰寫 SQL 進行資料查詢、開發或維護。這是日常工作最頻繁使用的部分。
  • Bookmarks(書籤):在撰寫腳本或瀏覽大量資料表時,將最常用、最深層或最複雜的資料庫物件(如某個特定的視圖 View 或預存程序)加入書籤,方便日後秒速跳轉。

4. 資料視覺化與監控(最後階段)

  • Dashboards(儀表板):當你的連線穩定、結構清晰、且常用的查詢腳本都寫好之後,最後才是將這些查詢結果模組化,建立成 Dashboards,用來做即時的資料監控或數據視覺化呈現。

💡 總結工作流建議

Connections(連線) ➡️ Diagrams(看懂結構) ➡️ Scripts(寫程式) ➡️ Bookmarks(存常用路徑) ➡️ Dashboards(做報表監控)

2024年8月3日 星期六

Debian 12 Bookworm 安裝問題紀錄

  • 使用者:
    Debian 12 安裝時所預設的使用者,並非sudoers,而是一般使用者。所以下 sudo 指令前,先到 設定 --> 使用者 -->新增一個管理員,登出預設的使用者,登入新增的管理員,到 設定 --> 使用者 -->將預設的使用者身份改為管理者,登出新增的管理員,登入預設的使用者,到 設定 --> 使用者 -->移除新增的管理員

  •  輸入法狀態
    Debian 12 預設使用者第一次用會問語系,將中文改為中文(新酷音),然後到 設定 -->鍵盤 將漢語拿掉,加入英語(美式)。至於右上角的 Input Method Panel 位址的顯示,則是由 Gnome shell 的擴充套件所控制,要自行安裝。

  •  apt deb822 格式
    Debian 12 是第一個使用 apt deb822 格式的發行版本,它的源檔案不在 /etc/apt/sources.list (現仍有效) ,而是 /etc/apt/sources.list.d/debian.sources。

  • 下 add-apt-repository 指令出現 python3 錯誤。
    $ sudo apt-get install python3-launchpadlib

  • 如果他不認識你的無線網卡
    $ lsusb (看網卡的製造公司名)
    $ sudo apt-get install firmware-網卡的製造公司名
  • 將 FireFox ERS 改為一般 FireFox

    1. 如果電腦裡沒有儲存 APT 倉庫金鑰的資料夾,那就先造一個。
      sudo install -d -m 0755 /etc/apt/keyrings
    2. 匯入 Mozilla APT 倉庫的簽名金鑰。
      wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null
      (如果你沒安裝 wget,先用後面語法安裝:sudo apt-get install wget)
    3. 輸入下列指令,螢幕上將出現如下字樣 35BAA0B33E9EB396F59CA838C0BA5CE6DC6315A3
      gpg -n -q --import --import-options import-show /etc/apt/keyrings/packages.mozilla.org.asc | awk '/pub/{getline; gsub(/^ +| +$/,""); if($0 == "35BAA0B33E9EB396F59CA838C0BA5CE6DC6315A3") print "\nThe key fingerprint matches ("$0").\n"; else print "\nVerification failed: the fingerprint ("$0") does not match the expected one.\n"}'
    4. 接著,將 Mozilla APT 倉庫加入到你的源表列中。
      echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | sudo tee -a /etc/apt/sources.list.d/mozilla.list > /dev/null
    5. 設定 APT 到達 Mozilla 倉庫的順位套件編號。
      echo '
      Package: *
      Pin: origin packages.mozilla.org
      Pin-Priority: 1000
      ' | sudo tee /etc/apt/preferences.d/mozilla
    6. 更新你的套件列表,並安裝 Firefox .deb 套件。
      sudo apt-get update && sudo apt-get install firefox

  •  

2022年12月4日 星期日

在 Linux 上安裝 VPN -- 以 NordVPN 為例

方法一

  • 安裝 NordVPN 應用程式

    1. $ sh <(curl -sSf https://downloads.nordcdn.com/apps/linux/install.sh)
    2. 沒有 curl 可以安裝 $ sudo apt install curl
  • NordVPN 指令集

    1. nordvpn login - Log in.

    2. nordvpn connect or nordvpn c - Connect to VPN. To connect to specific servers, use nordvpn connect <country_code server_number> (eg. nordvpn connect uk715) 

    3. nordvpn disconnect or nordvpn d - Disconnect from VPN. 

    4. nordvpn connect US -g double_vpn - Connect to a Double VPN server where the first hop is a specific country 

    5. nordvpn connect P2P - connect to a P2P server. 

    6. nordvpn connect The_Americas - connect to servers located in the Americas. 

    7. nordvpn connect Dedicated_IP - connect to a Dedicated IP server. 

    8. nordvpn set or nordvpn s - Set a configuration option. Possible options:

      • nordvpn set cybersec on or off - Enable or disable CyberSec 

      • nordvpn set killswitch on or off - Enable or disable Kill Switch 

      • nordvpn set autoconnect on or off - Enable or disable auto-connect. You can set a specific server for automatic connection using nordvpn set autoconnect on country_code+server_number. Example: nordvpn set autoconnect on us2435.

      • nordvpn set notify on or off - Enable or disable notifications

      •  nordvpn set dns 1.1.1.1 1.0.0.1 - Set custom DNS (you can set up a single DNS or two like shown in this command). 

      • nordvpn set protocol udp or tcp - Switch between UDP and TCP protocols 

      • nordvpn set obfuscate on or off - Enable or disable Obfuscated Servers. 

      • nordvpn set technology - Set connection technology (OpenVPN or NordLynx)

    9. nordvpn whitelist add port 22 - Add a rule to whitelist a specified incoming port. You can also whitelist multiple ports — just separate their numbers with a space. 

    10. nordvpn whitelist remove port 22 - Remove the rule to whitelist a specified port. 

    11. nordvpn whitelist add subnet 192.168.0.0/16 - Add a rule to whitelist a specified subnet. 

    12. nordvpn whitelist remove subnet 192.168.0.0/16  - Remove the rule to whitelist a specified subnet. 

    13. nordvpn account - See account information 

    14. nordvpn register - Register a new user account 

    15. nordvpn rate - Rate your last connection quality (1-5) 

    16. nordvpn settings - See the current settings. 

    17. nordvpn status - See the connection status. 

    18. nordvpn countries - See the country list. 

    19. nordvpn cities - See the city list. 

    20. nordvpn groups - See a list of available server groups. 

    21. nordvpn logout - Log out. 

    22. nordvpn help or nordvpn h - See the list of available commands or help for a specific command.

      You can get an extensive explanation of all commands by using the man nordvpn command in Terminal.

方法二

  • 關閉 IPv6 

    1. sudo nano /etc/sysctl.conf
    2. 在檔案尾端加入下列 4 行:
      net.ipv6.conf.all.disable_ipv6 = 1

      net.ipv6.conf.default.disable_ipv6 = 1

      net.ipv6.conf.lo.disable_ipv6 = 1

      net.ipv6.conf.tun0.disable_ipv6 = 1
    3. 存檔,重啟。 
  •  從 Linux Network Manager 連上 NordVPN Servers

    1. 下載 OpenVPN Configuration File Package (ovpn.zip),並解壓縮

    2.  從螢幕右上角點開網路設定,下拉 VPN OFF 選擇 VPN Setting

    3. 按下 VPN 旁 + 號,新增 VPN

    4.  選擇連線類型 Import from file…

    5.  從步驟 1 解壓縮產生之 ovpn_udp 夾中,開啟一個組態檔或參考方法三,使用推薦伺服器的組態檔。

    6. 在跳出的視窗中輸入帳密,按下 ADD 新增


    7.  在 Linux Network Manager 畫面 VPN 項下,按下撥動開關,當它呈現綠色,就完成 VPN 連線工作


方法三

  •  從 NordVPN 網站「推薦伺服器」功能連上 NordVPN Servers

    1.  點選「推薦伺服器

    2.  點選「Show available protocols」

    3.  點選「OpenVPN UDP」右側「Download config」

    4.  承接方法二:步驟 6 加入 VPN 即可

2022年10月1日 星期六

重新安裝 grub 的程序步驟

  1.  以任一款 Linux OS (與你要修復的 Linux OS 同款最好) 的 Live USB 開機。

  2.  查看硬碟分區狀態:
    $sudo fdisk -l

    Disk /dev/sda: 232.89 GiB, 250059350016 bytes, 488397168 sectors
    Disk model: WDC WD2500AAJS-0
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0xd273611e

    Device     Boot  Start           End     Sectors     Size  Id        Type
    /dev/sda1  *       2048     206847     204800  100M   ef    EFI (FAT-12/16/32)
    /dev/sda2       206848 61646847 61440000 29.3G   83   Linux

  3. 全程使用超級使用者身分

    home@mint: ~$ sudo -s (或 sudo -i )
    root@mint: /home@mint# cd (注意粗體部份的變化)

  4. 掛載磁區
    root@mint: /home@mint# mkdir /mnt/boot
    root@mint: /home@mint# mkdir /mnt/boot/efi
    root@mint: /home@mint# mount /dev/sda2 /mnt
    root@mint: /home@mint# mount /dev/sda1 /mnt/boot/efi

  5. 將 /mnt 暫時虛擬為根目錄

    為防止在 chroot 时,出現下面的警告:
    chroot: failed to run command '/bin/bash': No such file or directory
    root@mint: ~# for dir in /root /opt /proc /dev /sys /etc /bin /sbin /var /usr /lib /lib64 /tmp; do  mkdir /mnt$dir && mount  -B $dir /mnt$dir; done

    為防止在 grub-install 时,出現下面的警告:
    Installing for x86_64-efi platform.
    grub-install: warning: EFI variables are not supported on this system.
    root@mint: ~# for dir in /sys/firmware/efi/efivars; do mount  -B $dir /mnt$dir; done

    root@mint: ~# chroot /mnt(
    注意粗體部份的變化)

  6. 刪除既有 grub
    root@mint: ~#  dpkg --configure -a
    root@mint: ~# apt-get install -fy
    root@mint: ~# apt-get purge --allow-remove-essential -y grub-com*
    root@mint: ~# apt-get purge --allow-remove-essential -y grub2-com*
    root@mint: ~# apt-get purge --allow-remove-essential -y shim-signed
    root@mint: ~# apt-get purge --allow-remove-essential -y grub-common:*
    root@mint: ~# apt-get purge --allow-remove-essential -y grub2-common:*

  7. 重新安裝 grub
    root@mint: ~# apt-get install -y grub-efi

  8. UEFI 啟動用(有兩個作法都可採用)
    root@mint: ~# grub-install --target=x86_64-efi --efi-directory=/boot/efi /dev/sda

    root@mint: ~# grub-install /dev/sda

    如果出現下面,就一切OK
    Installing for x86_64-efi platform.
    Installation finished. No error reported.

  9. 更新 grub 產生/boot/grub/grub.cfg

    /boot/grub/grub.cfg=/etc/grub.d/01~ + /etc/default/grub + others
    先編寫 /etc/grub.d/40_custom,加入 menuentry
    再修改 /etc/default/grub,加入 GRUB_DISABLE_OS_PROBER=false、變動預設啟動順序及選單是 hidden (不出現) 或 menu (出現)

    root@mint: ~# update-grub


    root@mint: ~# grub-mkconfig -o /boot/grub/grub.cfg

  10. 離開
    Ctrl + D 先跳出 chroot /mnt 環境
    Ctrl + D 再跳出超级使用者環境
    reboot
參考資料:Debian Wiki

2022年8月28日 星期日

BIOS、UEFI、MBR、GPT

  • 2T 以下磁碟分割採 MBR(Master Boot Record,主要開機磁區),最多能有4個主分割
  • 2T 以上磁碟分割採 GPT,會有獨立的 EFI partiton,參考文章:歐飛先生
  • 統一可延伸韌體介面(Unified Extensible Firmware Interface,UEFI
  • 傳統 BIOS:組合語言撰寫,文字介面,用鍵盤操作,英文
  • UEFI BIOS:C 語言 撰寫,圖形介面,可用滑鼠操作,可選擇語言
  • MBR轉GPT指令:
    mbr2gpt /disk:2 /validate /allowfullos (2號磁碟,測試可轉否,允許轉換執行中的OS)
    mbr2gpt /disk:2 /convert /allowfullos (真的轉換)
  • 手動產生 Msr patition (保留,用途不明,gpt 磁碟專有):
 
      
  • 創建 EFI partition ():
                            
             
                                                  
  • 引導E:\windows開機的中文語系,uefi 檔案系統,寫入Z (efi partition)
         
 
 

如果您想要讓電腦只開機進入特定模式,您可移除 Windows PE 或 Windows 安裝程式用來以 UEFI 或 BIOS 模式開機的檔案。 視您想要開機進入的模式而定,移除下列檔案。

僅以 UEFI 模式開機

從 Windows PE 或 Windows 安裝程式媒體的根目錄中移除 bootmgr 檔案。 這可防止裝置在 BIOS 模式啟動。

僅以 BIOS 模式開機

從 Windows PE 或 Windows 安裝程式媒體的根目錄中移除 efi 資料夾。 這可防止裝置在 UEFI 模式啟動。

 

參考:T客邦-- 大容量硬碟、UEFI 系統進階玩法:GPT / MBR 分割表格式無損輕鬆互轉

              隨意窩日誌---GTP / MBR 小實驗(Windows PE 環境)

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


2022年8月20日 星期六

利用 Debian backports 為 Linux OS Slax 安裝 LibreOffice 7.4

手動的作法: 

$ wget https://www.libreoffice.org/donate/dl/deb-x86_64/7.4.0/zh-TW/LibreOffice_7.4.0_Linux_x86-64_deb.tar.gz 
$ tar zxvf LibreOffice_7.4.0_Linux_x86-64_deb.tar.gz
$ cd LibreOffice_7.4.0_Linux_x86-64_deb/DEBS/
$ dpkg -i *.deb

 backports 的作法:

$ sudo apt install -t bullseye-backports libreoffice

請參閱:Libreoffice - Debian Wiki