Skip to content. | Skip to navigation

Personal tools

Navigation

You are here: Home / Tips / Ubuntu Linux

Ubuntu Linux

Unix Utilities https://www.facebook.com/groups/pythontw/permalink/10160952703533438/ run as admin https://dotblogs.com.tw/swater111/2016/12/06/164005 poshgui powershell https://medium.com/@bajcmartinez/the-best-vs-code-extensions-for-python-developers-for-2021-748b2ce16eee

Docker Tool 家用版安裝 Docker Hyper-V 解除安裝 專業版下載 WSL and Windows Console Win10 USB install Web Dev on Windows with WSL and VS Code USB Bootdisk Unetbootin linux-dev-environment-on-windows-with-wsl-docker-tmux-and-vscode Visual Studio Code for Front-end Developers how-to-set-up-docker-and-windows-subsystem-for-linux-a-love-story 嚴重錯誤

public key vs private key

WSL PostgreSQL PANIC: could not flush dirty data: Function not implemented

systemd

SSH

Setup Keys JWT

bash -c 帶參數時會沒有反應

Text Processing

Grep a Block of Text delimited by two key lines

Windows10 USB Boot to update UEFI Firmware BIOS

Allow Specific Packages from PPA

Failed password for root from IP port 38980 ssh2: 1) ssh port other than 22 2) fail2ban

Increase Internet Speed with TCP BBR congestion control

Bash on Windows Example:

Setting up apport (2.14.1-0ubuntu3.25) ...
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
runlevel:/var/run/utmp: No such file or directory
invoke-rc.d: policy-rc.d denied execution of start.
Setting up linux-libc-dev:amd64 (3.13.0-125.174) ...
Setting up poppler-utils (0.24.5-2ubuntu4.5) ...
Processing triggers for libc-bin (2.19-0ubuntu6.13) ...

Recursive dos2unix

$ find . -type f -print0 | xargs -0 dos2unix

Regular Expression: "011.     ," to "011,"  試過 %s/(\d\d\d)\./\1 比對不到

Linux Load Averages

ffmpeg avidemux3 audacity script

$ grep -r KEYWORD . | cut -d':' -f1

tar -T, --files-from FILE

tar cvpf myfile.tar /myfolder --exclude "/myfolder/tmp"

zip -r myfile.zip myfolder -x *.git* --exclude=*.DS_Store*

tar cvpzf - /myfolder | ssh root@example.com "cat > /backup/another.tgz"

ssh root@example.com "cat /backup/another.tgz" | tar xvpzf -

tar cvpzf - myfolder --exclude "myfolder/tmp" | ssh root@example.com "tar xpzf -"

zip -r -s 100m archive.zip mydolder

Firewall Connection

ufw 刪除 v6 可先查出號碼 sudo ufw status numbered

sshd + TCPwrapper

/etc/ssh/ssh_config

Host *
  ServerAliveInterval 120
  ServerAliveCountMax 2

Editor

Vim Folding :setlocal foldmethod=indent (or syntax, in ~/.vim/after/ftplugin/html.vim)

isort plugin

Windows: Copy - Ctrl + fn + Delete Paste - Shift + fn + Delete

Image

$ identity orig.png

# ImageMagick orig.png = 640x480

$ convert orig.png -crop 640x440+0+40 output.png

$ convert orig.png -resize 640x640 output.png

$ convert orig.png -resize 640x640\! output.png

Input Method

$ sudo apt-get install fcitx
$ sudo add-apt-repository ppa:fcitx-team/nightly
$ sudo apt-get update
$ sudo apt-get install fcitx-table-boshiamy
$ im-config ## 輸入法設定, 選擇 fctix 後, 重新開機

Disk Filesystem

badblocks mkfs.ext4 -c /dev/sdxn 檢查壞軌 SMART support ext4 有 journal 錯誤 但 ext2 就避掉

Disk Recovery: TestDisk

Synology NAS

以 BusyBox 自製而成 透過 Chroot Jail 可安裝 Ubuntu 但需要重新安裝 Firmware 可能造成資料流失 使用 ipkg 可以自行安裝軟體

VIrtualBox

要 sudo docker 不然會 cannot connect to the docker daemon

這篇文章有用處 , 許多大螢幕一直固定亮著 , 怕它 發生 灼影 . 像是電腦上的 Spotify 之類的音樂播放軟體 , 電腦還得開著 , Windows 10 之下 , 一進入螢幕關閉狀況 (不是休眠喔) , Spotify 又會停止播放 . 這篇分享有個 捷徑 的 建立快速鍵 小秘訣 , 還滿好用的呢 . 該文利用指令列方式 [2] , 寫成批次檔 , 利用自建快捷鍵 呼叫該功能 (螢幕保護程式 讓全畫面變黑)

[1] https://www.wfublog.com/2016/02/win8-win10-turn-off-monitor-play-youtube-music.html [2] %systemroot%\system32\scrnsave.scr /s

現在網路封包都要經過 kernel 處理再複製到 user space 而 RDMA 可以節省這段處理。 DMA 很早就有了,現在連 TCP/IP 都硬體化了,請查詢 TCP/IP offloading,基本盤是把 checksum 硬體化進行加速,所以有些人會跟你說要用 wireshark 抓封包要先關掉這個。 RDMA是一種允許網絡中的計算機在主存儲器中交換數據, RDMA 主要運用在 data center,一般人買有支援RDMA的網卡應該沒有什麼用。 如果我理解沒錯,原po是問單機中的DMA技術,而此功能市面上的pci/pcie卡都已經支援。如果需要更有效率的卡,可找支援DPDK driver的卡(可能只有linux版....