Skip to content

Instantly share code, notes, and snippets.

View pietrorea's full-sized avatar
✌️

Pietro Rea pietrorea

✌️
View GitHub Profile
@pietrorea
pietrorea / nginx-location-block.conf
Created January 27, 2022 20:23
nginx reverse proxy to Wordpress install on another host
location /blog/ {
proxy_pass http://YOUR_IP_ADDRESS/; # this last forward slash is important
proxy_http_version 1.1;
proxy_cache_bypass $http_upgrade;
# Proxy headers
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@pietrorea
pietrorea / ssh-here-document.sh
Created January 28, 2022 16:45
SSH config here document
cat > /etc/ssh/sshd_config << "EOF"
Include /etc/ssh/sshd_config.d/*.conf
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
...
EOF
@pietrorea
pietrorea / mysql-here-document.sh
Created January 28, 2022 16:47
MySQL here document example
mysql -u root --password="${PASSWORD}" <<EOF
CREATE DATABASE ${DB_NAME};
CREATE USER '${APP_USER}'@'localhost' IDENTIFIED BY '${APP_PASSWORD}';
GRANT ALL ON ${DB_NAME}.* TO '${APP_USER}'@'localhost'
EOF
@pietrorea
pietrorea / gist:c9c5597677eb3db5e3aa90cd0b4e1c1f
Created September 6, 2022 04:06
BBEdit Startup Item - Symbolic link
ls -s ~/path/to/notes.bbprojectd ~/Library/Application Support/BBEdit/Startup Item