forked from jonathanpenn/PlistIncrementalStore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhammer.rb
31 lines (26 loc) · 834 Bytes
/
hammer.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
require 'rubygems'
require 'securerandom'
require 'time'
require 'fileutils'
DEST=File.expand_path("/Users/jonathan/Library/Application\ Support/iPhone\ Simulator/6.1/Applications/7368A09B-EC4F-49A5-B160-706E66ACED6D/Documents/Journal")
files = []
date_range = 10 * 25 * 60 * 60 # in seconds
(1..1000).each do |i|
uuid = SecureRandom.hex
fname = DEST + "/JournalEntry;#{uuid}.txt"
File.open(fname, 'w') do |f|
f.puts <<EOP % [(Time.now.utc - SecureRandom.random_number(date_range)).iso8601, "For #{i} - #{uuid}"]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>timestamp</key>
<date>%s</date>
<key>content</key>
<string>%s</string>
</dict>
</plist>
EOP
end
files << fname
end