Skip to content

Instantly share code, notes, and snippets.

@dawngerpony
dawngerpony / regex_checker.py
Created June 10, 2014 11:47
Python regex checker
# regex_checker.py
import re
expression = "setCookie('YPF8827340282Jdskjhfiw_928937459182JAX666', '31.221.70.151', 10);"
# pattern = re.compile("^setCookie\('([^']+)', '([^'])', [0-9]+\);$")
pattern = re.compile("^setCookie\('([^']+)'.*$")
print pattern
@dawngerpony
dawngerpony / print_cypher_statements.py
Last active July 11, 2016 12:34
Python code to print out a Cypher statement (or set of statements) to make changes to a neo4j database for adding UPPIdentifier nodes.
letters = "0123456789abcdef"
s = ""
for c in letters:
s += "\"{}\",".format(c)
letters = s.strip(',')
statement = """WITH [{}] AS letters
UNWIND letters as l
@dawngerpony
dawngerpony / Relevant service names
Last active July 13, 2016 12:26
Useful Neo4j CoCo commands
neo4j-blue-sidekick@1.service 177bf386.../172.24.99.92 inactive dead
neo4j-blue@1.service 177bf386.../172.24.99.92 active running
neo4j-read-blue-sidekick@1.service 177bf386.../172.24.99.92 inactive dead
neo4j-read-red-sidekick@1.service 07c72444.../172.24.151.154 active exited
neo4j-red-sidekick@1.service 07c72444.../172.24.151.154 inactive dead
neo4j-red@1.service 07c72444.../172.24.151.154 active running
@dawngerpony
dawngerpony / install-sqlplus.bash
Last active April 24, 2018 20:17
Run this script with a tnsnames.ora file as the only parameter to install instantclient version 12.2.0.1.0-2 (once you have downloaded the files from Oracle of course).
#!/usr/bin/env bash
## https://oraclespin.com/2018/01/25/install-sqlplus-instant-client-on-macos/
VERSION="12.2.0.1.0-2"
FILES="instantclient-basic-macos.x64-$VERSION.zip instantclient-sqlplus-macos.x64-$VERSION.zip instantclient-sdk-macos.x64-$VERSION.zip"
INSTALL_DIR="instantclient_12_2"
if [ $# -lt 1 ]; then
echo "Specify tnsnames.ora location"
exit 1
fi