2021年5月5日 星期三
[ubuntu]不需要sudo權限重開機
[ubuntu]不需要sudo權限重開機
2021年4月26日 星期一
[Raspbian]raspberry pi 中文輸入法
不知為何gcin就是無法在我的8G版本上work
後來改用fcitx就沒問題了..
安裝指令
$ sudo apt-get install fcitx fcitx-chewing
安裝完成後再去
menu > preference > input method 去選fcitx
安裝方式請參考
[Raspbian]raspberry pi 中文輸入法
[Raspbian][ raspberry pi ] dock window 與熱鍵修改
pi 的os 竟然沒辦法dock window...
這樣基本的功能,難道沒人把它當便宜主機用嗎?
因為解決方法有點小麻煩,這邊就紀錄一下
ref: https://pastebin.com/NBkccE7B
使用方法基本上就是用win + q/w/e/a/d/z/x/c 將視窗移到各個角落
win + s 全螢幕, win+shift+s縮小
but.. 因為pi 預設 win 一按下去就會打開 lxpanelctl menu我把<keybind key="Super_L">小改了一下變成
首先要先找到設定熱鍵的檔案(/home/pi/.config/openbox/lxde-pi-rc.xml),然後用某個文字編輯器(pi os 預裝有geany,就決定是你了)開啟它
~$ geany /home/pi/.config/openbox/lxde-pi-rc.xml
<keybind key="W-a"> <action name="UnmaximizeFull"/> <action name="MoveResizeTo"> <width>50%</width> <height>100%</height> <x>0%</x> <y>0%</y> </action></keybind><keybind key="W-d"> <action name="UnmaximizeFull"/> <action name="MoveResizeTo"> <width>50%</width> <height>100%</height> <x>50%</x> <y>0%</y> </action></keybind><keybind key="W-x"> <action name="UnmaximizeFull"/> <action name="MoveResizeTo"> <width>100%</width> <height>50%</height> <x>0%</x> <y>50%</y> </action></keybind><keybind key="W-w"> <action name="UnmaximizeFull"/> <action name="MoveResizeTo"> <width>100%</width> <height>50%</height> <x>0%</x> <y>0%</y> </action></keybind><keybind key="W-q"> <action name="UnmaximizeFull"/> <action name="MoveResizeTo"> <width>50%</width> <height>50%</height> <x>0%</x> <y>0%</y> </action></keybind><keybind key="W-e"> <action name="UnmaximizeFull"/> <action name="MoveResizeTo"> <width>50%</width> <height>50%</height> <x>50%</x> <y>0%</y> </action></keybind><keybind key="W-z"> <action name="UnmaximizeFull"/> <action name="MoveResizeTo"> <width>50%</width> <height>50%</height> <x>0%</x> <y>50%</y> </action></keybind><keybind key="W-c"> <action name="UnmaximizeFull"/> <action name="MoveResizeTo"> <width>50%</width> <height>50%</height> <x>50%</x> <y>50%</y> </action></keybind><keybind key="W-s"> <action name="Maximize"/></keybind><keybind key="W-S-s"> <action name="Iconify"/></keybind>[Raspbian][ raspberry pi ] dock window 與熱鍵修改
2021年4月25日 星期日
raspberry pi 截圖 without printscreen 按鍵
Microsoft的all in one 鍵盤加觸控板不知為何沒有printscreen鍵..
只好用terminal呼叫截圖程式
先用ctrl+alt+t打開termainal
呼叫scrot截圖
它還可以帶一些參數呼叫
scrot -s 框選擷取範圍
scrot -sb 選取視窗
scrot -d num num秒後截圖
scrot -cd num 倒數num秒後截圖
截下來的圖都會放在 ~目錄
raspberry pi 截圖 without printscreen 按鍵
[Raspbiam]raspberry pi4時鐘格式
用Raspbian OS 若想把toolbar換到左/右邊可以在工具列上
右鍵 > Panel settings > Position > Edge 去選擇工具列位置
如果選側邊,可以把Size調整成跟icon size差不多比較簡潔
後pi預設是多的視窗不會合併,這可以從
task bar(window list) settings > combine multiple application windows into a single button 去設定
這時候還有個問題,時鐘分的部份會看不到分
這可以在時鐘那邊按右鍵
digital clock settings > clock format
例如我用的是
%a%n------%n %d%n%b%n------%n%H%n:%M
效果像這樣
[Raspbiam]raspberry pi4時鐘格式
2021年4月23日 星期五
linux筆記軟體cherrytree
wps office
2021年4月21日 星期三
在Ubuntu下執行window程式
在Ubuntu下執行window程式
2021年3月30日 星期二
[豆知識] command prompt 下切換硬碟
2021年3月24日 星期三
[linux] 增加動態函式庫搜尋路徑
預設的搜尋路徑有
/lib/, /usr/lib/
在這裡面加入library只需呼叫
$ ldconfig
去更新/etc/ld.so.cache的內容
如果新增的lib在其他地方,有兩個選擇
1. 暫時的方法
在環境變數LD_LIBRARY_PATH加入資料夾路徑
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/myapp/lib
1.1 將上面的指令加入
~/.bashrc
這樣每次打開shell都會被執行
2. 永久的方式
在/etc/ld.so.conf.d/中加入.conf檔案
$ touch opencv.conf
$ echo "/user/local/lib" > opencv.conf
$ sudo ldconfig
ps.
$ ldconfig -v
看ldconfig連結的librarys
$ ldconfig -n
[linux] 增加動態函式庫搜尋路徑
2021年3月23日 星期二
[git] 完全回復成未修改狀態
清除未追蹤檔案
git clean -fx
(x表示連同ignored files)
可以先用
git clean -fxn
測試
還原git controlled files
git reset --hard
[git] 完全回復成未修改狀態
back in time -qt
之前都用time shift 但因為看time shift的readme說 time shift主要用來回覆系統檔,要完整回朔可以用back in time
但第一次用就悲劇...
因為在做備份的時候沒有掛一個share槽 (/mnt/share/),但還原的時候不小心掛了,又選清除多餘的檔案,於是share整個被清空(幸好不是很大的備份碟)
所以用 backintime 記得把 /dev/, /mnt/之類的目錄加到例外
back in time -qt
[Linux Shell Script] sed 在指定行前面加字元
最近因為寫安裝realsense sdk的script, 需要將原本的script部分註解掉,找到這個sed指令
sed -i '308,320 s/^/# /1' fileName
註解 308~320行
-i : 寫入原檔
308,320: 範圍 308 ~320
s: 取代
^: pattern前的空字元 ($ 表示pattern 的空字元)
1: 作用在第一個matched pattern (g表示所有)
sed -i '1 s/^/# /1 ; 3 s/^/# /1' test
註解 1,3行
sed -i 's/# //g' test
刪掉 test 中所有 '# '
ref:
https://terryl.in/zh/linux-sed-command/
regular express
https://www.gnu.org/software/sed/manual/sed.html#sed-regular-expressions
ps. 如果要取代檔案中的字
sed -i 's/WORD_TO_REPLACE/replacer/g' fileName
會將
abcdWORD_TO_REPLACEabcdWORD_TO_REPLACE123
變成
abcdreplacerabcdreplacer123
[Linux Shell Script] sed 在指定行前面加字元
2021年3月9日 星期二
bazel cache
最近在搞Isaac, 他用bazel這個build tool聽說是很scallable的tool
but...他的cache真的是神大,build幾個Isaac sample,cache了5xGB... SSD都塞暴了
bazel cache
2021年3月8日 星期一
[Isaac install]nvidia driver's location
Isaac 官網上有提到要自行增加環境變數,讓unity可以抓到nv driver
在~/.bashrc最後新增
export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json
但實際去找/usr/share/vulkan/icd.d/資料夾找不到nvidia_icd.json
後還發現在我的NB上是在/etc/vulkan/icd.d/nvidia_icd.json
實務上可以先updatedb後去locate nvidia_icd.json
[Isaac install]nvidia driver's location
2021年3月7日 星期日
[install cuda] install gcc
$ sudo apt update
$ sudo apt install build-essential
install manuals
$ sudo apt-get install manpages-dev
check install
$ gcc --version
[install cuda] install gcc
install cuda -- turn off Nouveau
before install cuda,Nouveau need to be turned off
create a new text file
$ sudo nano /etc/modprobe.d/blacklist-nouveau.conf
in blacklist-nouveau.conf
blacklist nouveauoptions nouveau modeset=0 then, rebuild kernel and reboot$ sudo update-initramfs -u$ sudo reboot
after reboot make sure Nouveau have been shut down$lsmod | grep nouveau
install cuda -- turn off Nouveau
[pre noted] 將linux移到其他硬碟
因為公司筆電的ssd很小(128G)上面大只夠run一個linux
Create an ext4 partition and a swap partition on the new drive.
Boot from LiveUSB.
Mount the old Ubuntu partition to some directory, mount the new one to some other directory.
Copy all files from the old one to the new one using
cp -acommand.Update
/etc/fstabwith new UUIDs.
[pre noted] 將linux移到其他硬碟
在已有ubuntu的狀況下免cd/usb安裝其他inux
用 grml-rescueboot套件
$ sudo apt-get install grml-rescueboot
安裝完成後會產生
/boot/grml資料夾
將iso移動到 /boot/grml
$ sudo mv <.iso> /boot/grml
更新grub
$ update-grub
在已有ubuntu的狀況下免cd/usb安裝其他inux
bazel geetting sart
最近因為用到Nv 的 Isaac, 他用的是bazel這個編譯器
之前沒接觸過,查了一下發現他原本是google內部用的編譯器,後來release出來產生的
但從他的官網進去要getting start卻一直是404找不到網頁
一直以為是有捨麼梗
後來檢查URL才發現他連結的URL是
https://docs.bazel.build/guide.html/getting-started.html
但應該要連到
https://docs.bazel.build/getting-started.html
才對...orz
