This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef A_DOT_H_INCLUDED | |
#define A_DOT_H_INCLUDED | |
#include "b.h" | |
struct a | |
{ | |
struct b *b; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ~/what_eth_drivers.sh | |
eth0 [52:54:00:aa:bb:cc]: virtio_net (up) | |
eth1 [52:54:00:dd:ee:ff]: virtio_net (up) | |
eth2 [52:54:00:99:88:77]: virtio_net (up) | |
lo [00:00:00:00:00:00]: (unknown) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Using Vim to view strace output | |
strace -o'!vim -R -' "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import BaseHTTPServer, SimpleHTTPServer | |
import ssl | |
import sys | |
import argparse | |
ap = argparse.ArgumentParser() | |
ap.add_argument('--certfile') | |
ap.add_argument('--keyfile') | |
ap.add_argument('--port', type=int, default=443) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows (PowerShell) (DER format): | |
Invoke-WebRequest -UseBasicParsing http://example.com/example.cer -OutFile example.cer | |
certutil.exe -addStore "Root" example.cer | |
Debian 8 (PEM format): | |
# wget -O /usr/local/share/ca-certificates/example.crt http://example.com/example.cer | |
# update-ca-certificates | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string | |
def hexdump(src, length=16, sep='.'): | |
DISPLAY = string.digits + string.letters + string.punctuation | |
FILTER = ''.join(((x if x in DISPLAY else '.') for x in map(chr, range(256)))) | |
lines = [] | |
for c in xrange(0, len(src), length): | |
chars = src[c:c+length] | |
hex = ' '.join(["%02x" % ord(x) for x in chars]) | |
if len(hex) > 24: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env = Environment( | |
CCFLAGS = ['-Wall', '-Werror'], | |
) | |
env.Program('mkdir_p_test', ['mkdir_p.c', 'test.c']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
email = jonathon.reinhart@gmail.com | |
name = Jonathon Reinhart | |
[color] | |
ui = true | |
[core] | |
# I can exclude my own editor's files; no need to include in project .gitignore | |
excludesfile = ~/.gitignore_global | |
editor = vim | |
[push] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This prevents docker config from persisting to disk. | |
# Place this file in /etc/profile.d/ to happen automatically at login for all users. | |
# JRR 2015-12-17 | |
# See: | |
# https://github.com/docker/docker/issues/10318 | |
# https://github.com/docker/docker/issues/18708 | |
dockercfgdir="/dev/shm/dockercfg-$(id -un)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Derived from http://stackoverflow.com/a/7776146/119527 | |
void fhexdump(FILE *f, const void *addr, size_t len, const char *addrfmt, size_t baseaddr) | |
{ | |
size_t i; | |
unsigned char buff[17]; | |
const unsigned char *pc = addr; | |
// Process every byte in the data. | |
for (i = 0; i < len; i++) { |