Skip to content

Instantly share code, notes, and snippets.

View josephbolus's full-sized avatar

Joseph Bolus josephbolus

View GitHub Profile
@josephbolus
josephbolus / d8-drushless-revert.sh
Created March 1, 2023 21:30 — forked from crittermike/d8-drushless-revert.sh
Revert configuration in Drupal 8 with Drush (without using Features)
drush cim -y --partial --source=modules/path/to/module/config/install/
<script>
function parseHttpHeaders(httpHeaders) {
return httpHeaders.split("\n")
.map(x=>x.split(/: */,2))
.filter(x=>x[0])
.reduce((ac, x)=>{ac[x[0]] = x[1];return ac;}, {});
}
var req = new XMLHttpRequest();
req.open('GET', document.location, false);
@josephbolus
josephbolus / Readme.md
Created January 12, 2023 19:57 — forked from saniaky/Readme.md
Docker + nginx-proxy + let's encrypt + watchtower + fail2ban

Complete solution for websites hosting

This gist contains example of how you can configure nginx reverse-proxy with autmatic container discovery, SSL certificates generation (using Let's Encrypt) and auto updates.

Features:

  • Automatically detect new containers and reconfigure nginx reverse-proxy
  • Automatically generate/update SSL certificates for all specified containers.
  • Watch for new docker images and update them.
  • Ban bots and hackers who are trying to bruteforce your website or do anything suspicious.
@josephbolus
josephbolus / socks.txt
Last active November 14, 2023 18:00 — forked from jasdeepkhalsa/socks.txt
Configuring a SOCKS proxy server in Chrome
From: http://www.chromium.org/developers/design-documents/network-stack/socks-proxy
To configure chrome to proxy traffic through the SOCKS v5 proxy server myproxy:8080, launch chrome with these two command-line flags:
--proxy-server="socks5://myproxy:8080"
--host-resolver-rules="MAP * 0.0.0.0 , EXCLUDE myproxy"
The first thing to check when debugging is look at the Proxy tab on about:net-internals, and verify what the effective proxy settings are:
chrome://net-internals/#proxy
@josephbolus
josephbolus / Caddy.env
Created July 23, 2022 06:44 — forked from crazy-max/Caddy.env
Proxmox web interface through Caddy as reverse proxy with Let's Encrypt
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_HOSTED_ZONE_ID=
@josephbolus
josephbolus / caddy.service
Created July 22, 2022 05:20
Caddy systemd service
# caddy.service
#
# For using Caddy with a config file.
#
# Make sure the ExecStart and ExecReload commands are correct
# for your installation.
#
# See https://caddyserver.com/docs/install for instructions.
#
# WARNING: This service does not use the --resume flag, so if you
@josephbolus
josephbolus / Caddyfile
Created July 22, 2022 05:15 — forked from dimasahmad/Caddyfile
Install Caddy 2 on Ubuntu
# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile
:80
reverse_proxy 10.100.100.1:80
@josephbolus
josephbolus / default.conf
Created June 16, 2022 21:43 — forked from flox1an/default.conf
nginx config that uses the oauth2-proxy (via auth_request) to authenticate against gitlab and then proxies all requests to a backend service while setting the auth headers X-User and X-Email
server {
listen 80;
server_name localhost;
location /oauth2/ {
proxy_pass http://oauth-proxy:4180;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Auth-Request-Redirect $request_uri;
@josephbolus
josephbolus / The Technical Interview Cheat Sheet.md
Created March 20, 2021 16:23 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

0 0 * * * /root/.acme.sh/acme.sh --renew --apache --renew-hook /root/.acme.sh/cloudkey-renew-hook.sh -d cloudkey.local.xintriq.net
* * */5 * * "/root/.acme.sh"/expirycheck.sh >> /var/log/letsencrypt.log