Skip to content

Instantly share code, notes, and snippets.

View davidbanham's full-sized avatar

David Banham davidbanham

View GitHub Profile
@davidbanham
davidbanham / gist:3234107
Created August 2, 2012 05:44
ND Update fail
gameservers@kermit:~$ /home/gameservers/steam -command update -game nucleardawn -dir /home/gameservers/nucleardawn/
Checking bootstrapper version ...
removing stale semaphore last operated on by process 1371 with name 0eBlobRegistryMutex_528E09C8780F0A9ADB2C6BA99A64426D
removing stale semaphore last operated on by process 1371 with name 0eBlobRegistrySignal_528E09C8780F0A9ADB2C6BA99A64426D
Updating Installation
Determining which depot(s) to install/update...
3 depot(s) will be installed/updated
0:01 Checking local files and building download list for depot 17711 'nucleardawn_content' version 128
0:01 Connecting content server session for version 128
0:03 [111.119.10.2:27030] Connecting...
traceroute to 27.50.71.5 (27.50.71.5), 64 hops max, 52 byte packets
1 home.gateway (10.10.0.254) 17.412 ms 1.023 ms 0.860 ms
2 lns20.syd7.internode.on.net (150.101.199.219) 69.530 ms 71.082 ms 75.901 ms
3 te3-3.cor2.syd7.internode.on.net (150.101.195.13) 70.798 ms 74.532 ms 71.016 ms
4 gi2-0-0.bdr1.syd6.internode.on.net (150.101.120.238) 72.384 ms 72.754 ms 73.819 ms
5 te2-0-0.bdr1.syd4.internode.on.net (150.101.197.2) 81.832 ms 79.512 ms 78.986 ms
6 45671.syd.equinix.com (202.167.228.22) 73.608 ms * 63.979 ms
7 27.50.71.5 (27.50.71.5) 69.171 ms 71.244 ms 76.514 ms
@davidbanham
davidbanham / gist:2550648
Created April 29, 2012 14:12
Failing to download a file with request
var request = require('request');
var fs = require('fs');
var url = 'http://www.google.com/images/srpr/logo3w.png';
// for comparison, wget https://www.google.com/images/srpr/logo3w.png then diff logo3w.png nodeVersion.png
request({url: url}, function(error, response, body) {
if (error) callback(error);
else {
fs.writeFile('./nodeVersion.png', body, 'base64', function(err){
if(err) console.log(err);
else console.log('yay')
@davidbanham
davidbanham / gist:1990381
Created March 7, 2012 01:50
Ansi fiddling
// Ignore the md5 stuff. It's a super naive implementation as a POC for a contest.
var a = [ '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'x', 'y', 'z' ]
var crypto = require('crypto');
var ansi = require('ansi')
, cursor = ansi(process.stdout);
var key = 'asd97-896aj-sa82n';
@davidbanham
davidbanham / gist:1706484
Created January 30, 2012 20:29
VideoJS API ready call delayed with javascript - Fails
<!DOCTYPE html>
<html>
<head>
<title>Video.js | HTML5 Video Player</title>
<link href="http://vjs.zencdn.net/c/video-js.css" rel="stylesheet" type="text/css">
<!-- video.js must be in the <head> for older IEs to work. -->
<script src="video.js"></script>
@davidbanham
davidbanham / gist:1706479
Created January 30, 2012 20:29
VideoJS API ready call delayed with jQuery - Fails
<!DOCTYPE html>
<html>
<head>
<title>Video.js | HTML5 Video Player</title>
<link href="http://vjs.zencdn.net/c/video-js.css" rel="stylesheet" type="text/css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<!-- video.js must be in the <head> for older IEs to work. -->
@davidbanham
davidbanham / gist:1702844
Created January 30, 2012 06:03
Piece of VideoJS behaving strangely
// Adjust for jQuery ID syntax
if (id.indexOf("#") === 0) {
id = id.slice(1);
}
// If a player instance has already been created for this ID return it.
console.log(_V_.players); // Object that appears to have one property Class named example_video_1
console.log(id); // example_video_1
console.log(_V_.players[id]); // undefined
if (_V_.players[id]) {
@davidbanham
davidbanham / gist:1702828
Created January 30, 2012 05:59
VideoJS API ready call failing
<!DOCTYPE html>
<html>
<head>
<title>Video.js | HTML5 Video Player</title>
<link href="http://vjs.zencdn.net/c/video-js.css" rel="stylesheet" type="text/css">
<!-- video.js must be in the <head> for older IEs to work. -->
<script src="http://vjs.zencdn.net/c/video.js"></script>
<script type="text/javascript">
@davidbanham
davidbanham / gist:1654833
Created January 22, 2012 00:50
node v0.6.8 on MBP Lion with --debug flag
davidbanham@David-Banhams-MacBook-Pro:~/segnode/node-v0.6.8$ ./configure --debug
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for program gcc or cc : /usr/bin/gcc
Checking for gcc : ok
Checking for library dl : yes
Checking for openssl : not found
@davidbanham
davidbanham / gist:1421331
Created December 2, 2011 01:49
npm output time issue
npm install time
> [email protected] preinstall /home/ubuntu/oim-cpanel/node_modules/time
> node-waf clean || true; node-waf configure build
sh: node-waf: not found
sh: node-waf: not found
npm ERR! error installing [email protected] Error: [email protected] preinstall: `node-waf clean || true; node-waf configure build`
npm ERR! error installing [email protected] `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 127
npm ERR! error installing [email protected] at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/exec.js:49:20)