#!/usr/bin/env ruby require 'redis' r = Redis.new r.flushdb 255.times do |i| r.zincrby("1.1.1.#{i}:detected", rand(100), "950001") r.lpush("1.1.1.#{i}:requests", "123, Chrome, GET, foo, bar") r.set("1.1.1.#{i}:repsheet", true) if i > 220 r.set("1.1.1.#{i}:repsheet:blacklist", "true") r.sadd("repsheet:blacklist:history", "1.1.1.#{i}") end r.expire("1.1.1.#{i}:requests", (24 * 60 * 60)) r.expire("1.1.1.#{i}:detected", (24 * 60 * 60)) end 255.times do |i| r.lpush("1.1.1.#{i}:requests", "123, Chrome, POST, foo, bar") end 20.times do |i| r.zincrby("1.1.1.1:detected", 1000, "9900#{i + 10}") end r.lpush("1.1.1.1:requests", "123, Chrome, PUT, foo, bar") r.lpush("1.1.1.1:requests", "123, Chrome, DELETE, foo, bar") r.lpush("1.1.1.1:requests", "123, Chrome, HEAD, foo, bar") r.lpush("1.1.1.1:requests", "123, Chrome, TRACE, foo, bar") r.lpush("1.1.1.1:requests", "123, Chrome, OPTIONS, foo, bar") r.lpush("1.1.1.1:requests", "123, Chrome, CONNECT, foo, bar") r.set("5.5.5.5:repsheet:whitelist", "true") r.set("5.5.5.6:repsheet:whitelist", "true") r.set("5.5.5.7:repsheet:whitelist", "true") r.set("5.5.5.8:repsheet:whitelist", "true")