Skip to content

Instantly share code, notes, and snippets.

@cawka
cawka / LOG4CXX-417---r1556413.patch
Last active August 29, 2015 14:23
LOG4CXX upstream patches for Homebrew
Index: src/main/cpp/stringhelper.cpp
===================================================================
--- src/main/cpp/stringhelper.cpp (revision 1556412)
+++ src/main/cpp/stringhelper.cpp (revision 1556413)
@@ -30,6 +30,10 @@
#include <cctype>
#include <iterator>
#include <apr.h>
+//LOG4CXX-417: need stdlib.h for atoi on some systems.
+#ifdef APR_HAVE_STDLIB_H
diff --git a/wake.cpp b/wake.cpp
index c34165b..0e64493 100644
--- a/wake.cpp
+++ b/wake.cpp
@@ -25,13 +25,13 @@ void WAKE_Base::GenKey(word32 k0, word32 k1, word32 k2, word32 k3)
CRYPTOPP_COMPILE_ASSERT(sizeof(x) == 4);
static int tt[10]= {
0x726a8f3b, // table
- 0xe69a3b5c,
- 0xd3c71fe5,
@cawka
cawka / ndn-tr-header.tex
Created January 26, 2016 23:44
Add NDN-TR header
\documentclass{article}
\usepackage{pdfpages}
\usepackage{url,soul,hyperref,eso-pic,xcolor}
\makeatletter
\AddToShipoutPicture*{%
\setlength{\@tempdimb}{20pt}%
\setlength{\@tempdimc}{\paperheight}%
\setlength{\unitlength}{1pt}%
\small
Subject: [NDN-TR] NDN-<number> revision <number>: <Title>
(A new NDN Technical Report (initial revision) is now available on NDN website.) |
(A new revision of NDN Technical report is now available on NDN website.)
Comments and suggestions are highly welcome.
Title : <Title>
Authors : <Authors>
Number : NDN-<number>
Revision : <number>
@cawka
cawka / ndn_gdb.py
Created March 3, 2016 09:13
GDB Pretty printers for ndn-cxx and NFD
from boost import printers
import gdb
import pyndn
printer_gen = printers.Printer_Gen('ndn')
# This function registers the top-level Printer generator with gdb.
# This should be called from .gdbinit.
def register_printer_gen(obj):
"Register printer generator with objfile obj."
@cawka
cawka / guess-tex-master.el
Created May 7, 2016 00:16
Automatically guess TeX-Master in Emacs based on files in the current folder
(defun my-guess-tex-master()
(save-excursion
(let ((files (directory-files (file-name-directory (buffer-file-name)) nil "^[^\.].*\.tex$" nil))
(done nil))
(goto-char (point-min))
(if (re-search-forward "documentclass" nil t)
(setq done file))
(while (and files (not done))
(let ((file (pop files)))
(save-excursion
if [ -f "$(brew --prefix bash-git-prompt)/share/gitprompt.sh" ]; then
# GIT_PROMPT_THEME=Default
GIT_PROMPT_THEME=Single_line_Ubuntu
GIT_PROMPT_FETCH_REMOTE_STATUS=0
# GIT_PROMPT_THEME=Single_line_openSUSE
source "$(brew --prefix bash-git-prompt)/share/gitprompt.sh"
# PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
fi
#!/usr/bin/perl
# Aquamacs Emacs starter
# (C) 2007, 2008, 2009 Aquamacs Project
# Revisions
# 1.0 - first version to be included with Aquamacs [2007-03-17 David Reitter]
# 1.1 - delayed deletion of new files [2008-11-12 David Reitter]
# 1.2 - remove hard-coding of application path; consequently, remove sudo functionality
# - shorter delay before deleting file
@cawka
cawka / macOS_virtualbox.sh
Last active October 12, 2016 22:39 — forked from kevin-smets/macOS_virtualbox.sh
Convert macOS installer for use in VirtualBox
#!/bin/bash
# This will require about 30GB of space, still in experimental phase right now
hdiutil attach /Applications/Install\ macOS\ Sierra\ Public\ Beta.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
asr restore -source /Volumes/install_app/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
cp -rp /Volumes/install_app/Packages /Volumes/OS\ X\ Base\ System/System/Installation/
cp -rp /Volumes/install_app/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System/BaseSystem.chunklist
#!/bin/sh
# Copyright (C) 2014 Patrick Georgi <patrick@georgi-clan.de>
# licensing: ISC license terms
#
# usage: $0 id-to-keep id-to-merge
# Include proper Host, user, and port configuration in your ~/.ssh/config as `gerrit`
if [ $# -ne 2 ]; then
echo "usage: $0 id-to-keep id-to-merge"