Skip to content

Instantly share code, notes, and snippets.

@jerroydmoore
jerroydmoore / tf-archive_file-node_modules.output
Created March 27, 2020 20:05
The zip file structure from terraform's archive_file on a node_module directory. Note that the parent directory has been stripped away, which is required for node to find the node_modules
$ unzip -l .cache/backend_node_modules.zip
Archive: .cache/backend_node_modules.zip
Length Date Time Name
--------- ---------- ----- ----
4972 01-01-2049 00:00 accepts/HISTORY.md
1167 01-01-2049 00:00 accepts/LICENSE
4081 01-01-2049 00:00 accepts/README.md
5252 01-01-2049 00:00 accepts/index.js
2270 01-01-2049 00:00 accepts/package.json
3574 01-01-2049 00:00 ansi-styles/index.js
import argparse
import heapq
parser = argparse.ArgumentParser(description='Analyze bashstart log for speed.')
parser.add_argument('filename', help='often /tmp/bashstart.<PID>.log')
parser.add_argument('-n', default=20, help='number of results to show')
args = parser.parse_args()
filename, n = args.filename, int(args.n)
with open(filename, 'r') as f: