Skip to content

Instantly share code, notes, and snippets.

View stiwardjherikofcr's full-sized avatar

STIWARD JHERIKOF CARRILLO RAMIREZ stiwardjherikofcr

View GitHub Profile
@stiwardjherikofcr
stiwardjherikofcr / install_docker_ubuntu.sh
Last active December 13, 2022 19:54
Install Latest or Specific Version of Docker in Ubuntu 22.04|20.04|18.04 LTS
#!/bin/bash
# $1: version of Docker Engine to install
# update the apt package index
sudo apt update
# install packages to allow apt to use a repository over HTTPS
sudo apt install -y \
apt-transport-https \
@stiwardjherikofcr
stiwardjherikofcr / uninstall_postgresql_*_ubuntu_20_04.sh
Created October 15, 2022 23:58
How To Completely Uninstall PostgreSQL || Ubuntu 20.04 LTS
# Step 1 — List All Postgres related packages
dpkg -l | grep postgres
# Step 2 — Remove all current Postgresql related packages
sudo apt --purge remove postgresql*
# Step 3 — Remove all of the PostgreSQL data and directories
sudo rm -rf /var/lib/postgresql/
sudo rm -rf /var/log/postgresql/
sudo rm -rf /etc/postgresql/
@stiwardjherikofcr
stiwardjherikofcr / install_postgresql_13_ubuntu_20_04.sh
Last active May 8, 2025 09:19
Install PostgreSQL 13 on Ubuntu 22.04|20.04|18.04 LTS
# Step 1 — Update Base Systems
sudo apt update && sudo apt -y upgrade
# Step 2 — Import Repository Signing Key
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
# Step 3 — Add PostgreSQL repository
sudo sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
# Step 4 — Update again
@stiwardjherikofcr
stiwardjherikofcr / download-gdrive.sh
Created October 15, 2022 23:26
Wget/cURL Large File from Google Drive
#! /bin/bash
# Get files from Google Drive
# $1 = file ID
# $2 = file name
URL="https://docs.google.com/uc?export=download&id=$1"
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate $URL -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=$1" -O $2 && rm -rf /tmp/cookies.txt