Wednesday, August 16, 2017

How to deploy Ubuntu Core from KVM to VirtualBox?

Steps:
1. Download Ubuntu Core of KVM image from URL below:
https://developer.ubuntu.com/core/get-started/kvm

2. To decompress xz.

3. To convert the format of img to the vdi via VBoxManage command below:

VBoxManage.exe convertdd ubuntu-core-16-amd64.img ubuntu-core-16-amd64.vdi
4. Import vdi file above to the VirtualBox without issue.



Wednesday, June 14, 2017

Python的額外錯誤處理

Example:
try:
    data=open('open_file.txt')
    for each_line in data:
        try:
            (var1,var2)=each_line.split(":",1)
            print(var1)
            print(var2)
        except:
            print(each_line)
    data.close()
except:

    print('File is not existing'

透過Python的try & except,程式碼果真變得很簡潔~

Monday, May 22, 2017

如何將Python程式模組化?

今天學習了如何將Python function模組化.
實際的步驟:
1. 撰寫python, 存檔為*.py
2. 撰寫setup.py for metadata (*.py跟setup.py需在同一個目錄下)
3. 執行python setup.py sdist 以建構發行套件檔案4. 執行python setup.py install 來安裝發行套件到本地端

開啟一個新檔案把module 用import的方式匯入, 透過引用正確的module名稱跟函式就可以執行了.

Tuesday, April 25, 2017

Cockpit

I saw this tools recently, and I am definitely to try it. :)

Cockpit


Thursday, April 06, 2017

Root file system is mounted as read only ?

I encountered this symptom and found out similar issue and solution is listed as below:

http://www.unix.com/linux/168716-root-filesystem-goes-readonly.html

Method:
fsck -p /dev/sdX