Skip to content

Instantly share code, notes, and snippets.

View crooksey's full-sized avatar

Luke Crooks crooksey

  • Hampshire, UK
View GitHub Profile
@crooksey
crooksey / directions_api
Created April 2, 2014 09:26
Google directions API result
{
"routes" : [
{
"bounds" : {
"northeast" : {
"lat" : 51.4544845,
"lng" : -0.9703505999999998
},
"southwest" : {
"lat" : 50.6999246,
@crooksey
crooksey / python_directions_api
Last active August 29, 2015 13:58
Directions API python JSON extraction
#!/usr/bin/python
# open a gist of json results, taken from google directions api
url = "https://gist.githubusercontent.com/crooksey/9930819/raw/947e4d17a93ca94b78216d92fbd94b281966dede/directions_api"
import urllib2
data = urllib2.urlopen(url)
pre_json = data.read()
import networkx as nx
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap as Basemap
m = Basemap(
projection='merc',
llcrnrlon=-130,
llcrnrlat=25,
urcrnrlon=-60,
urcrnrlat=50,
lat_ts=0,
from openopt import *
from numpy import sin, cos#, abs
import networkx as nx
solver = 'glpk'
N = 4
nodes = {}
nodes[0] = {'lat':37.96, 'lon':-121.29}
nodes[1] = {'lat':42.82, 'lon':-73.95}
@crooksey
crooksey / Mixed
Created January 8, 2015 07:59
Strongswan Confgigurations
freebsd luke # cat /usr/local/etc/ipsec.conf
# ipsec.conf - strongSwan IPsec configuration file
conn win7
left=%defaultroute
leftcert=serverCert.der
# Subnet where vpn server is
leftsubnet=172.10.10.0/24
right=%any
# IP address to asign to hosts
Jan 8 08:00:56 freebsd ipsec_starter[14748]: charon stopped after 200 ms
Jan 8 08:00:56 freebsd ipsec_starter[14748]: ipsec starter stopped
Jan 8 08:00:59 freebsd ipsec_starter[19320]: Starting strongSwan 5.2.1 IPsec [starter]...
Jan 8 08:00:59 freebsd ipsec_starter[19320]: no netkey IPsec stack detected
Jan 8 08:00:59 freebsd ipsec_starter[19320]: no KLIPS IPsec stack detected
Jan 8 08:00:59 freebsd ipsec_starter[19320]: no known IPsec stack detected, ignoring!
Jan 8 08:00:59 freebsd ipsec_starter[19331]: charon (19332) started after 40 ms
Jan 8 08:01:02 freebsd charon: 02[JOB] watcher got notification, rebuilding
Jan 8 08:01:02 freebsd charon: 02[JOB] watcher going to select()
Jan 8 08:01:02 freebsd charon: 02[JOB] watched FD 22 ready to read
Jan 8 08:01:03 00[DMN] Starting IKE charon daemon (strongSwan 5.2.1dr1, Linux 3.4.0-ga90a790, armv7l)
Jan 8 08:01:03 00[KNL] kernel-netlink plugin might require CAP_NET_ADMIN capability
Jan 8 08:01:03 00[LIB] loaded plugins: androidbridge charon android-log openssl fips-prf random nonce pubkey pkcs1 pkcs8 pem xcbc hmac socket-default kernel-netlink eap-identity eap-mschapv2 eap-md5 eap-gtc eap-tls
Jan 8 08:01:03 00[LIB] unable to load 9 plugin features (9 due to unmet dependencies)
Jan 8 08:01:03 00[JOB] spawning 16 worker threads
Jan 8 08:01:03 08[IKE] initiating IKE_SA android[2] to 217.36.193.188
Jan 8 08:01:03 08[ENC] generating IKE_SA_INIT request 0 [ SA KE No N(NATD_S_IP) N(NATD_D_IP) N(FRAG_SUP) ]
Jan 8 08:01:03 08[NET] sending packet: from 10.68.37.59[46376] to 217.36.193.188[500] (996 bytes)
Jan 8 08:01:04 12[NET] received packet: from 217.36.193.188[500] to 10.68.37.59[46376] (465 bytes)
Jan 8 08:01:04 12[ENC] parsed IKE_SA_INIT response 0 [ SA KE No N(NATD_S_IP) N(NATD_D_IP) CERTREQ N(MUL
@crooksey
crooksey / dh1_vpnclog
Created June 17, 2015 20:40
dh1_vpnclog
vpnc version 0.5.3r512
hex_test: 00010203
S1 init_sockaddr
[2015-06-17 21:36:22]
S2 make_socket
[2015-06-17 21:36:22]
@crooksey
crooksey / dh2_vpnclog
Created June 17, 2015 20:41
dh2_vpnclog
vpnc version 0.5.3r512
hex_test: 00010203
S1 init_sockaddr
[2015-06-17 21:36:44]
S2 make_socket
[2015-06-17 21:36:44]
Server Error in '/' Application.
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->