Skip to content

Instantly share code, notes, and snippets.

@eenblam
eenblam / linux_reading_list.md
Last active April 25, 2024 10:25
Linux Networking Reading List

Linux Networking Reading List

Currently in no particular order. Most of these are kind of ancient.

Where's all the modern documentation? So much of what I've turned up searching is other folks complaining about having few options beyond reading source code.

The OREILLY books, while dated, seem to be some of the best available. Note that these can be read with a 7-day trial. Do this! At least get through the introduction section and first chapter of each to see if it's what you're after.

https://www.netfilter.org/

@eenblam
eenblam / internet_radio_stream_aliases.sh
Created April 25, 2018 03:17 — forked from pwenzel/internet_radio_stream_aliases.sh
Internet Radio Streams Via Command Line
# 1. Install mplayer command line (via Brew, Macports, or APT)
# 2. Add the following aliases to ~/.profile
# 3. Type `source ~/.profile`
# 3. Type `news` or `current` to listen in your terminal
alias news="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/news.pls" # MPR News
alias current="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/the_current.pls" # The Current
alias classical="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/classical.pls" # Classical MPR
alias localcurrent="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/local.pls" # Local Current
alias heartland="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/radio_heartland.pls" # MPR Radio Heartland
@eenblam
eenblam / internet_radio_stream_aliases.sh
Created April 25, 2018 03:17 — forked from pwenzel/internet_radio_stream_aliases.sh
Internet Radio Streams Via Command Line
# 1. Install mplayer command line (via Brew, Macports, or APT)
# 2. Add the following aliases to ~/.profile
# 3. Type `source ~/.profile`
# 3. Type `news` or `current` to listen in your terminal
alias news="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/news.pls" # MPR News
alias current="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/the_current.pls" # The Current
alias classical="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/classical.pls" # Classical MPR
alias localcurrent="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/local.pls" # Local Current
alias heartland="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/radio_heartland.pls" # MPR Radio Heartland

Keybase proof

I hereby claim:

  • I am eenblam on github.
  • I am eenblam (https://keybase.io/eenblam) on keybase.
  • I have a public key ASA_mU3EVEifJ_olkJSY9Y3nrh8pWq6yv9MWTHoZuyXoego

To claim this, I am signing this object:

import argparse
import csv
import sys
parser = argparse.ArgumentParser(description='Replace values on a column level in CSV')
parser.add_argument('--column', help='The column to replace in', required=True)
parser.add_argument('--search', help='The value to search for', required=True)
parser.add_argument('--replace', help='The value to replace it with', required=True)
parser.add_argument('data', help='The data being operated on', nargs='?',
@eenblam
eenblam / dbgraph.py
Last active April 1, 2017 19:09
Example classes for implementing algorithms on De Bruijn graphs.
class DirectedEdge(object):
# Memory-saving hack; doesn't work for Node. Similar to a namedtuple.
__slots__ = ('src', 'dest')
def __init__(self, src, dest):
self.src = src
self.dest = dest
class Node(object):
def __init__(self, label):
#!/usr/bin/env python
from collections import namedtuple
from itertools import chain
from random import randint, sample
from PIL import Image, ImageSequence
Position = namedtuple('Position', ['i', 'j', 'val'])
class GameInstance(object):
@eenblam
eenblam / CaseClassMapping.scala
Created January 9, 2017 14:43 — forked from fancellu/CaseClassMapping.scala
Slick 2.x examples with MariaDB
package slick.lifted
import scala.slick.driver.MySQLDriver.simple._
import slick._
object CaseClassMapping extends App {
// the base query for the Users table
val users = TableQuery[Users]
@eenblam
eenblam / reverse.js
Last active November 13, 2016 16:07
Random FP examples illustrating syntactic sugar from ES2015. Toy problems, not optimized.
function empty(coll) { return 0 === coll.length; }
/**
* These one-liners are equivalent...
* But they're hard to read, and both are undefined on empty collections. :(
*/
function reverse([h, ...t]) { return empty(t) ? h : reverse(t).concat(h); }
let reverse = ([h,...t]) => empty(t) ? h : reverse(t).concat(h);
@eenblam
eenblam / gather-final.js
Last active October 15, 2019 11:00
Naive JS implementation of tidyr's gather function. Intended for use with JSON-styled tabular data... like you'd get from d3.dsv
'use strict';
let R = require('ramda');
// lengthenRow :: String -> String -> [Object]
let lengthenRow = R.curry(function (keyLabel, valueLabel, row) {
let customKV = key => ({[keyLabel]: key,
[valueLabel]: row[key]});
return Object.keys(row).map(customKV);
});