Skip to content

Instantly share code, notes, and snippets.

@lumilux
lumilux / redisdns.py
Created November 28, 2011 07:45 — forked from wheresalice/redisdns.py
Python DNS server with Redis backend
# 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
@lumilux
lumilux / compl1.py
Created February 28, 2011 08:36 — forked from shinzui/compl1.rb
# 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'):