Skip to content

Instantly share code, notes, and snippets.

View ashgillman's full-sized avatar
🚲

Ashley Gillman ashgillman

🚲
View GitHub Profile
@ashgillman
ashgillman / ptn-encode.c
Created March 6, 2018 05:53
Pythagorean Triple Numbers (Marijn Heule)
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main (int argc, char** argv) {
unsigned int a, b, c, max, offset = 0, nVars = 0, nClauses = 0;
if (argc < 2) {
printf ("run using ./ptn-encode MAX [OFFSET=0]\n"); exit (0); }
@ashgillman
ashgillman / .bashrc
Last active February 2, 2018 00:41 — forked from joepie91/.md
Nix in multi-user mode on a non-NixOS (eg. Debian) system
nix-setup-user() {
TARGET_USER="$1"
SYMLINK_PATH="/home/$TARGET_USER/.nix-profile"
PROFILE_DIR="/nix/var/nix/profiles/per-user/$TARGET_USER"
echo "Creating profile $PROFILE_DIR..."
echo "Profile symlink: $SYMLINK_PATH"
rm "$SYMLINK_PATH"
mkdir -p "$PROFILE_DIR"
@ashgillman
ashgillman / primes.py
Last active April 24, 2017 22:35
Euler Project
def sieve_up_to(n):
possible = list(range(2, n+1))
primes = []
for i, p in enumerate(possible):
if p:
primes.append(p)
for j in range(i, n-1, p):
possible[j] = False
return primes
@ashgillman
ashgillman / openconnect_wrapper
Created February 16, 2017 12:04
openconnect launchd
#!/bin/bash
# /etc/openconnect_wrapper
# swap out SIGTERM for openconnect-friendly SIGINT
_term() {
kill -INT "$child" 2>/dev/null
}
trap _term SIGTERM
@ashgillman
ashgillman / Snakefile
Created November 25, 2015 11:37
Snakemake Dynamic Parallel Example
rule all:
input: 'output.txt'
rule clean:
shell: 'rm input_* intermediate_* output.txt'
rule merge:
input: dynamic('intermediate_{n}.txt')
output: 'output.txt'
shell: 'cat {input} > {output}'
@ashgillman
ashgillman / Dockerfile
Created November 17, 2015 10:43
Docker MotD
FROM debian:jessie
MAINTAINER Ashley Gillman <[email protected]>
# Source working/installation directory
ENV INSTALL /usr/local/src
RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/issue && cat /etc/motd' \
>> /etc/bash.bashrc \
; echo "\
===================================================================\n\
= SomeApp Docker container =\n\
@ashgillman
ashgillman / encoded_latex.tex
Created October 26, 2015 12:49
Steganography
\subsection{Natural Language Watermarking and Tamperproofing}
In \emph{Natural language watermarking and tamperproofing}, Atallah \emph{et al.} \cite{atallah2003natural} propose a method for steganographically embedding watermarks or fingerprints into plain text. Modern natural language steganography methods attempt to apply steganographic methods to text, without relying on modifying specific formatting parameters, such as \LaTeX or HTML.
In this work, authors continue from previous work \cite{atallah2001natural}, and use a similar base concept. The concept depends on fundamental redundancies in language structure and semantics. These two separate areas of redundancy are exploited within this text to embed the hidden message.
Firstly, a sentence can be restructured, and maintain the exact same meaning \cite{bennett2004linguistic}. For example, ``Ashley submitted a perfect assignment'' and ``A perfect assignment was submitted by Ashley.'' In these sentenced, the order of the subject and object have been reve
@ashgillman
ashgillman / laplace.m
Created October 25, 2015 10:11
Laplace Finite Differences
clear all; close all
% Input Parameters
shieldxs = [0, 10, 10*cos(pi/3), 0];
shieldys = [0, 0, 10*sin(pi/3), 0];
shieldv = 10;
corexs = [4, 4, 6, 6, 4];
coreys = [5*tan(pi/6)+1, 5*tan(pi/6)-1, 5*tan(pi/6)-1, ...
5*tan(pi/6)+1, 5*tan(pi/6)+1];
corev = -10;
@ashgillman
ashgillman / package.json
Created September 9, 2015 13:00
Static D3 Visualisation
{
"name": "Static-D3-Visualisation",
"version": "1.0.0",
"description": "Template to make visualisations with D3 locally",
"dependencies": {
"jsdom": "^3.1.2"
},
"devDependencies": {
"coffee-script": "^1.10.0"
},