Skip to content

Instantly share code, notes, and snippets.

View prologic's full-sized avatar
👋
Principal SRE, Founder of Yarn.social and Salty.im

James Mills prologic

👋
Principal SRE, Founder of Yarn.social and Salty.im
View GitHub Profile
@prologic
prologic / gist:8929120
Last active August 29, 2015 13:56 — forked from philips/gist:7555876

Add a local docker unit file

Create a file called /media/state/units/docker-local.service that has the following contents:

[Unit]
Description=docker local

[Service]
PermissionsStartOnly=true
@prologic
prologic / setup-docker.sh
Last active August 29, 2015 13:56
A quick script to setup a Docker environment against an already running and properly configured Docker host with some nice containers setup for you ready to go :)
#!/bin/bash
# Sets up a Docker Environment with the following components:
#
# - skydns (https://index.docker.io/u/crosbymichael/skydns/)
# - skydock (https://github.com/crosbymichael/skydock)
# - hipache (https://index.docker.io/_/hipache/)
self=$(basename ${0})
@prologic
prologic / gist:9240426
Created February 26, 2014 22:48
Issue #4080
$ ssh vz1.nectar
Last login: Thu Feb 13 05:08:53 UTC 2014 from pc031986.staff.ad.griffith.edu.au on ssh
______ ____ _____
/ ____/___ ________ / __ \/ ___/
/ / / __ \/ ___/ _ \/ / / /\__ \
/ /___/ /_/ / / / __/ /_/ /___/ /
\____/\____/_/ \___/\____//____/
core@vz1 ~ $
core@vz1 ~ $ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
@prologic
prologic / Terminal Output
Created March 17, 2014 00:30
supervisor playing up on a CentOS 5.4 x86_64 VM
[root@terranova ~]# cat test.py
#!/usr/local/bin/python
import sys
sys.path[0:0] = [
'/mnt/opt/plone/ccaih-buildout/eggs/supervisor-3.0-py2.7.egg',
'/mnt/opt/plone/ccaih-buildout/eggs/meld3-0.6.10-py2.7.egg',
'/mnt/opt/plone/ccaih-buildout/eggs/setuptools-2.2-py2.7.egg',
]
@prologic
prologic / build.log
Created May 8, 2014 00:45
go 1.2.1 tests fails on crux 3.1
# pkgmk -d -kw
=======> Building '/usr/ports/contrib/go/go#1.2.1-3.pkg.tar.gz'.
bsdtar -p -o -C /usr/ports/contrib/go/work/src -xf /usr/ports/contrib/go/go1.2.1.src.tar.gz
cp golang.sh /usr/ports/contrib/go/work/src
+ build
+ cd /usr/ports/contrib/go/work/src/go/src
+ export GOROOT_FINAL=/usr/lib/go
+ GOROOT_FINAL=/usr/lib/go
+ export GOROOT=/tmp/go/
+ GOROOT=/tmp/go/
@prologic
prologic / build.log
Created May 8, 2014 00:48
bridge-utils 1.5 fails to build on crux 3.1
# pkgmk -d -kw
=======> Building '/usr/ports/contrib/bridge-utils/bridge-utils#1.5-1.pkg.tar.gz'.
bsdtar -p -o -C /usr/ports/contrib/bridge-utils/work/src -xf /usr/ports/contrib/bridge-utils/bridge-utils-1.5.tar.gz
+ build
+ cd bridge-utils-1.5
+ autoconf
+ ./configure --prefix=/usr --mandir=/usr/man
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
@prologic
prologic / search.sparql
Created May 8, 2014 01:47
[SAPRQL]: Find all Graphs with cs:subjectOfChange
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX cs: <http://purl.org/vocab/changeset/schema#>
SELECT DISTINCT ?item WHERE {
GRAPH ?g {
?item a cs:subjectOfChange .
}
}
@prologic
prologic / gist:0be92b0ce6d6b7fc8091
Created May 12, 2014 05:36
Changing the modified tiem of a directory on POSIX systems
>>> from os import mkdir
>>> from os.path import getmtime
>>> mkdir("foo")
>>> getmtime("foo")
1399872726.0
>>> from os import utime
>>> utime("foo", None)
>>> getmtime("foo")
1399872755.0
#!/usr/bin/env python
class Node(object):
def __init__(self, parent, obj):
self.parent = parent
self.next = None
self.obj = obj
@prologic
prologic / pbot.py
Created May 19, 2014 03:06
Pico IRC Bot using circuits in 24 Lines of Code.
from circuits import Component
from circuits.net.sockets import TCPClient, connect
from circuits.net.protocols.irc import IRC, PRIVMSG, USER, NICK, JOIN, RPL_ENDOFMOTD, ERR_NOMOTD # noqa
class PBot(Component):
def init(self, host, port=6667):
self.target = (host, port)
self += (TCPClient() + IRC())