Skip to content

Instantly share code, notes, and snippets.

View megberts's full-sized avatar

Michael Egberts megberts

View GitHub Profile
@megberts
megberts / domainNames.sh
Created September 7, 2022 07:31 — forked from yelkhatib/domainNames.sh
Get a list of unique resource domains from a HAR file. Uses jq to parse the HAR file.P.S. You could create HAR files using a number of tools, such as PhantomJS, hdrgrab or chrome-HAR-capturer.
#list unique resource domains
jq '.log.entries[].request | {method,url}' $1 | jq 'if .method=="GET" then .url else "" end' | grep -Eo "http(s?)://([^/]+)./" | sort | uniq
@megberts
megberts / har_response_urls.py
Created September 7, 2022 07:21 — forked from craSH/har_response_urls.py
Parse a HAR (HTTP Archive) and return URLs which resulted in a given HTTP response code
#!/usr/bin/env python
"""
Parse a HAR (HTTP Archive) and return URLs which resulted in a given HTTP response code
HAR Spec: http://groups.google.com/group/http-archive-specification/web/har-1-2-spec
Copyleft 2010 Ian Gallagher <crash@neg9.org>
Example usage: ./har_response_urls.py foo.har 404
"""
import json
@megberts
megberts / tail.php
Last active December 17, 2016 08:52 — forked from deizel/tail.php
PHP log tail example
<?php
$filename = '/private/var/log/system.log';
session_start();
if (isset($_GET['ajax'])) {
if ( !file_exists($filename) ) {
echo 'File does not exist...';
exit;
}