Skip to content

Instantly share code, notes, and snippets.

View mrsombre's full-sized avatar

Dmitrii Barsukov mrsombre

  • Montenegro
  • 15:27 (UTC +02:00)
View GitHub Profile
@mrsombre
mrsombre / github-api.md
Last active December 1, 2021 06:49
Validate github token
curl -H "Authorization: token OAUTH-TOKEN" https://api.github.com/users/codertocat -I
@mrsombre
mrsombre / _wsl.md
Last active April 2, 2021 03:57
WSL 2 Scripts and Hacks

A set of Hacks and scripts for WSL2 Ubuntu distro

@mrsombre
mrsombre / linux.sh
Last active September 29, 2022 12:45
Linux commands
## delete files
# rm indexed
rm a_{000750..000850}
# delete old
find . -type f -mtime +30 -delete
# delete by size
find . -type f -size 1k -delete
# delete dir
find . -depth -mtime +30 -execdir rm -rf {} +
@mrsombre
mrsombre / commands.sh
Last active December 24, 2021 09:41
Remove git tags
# local
git tag -d <tag_name>
# remote
git push --delete origin tagname
# Delete all local tags and get the list of remote tags:
git tag -l | xargs git tag -d
git fetch
# Remove all remote tags
git tag -l | xargs -n 1 git push --delete origin
@mrsombre
mrsombre / awscli.sh
Created September 29, 2022 13:15
AWS
# list instancess with ip
aws ec2 describe-instances --filters "Name=tag:Team,Values=Tools" --query 'Reservations[*].Instances[*].{Instance:InstanceId,Name:Tags[?Key==`Name`]|[0].Value,IP:PrivateIpAddress}'