Skip to content

Instantly share code, notes, and snippets.

2013/12/11 17:11:22 POST /v1.8/images/containers.apps.wsf/padi-webshop-builder/push
panic: runtime error: slice bounds out of range
goroutine 2191 [running]:
archive/tar.(*Writer).writePAXHeader(0xc2004bbdc0, 0xc2014dc540, 0x53, 0xc200dc5d80)
/usr/lib/go/src/pkg/archive/tar/writer.go:233 +0x21d
archive/tar.(*Writer).WriteHeader(0xc2004bbdc0, 0xc2014dc540, 0x0, 0x0)
/usr/lib/go/src/pkg/archive/tar/writer.go:139 +0x28d8
github.com/dotcloud/docker/utils.(*TarSum).Read(0xc2029d2880, 0xc2008a0000, 0x8000, 0x8000, 0x25, ...)
/var/tmp/portage/app-emulation/docker-0.7.1/work/gopath/src/github.com/dotcloud/docker/utils/tarsum.go:108 +0x7d5
# Metadata
FROM ubuntu:quantal
MAINTAINER Jonathan Stoppani "jonathan.stoppani@wsfcomp.com"
# Setup environment
ENV DEBIAN_FRONTEND noninteractive
RUN /usr/sbin/locale-gen en_US.UTF-8 && \
/usr/sbin/update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
@GaretJax
GaretJax / mapping.py
Created November 28, 2013 09:20
Set fastrouter mapping (not tested)
import socket
import struct
ip = '127.0.0.1'
port = 5005
payload = {
'key': '',
'address': '',
}
\documentclass[10pt,a4paper]{article}
\usepackage{pgfplots}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\begin{axis}[]
\addplot [domain=-10:10, samples=101]{cosh(x)^2};
\end{axis}
@GaretJax
GaretJax / index.html
Last active December 17, 2015 11:49
Clone this repo to a local folder, cd to the folder and run `twistd -ny server.py`, then go to http://127.0.0.1:8888
<html>
<head>
<title>WebSocket Test Page</title>
</head>
<body>
<h1>Websocket test page</h1>
<script src="http://code.jquery.com/jquery-1.9.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
loadTasks = (server) ->
collector = $(this)
uuid = collector.data('uuid')
container = $('.tasks', collector)
server.call('getTasksForCollector', uuid).done (tasks) ->
$.each(tasks, (i, data) ->
Task.fromData(data).appendTo(container)
)
checkComplete(collector)
@GaretJax
GaretJax / git.py
Last active December 17, 2015 10:39
Simple setup for gitolite
@task
def setup_gitolite():
# We know this one from C{braid}...
users.create_service_user(USERNAME)
# We need ~/bin on PATH, this is where gitolite installs its executables,
# this can be made more specific to the git user.
put(StringIO('PATH=${HOME}/bin:${PATH}'), '/etc/profile.d/40-user-bin.sh',
use_sudo=True, mode=0644)
@GaretJax
GaretJax / dump-trac.py
Last active December 15, 2015 13:09
Dumps a Trac database to a compressed sql file by excluding tables containing sensitive data, such as session cookies. Only works on Trac instances using a postgres database.
#!/usr/bin/env python
"""
Dumps a Trac database to a compressed sql file by excluding tables
containing sensitive data, such as session cookies.
Only works on Trac instances using a postgres database.
Usage: trac-env.py <projenv> <outfile>
projenv: path to Trac's environment directory
@GaretJax
GaretJax / gist:3783042
Created September 25, 2012 16:42
HID Device to UDP
#import <Foundation/Foundation.h>
#import <IOKit/hid/IOHIDManager.h>
#import <IOKit/hid/IOHIDUsageTables.h>
#define KEYS 4
static void Handle_InputCallback(void *inContext, IOReturn inResult, void *inSender, IOHIDValueRef value)
{
IOHIDElementRef elem = IOHIDValueGetElement(value);
@GaretJax
GaretJax / gist:3314801
Created August 10, 2012 15:01
Reload Django CMS URLs
import sys
from django.core.urlresolvers import clear_url_caches
from django.conf import settings
from cms.appresolver import clear_app_resolvers
def reload_urls():
clear_app_resolvers()