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/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 |
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
;;; 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) |
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
(defmacro lambdab ((&rest instrs) &rest body) | |
"Use `bind' to allow restructuring of argument to lambda expressions." | |
(declare (indent 1)) | |
(let* ((evald-instrs instrs) | |
(syms (mapcar (lambda (_) (gensym)) evald-instrs))) | |
`(lambda ,syms (bind ,(mapcar #'list evald-instrs syms) ,@body)))) | |
;; example usage | |
(let ((fn (lambdab ((a b) c) (cons a c)))) | |
(funcall fn '(1 2) 3)) ;; => (1 . 3) |
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
# 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 |
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
# 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 |
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
// 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 |
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
;;; 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 |
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
myKeys conf@(XConfig {XMonad.modMask = modm}) = | |
[ ((modm, xK_b), sendMessage ToggleStruts) -- Mod-b: toggle xmobar panel | |
, ((modm, xK_p), spawn "dmenu_run") -- needs explicit for completion | |
-- , ("<XF86AudioNext>", spawn "cmus-remote -n") | |
, ((0, xF86XK_AudioNext), spawn "cmus-remote -n") | |
, ((0, xF86XK_AudioPrev), spawn "cmus-remote -r") | |
, ((0, xF86XK_AudioPlay), spawn "cmus-remote -u") | |
, ((0, xF86XK_AudioStop), spawn "cmus-remote -s") | |
, ((0, xF86XK_AudioLowerVolume), spawn "amixer set Master 5%-") | |
, ((0, xF86XK_AudioRaiseVolume), spawn "amixer set Master 5%+") |
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
def confirm_intent(prompt, answer) | |
puts prompt | |
users_answer = Capistrano::CLI.ui.ask("(type #{answer} to continue)? ") { |p| p.echo == true } | |
abort unless users_answer == answer | |
end | |
task :staging do | |
confirm_intent("Are you SURE you want to deploy to the staging server? ", "YES") | |
role :app, "1.2.3.4" | |
role :web, "1.2.3.4" |
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
;; 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)))) |
NewerOlder