Skip to content

Instantly share code, notes, and snippets.

View jgillman's full-sized avatar

Joel Gillman jgillman

View GitHub Profile
@jgillman
jgillman / restore.sh
Last active March 8, 2024 17:51
pg_restore a local db dump into Docker
# Assumes the database container is named 'db'
DOCKER_DB_NAME="$(docker-compose ps -q db)"
DB_HOSTNAME=db
DB_USER=postgres
LOCAL_DUMP_PATH="path/to/local.dump"
docker-compose up -d db
docker exec -i "${DOCKER_DB_NAME}" pg_restore -C --clean --no-acl --no-owner -U "${DB_USER}" -d "${DB_HOSTNAME}" < "${LOCAL_DUMP_PATH}"
docker-compose stop db
@jgillman
jgillman / 1_intro.txt
Last active November 11, 2023 02:33
i3 config from /u/twodogsdave
If this is hard to read in your browser, just copy the text and paste it into your editor.
Turn 'line wrapping' on. :)
This is a 'how to' for anyone interested in a i3 setup and also for anyone currently
using i3 and wants to tweak there setup a little more. I am constantly updating my
i3 config with cool 'stuff.' I hope you enjoy reading and if you use some of the code,
great! I don't know everything and am still learning, too. :)
This is my system settings for i3. Specifically, I use [Manjaro i3](https://forum.manjaro.org/index.php?topic=28022.0).
@jgillman
jgillman / recyclarr.yml
Created August 25, 2022 17:49
My Recyclarr config
# For more details on the configuration, see the Configuration Reference on the wiki here:
# https://github.com/recyclarr/recyclarr/wiki/Configuration-Reference
# Joel Note: My Sonarr config ignores anime so none of that here.
sonarr:
- base_url: http://sonarr:8989/sonarr/
api_key: yoursonarrapikeyhere
quality_definition: series
@jgillman
jgillman / 1-Info.md
Created January 3, 2019 23:01
Automated certbot renew for Mac with launchd (launchctl)

Automatic certbot renew on a Mac

It seems like everyone is using cron for setting up certbot renew on Macs but I couldn't find anyone doing it with launchd. The other file in this Gist is the service file.

The documentation on the Let's Encrypt site actually recommends having it run twice a day (12 hours apart) but I've found that once a day is more than sufficient since if it fails it still has another 29 days to succeed.

tap "heroku/brew"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-fonts"
tap "homebrew/core"
tap "homebrew/services"
tap "puma/puma"
tap "saulpw/vd"
tap "universal-ctags/universal-ctags"
cask "osxfuse"
--exclude="node_modules/*"
--langdef=CoffeeScript
--langmap=CoffeeScript:.coffee
--regex-CoffeeScript=/(^|=[ \t])*class ([A-Za-z.]+)( extends [A-Za-z.]+)?$/\2/c,class/
--regex-CoffeeScript=/^[ \t]*@?([A-Za-z.]+):.*[-=]>.*$/\1/f,function/
--regex-CoffeeScript=/^[ \t]*([A-Za-z.]+)[ \t]+=.*[-=]>.*$/\1/f,function/
--regex-CoffeeScript=/^[ \t]*([A-Za-z.]+)[ \t]+=[^-=>\n]*$/\1/v,variable/
--langdef=JSX
#!/usr/bin/env bash
# Automatically optimize and inline ALL styles
# svgo_it.sh my.svg
main() {
local input=$1
local precision=${2:-2}
# Move ALL styles to inline
local config='{ "plugins": [{ "inlineStyles": { "onlyMatchedOnce": false } }] }'
@jgillman
jgillman / pre-commit.sh
Created May 7, 2018 21:04
This git hook is to deter a user from committing directly to the master branch.
#!/usr/bin/env bash
#
# This hook is to deter a user from committing directly to the master branch.
# It still allows the user to make the commit if they enter 'master' when
# prompted.
#
# To enable this hook, rename this file to "pre-commit" and place it in your
# .git/hooks/ directory.
@jgillman
jgillman / config-sample.ini
Last active March 31, 2018 11:38
An example of setting up PlexPy with a reverse proxy in Nginx
; This is the PlexPy config.ini file.
; Just the two lines needed for the reverse proxy, the rest of the file doesn't
; need to be touched
http_root = /plexpy
http_proxy = 1
@jgillman
jgillman / destiny-2-weapons.md
Created November 14, 2017 18:02
Best PvE weapons in Destiny 2

Best PvE weapons

Based on their Time To Kill (TTK)

Data from this Google Spreadsheet

Last updated 2017-11-14 20171114

Swords