The make-prefetch tool is a python script that generates prefetch action script commands from files or URLs. Previously on BigFix it only supported Python 2, but now it supports Python 2 and Python 3.
For example, the script can be used to create a prefetch statement for this picture of hodor:
$ make-prefetch.py --name hodor.jpg http://i.imgur.com/YAUeUOG.jpg
Outputs:
prefetch hodor.jpg sha1:ce842e0af799f2ba476511c8fbfdc3bf89612dd0 size:57656 http://i.imgur.com/YAUeUOG.jpg sha256:74f69205a016a3896290eae03627e15e8dfeba812a631b5e0afca140722a322b
Here’s the complete usage:
make-prefetch.py [options] <file or url>
Create a prefetch statement for BigFix ActionScript
Options:
-a, --algorithm ALGORITHM Hash algorithm to use (all, sha1, sha256)
default: all
-n, --name NAME The name to use for the file
default: the name of the file
-u, --url URL The url to use for the file
default: the url of the file
-o, --output OUTPUT Output format (prefetch, davis, value)
default: prefetch
-h, --help Print this help message and exit
Examples:
Create a pretch statement from a URL
make-prefetch.py http://example.com/hello.txt
Create a prefetch statement from a file
make-prefetch.py hello.txt
Create a 9.0 style prefetch statement
make-prefetch.py --algorithm sha1 hello.txt
Create a 7.2 style prefetch statement
make-prefetch.py --algorithm sha1 --output davis hello.txt