Skip to content

Instantly share code, notes, and snippets.

View jaygooby's full-sized avatar
✏️
working on https://writiny.com in my sparse spare time

Jay Caines-Gooby jaygooby

✏️
working on https://writiny.com in my sparse spare time
View GitHub Profile
@jaygooby
jaygooby / Dockerfile
Last active June 13, 2024 18:24
Testing my understanding of how `BUNDLE_DEPLOYMENT` affects `bundle install`
# syntax = docker/dockerfile:1
FROM registry.docker.com/library/ruby:3.3.1-slim as base
ARG BUNDLE_DEPLOYMENT \
BUNDLE_WITHOUT
ENV BUNDLE_DEPLOYMENT=$BUNDLE_DEPLOYMENT \
BUNDLE_WITHOUT=$BUNDLE_WITHOUT \
BUNDLE_PATH="/usr/local/bundle" \
@jaygooby
jaygooby / bluetooth-device-toggle.applescript
Created August 8, 2023 10:47
Toggle your Nothing ear (1) as the active bluetooth device
# Totally stolen from
# https://gist.github.com/ieatfood/814b065964492f71f728da59a47413bc
#
# Export this applescript as an app, and then just double click to toggle on & off
use framework "IOBluetooth"
use scripting additions
set blueToothDevice to "Nothing ear (1)"
@jaygooby
jaygooby / netblock-from-whois
Last active April 16, 2023 11:08
Gets and caches the netblock owner from `whois` for an IP address
#!/bin/bash
#
#
# MIT License
#
# Copyright (c) 2022 Jay Caines-Gooby, @jaygooby, jay@gooby.org
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
@jaygooby
jaygooby / what-user-agent
Last active December 15, 2021 18:00
bash script to humanize user-agent strings using the whatismybrowser.com API
Moved to https://github.com/jaygooby/what-user-agent
@jaygooby
jaygooby / log4j-jndi.conf
Last active February 2, 2022 12:04
fail2ban filter rule for the log4j CVE-2021-44228 exploit
# log4j jndi exploit CVE-2021-44228 filter
# Save this file as /etc/fail2ban/filter.d/log4j-jndi.conf
# then copy and uncomment the [log4j-jndi] section
# to /etc/fail2ban/jail.local
#
# jay@gooby.org
# https://jay.gooby.org/2021/12/13/a-fail2ban-filter-for-the-log4j-cve-2021-44228
# https://gist.github.com/jaygooby/3502143639e09bb694e9c0f3c6203949
# Thanks to https://gist.github.com/kocour for a better regex
#
@jaygooby
jaygooby / kaslurp
Last active December 8, 2021 13:50
A REPL wrapper for kaput-cli to download files from put.io
Now https://github.com/jaygooby/kaslurp
@jaygooby
jaygooby / interesting-referers
Last active November 22, 2022 14:52
Find interesting referers in access.log - see https://jay.gooby.org/2021/11/30/find-interesting-referers-in-access-log for more details
#!/bin/bash
#
# MIT License
#
# Copyright (c) 2021 Jay Caines-Gooby, @jaygooby, jay@gooby.org
#
# The one-liner from https://jay.gooby.org/2021/11/30/find-interesting-referers-in-access-log
#
# Usage: interesting-referers /path/to/access.log
# interesting-referers /path/to/access.log example.com
# DOH. There's a command for this already:
ssh-keygen -R <the host>
@jaygooby
jaygooby / nginx-google-domain-csp-map.sh
Created February 6, 2020 15:30
Use the correct google country domain in your nginx content-security-policy header, instead of all of them
#!/bin/bash
#
# Generates an nginx compatible map that you can use to
# put the relevant Google country code in your Content-Security-Policy
# instead of having them all.
#
# Add these to your nginx config:
# geoip2 /path/to/GeoLite2-Country.mmdb {
# $geoip2_country_code default=US source=$remote_addr country iso_code;
# $geoip2_country_name country names en;
@jaygooby
jaygooby / membash.sh
Created August 20, 2019 12:50 — forked from goodevilgenius/membash.sh
[membash] BASH script which may be used to interact with memcache. All main memcache functions are supported. #memcache
#!/bin/bash
# Gist: 11375877
# Url: https://gist.github.com/goodevilgenius/11375877
#
# All memcache functions are supported.
#
# Can also be sourced from other scripts, e.g.
# source membash.sh
# MCSERVER="localhost"