2020年6月5日 星期五
2020年2月27日 星期四
2020年1月29日 星期三
[Linux] Mount Windows Shared Folder
sudo mount -t cifs //192.168.2.2/x61_com /tmp/sdb2 -o username=administrator,vers=1.0
BJ4
BJ4
2020年1月27日 星期一
[Linux] 查看 Linux TCP Port 被哪隻程式(Process)佔用
sudo lsof -i sudo lsof -i | grep TCP sudo lsof -i :80 | grep LISTEN
reference:
* https://blog.longwin.com.tw/2013/12/linux-port-process-check-2013/
2019年10月17日 星期四
2019年10月8日 星期二
[Linux] 判斷未知的分割區格式
今天撿到一張記憶卡,想要看看裡面是什麼東西,結果一直 mount 不起來,錯誤訊息
後來看到這篇,用這個指令就可以知道這是什麼格式了
NTFS signature is missing. Failed to mount '/dev/mmcblk0p2': Invalid argument The device '/dev/mmcblk0p2' doesn't seem to have a valid NTFS. Maybe the wrong device is used? Or the whole disk instead of a partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
後來看到這篇,用這個指令就可以知道這是什麼格式了
sudo file -s /dev/mmcblk0p2
2019年5月21日 星期二
[Linux] access the webcam at the same time
找了一陣子終於看到了
https://askubuntu.com/questions/165727/is-it-possible-for-two-processes-to-access-the-webcam-at-the-same-time
https://askubuntu.com/questions/165727/is-it-possible-for-two-processes-to-access-the-webcam-at-the-same-time
$ git clone https://github.com/umlaeute/v4l2loopback.git $ cd v4l2loopback $ make $ sudo make install $ sudo depmod -a $ sudo modprobe v4l2loopback devices=2 gst-launch-1.0 v4l2src device=/dev/video0 ! tee name=t ! queue ! v4l2sink device=/dev/video1 t. ! queue ! v4l2sink device=/dev/video2
2018年6月20日 星期三
[Linux] 輸入法
用了很多年的Linux,可是中文輸入法一直沒有太改善,常會莫名出現問題
今天的 libreoffice 中文輸入突然啟動不了,我是使用 fcitx,最後是又裝了 IBus 的新酷音才在 libreoffice 啟動
幫 QQ
今天的 libreoffice 中文輸入突然啟動不了,我是使用 fcitx,最後是又裝了 IBus 的新酷音才在 libreoffice 啟動
幫 QQ
2018年5月31日 星期四
2018年5月19日 星期六
[Linux] buffering I/O
Linux 上面的一些指令有些是 buffering I/O 有些不是,因此行為會有些不同
看這篇文章可以更清楚: http://mywiki.wooledge.org/BashFAQ/009
看這篇文章可以更清楚: http://mywiki.wooledge.org/BashFAQ/009
[Linux] shell的一些組合技
問題:將資料pipe出來以後傳給touch當變數建立新檔案
作法:
1. $ some_command | sed 's/^/touch /' | sh -x
2. $ some_command | xargs -n 1 touch
參考資料: https://serverfault.com/questions/34606/looping-a-command-over-a-list-of-arguments-in-linux
作法:
1. $ some_command | sed 's/^/touch /' | sh -x
2. $ some_command | xargs -n 1 touch
參考資料: https://serverfault.com/questions/34606/looping-a-command-over-a-list-of-arguments-in-linux
2018年1月16日 星期二
[Linux] Visual Studio on Linux
意外的好用 QQ
安裝就參考官方教學
https://code.visualstudio.com/docs/setup/linux
安裝 python 擴充套件
https://code.visualstudio.com/docs/editor/extension-gallery?pub=ms-python&ext=python
如果有缺的套件記得先補一下
https://lnx.azurewebsites.net/python-dev-environment-with-visual-studio-code-on-linux/
竟然 Raspberry Pi 3 也可以安裝
https://code.headmelted.com/
安裝就參考官方教學
https://code.visualstudio.com/docs/setup/linux
安裝 python 擴充套件
https://code.visualstudio.com/docs/editor/extension-gallery?pub=ms-python&ext=python
如果有缺的套件記得先補一下
https://lnx.azurewebsites.net/python-dev-environment-with-visual-studio-code-on-linux/
竟然 Raspberry Pi 3 也可以安裝
https://code.headmelted.com/
2017年7月12日 星期三
2016年7月10日 星期日
2016年2月15日 星期一
[Linux] linux 初始化 init 系統
話說 Debian 從 Wheezy 昇到 Jessie 以後, 一些系統設定都不一樣了, 例如初始化系統(init system)
這篇有簡單比較一下 SysVinit, Upstart 和 Systemd 的常用指令
如果要看歷史故事(?)和比較詳細的說明, 可以先從這三篇看起吧
1. 淺析 Linux 初始化 init 系統,第 1 部分: sysvinit
2. 淺析 Linux 初始化 init 系統,第 2 部分: UpStart
3. 淺析 Linux 初始化 init 系統,第 3 部分: Systemd
這篇有簡單比較一下 SysVinit, Upstart 和 Systemd 的常用指令
如果要看歷史故事(?)和比較詳細的說明, 可以先從這三篇看起吧
1. 淺析 Linux 初始化 init 系統,第 1 部分: sysvinit
2. 淺析 Linux 初始化 init 系統,第 2 部分: UpStart
3. 淺析 Linux 初始化 init 系統,第 3 部分: Systemd
2013年11月9日 星期六
[Linux] Ubuntu 10.04在x220下找不到ethernet
因為Ubuntu 12.04用不習慣, 只好裝回10.04, 但杯具馬上發生, 安裝完後竟然找不到ethernet
解決步驟 1. 查詢裝置類型
3. 去intel網站下載適合的驅動程式 先搜尋"82579", 再作業系統欄位選擇"Linux", 會得到e1000e-2.5.4.tar.gz
4. 最後就編譯安裝, 重新啟動網路, 搞定, 看到ifconfig有eth0真是太感動了
reference: Fix for non-working wired ethernet on Dell Latitude E6520 with Intel 82579 based adapter running Ubuntu 10.04 LTS Lucid
dmesg|grep -in eth
空沒有網路也沒辦法下載套件,source等, 什麼都沒辦法做, 還好有估到一篇
解決步驟 1. 查詢裝置類型
$ lspci -nn|grep -in eth
5:00:19.0 Ethernet controller [0200]: Intel Corporation Device [8086:1502] (rev 04)2. 根據vendor id + device id搜尋, 8086是Intel Corporation, 1502是Intel 82579LM Gigabit Network Card
3. 去intel網站下載適合的驅動程式 先搜尋"82579", 再作業系統欄位選擇"Linux", 會得到e1000e-2.5.4.tar.gz
4. 最後就編譯安裝, 重新啟動網路, 搞定, 看到ifconfig有eth0真是太感動了
$ cd e1000e-2.5.4/src$ make
make -C /lib/modules/2.6.32-38-generic/build SUBDIRS=/home/sosorry/driver/e1000e-2.5.4/src modules make[1]: Entering directory `/usr/src/linux-headers-2.6.32-38-generic' CC [M] /home/sosorry/driver/e1000e-2.5.4/src/netdev.o CC [M] /home/sosorry/driver/e1000e-2.5.4/src/ethtool.o CC [M] /home/sosorry/driver/e1000e-2.5.4/src/param.o CC [M] /home/sosorry/driver/e1000e-2.5.4/src/82571.o CC [M] /home/sosorry/driver/e1000e-2.5.4/src/ich8lan.o CC [M] /home/sosorry/driver/e1000e-2.5.4/src/80003es2lan.o CC [M] /home/sosorry/driver/e1000e-2.5.4/src/mac.o CC [M] /home/sosorry/driver/e1000e-2.5.4/src/nvm.o CC [M] /home/sosorry/driver/e1000e-2.5.4/src/phy.o CC [M] /home/sosorry/driver/e1000e-2.5.4/src/manage.o CC [M] /home/sosorry/driver/e1000e-2.5.4/src/kcompat.o LD [M] /home/sosorry/driver/e1000e-2.5.4/src/e1000e.o Building modules, stage 2. MODPOST 1 modules CC /home/sosorry/driver/e1000e-2.5.4/src/e1000e.mod.o LD [M] /home/sosorry/driver/e1000e-2.5.4/src/e1000e.ko make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-38-generic'
$ sudo make install
make -C /lib/modules/2.6.32-38-generic/build SUBDIRS=/home/sosorry/driver/e1000e-2.5.4/src modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.32-38-generic'
Building modules, stage 2.
MODPOST 1 modules
make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-38-generic'
gzip -c ../e1000e.7 > e1000e.7.gz
# remove all old versions of the driver
find /lib/modules/2.6.32-38-generic -name e1000e.ko -exec rm -f {} \; || true
find /lib/modules/2.6.32-38-generic -name e1000e.ko.gz -exec rm -f {} \; || true
install -D -m 644 e1000e.ko /lib/modules/2.6.32-38-generic/kernel/drivers/net/e1000e/e1000e.ko
/sbin/depmod -a || true
install -D -m 644 e1000e.7.gz /usr/share/man/man7/e1000e.7.gz
man -c -P'cat > /dev/null' e1000e || true
e1000e.
$ sudo /etc/init.d/networking restart
reference: Fix for non-working wired ethernet on Dell Latitude E6520 with Intel 82579 based adapter running Ubuntu 10.04 LTS Lucid
訂閱:
文章 (Atom)
