Skip to content

Instantly share code, notes, and snippets.

@boydc7
boydc7 / gist:04614371b43cb7a2666420dd5aa55bc1
Created August 17, 2018 15:52
Redis remove keys matching prefix
EVAL "local keys = redis.call('keys', ARGV[1]) \n for i=1,#keys,5000 do \n redis.call('del', unpack(keys, i, math.min(i+4999, #keys))) \n end \n return keys" 0 PUT_PREFIX_TO_DELETE_HERE
@boydc7
boydc7 / gist:0b5b02f594004254757d043ef65a838f
Created August 17, 2018 15:51
Gremlin Console to AWS Neptune
# Download gremlin console (http://tinkerpop.apache.org/downloads.html), then:
unzip apache-tinkerpop-gremlin-console-3.3.3-bin.zip
cd apache-tinkerpop-gremlin-console-3.3.3-bin
# in /conf, create a neptune yaml file with following properties (see https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-gremlin-console.html)
hosts: [AWS NEPTUNE ENDPOINT]
port: 8182
serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}
@boydc7
boydc7 / gist:d23a115e0030ca43585c77f5d094b386
Created August 17, 2018 15:50
LetsEncrypt certificate creation for OpenVpn server
Adapted from https://loige.co/using-lets-encrypt-and-certbot-to-automate-the-creation-of-certificates-for-openvpn/
* SSH to the open vpn server:
ssh -i .ssh/_THE_KEY_TO_USE_ openvpnas@_THE_SERVER_NAME_OR_IP_
* Install Certbot:
sudo apt-get -y install software-properties-common
sudo add-apt-repository -y ppa:certbot/certbot
sudo apt-get -y update
sudo apt-get -y install certbot
@boydc7
boydc7 / gitdefaults.txt
Last active November 2, 2023 17:47
Reasonable git defaults
# push relevant tags when pushing branches
git config --global push.followTags true
# Make git pull do a --recurse-submodules flag on each pull
git config --global submodule.recurse true
# Make git push do an on-demand try of pushing sub-modules before pushing main repos
git config --global push.recurseSubmodules on-demand
# push only current branch on a push