Skip to content

Instantly share code, notes, and snippets.

View bahayman's full-sized avatar

Baruch Hayman bahayman

View GitHub Profile
@bahayman
bahayman / router.js
Last active September 21, 2016 15:21
Express router chaining
var dealsRouter = express.Router();
dealsRouter.get('/', function (req, res) {
res.send("/deals/" + req.params.id);
});
dealsRouter.get('/:id', function (req, res) {
res.send("/deals/" + req.params.id);
});
app.use('/deals', dealsRouter);

Keybase proof

I hereby claim:

  • I am bahayman on github.
  • I am bahayman (https://keybase.io/bahayman) on keybase.
  • I have a public key ASB5a5LAe8R9toZ3Ah-vnuM6tRyzMAsBvx2PC54cse3N7wo

To claim this, I am signing this object:

@bahayman
bahayman / sn-rss-scaper.py
Created July 11, 2014 20:11
TWiT.tv Security Now Full RSS (2014-07-11)
from bs4 import BeautifulSoup
import urllib2
from datetime import datetime
from yattag import Doc, indent
class Episode:
id
def __init__(self, id):
self.id = id
@bahayman
bahayman / gist:9369651
Created March 5, 2014 15:38
tcpdump http monitor
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: