#!/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") 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")