Skip to content

Instantly share code, notes, and snippets.

@ryanburnette
ryanburnette / Caddyfile
Last active May 4, 2021 06:27
caddy cache strategy
(asset-paths) {
path *.bmp *.jpg *.png *.svg *.gif *.pdf *.css *.js
}
(cache) {
@content {
not {
import asset-paths
}
}
header @content cache-control max-age=0
@ryanburnette
ryanburnette / gist:9c6898493336f849e8280df7c3fd101b
Created August 16, 2020 01:03
markdownify for getting consistent results when you need a p tag on a single paragraph
{{- $markdown := .Inner | markdownify -}}
{{ if not ( findRE "<[h|p][^>]*>" $markdown ) }}
<p>{{ $markdown }}</p>
{{ else }}
{{ $markdown }}
{{ end }}
smtp
authentication
TLS 1.2 encryption
@ryanburnette
ryanburnette / caddy_snippet_log
Created August 7, 2020 13:17
snippet for caddy to set the log up to use the output and format I prefer
(log) {
log {
output stdout
format console
}
}
@ryanburnette
ryanburnette / caddy_snippet_reverse_proxy_insecure
Created August 7, 2020 13:13
caddy snippet reverse_proxy_insecure
(reverse_proxy_insecure) {
reverse_proxy * {
to {args.0}
transport http {
tls
tls_insecure_skip_verify
read_buffer 8192
}
}
}
@ryanburnette
ryanburnette / php-fpm.conf
Created July 14, 2020 01:55
php fpm settings for slightly better reliability
# https://serverfault.com/a/575946/203448
emergency_restart_threshold = 3
emergency_restart_interval = 20s
process_control_timeout = 5s
@ryanburnette
ryanburnette / mysql.cnf
Created July 13, 2020 20:32
mysql no zero date issue
# /etc/mysql/mysql.conf.d/mysql.cnf
[mysqld]
sql_mode = ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
@ryanburnette
ryanburnette / gist:2a2cdcc3af979e5197adc381d2f74f1a
Created July 9, 2020 16:44
p12 cert from greenlock domains
openssl pkcs12 -export -out certificate.p12 -inkey privkey.pem -in fullchain.pem
hdiutil convert -format UDRW -o /path/to/target /path/to/source.iso
# ext should be .img, not .dmg
mv /path/to/target.dmg /path/to/target.img
diskutil unmountDisk /dev/diskN
sudo dd if=/path/to/downloaded.img of=/dev/rdiskN bs=1m
.noscroll {
overflow: hidden;
}
.overlay {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow-y: scroll;