This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A naive dns server with a Redis backend | |
# Set keys in Redis you want to be authoritative for (set google.com. 127.0.0.1) | |
# Tip: Use Redis's ttl functions to have temporary names | |
# Currently only does A records, feel free to fix that | |
# | |
# Licensed under the PSF License | |
# Thanks to: http://code.activestate.com/recipes/491264-mini-fake-dns-server/ | |
# Author: @Kaerast <alice@kaerast.info> | |
import socket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# compl1.py - Redis autocomplete example | |
# download female-names.txt from http://antirez.com/misc/female-names.txt | |
import redis #redis-py | |
import sys | |
r = redis.Redis(host='localhost', port=6379, db=1) | |
# Create the completion sorted set | |
if not r.exists('compl'): |