Skip to content

Instantly share code, notes, and snippets.

View danilogco's full-sized avatar

Danilo Carolino danilogco

View GitHub Profile
docker container prune -f
docker volume prune -f
docker image prune -a -f
docker network prune -f
docker system prune -f

Conventinal Commit Messages

See how a minor change to your commit message style can make a difference. Examples

Have a look at CLI util git-conventional-commits to ensure this conventions and generate changelogs

Commit Formats

Default

@danilogco
danilogco / git_cleanup
Last active August 5, 2024 15:04
git cleanup shortcut way
git config -e --global
[user]
email = [email protected]
name = Danilo
[pull]
rebase = true
[alias]
cleanup = "!git fetch -f && git branch | grep -v "dev" | grep -v "master" | xargs --no-run-if-empty git branch -D && git gc"
@danilogco
danilogco / clean_snaps.sh
Created April 26, 2021 02:36
Clean old snap packages
#!/bin/bash
# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
set -eu
LANG=C snap list --all | awk '/disabled/{print $1, $3}' |
while read snapname revision; do
snap remove "$snapname" --revision="$revision"
done
@danilogco
danilogco / install.sh
Last active August 11, 2024 03:12
TP-Link Archer T4U v3 - Ubuntu 21.04
#!/bin/bash
# tested 5.11.0-16-generic #17-Ubuntu SMP Wed Apr 14 20:12:43 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
# installing dkms and git
sudo apt update
sudo apt install -y dkms git
# cloning driver repository
mkdir ~/src
cd ~/src
@danilogco
danilogco / gist:1adbcdaffa4400672436cabd83fa16fb
Last active April 24, 2021 19:47 — forked from mislav/gist:938183
Faraday SSL example
connection = Faraday::Connection.new('http://example.com') do |builder|
builder.request :url_encoded # for POST/PUT params
builder.adapter :net_http
end
# same as above, short form:
connection = Faraday.new 'http://example.com'
# GET
connection.get '/posts'
@danilogco
danilogco / github_desktop_ubuntu.sh
Last active December 23, 2024 19:56 — forked from berkorbay/github_desktop_ubuntu.md
To install Github Desktop for Ubuntu
wget https://github.com/shiftkey/desktop/releases/download/release-3.1.1-linux1/GitHubDesktop-linux-3.1.1-linux1.deb
sudo gdebi GitHubDesktop-linux-3.1.1-linux1.deb
# OR
wget -qO - https://apt.packages.shiftkey.dev/gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/shiftkey-packages.gpg > /dev/null
sudo sh -c 'echo "deb [arch=amd64] https://packagecloud.io/shiftkey/desktop/any/ any main" > /etc/apt/sources.list.d/packagecloud-shiftky-desktop.list'
sudo apt update && sudo apt install github-desktop
@danilogco
danilogco / fix_docker_startup.sh
Last active April 21, 2021 18:22
Fix docker startup - Ubuntu 20.10
#!/bin/sh
# Disable docker service autoload
sudo systemctl disable docker.service docker.socket
# Aliases to start or shutdown docker service
echo "alias docker_start='systemctl start docker.service'" | sudo tee -a ~/.bash_profile
echo "alias docker_stop='systemctl stop docker.service docker.socket'" | sudo tee -a ~/.bash_profile
source ~/.bash_profile
@danilogco
danilogco / clean.sh
Last active June 23, 2025 16:14 — forked from Iman/clean.sh
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#!/bin/sh
#Check the Drive Space Used by Cached Files
du -sh /var/cache/apt/archives
#Clean all the log file
#for logs in `find /var/log -type f`; do > $logs; done
logs=`find /var/log -type f`
for i in $logs
@danilogco
danilogco / install-comodo-ssl-cert-for-nginx.rst
Created January 7, 2019 20:17 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert