Skip to content

Instantly share code, notes, and snippets.

import pyshark
def extract_http_headers(pcap_file):
# Open the PCAP file using PyShark
cap = pyshark.FileCapture(pcap_file, display_filter="http")
# Iterate through the packets
for packet in cap:
try:
@c0dist
c0dist / league_matches_generator.py
Last active April 25, 2024 07:04
Generate league matches
"""This script generates FortiCric Tournament league matches for provided number of teams
based on max number of matches per team. Sometimes, the code is not able to generate matches
after crossing MAX_ITERATIONS, just re-run it and it should work fine. It was written in quick
time so bugs are expected and welcomed.
"""
from random import sample
# Max number of teams in a tournament
MAX_TEAMS = 8
@c0dist
c0dist / preacher.py
Last active October 21, 2016 09:26
Download all 66 issues of Preacher comics
#!/usr/bin/env python
import os
import requests
import time
def main():
session = requests.Session()
chunk_size = 1024