Skip to content

Instantly share code, notes, and snippets.

View qlyoung's full-sized avatar
🐈
thinking about bingus

Quentin Young qlyoung

🐈
thinking about bingus
View GitHub Profile
@qlyoung
qlyoung / mat-273-final.sage
Last active August 29, 2015 14:02
mat-273 final project
def dog():
"""Plot the word DOG using six parametric graphs"""
u, v = var('u, v')
# D
x(u, v) = u
y(u, v) = -5
z(u, v) = v
D_plane = parametric_plot3d( (x, y, z), (u, -7, 7), (v, -10, 10) )
y(u, v) = -(.1*(u^2))
@qlyoung
qlyoung / xkcd-philosophy.py
Last active August 29, 2015 14:02
rough proof-of-concept for alt-text of https://xkcd.com/903/
#!/usr/bin/python
# dependencies: BeautifulSoup, requests
from BeautifulSoup import BeautifulSoup
import requests
# starting page
url = raw_input("Wikipedia URL: ")
pagename = ''
@qlyoung
qlyoung / tmux-cheatsheet.txt
Last active December 6, 2018 13:37
tmux cheatsheet
tmux cheatsheet
===============
Session Control (from the command line)
---------------------------------------
tmux Start a new session
tmux attach Re-attach a detached session
tmux attach -d Re-attach a detached session (and detach it from elsewhere)
@qlyoung
qlyoung / kittens.txt
Last active August 29, 2015 14:24
kittens
N4IgTgpgzg9grmAxtEAuA2qAdgQwLYRoiI4AuWAlgA4gA0IAbjgDZyGoBMAHAJxcDMAOgBsPAKy8x/HgHZhAFgC+tbPnYgA7jBgATOoxZs0ARn4AGMYIviuZ+fNMKOy1QSJ4KWCGBZR9TVnYOKSF+GWljMTNo3hkXEFw3VGIYFn9DdjN4xPUKMBgsdMC0aSEzYWjKyv4uDmFstSJSClIcSjg8IqNULJUExuSAcxhmPXoA7t7XdRgKZi7MhqSQBDaKDoW0Kf7luCwYACNWz3XO8YytpfU8NqoYDW9NzijBfjF5Mx4qsy57K6IoIgKBAsMgnuZov9kog4MxSAhCOdij0oSAAGY4FoACye2xyRAA1i1SCC/EjusYlH18ckAF4QA4+MkGZF4gYgKCtJBYnBgUi41FtZo3UgksAC6nstEIZkTRaS5YUBgwMAATwl0wBVAoYPJ8s1yT2OpVWFlFxRCvULGNYEKesulqIXkQ+UQJo1O3UJN5ZtZqIJvJuHppICovJwwztLMmqOFEAAwmrOWl7RaDRyVfkNMH2QcIPgc8soMwcAdC+o3aCfCTy0QqCWa6m2UWSRB5k3BcxmDB1R3Hck23AdKda0N8+K++nATg0WiRmNo/rPQCsdRRyBWlgCY9J8vkmHuQQsPzdyGblg4ICwNQT4uHem3XgqBBhxtT7nAlRr8f1wRBtbSBxDsAF1xjmEtBnYUAiVFUk0EwPcQAAQTwPMJw5BAQwAZTwGBt30UgfBaNB0xBQZPAgHcNxaZh1AAUSwcivEeZQQAjIJhHoKAiS7PxUFALRdBhWDxVQcQzFeD5vmieRhC4egMTAAhRPsSwQm+YwzA4fhjHoDwvFEsRhFeXgeDM8zYlqLjECxEZeTQABaCTKnM1yzO0/h5HEViIAADxoVBKTEDhBDqDhvgcYweHoAArQ4iEEnRhLFfQfC3LZ6AoKAABl8x0R5UAxZgoAgTKoCwkEyBVNAipK1EAHlp3QqBMPZAAhbw1QIoj+X4xDAWBY8stvZpSFoo
@qlyoung
qlyoung / fuzzing-bgpd-afl.md
Created May 12, 2017 00:28
fuzzing frr bgpd with afl

You Will Need

  • A local copy of AFL with Doug Birdwell's networking patch
  • A binary dump of a BGP OPEN packet
  • Latest copy of Free Range Routing
  • Patience

Acquiring Resources

A local copy of AFL with Doug Birdwell's networking patch

@qlyoung
qlyoung / linux-clang-format
Created July 17, 2017 18:37
Linux kernel style .clang-format
---
BasedOnStyle: LLVM
Language: Cpp
IndentWidth: 8
UseTab: Always
BreakBeforeBraces: Linux
AlwaysBreakBeforeMultilineStrings: true
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
@qlyoung
qlyoung / how-to-create-debian-source-package.md
Created July 24, 2017 16:23
How to create a Debian source package

This assumes the upstream source is not already set up for packaging.

  1. Download the upstream source tarball. (upstream source = the one from the software’s original developers)

  2. Rename to <source_package>_<upstream_version>.orig.tar.gz (example: simgrid_3.6.orig.tar.gz)

  3. Untar the source tarball.

\documentclass[a4paper,english]{article}
%% Use utf-8 encoding for foreign characters
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
%% Vector based fonts instead of bitmaps
\usepackage{lmodern}
@qlyoung
qlyoung / texinfo2rst.py
Last active July 16, 2020 22:20
Texinfo --> RST converter script
#!/usr/bin/python
# Retrieved from: https://gcc.gnu.org/ml/gcc-patches/2015-11/msg01095.html
# Authored by someone at AdaCore
# Copied by Quentin Young with no modifications
# -*- coding: utf-8 -*-
"""Splits an existing .texinfo file into components suitable for
makeinfo.py
If "-node <name>" is specified, only that node and its children are
kept
@qlyoung
qlyoung / ghosts-linux-net-stack.rst
Last active November 11, 2019 19:21
Curiosities and notes on the Linux networking stack
  • Linux will send IPv4 (and probably IPv6) datagrams with no payload - just a header.
  • It is possible to bind() a socket to an address X on interface A, set the outgoing multicast interface to interface B with IP[V6]_MULTICAST_IF and then send datagrams IP sourced from X but transmitted on B (i.e. using B's MAC address).
  • The above does not work when the source address is an IPv6 link local.