Skip to content

Instantly share code, notes, and snippets.

View kattatzu's full-sized avatar
🎯
Focusing

José Eduardo Ríos kattatzu

🎯
Focusing
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
kattatzu / open-ports.sh
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 https://gist.githubusercontent.com/kattatzu/42d59be282c7e6d1c21cfde2b575d7cc/raw/119f828d26c449d32190e0a14d2b7dcd52a724b0/install-docker.sh | bash
@kattatzu
kattatzu / install-docker.sh
Created July 16, 2022 06:20
Install Docker & Docker Compose on Ubuntu Server
sudo apt-get update
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get install -y ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(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 containerd.io 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