在 archlinux 裡,執行 yaourt -Syu 以後,出現這訊息:
failed to initialize alpm library (database is incorrect version)
Google 到這篇:Failure to initialise alpm library:archlinux,裏面有提到原因,是因為 yaourt 更新 pacman 以後,沒更新 pacman 資料庫的關係,執行 sudo pacman-db-upgrade 以後就沒問題了。
Just thinking more…
在 archlinux 裡,執行 yaourt -Syu 以後,出現這訊息:
failed to initialize alpm library (database is incorrect version)
Google 到這篇:Failure to initialise alpm library:archlinux,裏面有提到原因,是因為 yaourt 更新 pacman 以後,沒更新 pacman 資料庫的關係,執行 sudo pacman-db-upgrade 以後就沒問題了。
之前試 java rxtx 函式庫時找到的方法,雖然在 Linux 下都是操作檔案,不過檔案跟真的 Serial port 有點差異,後來我是用 socat 指令來摹擬。
socat -d -d pty,raw,echo=1 STDOUT
這行指令會在 /dev/pts 下建立一個 node,假若是 PTY is /dev/pts/7,那麼就 sudo ln -s /dev/pts/7 /dev/ttyS0 ,這樣 /dev/ttyS0 就可以當作 Serial Port 來用了,可以設 baud rate 等等 serial port 特有的參數。接著執行程式,可以在執行 socat 的 console 看到程式寫到 serial port 的訊息。
要對接也是可以的,這時要用:
socat -d -d pty,raw,echo=1 pty,raw,echo=1
這會在 /dev/pts 下建立兩個 node。
備註:
之前就想要裝 GitLab,無奈,裝 GitLab 的相依性實在太多,後來就不了了之。時間飛快,今年年初時,知道了 Docker 這個東西,然後最近想到應該是可以把 GitLab 裝到 Docker 裡,這樣子 GitLab 的環境乾淨,也不會動到原本伺服器上的設定。於是就上網 Google ,果然已經有人做好了 (sameersbn/docker-gitlab),那就不囉唆,立刻來試試看。
網站上的安裝步驟其實已經蠻清楚了,這裡我就紀錄我改的部份。我用 fig 來進行客製化,所以就先下載他的 fig.yml,原本的 fig.yml 裡有三個 container,一個是 gitlab,一個是 postgresql,一個是 redis。我移掉了 postgresql 跟 redis,這邊我改用 host 的 mysql 與 redis,並且設定必要的環境變數。fig 的安裝一定要用 python2 的 pip 來安裝,否則會有問題,目前還沒移植到 python3 上。
要存取 host 的 mysql 與 redis,要注意幾點:
netstat -nr | grep '^0\.0\.0\.0' | awk '{print $2}' 這指令,但這得在 docker container 裡執行,fig.yml 裡沒辦法指定這個。後來是看到說直接用 host IP 也可以,所以我就直接指定,看起來是沒問題。等設定好之後,直接 fig up,fig 就會幫你 pull image、建立 image 然後開始執行,第一次執行需要花一點時間。這邊我碰到的怪情況:
Ubuntu 開機過程其實是可以更換圖片的,甚至已經提供了不少佈景主題可以使用:apt-cache search plymouth-theme
plymouth-theme-ubuntu-logo - graphical boot animation and logger - ubuntu-logo theme plymouth-theme-ubuntu-text - graphical boot animation and logger - ubuntu-logo theme mythbuntu-default-settings - default settings for Mythbuntu plymouth-theme-edubuntu - Plymouth is an application that runs very early plymouth-theme-fade-in - graphical boot animation and logger - fade-in theme plymouth-theme-glow - graphical boot animation and logger - glow theme plymouth-theme-kubuntu-logo - graphical boot animation and logger - kubuntu-logo theme plymouth-theme-kubuntu-text - graphical boot animation and logger - kubuntu-text theme plymouth-theme-lubuntu-logo - plymouth theme for Lubuntu plymouth-theme-lubuntu-text - plymouth text theme for Lubuntu plymouth-theme-sabily - plymouth theme for Sabily (graphical theme) plymouth-theme-sabily-text - plymouth theme for Sabily (text theme) plymouth-theme-script - graphical boot animation and logger - script theme plymouth-theme-solar - graphical boot animation and logger - solar theme plymouth-theme-spinfinity - graphical boot animation and logger - spinfinity theme plymouth-theme-text - graphical boot animation and logger - text theme plymouth-theme-ubuntu-gnome-logo - graphical boot animation and logger - ubuntu-gnome-logo theme plymouth-theme-ubuntu-gnome-text - graphical boot animation and logger - ubuntu-gnome-text theme plymouth-theme-ubuntustudio - Ubuntu Studio Plymouth theme plymouth-theme-xubuntu-logo - graphical boot animation and logger - xubuntu-logo theme plymouth-theme-xubuntu-text - graphical boot animation and logger - xubuntu-text theme
你可以使用 apt-get install 來安裝,這些佈景主題會被安裝到 /lib/plymouth/themes/ 目錄下,安裝以後,該如何使用呢? 可以用 update-alternative 來替換,在 terminal 輸入 sudo update-alternative default.plymouth 以後,就可以選擇你喜愛的佈景主題了。
網路上也有人自行去修改 theme,調整字的位置、圖形等等的,用 ubuntu plymouth 去找,就可以找到相關的資訊了。
git 沒辦法加空目錄,沒有任何選項可以用。Stackoverflow (How do I add an empty directory to a Git repository? – Stack Overflow) 上提到的變通方法就是為這些空目錄添加一個空白的檔案,檔名看是要用 .gitignore 或是 README 之類的就可以。
那要找所有空目錄的話,該怎麼找?find 就可以做到這點 (參考 bash – finding empty directories unix – Stack Overflow) :
find . -type d -empty -print
那麼,要為每個空目錄加上空白檔案的話,再利用 -exec 參數就可以了:
find . -type d -empty -exec touch {}/README \;
在 Ubuntu 14.04 編譯 gcin,需要安裝這些套件:
gcin 的原始碼可以在這裡取得,在 2.8.2 裡,新酷音的支援被關掉,可以自己修改 configure 來打開設定。qt5-default 跟 qtchooser 是可以不用安裝的,這是 QT5 使用的標頭檔與工具。
最近試著寫 Dockerfile,遇到了一些問題,也順利解決了,所以紀錄在這裡:
關於 Docker push/pull
資料來源:
ArchLinux 裡安裝 fbterm 的方法很簡單,就 pacman -S fbterm 完以後,照說明做就行了。執行 fbterm 以後,中文卻沒正常顯示,猜想應該是沒指定字型的關係。所以我輸入 exit ,退出 fbterm,接著加裝了 wqy-microhei-lite :pacman -S wqy-microhei-lite ,接著看 man fbterm,參考裏面的說明,去修改 $HOME/.fbtermrc 裡的 font-names (.fbtermrc 在第一次執行 fbterm 時,會自動產生),將其改為 WenQuanYi Micro Hei Mono Light,並調整字體大小,然後重新執行一次 fbterm 就可以了。
在 pacman -Ss fbterm 時,有看到 fcitx-fbterm,所以 fbterm 也可以使用中文輸入法,目前只有這個。
原本以為,在 USB 那邊切過去就可以,但 Guest 裡的 Windows XP 在安裝驅動程式以後還是無法使用。
後來還是在 VirtualBox 裡設定,啟用 COM1,然後連接埠模式選”主機裝置”,連接埠設 Ubuntu Host 偵測到的 “/dev/ttyUSB0″。這樣應該是沒問題,再看看。
公司的桌機是用 Ubuntu 12.04 LTS,今天發現 virtualbox 不能執行了,就順道把 Kernel 升級到 trusty (linux-image-generic-lts-trusty),然後重新安裝 virtualbox,發現不行,Ubuntu 附的 virtualbox-ose 會說沒有適合現在 kernel 的 module,改用 oracle virtualbox-4.3 則會出現模組無法驗證的訊息。
模組無法驗證,上網 Google 了一下,發現應該是 Kernel 啟用了 CONFIG_MODULE_SIG 的緣故,參考 Signed kernel module support – Gentoo Wiki ,研判是需要 key 才能編譯出 sign 過的 module,但實在找不到 key,就放棄了。
退到 saucy 的 kernel (linux-image-generic-lts-saucy),一樣用 oracle virtualbox,這次在編譯時有警告 (這可以參考 /var/lib/dkms/vboxhost/ 目錄裡的 make.log ),insmod 時,出現 vboxdrv: Unknown symbol mcount (err 0) 的錯誤。Virtualbox issue tracker 有人回報過此問題:dkms unknow symbol mount (err0) ,結論是 gcc 版本過舊而導致。所以安裝 gcc-4.6 以後,再參考這篇 Choose gcc and g++ version ,把預設的 gcc 改為 gcc-4.6 之後就可以編譯出沒問題的模組了。(備註:文章裡是以 4.3 與 4.4 為例,相信你知道如何改動)