Skip to content

Instantly share code, notes, and snippets.

@mcastelino
mcastelino / rawsocket.md
Created April 5, 2018 19:04
Raw Sockets debugging

How to track raw sockets

Example program

Say a program has opened a raw socket. How do you know it has it open

+       int sock_r;
+       struct ifreq ifrr;
+ size_t if_name_len=strlen("dummy0");
#!/usr/bin/env runhaskell
-- Copyright (C) 2018 Daniel Gröber <[email protected]>
--
-- Copying and distribution of this file, with or without modification,
-- are permitted in any medium without royalty provided the copyright
-- notice and this notice are preserved. This file is offered as-is,
-- without any warranty.
{-|
License: GNU All-Permissive License
@mdawaffe
mdawaffe / diff-changed-lines.sh
Last active March 25, 2025 11:24
Get line numbers of changed lines - git, diff - Full of bashisms
#!/bin/bash
# Call like you would `diff`
# `./diff-changed-lines.sh old new`
# Outputs the lines numbers of the new file
# that are not present in the old file.
# That is, outputs line numbers for new lines and changed lines
# and does not output line numbers deleted or unchanged lines.
@hellricer
hellricer / devtools.py
Created May 29, 2019 09:39
ELinks hooks providing a framework for manipulating DOM
import os
import re
import subprocess
from bs4 import BeautifulSoup
import rules
def replacer(url, html):
new = html
reload(rules)
doc = nlp("the drawdown process is governed by astm standard d823")
for tok in doc:
print(tok.text, "...", tok.dep_)