Skip to content

Instantly share code, notes, and snippets.

@dims
dims / gist:f4efd63af8b2216dff0e
Created December 22, 2014 03:30
fwd docker unix socket via ssh
sudo socat "UNIX-LISTEN:/var/run/docker.sock,reuseaddr,fork" EXEC:'ssh -i /Users/dims/.ssh/id_dsa dims@192.168.1.30 socat STDIO UNIX-CONNECT\:/var/run/docker.sock'
@dims
dims / gist:c3327f633c526847c8e5
Created December 22, 2014 13:20
simple docker-py client to stream logs
import docker
base_url = 'unix://var/run/docker.sock'
print(">>>>>> CLIENT")
client = docker.Client(base_url=base_url,
version='1.14',
timeout=10)
print(">>>>>> CLIENT LOGS")
log_stream = client.logs('20ce0b3c8f5d', stream=True)
@dims
dims / gist:2f56a64f5460b79f0a6c
Created December 31, 2014 16:23
verbose unix socket redirect using socat
sudo socat -x -v -d -d "UNIX-LISTEN:/var/run/docker2.sock,reuseaddr,fork" "UNIX-CONNECT:/var/run/docker.sock"
@dims
dims / gist:2ba347b79da3ccdc882a
Created February 12, 2015 17:49
Scan the Nova "In Progress" Launchpad bugs for abandoned reviews
#!/usr/bin/env python
from launchpadlib import uris
from launchpadlib.launchpad import Launchpad
def get_abandoned_bugs(projects=None):
if projects is None:
projects = [
'nova'
#!/usr/bin/python
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@dims
dims / app.conf
Last active August 29, 2015 14:17
Quick oslo.config example for testing
#/etc/my.conf
[DEFAULT]
###########
# Logging #
###########
# syslog server configuration (default port(UDP): 514)
# NOTE: Following logging configuration can be left as is for logs to come on UI
syslog_host=127.0.0.1
@dims
dims / app.py
Created March 17, 2015 14:19
oslo.config + oslo.log sample
import sys
from oslo.config import cfg
from oslo_log import log as oslo_logging
CONF = cfg.CONF
CONF.register_opt(cfg.StrOpt('NODE_NAME'), cfg.OptGroup('HA'))
def main():
oslo_logging.register_options(CONF)
CONF(sys.argv[1:], default_config_files=['app.conf'])
set -x
git fetch origin
git checkout -b $1
git branch -u $1
git branch --set-upstream-to=origin/$1 $1
git reset --hard origin/$1
git pull
@dims
dims / moose.svg
Created May 6, 2015 16:35
moose.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.