Skip to content

Instantly share code, notes, and snippets.

View Masynchin's full-sized avatar

Max Smirnov Masynchin

View GitHub Profile
@Masynchin
Masynchin / install-docker.sh
Created June 16, 2023 09:02
Install Docker from apt repository on Debian 11
# Stolen and compiled into one shell script
# from https://docs.docker.com/engine/install/debian/
# Uninstall old versions
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done
# Set up the repository
## Update the apt package index and install packages to allow apt to use a repository over HTTPS:
sudo apt-get update
@Masynchin
Masynchin / rgnot.sh
Last active July 30, 2022 23:59
Regexp not in ripgrep. In the example we search all `new RqHeaders.Smart(` which not followed by `req`
rg 'new RqHeaders.Smart\((?!req)' --pcre2
@Masynchin
Masynchin / flake8plugins.sh
Last active July 4, 2022 20:32
Fetch all installed flake8 plugins
# Just names
pip list | awk '/^flake8/{print $1}'
# With version
pip list | awk '/^flake8/{print $1 "==" $2}'
@Masynchin
Masynchin / exceptmain.sh
Created June 12, 2022 23:37
Delete all git branches except main
# Shamelessly stolen from https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/delete-all-branches-except-master-main-local-remote
# using ripgrep instead of grep, so it is two symbols shorter :)
git branch | rg -v 'main' | xargs git branch -D