Skip to content

Instantly share code, notes, and snippets.

View tfb414's full-sized avatar

Tim Brady tfb414

View GitHub Profile

Keybase proof

I hereby claim:

  • I am tfb414 on github.
  • I am tfb414 (https://keybase.io/tfb414) on keybase.
  • I have a public key ASA3xMKIUpzcnk3khaWtl4n6tBouFJ2yvJCDYt29W-JjRwo

To claim this, I am signing this object:

const input = `
timestamp="Wed Jun 19 09:35:36 PDT 2019" message="test 10" id=10 field_1="test 10" field_6="test 1"
timestamp="Wed Jun 19 09:35:37 PDT 2019" message="test 4" id=4 field_2="test 4"
timestamp="Wed Jun 19 09:35:38 PDT 2019" message="test 2" id=3 field_3="test 2" field_9="test 23"
timestamp="Wed Jun 19 09:35:39 PDT 2019" message="test 3" id=2 field_4="test 3"
timestamp="Wed Jun 19 09:35:40 PDT 2019" message="test 4" id=1 field_5="test 4"
timestamp="Wed Jun 19 09:35:37 PDT 2019" message="test 5" id=5 field_3="test 10"
timestamp="Wed Jun 19 09:35:40 PDT 2019" message="test 6" id=6 field_1="test 5"
`
@tfb414
tfb414 / Securing-SWAG.md
Created January 7, 2022 22:34 — forked from quietsy/Securing-SWAG.md
Securing SWAG

Securing SWAG

SWAG - Secure Web Application Gateway (formerly known as linuxserver/letsencrypt) is a full fledged web server and reverse proxy with Nginx, PHP7, Certbot (Let's Encrypt™ client) and Fail2Ban built in. SWAG allows you to expose applications to the internet, doing so comes with a risk and there are security measures that help reduce that risk. This article details how to configure SWAG and enhance it's security.

This article assumes that you already have a functional SWAG setup. Following is the compose yaml used to create the SWAG container referenced in this article. Keep in mind your local mount paths will be different so adjust accordingly.

---
version: "2.1"
services:
  swag:
https://sharats.me/posts/shell-script-best-practices/
This article is about a few quick thumb rules I use when writing shell scripts that I’ve come to appreciate over the years. Very opinionated.
Things
Use bash. Using zsh or fish or any other, will make it hard for others to understand / collaborate. Among all shells, bash strikes a good balance between portability and DX.
Just make the first line be #!/usr/bin/env bash, even if you don’t give executable permission to the script file.
Use the .sh (or .bash) extension for your file. It may be fancy to not have an extension for your script, but unless your case explicitly depends on it, you’re probably just trying to do clever stuff. Clever stuff are hard to understand.