Linux Notes
Menu
shell
bash
- remove double quotes.
- all
"${opt//\"}" - suffix
"${opt%\"}" - prefix
"${opt#\"}"
- all
zsh
- Prompt only displays the basename of the current directory.
Change%~to%1~
Reference
raspberry pi
- headless wifi
wpa_supplicant.confcountry=US ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ ssid="your_real_wifi_ssid" scan_ssid=1 psk="your_real_password" key_mgmt=WPA-PSK } - headless ip address setup
add a line in cmdline.txt
ip=192.168.0.10
apt
- sudo dpkg -i –force-overwrite /var/cache/apt/archives/apport_2.20.1-0ubuntu2.4_all.deb
X11
Solution for Warning: No xauth data; using fake authentication data for X11 forwarding.
- at local(client) machine.
touch ~/.Xauthority xauth generate $DISPLAY .
Issues
- Local sites running in WSL2 not accessible in browser
- the windows docker edits the host file. it works well after reseting the host file.
asdf with brew
- the windows docker edits the host file. it works well after reseting the host file.
echo -e "\n. $(brew --prefix asdf)/libexec/asdf.sh" >> ${ZDOTDIR:-~}/.myshell.sh- failed to use asdf zsh plugin
Emacs
The emacs daemon can be started automatically in a very simple manner.
export ALTERNATE_EDITOR=""
ulimit -n in WSL2:
problem: https://askubuntu.com/a/1327539 walkaround: https://github.com/microsoft/WSL/discussions/6226