View docker-stop-all-containers.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo docker ps -q | xargs -r sudo docker stop |
View macOS-list-ports.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
PORT=8013 | |
lsof -nP -iTCP:$PORT | grep LISTEN;: |
View gunicorn-kill-processes.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
ps aux | grep gunicorn | awk '{print $2;}' | xargs kill -9 2>/dev/null | |
ps aux | grep gunicorn | awk '{print $2;}' | xargs kill -9 2>/dev/null | |
ps aux | grep gunicorn | awk '{print $2;}' | xargs kill -9 2>/dev/null | |
ps aux | grep python | awk '{print $2;}' | xargs kill -9 2>/dev/null | |
View certbot.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo certbot --nginx certonly -d domain.com,www.domain.com --expand |
View user.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--sudo -u postgres psql -p 5432 | |
CREATE USER username WITH PASSWORD 'secret'; | |
ALTER USER username WITH PASSWORD 'secret'; | |
DROP USER username; | |
CREATE DATABASE dbname WITH OWNER=username; | |
GRANT ALL PRIVILEGES ON DATABASE "dbname" to username; |
View postgres-status.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service postgresql status | tee | |
sudo pg_lsclusters | |
ps -ax | grep -v grep | grep postgres | |
sudo netstat -tulpn | grep :543 |
View Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SSH_HOSTNAME:=ubuntu@github42 | |
NAME:=github42 | |
VERSION:=12 | |
all: | |
make sync | |
make restart | |
make status | |
sync: |
View postgres-logs.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo find /var/log/postgresql -name '*.log' | |
sudo find /var/log/postgresql -name '*.log' -exec rm {} \; |
View Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SSH_HOSTNAME:=ubuntu@github42 | |
NAME:=github42 | |
VERSION:=12 | |
all: | |
make sync | |
make restart | |
make status | |
sync: |
View docker-exec.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo docker exec -it "$(sudo docker ps -qf name=NAME)" sh |
NewerOlder