Skip to content

Instantly share code, notes, and snippets.

View bassdread's full-sized avatar

bassdread

  • UK
View GitHub Profile
@bassdread
bassdread / Version Display
Created February 24, 2011 09:48
Display branch and version at your prompt
# Show current git branch or SVN subfolder in prompt.
GREEN="\[\033[0;32m\]"
LIGHT_GREEN="\[\033[1;32m\]"
GRAY="\[\033[1;30m\]"
LIGHT_BLUE="\[\033[1;34m\]"
LIGHT_GRAY="\[\033[0;37m\]"
COLOR_OFF="\[\e[0m\]"
function prompt_func() {
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
@bassdread
bassdread / gist:958806
Created May 6, 2011 11:43
Locker error when starting up
TypeError: Invalid argument to getAgent
at Object.getAgent (http.js:1446:11)
at _getAgent (/home/channam/Code/Locker/node_modules/http-proxy/lib/node-http-proxy.js:48:30)
at [object Object].proxyRequest (/home/channam/Code/Locker/node_modules/http-proxy/lib/node-http-proxy.js:377:12)
at proxied (/home/channam/Code/Locker/Ops/webservice.js:336:11)
at Object.<anonymous> (/home/channam/Code/Locker/Ops/webservice.js:329:5)
at param (/home/channam/Code/Locker/node_modules/connect/lib/middleware/router.js:147:21)
at pass (/home/channam/Code/Locker/node_modules/connect/lib/middleware/router.js:163:10)
at Object.router [as handle] (/home/channam/Code/Locker/node_modules/connect/lib/middleware/router.js:169:6)
at next (/home/channam/Code/Locker/node_modules/connect/lib/http.js:204:15)
@bassdread
bassdread / gist:960005
Created May 6, 2011 23:36
Failing to render a page
var express = require('express'),
connect = require('connect'),
fs = require('fs'),
http = require('http'),
url = require('url'),
sys = require('sys'),
wwwdude = require('wwwdude'),
locker = require('../../Common/node/locker.js'),
lfs = require('../../Common/node/lfs.js');
@bassdread
bassdread / gist:967175
Created May 11, 2011 19:45
twitter error
[20:44:31][Twitter Account][ERROR]
[20:44:31][Twitter Account][ERROR] node.js:134
[20:44:31][Twitter Account][ERROR] throw e; // process.nextTick error, or 'error' event on first tick
[20:44:31][Twitter Account][ERROR] ^
[20:44:31][Twitter Account][ERROR] Error: Cannot find module '/home/channam/Code/Locker/Connectors/Twitter/client.js'
at Function._resolveFilename (module.js:320:11)
@bassdread
bassdread / gist:974446
Created May 16, 2011 13:39
jinja2 issue
{% for interface in interfaces %}
{% if interface['auto-up'] is defined %}{% if interface['auto-up'] in ('yes', 'true', 'on') %}auto {{ interface.name }}{% endif %}{% endif %}
iface {{ interface.name }} inet {{ interface.type }}
{% if interface.address is defined %} address {{ interface.address }}{% endif %}
{% if interface.gateway is defined %} gateway {{ interface.gateway }}{%- endif -%}
{% endfor %}
@bassdread
bassdread / gist:1164543
Created August 23, 2011 07:15 — forked from voodootikigod/gist:1155790
PyCodeConf Ticket Give-away
Day job:
Python Dev
Favorite Python project:
App Engine
Favorite Conference:
DIBI
Python Experience Level:
for infile in glob.glob( os.path.join(pathname, '*.dll') ):
pe = pefile.PE(infile, fast_load=True)
f.write("\n" + str(infile))
if pe.OPTIONAL_HEADER.DATA_DIRECTORY[pefile.DIRECTORY_ENTRY['IMAGE_DIRECTORY_ENTRY_IMPORT']].VirtualAddress == 0:
print "nope"
else:
pe.parse_data_directories(directories=[pefile.DIRECTORY_ENTRY['IMAGE_DIRECTORY_ENTRY_IMPORT']])
for entry in pe.DIRECTORY_ENTRY_IMPORT:
f.write("\n".join(child_dll))
f.close()
26 Aug 20:09:14 - error: [Foursquare Account friends]
26 Aug 20:09:14 - error: [Foursquare Account friends] /home/channam/Code/Locker/Connectors/foursquare/friends.js:38
26 Aug 20:09:14 - error: [Foursquare Account friends] var userID = self.id;
26 Aug 20:09:14 - error: [Foursquare Account checkins]
26 Aug 20:09:14 - error: [Foursquare Account friends] ^
31 Aug 19:22:49 - debug: Firing event to links to /events
31 Aug 19:22:49 - debug: Firing event to places to /events
31 Aug 19:22:49 - debug: Firing an event for timeline/twitter from synclet/twitter action(new)
31 Aug 19:22:49 - debug: Firing event to links to /events
31 Aug 19:22:49 - debug: Firing event to places to /events
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: socket hang up
@bassdread
bassdread / gist:1184482
Created August 31, 2011 19:37
Test Tile
31 Aug 19:21:01 - debug: Firing event to links to /events
31 Aug 19:21:03 - info: [Locker] Synclet recent starting for foursquare
31 Aug 19:21:05 - info: [Locker] Synclet recent finished for foursquare
31 Aug 19:21:18 - info: [Locker] Having to spawn links
31 Aug 19:21:18 - info: [Locker] spawning into: /home/channam/Code/Locker/Me/links
31 Aug 19:21:18 - info: [Locker] sending links startup info of {"port":18054,"sourceDirectory":"/home/channam/Code/Locker/Collections/Links","workingDirectory":"/home/channam/Code/Locker/Me/links","lockerUrl":"http://localhost:8042","externalBase":"http://localhost:8042/Me/links/","mongo":{"host":"localhost","port":27018,"collections":["link","encounter"]}}
31 Aug 19:21:18 - info: [Locker] Proxy complete
31 Aug 19:21:18 - info: [Locker] Having to spawn links
31 Aug 19:21:18 - info: [Locker] links is still spawning, adding callback to queue.
31 Aug 19:21:18 - info: [Locker] Proxy complete