Bash_Everywhere


# Mac format command
diskutil eraseDisk ExFAT iMAC1T disk0
diskutil list
diskutil unmountDisk /dev/disk0
sudo dd if=/dev/urandom of=/dev/disk0 bs=1000000
(Note that on OS X you can also hit Ctrl+T to show the current process of dd)
# Azure VM
ssh <username>@<ip address>
sudo apt-get install lxde -y
sudo apt-get install xrdp -y
/etc/init.d/xrdp start

# Mac 安裝套件管理工具
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install wget --with-libressl

# Ubuntu on Windows 使用者路徑
C:\Users\Username\AppData\Local\Lxss\rootfs

# Android Termux
termux-setup-storage
apt update
apt install openssh
ssh-keygen
touch ~/.ssh/authorized_keys
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
chmod 700 ~/.ssh
開始 sshd
結束 pkill sshd

ssh <ip address> -p 8022 -i ~/.ssh/id_rsa

# UFW 簡式防火牆
sudo ufw enable 開
sudo ufw disable 關
sudo ufw default allow
sudo ufw default deny
sudo ufw allow ssh 允許ssh服務
sudo ufw allow in 8000 設定port number
sudo ufw deny out 4000
sudo ufw deny in 4000/udp 設定port/protocol
sudo ufw status numbered 查規則號碼
sudo ufw delete 規則號碼

# Linux 筆電休眠不正常關機

編輯 /etc/systemd/logind.conf
移除下四列 # 號
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend (改成 HandleLidSwitch=ignore)
sudo restart systemd-logind