Skip to content

Instantly share code, notes, and snippets.

View BrianGreenhill's full-sized avatar

Brian Greenhill BrianGreenhill

View GitHub Profile
@BrianGreenhill
BrianGreenhill / memcached-replay.py
Created January 21, 2025 17:33
Replay memcached sets from pcap
import argparse
import dpkt
from pymemcache.client import base
# Replay a pcap file to a memcached server.
def parse_pcap(file_path, memcached_host, memcached_port):
client = base.Client(memcached_host, memcached_port)

Keybase proof

I hereby claim:

  • I am briangreenhill on github.
  • I am briangreenhill (https://keybase.io/briangreenhill) on keybase.
  • I have a public key ASBlhpd1fU9zuZdKgL6UPGNr852aFCquFE2JBaU4G94wjAo

To claim this, I am signing this object:

@BrianGreenhill
BrianGreenhill / keybase.md
Last active August 12, 2019 11:04
keybase.md

Keybase proof

I hereby claim:

  • I am briangreenhill on github.
  • I am briangreenhill (https://keybase.io/briangreenhill) on keybase.
  • I have a public key ASDvIN9C1RYr468X3PlmX7zIfuRH3_yq53AmblxktAZY7Ao

To claim this, I am signing this object:

@BrianGreenhill
BrianGreenhill / gist:5235553
Created March 25, 2013 07:58
WordPress custom post type active menu item fix
/* Menu Active Class Fix for Custom Post Types
http://wordpress.org/support/topic/why-does-blog-become-current_page_parent-with-custom-post-type
*/
function remove_parent_classes($class)
{
// check for current page classes, return false if they exist.
return ($class == 'active') ? FALSE : TRUE;
}
function add_class_to_wp_nav_menu($classes)