Skip to content

Instantly share code, notes, and snippets.

View jasonray716's full-sized avatar
🏠
Working from home

Jason Ray jasonray716

🏠
Working from home
  • Microsoft Corp
  • Denham Springs
View GitHub Profile
var test = require( "tape" );
// main function to flat nested array
const flatten = ( arr ) => {
return arr.reduce( ( flat, toFlatten ) => {
return flat.concat(
Array.isArray( toFlatten ) ? flatten( toFlatten ): toFlatten
);
}, []);
};
@jasonray716
jasonray716 / s3-upload-aws4.sh
Created March 31, 2017 20:33 — forked from vszakats/s3-upload-aws4.sh
AWS S3 Upload using signature v4
#!/bin/sh -u
# To the extent possible under law, Viktor Szakats (vszakats.net)
# has waived all copyright and related or neighboring rights to this
# script.
# CC0 - https://creativecommons.org/publicdomain/zero/1.0/
# Upload a file to Amazon AWS S3 using Signature Version 4
#
# docs:
Use TCPDUMP to Monitor HTTP Traffic
1. To monitor HTTP traffic including request and response headers and message body:
tcpdump -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
2. To monitor HTTP traffic including request and response headers and message body from a particular source:
tcpdump -A -s 0 'src example.com and tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
3. To monitor HTTP traffic including request and response headers and message body from local host to local host: