Skip to content. | Skip to navigation

Personal tools


You are here: Home / Tips / Ubuntu Linux

Ubuntu Linux

Unix Utilities

Win10 Web Dev on Windows with WSL and VS Code USB Bootdisk Unetbootin linux-dev-environment-on-windows-with-wsl-docker-tmux-and-vscode


Setup Keys

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 myfolder -x *.git* --exclude=*.DS_Store*

tar cvpzf - /myfolder | ssh "cat > /backup/another.tgz"

ssh "cat /backup/another.tgz" | tar xvpzf -

tar cvpzf - myfolder --exclude "myfolder/tmp" | ssh "tar xpzf -"

zip -r -s 100m mydolder

Firewall Connection

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

sshd + TCPwrapper


Host *
  ServerAliveInterval 120
  ServerAliveCountMax 2


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

isort plugin

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


$ 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 可以自行安裝軟體


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