Skip to content

Instantly share code, notes, and snippets.

@adriagalin
Last active March 28, 2016 17:23
Show Gist options
  • Save adriagalin/3bc1065eaf7b00408f08 to your computer and use it in GitHub Desktop.
Save adriagalin/3bc1065eaf7b00408f08 to your computer and use it in GitHub Desktop.
Log generator
#!/usr/bin/env ruby
period = ARGV[0]
while true
f = File.open("access.log", "a")
value = ["GET", "POST"].sample
output = "#{Time.now.strftime("%T")} #{value} /test/test/test.html"
f.puts output
puts output
f.close
sleep(period.to_f)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment