Skip to content

Instantly share code, notes, and snippets.

View carlosrabelo's full-sized avatar
🛠️
Always making

Carlos Rabelo carlosrabelo

🛠️
Always making
View GitHub Profile
@carlosrabelo
carlosrabelo / squash-all-commits-in.one.sh
Last active June 23, 2023 18:15
squash all commits in one
git-squash-commit='git reset $(git commit-tree HEAD^{tree} -m "Initial commit")'
#!/bin/bash
nmap -n -sn 192.168.0.0/24 -oG - | awk '/Up$/{print $2}'
@carlosrabelo
carlosrabelo / pub.key
Last active June 25, 2023 02:59
pgp key
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQGNBGSXqv4BDADpoc4ufGv9TTdqQUFym7xGtRhzIuFaGb0fhlHC0xAYjv+V0409
QQpsreVE+ntEdBt7LWjbW7595KbCeq+0e9tQq0iZluBZ5vhUYCdXxIEt7nuJmbXe
1CaLfYw150jQ2VAVsCCbf7C3HLLoNanItgkDKleX51cQA1KcKz8to5YNllK70w6r
jbDe6b8LnaKKZj+iqlhag8mNK+zl9z+Rvoe9mzt5eWY4mGRhrM36THJ8LJUHiK+X
GZ7JQASKr1S0RgcQQGsi+8YPKFl7jwHGP8WNIIyJRwBv8XYhI8u/gY3kda+xQ+oN
YWEYuxhFBkCmhWtJle2zoWyEs74m/TlwzVDTLb6uyurkMqmd6hlx4VFyebAQuPaL
EUg9iPR4xwUNYYNJhp273e4NfaJ3UwigP/q9IyV4gZNbsEb4p7uOxm3WlYPHRgl/
pkGBuR+KFG+0y1D0FBIXGzDPnFZy1JcEkSzkyCf/IgZQUCHy2ew5QUrQ2vSnYCQd
@carlosrabelo
carlosrabelo / my-bash-prompt.sh
Last active June 23, 2023 15:04
my bash prompt
export PS1='\[\033[0;37m\]\[\033[0m\033[0;33m\]\u\[\033[0;31m\]@\[\033[0;33m\]\h \033[0;36m\]\w\[\033[0;32m\]$(__git_ps1)\n\[\033[0;34m\]└─\[\033[0m\033[0;37m\]\$\[\033[0m\033[0;37m\]\[\033[0m\] '
@carlosrabelo
carlosrabelo / allow-ping-on-windows.bat
Last active June 23, 2023 15:03
allow ping on windows
netsh advFirewall Firewall add rule name="Allow Ping IPv4" protocol=icmpv4:8,any dir=in action=allow
netsh advFirewall Firewall add rule name="Allow Ping IPv6" protocol=icmpv6:8,any dir=in action=allow
--format "mp4[height<=1080]"
--audio-format "mp3"
--output "%(upload_date)s - %(title)s.%(ext)s"
#!/bin/sh
MONITOR="DP-1"
ID_STYLUS=`xinput | grep "HUION Huion Tablet Pen stylus" | cut -f 2 | cut -c 4-5`
# ID_STYLUS=`xinput | grep "Wacom Intuos S Pen stylus" | cut -f 2 | cut -c 4-5`
xinput map-to-output $ID_STYLUS $MONITOR
#!/bin/bash
# remove exited containers:
docker ps -aq --filter status=dead --filter status=exited | xargs -r docker rm -v
# remove unused images:
docker images -qf dangling=true --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi
# remove unused volumes:
docker volume ls -qf dangling=true | xargs -r docker volume rm