Skip to content

Instantly share code, notes, and snippets.

View davidbanham's full-sized avatar

David Banham davidbanham

View GitHub Profile
@davidbanham
davidbanham / gist:4527102
Last active December 11, 2015 01:58
vastproxy
// Generated by CoffeeScript 1.4.0
(function() {
var fs, http, qs, server;
http = require("http");
qs = require("querystring");
fs = require("fs");
@davidbanham
davidbanham / gist:4082284
Created November 15, 2012 23:20
No CORS headers from first req
Request URL:http://ads.intergi.com/adrawdata/3.0/5205/2408430/0/2898/ADTECH;referring_url=http%3A%2F%2Fmotd.pinion.gg%2Fmotd%2Foffice%2Fintergihtml5wcookie.html;number=1353021571;time=1353021571;cors=yes;acao=motd.pinion.gg
Request Headers
GET http://ads.intergi.com/adrawdata/3.0/5205/2408430/0/2898/ADTECH;referring_url=http%3A%2F%2Fmotd.pinion.gg%2Fmotd%2Foffice%2Fintergihtml5wcookie.html;number=1353021571;time=1353021571;cors=yes;acao=motd.pinion.gg HTTP/1.1
@davidbanham
davidbanham / gist:4082280
Created November 15, 2012 23:19
CORS set, no response from 302 target
Request URL:http://ads.intergi.com/adrawdata/3.0/5205/2408430/0/2898/ADTECH;referring_url=http%3A%2F%2Fmotd.pinion.gg%2Fmotd%2Foffice%2Fintergihtml5wcookie.html;number=1353021331;time=1353021331;cors=yes;acao=motd.pinion.gg
Request Method:GET
Status Code:302 Moved Temporarily
Request Headers
GET /adrawdata/3.0/5205/2408430/0/2898/ADTECH;referring_url=http%3A%2F%2Fmotd.pinion.gg%2Fmotd%2Foffice%2Fintergihtml5wcookie.html;number=1353021331;time=1353021331;cors=yes;acao=motd.pinion.gg HTTP/1.1
Host: ads.intergi.com
Connection: keep-alive
Origin: http://motd.pinion.gg
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11
├── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ └── [email protected]
├─┬ [email protected]
@davidbanham
davidbanham / gist:3997781
Created November 2, 2012 00:13
spool8 blob
{ fgscsgo1:
{ start: 'cd /usr/games/csgo/fgscsgo1 && sudo -u csgo HOME=/home/csgo ./srcds_run -console -game csgo -ip 10.79.28.72 -port 25014+## +clientport 26004+## +map de_dust +exec server_##.cfg -pidfile /var/run/csgo/fgscsgo1.pid -fork 20 +sv_region 255 -tickrate 100 -usercon +rcon_password xxx >> /var/log/csgo/fgscsgo1.log 2>&1',
pidFile: '/var/run/csgo/fgscsgo1.pid',
writePidFile: false,
cwd: '/home/csgo',
ip: '10.79.28.72',
region: 'TEST',
steam: { steamDir: '/home/csgo/Steam/' },
srcds:
{ '25015': [Object],
@davidbanham
davidbanham / gist:3997775
Created November 2, 2012 00:11
Serverinfo blob
{ fgscsgo1:
{ start: 'cd /usr/games/csgo/fgscsgo1 && sudo -u csgo HOME=/home/csgo ./srcds_run -console -game csgo -ip 107.6.93.170 -port 25014+## +clientport 26004+## +map de_dust +exec server_##.cfg -pidfile /var/run/csgo/fgscsgo1.pid -fork 20 +sv_region 255 -tickrate 100 -usercon +rcon_password xxx >> /var/log/csgo/fgscsgo1.log 2>&1',
pidFile: '/var/run/csgo/fgscsgo1.pid',
writePidFile: false,
cwd: '/home/csgo',
ip: '107.6.93.170',
region: 'TEST',
steam: { steamDir: '/home/csgo/Steam/' },
srcds:
{ '25015': [Object],
@davidbanham
davidbanham / gist:3916231
Created October 19, 2012 04:24
Example nginx conf
server {
listen localhost:81;
location /RPC2 {
auth_basic "Restricted";
auth_basic_user_file htpasswd;
include scgi_params;
scgi_pass localhost:5000;
}
}
@davidbanham
davidbanham / gist:3902771
Created October 16, 2012 23:36
RSS fetch
function fetchRSS() {
$.ajax({
url: document.location.protocol + '//ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=10&callback=?&q=http%3A%2F%2Fblog.counter-strike.net%2Findex.php%2Fcategory%2Fmotd%2Ffeed%2F',
dataType: 'json',
success: function(data) {
var post = data.responseData.feed.entries[0];
$('.title').text(post.title);
$('#post_content').html(post.content);
}
});
@davidbanham
davidbanham / errorhandling.coffee
Created October 10, 2012 21:39 — forked from jpallen/errorhandling.js
errorhandling (express)
respondWithError (response, namespace, message, status) ->
status = 500 if status?
console.log namespace, message
response.send "Mising guid", status
handleDelete (request, response) ->
return respondWithError response, 'Blogs', 'Error - Missing guid in handleDelete', 400 if request.url.query.guid
getBlogByGuid request.url.query.guid, (err, blog) ->
return respondWithError(response, 'Blogs', 'Error in getBlogByGuid callback in handleDelete') if err
@davidbanham
davidbanham / gist:3292528
Created August 8, 2012 05:49
Cloudfiles marker
fetchList = (containerName, marker, files, soFar) ->
if typeof soFar == 'undefined'
soFar = []
client.getFiles containerName,marker, (err, serverFiles) ->
return console.log "ERROR", err if err
# Default max return for the rackspace API is 10000.
if serverFiles.length == 10000
marker = serverFiles[serverFiles.length - 1].name
soFar = soFar.concat(serverFiles)
fetchList containerName, marker, files, soFar