Skip to content

Instantly share code, notes, and snippets.

View sirleech's full-sized avatar

Christopher Lee sirleech

  • Canberra, Australia
View GitHub Profile
@sirleech
sirleech / Qgis TileLayer TVS file
Last active August 29, 2015 14:07
Qgis TileLayer TVS file
#title credit serviceUrl yOriginTop zmin zmax xmin ymin xmax ymax
Mapbox © OpenStreetMap contributors http://api.tiles.mapbox.com/v4/sirleech.map-izvflxu8/{z}/{x}/{y}.png?access_token=[yourkey] 1 0 19
OpenStreetMap © OpenStreetMap contributors http://a.tile.openstreetmap.org/{z}/{x}/{y}.png 1 0 19
Mapquest sat http://otile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg 1 0 19
Mapquest streets http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg
@sirleech
sirleech / gist:5156451
Last active December 14, 2015 22:09
Raspberry Pi /etc/networks/interface for static ips and wireless dongle with WPA2-Personal
auto lo
# assign static IP 192.168.1.55
# gateway = your router IP
iface lo inet loopback
iface eth0 inet static
address 192.168.1.55
netmask 255.255.255.0
gateway 192.168.1.254
@sirleech
sirleech / gist:5075591
Last active December 14, 2015 10:59
Install Ruby on Rails on Ubuntu 12.04 LTS (Precise Pangolin)
!#/bin/bash
# install on AMI Sydney Ubuntu 12.04 lTS
# ami-4cf26376
# ap-southeast-2 precise 12.04 LTS amd64 ebs 20130222 ami-4cf26376
# https://console.aws.amazon.com/ec2/home?region=ap-southeast-2#launchAmi=ami-4cf26376
# run as user 'ubuntu'
# bash <(curl -s http://mywebsite.com/myscript.txt)
sudo apt-get -q -y update
sudo apt-get -q -y upgrade
@sirleech
sirleech / gist:5056011
Created February 28, 2013 11:12
My .vimrc
syntax on
filetype indent plugin on
@sirleech
sirleech / gist:5055976
Created February 28, 2013 11:06
The apache config for the web.py example before
<VirtualHost *:80>
ServerAdmin webmaster@localhost
WSGIScriptAlias / /var/www/webpy-app/code.py/
Alias /appname/static /var/www/webpy-app/static/
AddType text/html .py
<Directory /var/www/webpy-app/>
Order deny,allow
@sirleech
sirleech / gist:5055971
Last active October 2, 2017 06:59
web.py example with a few URLs and a JSON web service. Installed as mod_wsgi on apache, see conf at https://gist.github.com/sirleech/5055976
import web
import json
urls = (
'/', 'index',
'/random', 'random',
'/dump', 'dump'
)
@sirleech
sirleech / gist:5047407
Created February 27, 2013 11:57
Python REST web service in cgi bin on Apache
#!/usr/bin/python
print "Content-type:application/json"
print "Access-Control-Allow-Origin: *\r\n\r\n"
import random
import sys
import datetime
now = datetime.datetime.now()
@sirleech
sirleech / gist:5047400
Created February 27, 2013 11:56
Jquery AJAX call to JSON rest service, with spinner animation during load
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<style>
body {font-size: 200%;}
.hidden {display:none;}
</style>
</head>
<body>
Random: <div id="randomNumber">RAND</div>
@sirleech
sirleech / gist:4050330
Created November 10, 2012 07:45
PHP with Cosm and CURL
<?php
function putToCosm($csv){
echo 'logging to cosm...';
$url = 'http://api.cosm.com/v2/feeds/YOURFEEDID.csv';
$ch = curl_init($url);
@sirleech
sirleech / gist:3991102
Created November 1, 2012 01:47
Install Ruby On Rails Mac Os 10.7.5
Install Homebrew:
http://mxcl.github.com/homebrew/
http://blog.teamtreehouse.com/installing-ruby-rails-and-mysql-on-os-x-lion
To solve mysql problems:
http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html