Skip to content

Instantly share code, notes, and snippets.

View shanemhansen's full-sized avatar

Shane Hansen shanemhansen

View GitHub Profile
Don't paste this into hipchat.
/code 2039.92-5434.92-2648.92-2280.94-5426.96-2989.98-3923.99-2999.29-5690.22-2486.23-2969.23-5699.23-3025.24-5435.27-4974.27-9972.29-3455.29-5884.30-3493.32-3023.32
(use 'ring.adapter.jetty)
; => nil
(defn app-handler [request]
{:status 200
:headers {"Content-Type" "text/html"}
:body "Hello from Ring"})
; => #'user/app-handler
(run-jetty app-handler {:port 3000})
@shanemhansen
shanemhansen / fix.md
Created January 21, 2016 21:52
Fix to get libstoken integration working on my company's vpn

My issue was that the passwords were being sent in the wrong order. I needed to send my regular password first and my token 2nd.

I had to apply this diff to auth.c which made rsa token generation similar to whatever "LIBOAUTH" does.

-	if ((strcmp(opt->name, "password") && strcmp(opt->name, "answer")) ||
+	if ((strcmp(opt->name, "secondary_password") != 0) ||
@shanemhansen
shanemhansen / male.log
Last active January 21, 2016 17:28
Output of make -n for openconnect 5.02 (from ubuntu repos) attempting to link against stoken 0.9
fail=; \
if (target_option=k; case ${target_option-} in ?) ;; *) echo "am__make_running_with_option: internal error: invalid" "target option '${target_option-}' specified" >&2; exit 1;; esac; has_opt=no; sane_makeflags=$MAKEFLAGS; if test -n ' Makefile .deps/libopenconnect_la-auth.Plo .deps/libopenconnect_la-compat.Plo .deps/libopenconnect_la-gnutls.Plo .deps/libopenconnect_la-gnutls_pkcs12.Plo .deps/libopenconnect_la-gnutls_tpm.Plo .deps/libopenconnect_la-http.Plo .deps/libopenconnect_la-library.Plo .deps/libopenconnect_la-openssl.Plo .deps/libopenconnect_la-ssl.Plo .deps/libopenconnect_la-version.Plo .deps/openconnect-cstp.Po .deps/openconnect-dtls.Po .deps/openconnect-main.Po .deps/openconnect-mainloop.Po .deps/openconnect-tun.Po .deps/openconnect-xml.Po' && test -n '0'; then sane_makeflags=$MFLAGS; else case $MAKEFLAGS in *\\[\ \ ]*) bs=\\; sane_makeflags=`printf '%s\n' "$MAKEFLAGS" | sed "s/$bs$bs[$bs $bs ]*//g"`;; esac; fi; skip_next=no; strip_trailopt () { flg=`printf '%s\n' "$flg" | sed "s/$1.*$//"`;
inputFile = open('input.csv')
outputFile = open('output.csv', 'w')
counter = 0
for line in inputFile:
counter+=1
if counter < 4:
continue
outputFile.write(line)
inputFile.close()
#-------------------------------------------------------------------------------
# Name: BusinessData Sorting
# Purpose:
#
# Author: woswald
#
# Created: 01/09/2015
# Copyright: (c) woswald 2015
#-------------------------------------------------------------------------------
#!/usr/bin/env python
#-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: woswald
#
# Created: 10/08/2015
# Copyright: (c) woswald 2015
#-------------------------------------------------------------------------------
#!/usr/bin/env python
#!/usr/bin/env python
import sys
import csv
# change these
inputfile = "the-input-file.csv"
outputfile = "the-output-file
#!/bin/bash
# this is a fun little script to compute euler's number using bash.
# It attempts to produce n digits of e when invoked as: ./euler.sh n
# There's a well known taylor series for approximating e:
# e = sum from 1 to infinity of 1/n!
# unfortunately bash doesn't support fractions, just integers.
# so we basically fake a rational number data structure, storing the numerator
# and denominator as integers. At that point we have to deal with the fact
# that bash integers are finite precision, so large numerator and large denominators
# overflow very fast. We constantly have to reduce the fraction to shrink the numerator
----- pillar/top.sls ---
base:
'*-prod*':
- prod
'dal-*':
- dal
------- pillar/prod.sls ---
foo: prodfoo