These are just reminders/documentation for me because I don’t want to remember them. It is not a guide for anything, it just has commands and tricks I use when reinstalling OS or fixing someone’s computer. Please don’t copy/paste commands without knowing what they do.
-
GNU/Linux
-
install and setup nnn, a cli file manager
sudo apt install nnn sudo apt install moreutils sudo apt install renameutils nano ~/.bashrc # add the following export EDITOR='nano' export VISUAL='nano' export NNN_USE_EDITOR=1
-
Remap right alt key with context menu button (I miss the context button on my ThinkPad)
// add this to your startup script to make it permanent xmodmap -e "keycode 108 = Menu"
-
wordpress: fix file permission issues
sudo find . -type f -exec chmod 644 {} \; sudo find . -type d -exec chmod 755 {} \; sudo chown -R www-data:www-data .
-
awk
awk '/regex/' awk '!/regex/' awk 'BEGIN{a=5; b=2.5; print a+b}' awk '{sub(/:/, "-")} 1' // substitution awk '{gsub(/:/, "-")} 1'
-
Rename files in bulk using regex
for f in *.ttf; do mv "$f" "$(echo "$f" | sed s/findthis/replacewiththis/)"; done
-
Make VS Code remember Github credentials; Easier if you are working with multiple accounts for work and personal.
git config credential.helper store
-
Print exit code of previous-run program
echo $?
-
if dpkg breaks while updating
sudo dpkg --configure -a sudo apt --fix-broken install
-
to force remove a package
sudo dpkg -P --force-depends <pkg-name>
-
copy from terminal to clipboard
sudo apt install xsel echo "Hello" | xsel -ib
-
share files between devices on same network
python3 -m http.server
-
open editor to edit a command
Ctrl+X Ctrl+E
-
get your IP
curl ifconfig.me
-
raspberry pi - resolve wifi issue
sudo killall wpa_supplicant sudo wpa_supplicant -c/boot/octopi-wpa-supplicant.txt -iwlan0
if that doesn’t work
sudo nano etc/wpa_supplicant/wpa_supplicant.conf country=CA ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ ssid="**SSID**" psk="**PASS**" } sudo nano /etc/network/interfaces auto lo iface lo inet loopback iface eth0 inet manual auto wlan0 allow-hotplug wlan0 iface wlan0 inet manual wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf sudo systemctl enable wpa_supplicant.service
Thats it, reboot.
-
Play noise
-
pinknoise
play -t sl -r48000 -c2 -n synth -1 pinknoise .1 60
-
whitenoise
play -n synth 00:00:05 whitenoise
-
brownnoise as ocean waves
play -n synth brownnoise synth pinknoise mix synth sine amod 0.3 10
-
-
-
Android
-
unlock bootloader
fastboot devices fastboot oem unlock fastboot flash recovery twrp.img fastboot reboot
-
-
Windows
-
Flush DNS
ipconfig /flushdns ipconfig /registerdns ipconfig /release ipconfig /renew netsh winsock reset
-
Power usage info
powercfg -energy
-
PATH manipulation
env | grep PATH echo $PATH export PATH=<previous-paths>:<new-path>
-
List network devices
arp -a
-
Virtual Box issue on Windows 10 If you are not able to get Virtual Box in Windows, try running the following (as admin)
dism.exe /Online /Disable-Feature:Microsoft-Hyper-V bcdedit /set hypervisorlaunchtype off
Also make sure to remove the following from Windows Program and Features:
* Hyper-V * Virtualizing Platform
-
Restart to UEFI settings
shutdown -o -r -t 0
-
Restart graphics driver
ctrl + shift + win + b
-
-
nodejs
-
Installing NPM
curl -L https://npmjs.org/install.sh | sudo sh
-
Clear node modules cache and install dependencies
rm node_modules -r npm cache clean --force npm cache verify npm install
-
-
common CLI
-
youtube-dl - best audio
youtube-dl -f bestaudio --extract-audio --audio-format mp3 --audio-quality 0
-
termux - setting up, etc
-
settings file
~/.termux/termux.properties
-
add extra touch keyboard buttons
extra-keys = [ \ ['ESC','|','/','HOME','UP','END','PGUP','DEL'], \ ['TAB','CTRL','ALT','LEFT','DOWN','RIGHT','PGDN','BKSP'] \ ]
-
reload settings
termux-reload-settings
-
-