Skip to content

Instantly share code, notes, and snippets.

@jcPOLO
jcPOLO / tcpdump_http_headers.txt
Last active January 27, 2023 11:41
tcpdump captures HTTP Headers
sudo tcpdump -A -s 10240 'tcp port 4080 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | egrep --line-buffered "^........(GET |HTTP\/|POST |HEAD )|^[A-Za-z0-9-]+: " | sed -r 's/^........(GET |HTTP\/|POST |HEAD )/\n\1/g'
# https://serverfault.com/questions/504431/human-readable-format-for-http-headers-with-tcpdump
# script to get the configuration file based on a jinja2 template.
# Usage python do_config.py template_file.j2
# it will generate a cfg.txt file with the output shown
# Example j2 template file:
#
# {{ vlan_tag }}
# {{ vlan_description }}
# {{ int_out_to_peer }}
# {{ vpn_instance }}
# {{ ip_vlan_svi }}
@jcPOLO
jcPOLO / Install Openssh from Source
Created April 24, 2020 22:46 — forked from imagescape/Install Openssh from Source
Install openssh in an alternate location from source
# We will assume installation in the /opt/ directory
mkdir /opt/openssh/
cd /opt/openssh/
# gather and install the dependencies
wget http://zlib.net/zlib-1.2.7.tar.bz2
tar jxvf zlib-1.2.7.tar.bz2
cd zlib-1.2.7
./configure --prefix=/opt/openssh/dist/
#!/usr/bin/python3
import re
import sys
L7_LOADBALANCE_POLICY = 'policy-map type'
STICKY_GROUP = 'sticky ip-netmask'
CLASS_MAP = 'class-map'
SERVER_FARM = 'serverfarm host'
POLICY_MAP = 'policy-map'
@jcPOLO
jcPOLO / index.md
Created October 5, 2017 18:58 — forked from rstacruz/index.md
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one