Skip to content

Instantly share code, notes, and snippets.

# Build the faulty version of UnrealIRCd.
# This is the oldest version of Ubuntu that seems to work w/Docker.
FROM ubuntu:14.04 as unrealircd
RUN apt-get -y update && apt-get -y install automake build-essential git libssl-dev wget
RUN wget http://stalkr.net/files/unrealircd/Unreal3.2.8.1_backdoor.tar.gz
COPY Unreal3.2.8.1_backdoor.tar.gz Unreal3.2.8.1_backdoor.tar.gz
RUN tar xzf Unreal3.2.8.1_backdoor.tar.gz
WORKDIR /Unreal3.2
# This change was required to get the build to go through.
RUN sed -i 's/inline void parse_addlag/void parse_addlag/' src/parse.c
// blog.cpp --- Simple example demonstrating GTIRB usage
//
// Search a GTIRB instance printing the calls preceeding `system' calls.
//
// Compiled with (with system installs):
// g++ --std=c++17 -lgtirb blog.cpp
//
// or with (with explicit includes):
// g++ -I/gtirb/build/include/ -I/gtirb/build/protobuf-src/include/ \
// --std=c++17 -lgtirb blog.cpp
# Build souffle
FROM ubuntu:18.04 as souffle
RUN apt-get -y update && apt-get -y install automake bison build-essential clang doxygen flex git libtool make mcpp openjdk-8-jdk pkg-config python sqlite3 libsqlite3-dev subversion swi-prolog zlib1g-dev
RUN git clone -b 1.4.0 https://github.com/souffle-lang/souffle
RUN cd souffle && sh ./bootstrap
RUN cd souffle && ./configure --prefix=/usr --enable-64bit-domain --disable-provenance
RUN cd souffle && make -j4 install
RUN cd souffle && cp include/souffle/RamTypes.h /usr/include/souffle/
# Build the faulty version of UnrealIRCd
@eschulte
eschulte / asm-diff
Created March 26, 2019 20:10
Use objdump to view the differences between two object files
#!/bin/bash
#
# Usage: asm-diff [options] file1 file2 [-- diff options]
# Return the difference in the objudmp parsing of files
#
# OPTIONS:
# -o,--objdump CMD --- specify objdump command to use
# -j,--section NAME -- section to compare
# (default: .text)
# -c,--clean --------- specify whether to clean addresses
@eschulte
eschulte / loop-rec.lisp
Created November 25, 2013 19:05
compile a looping function from a recursive definition
;;; loop-rec.lisp --- compile a looping function from a recursive definition
;; Copyright (C) 2013 Eric Schulte
;;; Commentary:
;; Use the `defwhile' macro to define a looping (using while) version
;; of any recursive function.
;;
;; It maintains a fifo stack of arguments (my-args), and a pointer to
@eschulte
eschulte / feedgnuplot-repl.lisp
Last active December 24, 2015 10:08
Use feedgnuplot to visualize list data from the Common Lisp REPL
;; Use feedgnuplot to visualize list data from the Common Lisp REPL.
;;
;; Useful for visualizing distributions of large lists.
;;
;; Example usage.
;;
;; (feedgnuplot (loop :for x :below 200 :collect (sin (/ x 25))))
;; (feedgnuplot (loop :for x :below 2000 :collect (random 25)) :histogram t)
;; (feedgnuplot (loop :for x :from 1 :upto 200 :collect (list (float (/ x 25)) (sin (/ x 25)))))
;; (feedgnuplot (loop :for x :from 1 :upto 200 :collect (list (float (/ x 25)) (sin (/ x 25))))
@eschulte
eschulte / curry-compose.el
Last active February 26, 2022 19:52
Implementation of curry, rcurry and compose in Emacs Lisp. Including some code to make Emacs display these functions in a compact and attractive manner.
;;; Commentary
;;
;; Allows for more compact anonymous functions. The following
;; examples demonstrate the usage.
;;
;; ;; partial application with `curry'
;; (mapcar (» #'+ 2) '(1 2 3 4)) ; => (3 4 5 6)
;;
;; ;; alternate order of arguments with `rcurry'
;; (mapcar (« #'- 1) '(1 2 3 4)) ; => (0 1 2 3)
//// Key Bindings
define_key(content_buffer_normal_keymap, "h", "cmd_scrollLeft");
define_key(content_buffer_normal_keymap, "j", "cmd_scrollLineDown");
define_key(content_buffer_normal_keymap, "k", "cmd_scrollLineUp");
define_key(content_buffer_normal_keymap, "l", "cmd_scrollRight");
define_key(content_buffer_normal_keymap, "C-j", "cmd_scrollLineDown");
define_key(content_buffer_normal_keymap, "C-k", "cmd_scrollLineUp");
call_after_load("google-search-results",
function () {
undefine_key(google_search_results_keymap, "j");
@eschulte
eschulte / fix-caps-cntrl.sh
Created May 6, 2012 18:47
switch Capslock and Control
#!/bin/sh
#
# Swap Caps lock and Control
#
xmodmap -e "remove Lock = Caps_Lock"
xmodmap -e "remove Control = Control_L"
xmodmap -e "keysym Control_L = Caps_Lock"
xmodmap -e "keysym Caps_Lock = Control_L"
xmodmap -e "add Lock = Caps_Lock"
xmodmap -e "add Control = Control_L"
@eschulte
eschulte / gist:1903109
Created February 24, 2012 19:21
remove parts of the current url following "?"
function remove_params(I)
{
var rx=/^(.*)\?/;
var url=I.buffer.current_uri.spec;
var match = rx.exec(url);
if(match)
{
I.window.minibuffer.message("matched");
I.window.minibuffer.message(match[1]);
apply_load_spec(I.buffer, match[1])