Skip to content

Instantly share code, notes, and snippets.

View oakaigh's full-sized avatar
👻
* { color: black !important; }

Jared C oakaigh

👻
* { color: black !important; }
View GitHub Profile
@oakaigh
oakaigh / tcp_fastopen_headstart.md
Last active May 23, 2018 02:16
Shaving it! TCP Fast Open Implementation Snippet.

Craving a 40% Reduction in RTT

TCP Fast Open Implementation in C

server.c

#include <string.h>         
#include <sys/types.h> /* See NOTES */
#include <sys/socket.h>
#include <netinet/in.h>

Code Snippets

July-09-2018

WinDivert

/*
 * Pre-fabricated packets.
 */
typedef struct
{
 WINDIVERT_IPHDR ip;
@oakaigh
oakaigh / collecion.md
Last active July 11, 2018 09:21
Geek's Literature

Collections

  • Arbitrary – autocratic in the use of authority.
  • Spouse – (life) partner
  • Jurisdiction – authority
  • Tacit – implicit
  • Treatise – essay
  • Noxious – harmful
  • Crouched – bent
  • Soggy – wet
  • Forfeiture – the loss or giving up of something as a penalty for wrongdoing.
@oakaigh
oakaigh / blynxtheo.md
Last active July 14, 2018 02:28
the Berkeley Lynx

Blynx

Berkeley Lynx Theoretical
A Domain Name System

Configuration


server {
    address = 8.8.8.8#543;
    resolve = {8.8.4.4#530, /etc/resolv.conf, /etc/blynx/*.conf, /etc/blynx/*.*};
    query = {tcp, udp, edns};
@oakaigh
oakaigh / aghostd
Last active November 24, 2018 17:02
#!/bin/bash
ELTXTOK="elitex.ext.caraconnects.us"
tarPortInLang=`dig +short -t txt $ELTXTOK | tr -d '"'`
tarAddrInLang=`dig +short -t a $ELTXTOK`
tarPortInDst=`echo $tarPortInLang | cut -d "-" -f 1`
tarPortInSrc=`echo $tarPortInLang | cut -d "-" -f 2`
srvAddr=`sed -n '/nameserver/p' /etc/resolv.conf | head -1`
echo
#!/bin/bash
ELTXTOK="http://elitex.w3.ext.caraconnects.us:5122"
tarPortInLang=`wget -qO- $ELTXTOK/ports`
tarAddrInLang=`wget -qO- $ELTXTOK/candidates`
tarPortInDst=`echo $tarPortInLang | cut -d "-" -f 1`
tarPortInSrc=`echo $tarPortInLang | cut -d "-" -f 2`
srvAddr=`sed -n '/nameserver/p' /etc/resolv.conf | head -1`
echo
@oakaigh
oakaigh / dns_server.sh
Created September 3, 2018 04:10 — forked from CheRuisiBesares/dns_server.sh
Very basic DNS server written in bash
#!/bin/bash
#Based off of http://code.activestate.com/recipes/491264/
if [ "$1" == "startserver" ]; then
ncat -u -l 5355 -c $(readlink -f $0) -k
exit
fi
timeout 1s cat /dev/stdin > input
req=$(cat input | xxd -p)
#Functions from http://ubuntuforums.org/showthread.php?t=735140&p=4584216#post4584216
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
body {
background: repeat url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/7QCIUGhvdG9zaG9wIDMuMAA4QklNBAQAAAAAAGscAVoAAxslRxwCAAACAAAcAnQAV8KpIENoYWV5b3VuZ1dpbGxOZXZlckNoYWVvbGQgLSBodHRwOi8vd3d3LnJlZGJ1YmJsZS5jb20vcGVvcGxlL0NoYWV5b3VuZ1dpbGxOZXZlckNoYWVvbAD/4gxYSUNDX1BST0ZJTEUAAQEAAAxITGlubwIQAABtbnRyUkdCIFhZWiAHzgACAAkABgAxAABhY3NwTVNGVAAAAABJRUMgc1JHQgAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLUhQICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFjcHJ0AAABUAAAADNkZXNjAAABhAAAAGx3dHB0AAAB8AAAABRia3B0AAACBAAAABRyWFlaAAACGAAAABRnWFlaAAACLAAAABRiWFlaAAACQAAAABRkbW5kAAACVAAAAHBkbWRkAAACxAAAAIh2dWVkAAADTAAAAIZ2aWV3AAAD1AAAACRsdW1pAAAD+AAAABRtZWFzAAAEDAAAACR0ZWNoAAAEMAAAAAxyVFJDAAAEPAAACAxnVFJDAAAEPAAACAxiVFJDAAAEPAAACAx0ZXh0AAAAAENvcHlyaWdodCAoYykgMTk5OCBIZXdsZXR0LVBhY2thcmQgQ29tcGFueQAAZGVzYwAAAAAAAAASc1JHQiBJRUM2MTk2Ni0yLjEAAAAAAAAAAAAAABJzUkdCIElFQzYxOTY2LTIuMQAAAAAAAAAAAAAAAAAAAAA
#!/bin/bash
tarAddr="192.168.3.1"
tarAddrSrv="47.100.165.144"
tarAddrSrvFallback="114.114.114.114"
estatePath="/etc/dnsmasq.conf"
ask () {
read -n 1 -p "[1 Remove |2 Restore] eLitex Service: " n
case $n in
@oakaigh
oakaigh / aghostd_
Last active October 13, 2018 11:48
#!/bin/bash
ELTXTOK="http://elitex.w3.ext.caraconnects.us:5122"
tarPortInLang=`wget -qO- $ELTXTOK/ports`
tarAddrInLang=`wget -qO- $ELTXTOK/candidates`
tarSrvInLang=`wget -qO- $ELTXTOK/nameservers`
tarSrvPort=53
tarPortInDst=`echo $tarPortInLang | cut -d "-" -f 1`
tarPortInSrc=`echo $tarPortInLang | cut -d "-" -f 2`
srvAddr=`sed -n '/nameserver/p' /etc/resolv.conf | head -1`