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
#!/bin/bash
PKG="$1"
BIN="$2"
shift;shift
go install "$BIN"
$GOPATH/bin/$(basename $BIN) $@ &
while true; do
(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.*$//"`;
@shanemhansen
shanemhansen / gist:7492381
Created November 15, 2013 22:00
scrubbed
DirectoryIndex index.html index.php index_mvc.php
php_value include_path "a:b"
<Location />
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index_mvc.php [NC,L]
</Location>
<?
function a() {?><?}
<?php
require_once 'lib/__init__.php';
$wd_host = 'http://localhost:4444/wd/hub'; // this is the default
$browser = "firefox";
for ($i=1;$i<=100;$i++) {
$browser = $browser=="firefox"?"chrome":"firefox";
$capabilities = array(WebDriverCapabilityType::BROWSER_NAME => $browser);
$driver = new WebDriver($wd_host, $capabilities);
$driver->get('http://baby.steals.com/');
$driver->findElement(WebDriverBy::className("login_link"))->click();
diff --git a/sqlx.go b/sqlx.go
index 5ea0a4a..ed0bead 100644
--- a/sqlx.go
+++ b/sqlx.go
@@ -3,7 +3,6 @@ package sqlx
import (
"database/sql"
"errors"
- "fmt"
"io/ioutil"
{
"ProductId": 3011227,
"DefaultCatalogId": 3,
"ProductName": "my girl 6x6 paper pad",
"ManufacturerId": 3000139,
"BrandId": 3000139,
"CountryOfOrigin": "USA",
"ProductTypeId": 1,
"CreatedDate": null,
"ProductGenderId": 1,