2019/6/26

/etc/profile.d

原來login 之後, shell 會先 run /etc/profile。
然後 /etc/profile 最後有一個 loop,會去 run /etc/profile.d 下所有的 script。
所以,有個別的全域的參數要設定,就可以放在 /etc/profile.d/ 下。

舉例來說,安裝完 anaconda 後,在 $(INSTALLPATH)/etc/profile.d/ 會有 conda.sh
可以建一個 link 到 /etc/profile.d/conda.sh
這樣,所有 user login 後,都會自動執行 anaconda 的環境設定 script

2019/6/21

disable touchpad

:~$ xinput list
⎡ Virtual core pointer                     id=2 [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer               id=4 [slave  pointer  (2)]
⎜   ↳ Kensington      Kensington Expert Mouse  id=10 [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad               id=13 [slave  pointer  (2)]
⎜   ↳ TPPS/2 IBM TrackPoint                    id=14 [slave  pointer  (2)]
⎣ Virtual core keyboard                    id=3 [master keyboard (2)]
    ↳ Virtual core XTEST keyboard              id=5 [slave  keyboard (3)]
    ↳ Power Button                             id=6 [slave  keyboard (3)]
    ↳ Video Bus                                id=7 [slave  keyboard (3)]
    ↳ Video Bus                                id=8 [slave  keyboard (3)]
    ↳ Power Button                             id=9 [slave  keyboard (3)]
    ↳ Integrated Camera                        id=11 [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard             id=12 [slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                   id=15 [slave  keyboard (3)]
:~$ xinput --disable 13
先用xinput 列出所有 input device,然後用 disable 關掉 touchpad

2019/6/19

python3 and tensorflow 1.X

python3 -m venv env
source env/bin/activate
pip install tensorflow==1.3
不指定 1.3 的話,install 會有一堆相容問題。
不用 venv 的話,會裝到系統目錄,問題更大。


在 ubuntu 18.04,python3 (3.6.9),pip3 安裝 tensorflow==1.14.0,會出現 Error:
protobuf need python > 3.7
這個問題升級 pip3 後就 OK

升級pip3 的方法:
python -m pip install --upgrade pip
實際上,因為沒有sudo,這個command 會install 新版 pip 到 ~/.local/bin 下。
要重新login 才會 invoke 到。

要更新 pip3 的話,不知道用什麼方法,所以:
python3 -m pip install --upgrade pip
結果在 ~/.local/bin 下產生了 pip3, pip3.6,同時 pip 內容也被改成 python3.6 了。
為了讓 pip 回到 python2.7,把 .local/bin 下的 pip2 copy 成 pip

好像用...
pip3 install --upgrade pip

2019/6/11

ralink firmware install failed.

Unpacking firmware-misc-nonfree (20161130-5~deb8u1) ...
dpkg: error processing archive /var/cache/apt/archives/firmware-misc-nonfree_20161130-5~deb8u1_all.deb (--unpack): trying to overwrite '/lib/firmware/kaweth/trigger_code.bin', which is also in package linux-firmware-image 16.04.05
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/firmware-misc-nonfree_20161130-5~deb8u1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

竟然...沒包好,兩個 package 有相同的 install file。所以衝突。

follow 這一篇,force-overwrite...
#sudo dpkg -i --force-overwrite /var/cache/apt/archives/firmware-misc-nonfree_20161130-5~deb8u1_all.deb

這樣就 OK 了..

只有等待mantainer 在下一版會修正。