Skip to content

Instantly share code, notes, and snippets.

@nordicdyno
Created June 29, 2013 10:59
Show Gist options
  • Save nordicdyno/5890740 to your computer and use it in GitHub Desktop.
Save nordicdyno/5890740 to your computer and use it in GitHub Desktop.
use Redis;
my $redis = Redis->new;
open my $fh, '>', 'gen_map.txt';
for my $d (qw(ru ua)) {
my $count = 1;
for my $i (1_000_000 .. 1_200_000) {
print $fh join(" ", $d, "I", "/$i", "/_tags/$d/$i.html") . "\n";
print $fh join(" ", $d, "301", "/tags/$d/$i.html", "/$i") . "\n";
$redis->set("$d:/$i", "I /_tags/$d/$i.html");
$redis->set("$d:/tags/$d/$i.html", "301 /$i");
print "Set $count keys\n" if $count++ % 10_000 == 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment