Skip to content

Instantly share code, notes, and snippets.

@kwharrigan
kwharrigan / 10_6_install
Created September 15, 2010 04:15
ns2 install script for OSX 10.6.4
#! /bin/sh
#
# Copyright (C) 2000 by USC/ISI
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that the above copyright notice and this paragraph are
# duplicated in all such forms and that any documentation, advertising
# materials, and other materials related to such distribution and use
# acknowledge that the software was developed by the University of
syntax on
set tabstop=4
set textwidth=80
set laststatus=2
set statusline=%F%m%r%h%w\ [FMT=%{&ff}]\ [TYPE=%Y]\ [ASC=\%03.3b]\[HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]
augroup filetype
au! BufRead,BufNewFile *.proto setfiletype proto
augroup end
augroup filetype
au! BufRead,BufNewFile *.ADA setfiletype ada
@kwharrigan
kwharrigan / cmanage.py
Created June 17, 2010 04:21
Manage Kindle 2.5 collections.json file
#!/usr/bin/env python
import optparse
import simplejson as json
import time
LONGNAME = "%s@en-US"
def load_file(filename):
'''
Load a json file and return the resulting object
@kwharrigan
kwharrigan / process_manifest.sh
Created June 1, 2010 21:38
Process Innosetup Manifest File
#!/bin/sh
EXPECTED_ARGS=1
B2F='gsub(/\\/, "/")'
OUT='("basename \"" $2 "\"") | getline filename ; printf("%s %s %s %s\n", $1, filename, $3, $5)'
if [ $# -ne $EXPECTED_ARGS ]
then
echo "Usage: process_manifest.sh <filename>"
exit 1
@kwharrigan
kwharrigan / requirementtable.xsl
Created May 28, 2010 19:08
Topcased Requirements Table XSLT
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*******************************************************************************
* Copyright (c) 2009 RealTime-at-Work.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
@kwharrigan
kwharrigan / C3D.i
Created February 15, 2010 15:17
Swig script for C3D and related makefile
%module C3D
%{
/* Includes the header in the wrapper code */
#include "C3D.h"
#include "vl/vld.h"
%}
/* Parse the header file to generate wrappers */
@kwharrigan
kwharrigan / adduser.sh
Created October 16, 2009 14:59
openssl utility script for adding users
#!/bin/bash
EXPECTED_ARGS=2
if [ $# -ne $EXPECTED_ARGS ]
then
echo $'Usage: \n\tadduser <name> <CA>'
echo $'\tWhere <name>.csr, <name>.pem, and <name>.key exist\n'
exit 0
else
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kwharrigan
kwharrigan / tree.js
Created July 22, 2014 06:11
Basics for visualizing GIT history using d3 from some json. Makes a tooltip out of the details.
var commits = [
{
"parent": "e98bb31",
"commit": "fb3a06f49b06fd7358c46c153b35ff6a29cd33cd",
"author": "Kyle Harrigan <kwharrigan@gmail.com>",
"date": "Mon Mar 5 20:12:12 2012 -0500",
"message": "Fortran-examples-and-automake-scripts"
},
{
"parent": "3475367",
git log -n 3 --pretty=format:'{%n "parent": "%P", %n "commit": "%H",%n "author": "%an <%ae>",%n "date": "%ad",%n "message": "%f"%n},' | sed -e '1i\
[' -e '$s/,/]/g' > tmp.json