Category: Tech

IT Technology, 3C, AI

  • 在Ubuntu Linux上擴充虛擬機的邏輯分割區

    流程說明

    • 檢查磁區:使用 lsblk 命令來檢查磁碟設備名稱與分割區位置。
    • 更改硬碟容量:將虛擬機硬碟從原始大小擴充至新的大小,例如從8G到16G。
    • 擴充分割區:使用 growpart 命令來擴充分割區,並確認變更後的大小。
    • 擴充檔案系統:執行 pvs 和 pvresize 來擴充物理分割區,然後用 lvextend 擴充邏輯分割區並整合所有可用空間。

    以下以 UBuntu 22.04 使用單顆虛擬硬碟,並使用安裝程式預設的磁碟分割方式所建立的虛擬機器為例:

    1. 刪除虛擬機器的快照並合併硬碟 (不做會無法更動硬碟容量)

    2. 設定虛擬機器所需要的硬碟容量

    3. 重啟虛擬機器(不重啟系統認不到擴充後的容量):reboot

    4. 檢查磁區:lsblk

    5. 擴充硬碟容量:sudo growpart /dev/sda 3

    6. 檢查磁區確認硬碟是否已擴充:lsblk

    7. 再次重啟虛擬機器(我的情況是不重啟無法擴充檔案系統):reboot

    8. 擴充檔案系統:sudo pvs

    9. 擴充檔案系統(續):sudo pvresize /dev/sda3

    10. 檢查檔案系統是否已擴充:lsblk

    11. 擴充邏輯分割:sudo lvextend -r -l +100%FREE /dev/mapper/ubuntu–vg-ubuntu–lv

    12. 檢查邏輯分割是否已擴充:lsblk

    13. 重啟虛擬機器已確認系統是否運作正常無誤:reboot

    14. 檢查所有確認硬碟分割設定是否正確無誤:lsblk

  • 香港基本法23條

    香港《基本法》23條是有關國家安全的條款,規定香港特別行政區應自行立法禁止7類危害國安的行為:

    1. 叛國:包括對中國發動戰爭等叛國罪外,新法案試圖將未經授權的軍事演習和得知叛國行為但未舉報定為刑事犯罪。
    2. 分裂國家。
    3. 煽動叛亂:新增「叛亂罪」,處理涉及國安的暴動、國家內亂及武裝衝突。
    4. 顛覆中央人民政府。
    5. 竊取國家機密:對「國家機密」有更廣泛的定義,包括重大決策、經濟或社會發展以及香港的對外事務等。
    6. 外國的政治性組織或團體在香港進行政治活動。
    7. 香港的政治性組織或團體與外國的政治性組織或團體建立聯繫。

    這次立法定義5大類危害國安的行為,包括叛國、叛亂、煽動意圖、竊取國家機密、間諜、破壞、境外干預等罪刑的定義和罰則。具體來說,例如叛國與叛亂最高可處以無期徒刑,間諜罪可判20年,非法揭露政府機密最重可關10年。此外,被捕人未被起訴的羈留時間由一般的2天增至16天,拘捕後首48小時可被禁止諮詢律師,保釋期間可限制其活動。

    Reference By: https://www.bbc.com/zhongwen/trad/chinese-news-66051256

  • 讓後院芬芳的8種植物

    讓後院芬芳的8種植物

    1. 薰衣草(Lavandula)
      薰衣草以其溫和且舒緩的香味聞名,是花園裡的熱門選擇。它的紫色花朵吸引著蝴蝶和蜜蜂,並且其香氣完美地營造出寧靜的氛圍。
    2. 茉莉花(Jasminum)
      茉莉花因其精緻的白色花朵和甜美的迷人香氣而聞名。它非常適合用於籬笆或藤架,其中它的藤蔓可以蔓延並散發出令人無法抗拒的香氣。
    3. 玫瑰(Rosa)
      玫瑰以其美麗和獨特的香氣而聞名。有許多具有濃郁香氣的玫瑰品種可供選擇,因此選擇您喜歡的品種,並享受其迷人的香氣。
    4. 羅勒(Ocimum basilicum)
      羅勒不僅是流行的烹飪香草,還散發出美味的香氣。在花園裡種植一些這些植物,每次經過時都能享受到新鮮羅勒的香氣。
    5. 迷迭香(Rosmarinus officinalis)
      迷迭香是一種帶有清新草藥香氣的香草。其葉常用於烹飪,其芳香氣味為空氣增添了一絲清新。
    6. 百合(Lilium)
      百合是優雅且芬芳的花朵,可以為您的後院增添獨特的花香。有許多色彩的變化,可以將它們分組種植,以營造令人印象深刻且芳香的視覺效果。
    7. 天竺葵(Pelargonium)
      天竺葵是易於種植的植物,有多種顏色和香味可供選擇。選擇香味濃郁的品種,如玫瑰或檸檬香味的天竺葵,為您的花園增添迷人的香氣。
    8. 薄荷(Mentha)
      薄荷以其清新而薄荷味的香氣而聞名。在花盆或高架花床中種植一些這些植物,以避免它們蔓延過多,並在經過時享受清新薄荷的香氣。
  • LINE Keep 要如何備份/移轉

    Line keep即將於今年的七月底停止服務,以下為資料備份/移轉的方式。

    1. 電腦版LINE
      • 開啟LINE應用程式,點選主頁面左下角的LINE Keep圖示。
      • 點選右上角的「三個點」按鈕,選擇「下載」。
      • 勾選您想要下載備份的檔案,然後點選「下載」按鈕,檔案就會被保存到您的電腦上。
    2. 手機版LINE
      • 在LINE App主頁面點選Keep圖示。
      • 點選右上角的「打勾」按鈕。
      • 選擇您想要下載備份的檔案。
      • 透過「分享」>「分享至應用程式」就可以匯出備份。

    補充說明:移轉備份有單次最多20筆資料的限制

  • Transfer Trello to Wekan with LDAP

    My use case is Transfer from Trello to Wekan, and need use MS AD auth to manage accounts.

    I test the following wekan versions on snap (latest version on 2024/03/18):

    1. Stable: 6.09

    2. Candidate: 7.41

    3. Beta: 6.77

    Transfer Trello to Wekan

    I set original board visiable setting to public. Add new board by import JSON that export from Trello, and tested more than three times.

    1. All wekan versions cannot import attachments.

    2. Version 6.77 and version 7.41 cannot transfer all cards to wekan.

    3. It will not redirect to imported baord after press [完成] or the [Done] button. IMPORTANT! PRESS BUTTON ONLY ONE TIME!!! I press [Done] button lots of times and made lots of duplicate board …

    LDAP Authentication

    The AD server I use is Windows 2012 R2. But there are lots of factors let ldap function work or not. And this is just my experience in my environment.

    1. I cannot bind to my AD server, and I cannot use any data sync function, either.

    2. The only way I can use is Ldap-AD-Simple-Auth. It works well.

    3. It need set Admin permission to Password Auth Account and LDAP Auth Account. If not, The default login auth method will not work when enable the hiding option.

    In the mean time, the version I suggest is 6.09. It’s really more stabled than other version in my case.

  • About 關於 Snap(Snapcraft)

    Ubuntu 的 snap 是一種應用程式包管理系統,它允許開發者和用戶更容易地分發和安裝應用程式。snap 包含了應用程式和它們運行所需的所有依賴項,這樣可以在不同的 Linux 發行版上無縫運行。

    Snap 版本分為幾個不同的通道,反映了不同的穩定性和開發階段:

    • stable: 最穩定的版本,適合所有用戶使用。如:sudo snap install wekan
    • candidate: 候選版本,通常是接近穩定的,但可能還需要進一步測試。如:sudo snap install wekan –candidate
    • beta: 測試版本,包含了即將發布的新功能,但可能還不夠穩定。如:sudo snap install wekan –beta
    • edge: 最前沿的版本,通常是開發中的版本,可能包含未完成的特性或較多錯誤。如:sudo snap install wekan –edge

    通常情況下,開發者會先在 edge 通道發布最新的更改,然後隨著問題的解決,逐步推送到 beta、candidate,最後是 stable 通道。這樣用戶可以根據自己願意承擔的風險程度選擇安裝不同通道的版本

    MUbuntu’s snap is an application packaging system that allows developers and users to distribute and install applications more easily. Snap packages contain the application and all its dependencies, ensuring it can run seamlessly across different Linux distributions.

    Snap versions are divided into several channels, reflecting different levels of stability and development stages:

    • stable: The most stable version, suitable for all users. Ex: sudo snap install wekan
    • candidate: A release candidate version, usually close to stable but may require further testing. Ex: sudo snap install wekan –candidate
    • beta: A beta version that includes upcoming features but might not be stable enough. Ex: sudo snap install wekan –beta
    • edge: The cutting-edge version, often in development, which may include incomplete features or more errors. Ex: sudo snap install wekan –edge

    Typically, developers release the latest changes in the edge channel first, and as issues are resolved, they progressively push updates to the beta, candidate, and finally the stable channel. This allows users to choose which version to install based on the level of risk they are willing to take.

  • How to put file from windows to Ubuntu

    How to put file from windows to Ubuntu

    Transferring files from Windows to Ubuntu can be done in several ways. Here are a couple of methods:

    1. Using SCP (Secure Copy Protocol):

    • Install an SCP client on your Windows machine, such as PuTTY’s pscp.
    • Use the following command format in your Windows command prompt:
      pscp <Source_File> <Linux_Username>@<Destination_Address>:<Destination_Directory>
    • For example, to transfer file.txt from the C drive to the home directory of a user named ubuntu_user on the Linux machine with IP address 192.168.1.10, you would use:
      pscp C:\file.txt ubuntu_user@192.168.1.10:/home/ubuntu_user/
    • You will need to authenticate with the Linux machine to complete the transfer.

    2. Using WinSCP:

    • Install WinSCP on your Windows machine.
    • Open WinSCP and enter the credentials of your Ubuntu machine.
    • Drag and drop files from the Windows interface to the Ubuntu interface within WinSCP to transfer them.

    Remember to have an SSH server installed on your Ubuntu machine for these methods to work. You can install it using the command:sudo apt install openssh-server

    Choose the method that best suits your needs and follow the instructions to transfer your files. If you’re transferring files between systems in a VirtualBox environment, you can also set up a shared folder in VirtualBox Manager and mount it in Ubuntu.

    How to put file from windows to Ubuntu
  • 關於 Amazon 亞馬遜電商平台的那些事

    關於 Amazon 亞馬遜電商平台的那些事

    以下是彙整關於亞馬遜電商平台的一些資訊:

    • ASIN – Amazon Standard identification number 亞馬遜標準識別號碼 – 為商品於分區市場內的唯一識別碼。(通常以國別做為市場分區)
    • Keywords 關鍵字 – 絕大多數的用戶都是透過關鍵字來找尋商品,一個商品可能會被各種不同的關鍵字觸及。而關鍵字本身,也對應著各種不同的類別。因此,透過商品關鍵字的分析,能了解用戶是在什麼樣的應用場景觸及該商品。
    • BSR – Best Seller Rank 熱銷排名,越低越好,亞馬遜提供對於該商品在對應商品類別的綜合性評價排名。其用於評價的指標包含,銷售速度、歷史銷量、近期銷量等。
    • Average Reviews – 用戶對於商品的每月平均評論數。
    • Fulfillment 物流 – 亞馬遜有3種商品物流方式物流方式:AMZ 亞馬遜自己出貨、MFN/FBM 賣家自行出貨、FBA 亞馬遜配送。其中,FBA(Fulfillment By Amazon)包含倉儲、配送和售後服務,是亞馬遜電商平台能做到跨境銷售的特色機制。
    • Revenue 營業額;查閱該數據時需要留意其組成成份,以及是含稅還是未稅。
  • Aras Innovator – 表單新增時自動新增單身資料

    在表單單頭 View 的 onFormLoad Client Event,透過 is new 或 action 是否為 add,來判斷是否為新單據,然後新增關係

    var itmThis = document.thisItem;
    if (itmThis.isNew() || itmThis.getAction()=='add') {
    var inno = itmThis.newInnovator();
        for (var i=0; i<10; i++) {
            var relItem = inno.newItem('{RELATIONSHIP ITEMTYPE}', 'add');

    // set properties if needed

            itmThis.addRelationship(relItem);
        }
    }