Skip to content

Instantly share code, notes, and snippets.

View srenatus's full-sized avatar
🍉

Stephan Renatus srenatus

🍉
View GitHub Profile
@srenatus
srenatus / mock.rb
Last active August 29, 2015 13:57
how about that?
iter my_array do |it|
execute "git fetch -p" do
cwd path_for(it)
end
end
# ---> with my_array = %(foo bar), this should lead to
execute "foo: git fetch -p" do
command "git fetch -p"
@srenatus
srenatus / Berksfile
Created April 1, 2014 13:15
A somewhat githubby Berksfile
site :opscode
%w(
poise/poise
poise/poise-ruby
gofullstack/backup-cookbook
stackforge/cookbook-openstack-common
phlipper/chef-percona
).each do |github|
name = github.split('/').last
# Description:
# Add entries to trello directly from hubot
#
# Dependencies:
# "node-trello": "0.1.2"
#
# Configuration:
# HUBOT_TRELLO_KEY - your trello developer key
#
# Commands:
@srenatus
srenatus / chefdiff
Last active August 29, 2015 14:02
Chefdiff, executing a diff between the latest (chef) backup and the file in its usual location. Can be used with relative paths, e.g. `cd /etc; chefdiff my/files.conf`.
#!/opt/chef/embedded/bin/ruby
#
# Copyright (C) 2014 x-ion GmbH
#
# 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
#
@srenatus
srenatus / WHY.md
Created October 14, 2014 14:20
minimal cabal config for stackage

With only line #1, you end up with cabal update returning

Downloading the latest package list from stackage
cabal: fromFlag NoFlag. Use fromFlagOrDefault
@srenatus
srenatus / Dockerfile
Created June 22, 2015 08:35
spack/llvm problem
FROM debian:jessie
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends curl ca-certificates \
python git build-essential && \
apt-get clean
@srenatus
srenatus / docker volume tests
Created September 4, 2015 12:36
start a container from a container, with volumes.
docker@boot2docker:~$ pwd
/home/docker
docker@boot2docker:~$ docker run -it -v $(pwd)/foo:/foo -v /var/run/docker.sock:/var/run/docker.sock sse/jenkins bash
jenkins@ccfdbe3ccaac:/$ ls /foo/
bar foofoo
jenkins@ccfdbe3ccaac:/$ docker run -it -v /home/docker/foo/bar:/bar debian:jessie bash # <-- /!\
root@be6343378d9a:/# ls /bar
baz
root@be6343378d9a:/# date > /bar/bar
root@be6343378d9a:/# exit
@srenatus
srenatus / console log
Created September 9, 2015 06:57
panic (boot2docker, win7, msys2)
$ winpty docker run -it debian:jessie bash
root@d3c36743f062:/# tput rc
oot@d3c36743f062:/# panic: runtime error: slice bounds out of range
goroutine 12 [running]:
bufio.(*Reader).fill(0xc08208a300)
/usr/local/go/src/bufio/bufio.go:86 +0x2e2
bufio.(*Reader).WriteTo(0xc08208a300, 0x3624f0, 0xc08200ab90, 0x3b, 0x0, 0x0)
/usr/local/go/src/bufio/bufio.go:449 +0x285
io.Copy(0x3624f0, 0xc08200ab90, 0x364738, 0xc08208a300, 0x0, 0x0, 0x0)
@srenatus
srenatus / Dockerfile
Last active September 9, 2015 10:33
htaccess test drive for crowd-funding (multilang); with docker installed: `docker build -t cf .; docker run -p 8080:80 cf`, then access http://127.0.0.1:8080
FROM ruby:2.1-onbuild
# execjs needs some js engine
RUN apt-get update && apt-get install -y --no-install-recommends nodejs apache2
# jekyll needs this
ENV LANG C.UTF-8
# "configure" apache
RUN sed -i 's#/var/www/html#/usr/src/app/build#' /etc/apache2/sites-enabled/000-default.conf
@srenatus
srenatus / 20601.json
Created October 2, 2015 12:00
betterplace JSON
{
"id": 20601,
"created_at": "2014-07-21T16:19:26+02:00",
"updated_at": "2015-10-02T13:48:36+02:00",
"latitude": 52.36701189999999,
"longitude": 13.09298250000006,
"street": "",
"zip": "14478",
"city": "Potsdam",
"country": "Deutschland",