Skip to content

Instantly share code, notes, and snippets.

@atb00ker
Last active July 3, 2021 12:21
Embed
What would you like to do?
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>
- 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
cat /usr/share/gnome-session/sessions/budgie-desktop.session -- (budgie-wm;budgie-daemon;budgie-panel;)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment