Skip to content

Instantly share code, notes, and snippets.

@JakeDEvans
JakeDEvans / docker-compose.yml
Last active November 11, 2020 13:24
graylog 4 rc docker-compose file, change the external URI IP to your dev machine's IP, will send all local logs to graylog (once you add gelf inputs)
version: "3.4"
services:
mongo:
image: mongo:3
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.9.3
environment:
- discovery.type=single-node
graylog:
image: graylog/graylog:4.0.0-rc.1-1
@JakeDEvans
JakeDEvans / com.zone
Created February 1, 2020 01:49
glue records
@ IN NS ns1.net.
@ IN NS ns2.net.
@ IN NS ns3.net.
@ IN NS ns4.net.
example.com. IN NS dns1.example.com.
example.com. IN NS dns2.example.com.
dns1.example.com. IN A 192.0.2.1
dns2.example.com. IN A 192.0.2.2
#!/usr/bin/env sh
# make sure we never run 2 rsync at the same time
lockfile="/tmp/alpine-mirror-v3.9.lock"
if [ -z "$flock" ] ; then
exec env flock=1 flock -n $lockfile "$0" "$@"
fi
src=rsync://rsync.alpinelinux.org/alpine/v3.9/
dest=/var/www/localhost/htdocs/alpine/v3.9/
@JakeDEvans
JakeDEvans / generate-csr.sh
Created May 31, 2018 14:06
one-liner CSR generation for Multi SAN Certificates openssl
openssl req -new -newkey rsa:2048 -nodes -sha256 -keyout example.key -subj "/C=US/ST=CA/O=Organization/OU=Department/CN=example" -config <(
cat <<-EOF
[req]
default_bits = 2048
default_md = sha256
req_extensions = req_ext
distinguished_name = dn
[ dn ]
[ req_ext ]
subjectAltName = @alt_names
@JakeDEvans
JakeDEvans / cron
Last active May 2, 2018 18:01
using libreELEC for raspberry pi security camera monitor
*/5 * * * * * /usr/bin/kodi-send --action='PlayMedia(/storage/videos/camera.strm)'
# content of camera.strm is: rtsp://user:pass@192.168.100.100/live/ch0
@JakeDEvans
JakeDEvans / cloudflared.service
Created April 2, 2018 14:08
Cloudflare DoH Proxy Startup Script for Systemd (/etc/systemd/system/cloudflared.service)
[Unit]
Description=Cloudflare DoH Proxy
[Service]
Type=simple
ExecStart=/usr/local/bin/cloudflared proxy-dns
[Install]
WantedBy=multi-user.target
@JakeDEvans
JakeDEvans / bigger
Created March 16, 2018 16:42 — forked from Habbie/bigger
$ dig -t txt foo2.example.net @127.0.0.1
; <<>> DiG 9.11.2 <<>> -t txt foo2.example.net @127.0.0.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62695
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
# nginx config for overriding google search doamin for internal domains.
add google search https://www.example.com/search/%s
location ~* ^/search/(.*\.*)$ {
return 307 http://$1;
}
location ~* ^/search/(.*)$ {
return 307 https://www.google.com/search?q=$1;
}
@JakeDEvans
JakeDEvans / ttfb.sh
Created November 6, 2017 21:25 — forked from sandeepraju/ttfb.sh
curl command to check the time to first byte
#!/bin/bash
# file: ttfb.sh
# curl command to check the time to first byte
# ** usage **
# 1. ./ttfb.sh "https://google.com"
# 2. seq 10 | xargs -Iz ./ttfb.sh "https://google.com"
curl -o /dev/null \
-H 'Cache-Control: no-cache' \
-s \
@JakeDEvans
JakeDEvans / gist:e32c4079791656349125d6e6d3e63545
Last active May 26, 2017 12:38
google-chrome-socket-selection

first attempt:

t=43799 [st=   0] +SOCKET_ALIVE  [dt=?]
                   --> source_dependency = 150691 (TRANSPORT_CONNECT_JOB)
t=43799 [st=   0]   +TCP_CONNECT  [dt=80]
                     --> address_list = ["192.0.2.124:443","192.0.2.120:443"]
t=43800 [st=   1]      TCP_CONNECT_ATTEMPT  [dt=79]
                       --> address = "192.0.2.124:443"
t=43879 [st=  80]   -TCP_CONNECT