Skip to content

Instantly share code, notes, and snippets.

@hunj
Created September 24, 2015 01:12
Show Gist options
  • Save hunj/98332de663fc6a6ca456 to your computer and use it in GitHub Desktop.
Save hunj/98332de663fc6a6ca456 to your computer and use it in GitHub Desktop.
Generates a dummy file full of 0's and 1's up to desired size
DESIRED_SIZE = 1073741824 # 1gb
FILE_NAME = "dummy" # name of the dummy file
dummy_file = File.new(FILE_NAME, "w")
while dummy_file.size < DESIRED_SIZE
dummy_file.write([0,1].sample)
end
dummy_file.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment