Skip to content

Instantly share code, notes, and snippets.

@dpricha89
dpricha89 / gist:30693cbe15435e840e0eefd7026f4128
Created April 11, 2021 15:15
Generate large file of log lines
import string
import random
import os
class HashGenerator:
def __init__(self, length):
print(dir(string))
self.characters = string.ascii_letters + string.digits
@dpricha89
dpricha89 / gist:7eb2bde5568648c07007bd2702ddf186
Created April 11, 2021 15:14
Get top 10 lines in large file
import unittest
import sys, array, tempfile, heapq
import io
from itertools import islice
NUM_LINES_IN_MEM_PER_FILE = 100000
NUM_LINES_IN_EACH_FILE = 1000000
class SortLargeFile:
def intsfromfile(self, f):