Skip to content

djsamseng/cheat_sheet

Repository files navigation

Cheat Sheet

Reset Ubuntu Audio - Reset PulseAudio

systemctl --user restart pulseaudio

Record Audio

sox -d rec.wav

Play Audio

aplay rec.wav # Linux
afplay rec.wav # MacOS

Center Audio

sox test.wav out.wav highpass 10

grep recursively for text in folder

./grep_for_text.sh "text to find" /path/to/folder --include=\*.{cpp,h}
grep -Ril "text to find" /path/to/folder --include=\*.{cpp,h}

Change Java versions

sudo update-alternatives --config java

Wifi signal strength

sudo iwlist wlan0 scan | egrep "Cell|ESSID|Signal|Rates" | head -5

Local ip address

ipconfig getifaddr en0

External ip address

curl ifconfig.me

RPI video stream

On RPI

Setup Instructions or Full Setup Instructions

/usr/local/bin/mjpg_streamer -i "/usr/local/lib/mjpg-streamer/input_uvc.so -n -f 10 -r 1280x720" -o "/usr/local/lib/mjpg-streamer/output_http.so -p 8085 -w /usr/local/share/mjpg-streamer/www"

Web Browser on Desktop

ping raspberrypi.local

My Altice Port Forwarding

  • http://192.168.1.1
  • Port forwarding >> Manage >> Add port forwarding Rule >> Select device >> Enter destination port (external forces internal to be the same, external is outside port and internal port is the port on the device to go to)

Multiple Git Accounts

  1. Generate a second ssh key and rename it to something else
ssh-keygen -t ed25519 -C "SOMEWHERE_ELSE@gmail.com"
# Enter file in which to save the key (/home/samuel/.ssh/id_ed25519): /home/samuel/.ssh/id_ed25519_SOMEWHERE_ELSE
ssh-add ~/.ssh/id_ed25519_SOMEWHERE_ELSE
  1. Add the key in github
cat ~/.ssh/id_ed25519_SOMEHWERE_ELSE.pub
  1. Create ~/.ssh/config
Host github.com github account
        HostName github.com
        PreferredAuthentications publickey
        IdentityFile ~/.ssh/id_ed25519

Host github.com-SOMEWHERE github account
        HostName github.com
        PreferredAuthentications publickey
        IdentityFile ~/.ssh/id_ed25519_SOMEWHERE_ELSE
  1. Update ~/.gitconfig
[user]
        email = REGULAR@gmail.com
        name = REGULAR
[core]
        editor = vim

[includeIf "gitdir:~/dev/SOMEWHERE_SPECIAL"]
        path = ~/.gitconfigSOMEWHERE_ELSE
  1. Create ~/.gitconfigSOMEWHERE_ELSE
[user]
        email = SOMETHING_ELSE@gmail.com
        name = SOMETHING_ELSE
  1. Add the remote for using the SOMETHING_ELSE account
  • git@github.com-SOMEWHERE matches the Host in ~/.ssh/config
git remote add origin git@github.com-SOMEWHERE:account_name/repo_name.git

Reindent VSCode

  1. Indent Using Tabs
  2. Select the current tab size (ex: 4 if converting from 4 to 2)
  3. Convert Indentation to Tabs
  4. Indent Using Tabs
  5. Select the desired tab size (ex: 2 if converting from 4 to 2)
  6. Convert Indentation to Spaces

About

Command cheet sheet

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages