Artificial intelligent assistant

Create a gzip file of a predetermined size I want to test an upload of files of content type `application/x-gzip` of various sizes ranging from 100 MB to 999 MB. How can go I about creating `.gz` files of these predetermined sizes? If I do `dd if=/dev/zero of=somefile bs=1 seek=100`, the resultant file after zipping is usually very small.

* You can create a 10MB gzip file like this:

head -c 10M /dev/urandom | gzip -1 >10m.gz


This uses `urandom` to get a high-entropy stream of bytes: since this is incompressible, the gzipped version will be about the same size as the input.

* You can then catenate copies of your gzip file together:

cat $(perl -e "print '10m.gz ' x 30") >300m.gz


Thirty copies of the source file will be about 300MB, and 100 copies will be about a gigabyte.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy a7a6e6558f69fab3e436769119aaa682