Skip to content

Instantly share code, notes, and snippets.

View kattatzu's full-sized avatar

José Eduardo Ríos kattatzu

View GitHub Profile
# Stop all containers
# sudo docker-compose down
# Delete all containers
sudo docker rm -f $(sudo docker ps -a -q)
# Delete all volumes
sudo docker volume rm $(sudo docker volume ls -q)
# Delete all networks
sudo lsof -i -P -n | grep LISTEN
# Obtiene el UUID
lsblk -f
# Creamos directorio donde se montar el volumen
sudo mkdir /mnt/data
# Registro en fstab
sudo nano /etc/fstab
UUID="..." /mnt/data ext4 defaults,noatime,_netdev 0 2
kattatzu /
Last active July 22, 2022 02:24
Open Port on Ubuntu
sudo ufw disable
sudo apt install firewalld -y
sudo systemctl enable firewalld
# sudo firewall-cmd --permanent --zone=public --add-port=80/tcp
# sudo firewall-cmd --permanent --zone=public --add-port=443/tcp
# sudo firewall-cmd --permanent --zone=public --add-port=5432/tcp
sudo firewall-cmd --reload
curl -L | bash
kattatzu /
Created July 16, 2022 06:20
Install Docker & Docker Compose on Ubuntu Server
sudo apt-get update
sudo apt-get remove docker docker-engine containerd runc
sudo apt-get install -y ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli docker-compose-plugin
sudo apt-get install -y docker-compose

For archive the branches that are no longer used I created a function in my .zshrc file (or .bashrc). The content of the branch is saved in a new tag and subsequently deleted.

To make this process faster I created this function in my .zshrc file (or .bashrc).

function archive_branch() {
  date=$(date '+%Y-%m-%d')

 git checkout master