Skip to content

Instantly share code, notes, and snippets.

@atb00ker
Last active January 11, 2024 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atb00ker/aad7fb8e718f23f01e07798a6c6c2364 to your computer and use it in GitHub Desktop.
Save atb00ker/aad7fb8e718f23f01e07798a6c6c2364 to your computer and use it in GitHub Desktop.
Collection of snippets i find myself using every once in a while
snippet-active : commands I keep forgetting
snippets-archive : commands I used to forget
snippets-backup : commands that might be useful again someday
- git remote rm origin
- git remote prune origin
- tar -xvzf file.tar.gz
- ln -s <path/to/real/file-or-folder> <symlink path>
- stat <file-name>
- grep -Hrn "<<<<<<< HEAD"
- sudo dd bs=4M if=/path/to/iso of=/dev/sdb status=progress && sync
- git log --all --decorate --oneline --graph
- git branch -dr <remote>/<branch>
- netcat -u -v -w2 <IP> <Port>
- javascript: (function () { document.getElementsByTagName("video")[0].playbackRate = 2; })();
- docker run -d --user $UID:$GID \
-p 8080:8080 -p 6881:6881/tcp -p 6881:6881/udp \
-v /home/path/config:/config:rw \
-v /home/path/torrents:/torrents:rw \
-v /home/path/downloads:/downloads:rw \
wernight/qbittorrent
SSH Options
- sshuttle -e 'ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' --dns -r <user>@<ip> 0/0
- pkill sshuttle
- sudo kill -9 $(sudo lsof -t -i:9999)
- ssh -D 9999 -f -C -N <user>@<ip>
- export http_proxy=socks5://127.0.0.1:9999 https_proxy=socks5://127.0.0.1:9999 ALL_PROXY=socks5://127.0.0.1:9999
# GPG
gpg --symmetric --output <output> <input>
gpg --decrypt --output <output> <input>
- Ansible:
ansible-playbook -i hosts playbook.yml -u root -k --become -K
- SSH known_hosts:
for i in $(seq 34 48); do ssh-keyscan -H 192.168.56.$i >> ~/.ssh/known_hosts; done
for i in $(seq 34 48); do ssh-keygen -R 192.168.56.$i; done
sshpass -p "root" ssh -o StrictHostKeyChecking=no root@192.168.56.43
- GZIP:
tar -cf texfiles.tar
gzip -9 textfiles.tar
gunzip texfiles.tar.gz
tar -xf texfiles.tar
echo 0 > /sys/class/backlight/intel_backlight/brightness
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment