Skip to content

Instantly share code, notes, and snippets.

Avatar

Soenke Ruempler s0enke

View GitHub Profile
@s0enke
s0enke / test.rb
Created May 16, 2014
trying to merge a `let` from included context
View test.rb
require 'rspec'
shared_context 'test' do
let(:something) {['something']}
end
describe 'something' do
include_context 'test'
let(:something) { super().merge(['another']) }
@s0enke
s0enke / gist:746b8c235ce1c0d7ef10
Created Jun 14, 2014
Problem with raspbian and german umlauts
View gist:746b8c235ce1c0d7ef10
soenke♥kellerautomat:~$ ssh xbian@mediarasp1
------------------------------------------------------------------
Y88b d88P 888888b. 8888888 d8888 888b 888
Y88o88P 888 .88P 888 d88P888 88888b 888
Y888P 8888888K. 888 d88P 888 888Y88b 888
d888b 888 "Y88b 888 d88P 888 888 Y88b888
d88P Y88b 888 d88P 888 d8888888888 888 Y8888
d88P Y88b 8888888P" 8888888 d88P 888 888 Y888
------------------------------------------------------------------
XBian v1.0B2 - XBMC on the Raspbery Pi, Bleeding Edge, 2012 - 2013
@s0enke
s0enke / beeds.md
Last active Aug 29, 2015
starting bees
View beeds.md
bees up --group=bees-load-testing -k soenke -i  ami-f6b11181 -z eu-west-1c -l ubuntu -s 50 -t m1.small
parallel-ssh -O 'StrictHostKeyChecking=No' -h <(aws ec2 describe-instances --filters "Name=tag-key,Values=Name,Name=tag-value,Values=a bee!" | grep ec2- | cut -d'"' -f4 | sed -e 's/^/ubuntu@/g') sudo apt-get -y install apache2-utils

increase open file limits for apache bench

@s0enke
s0enke / elasticache_replication_group.py
Created Dec 21, 2014
Skeleton of an Ansible module for ElastiCache replication groups
View elasticache_replication_group.py
#!/usr/bin/python
import sys
import os
import time
try:
import boto
from boto.elasticache.layer1 import ElastiCacheConnection
from boto.regioninfo import RegionInfo
@s0enke
s0enke / crashlog.txt
Last active Aug 29, 2015
terraform crash
View crashlog.txt
Crash Log:
```
2015/03/05 22:35:57 [INFO] Terraform version: 0.4.0 dev 9270af6dfad0264bbaf50d91b8bc20e4a65a95eb
2015/03/05 22:35:57 Detected home directory from env var: /home/soenke
2015/03/05 22:35:57 [DEBUG] Discoverd plugin: atlas = /home/soenke/projects/go/bin/terraform-provider-atlas
2015/03/05 22:35:57 [DEBUG] Discoverd plugin: aws = /home/soenke/projects/go/bin/terraform-provider-aws
2015/03/05 22:35:57 [DEBUG] Discoverd plugin: cloudflare = /home/soenke/projects/go/bin/terraform-provider-cloudflare
2015/03/05 22:35:57 [DEBUG] Discoverd plugin: cloudstack = /home/soenke/projects/go/bin/terraform-provider-cloudstack
2015/03/05 22:35:57 [DEBUG] Discoverd plugin: consul = /home/soenke/projects/go/bin/terraform-provider-consul
2015/03/05 22:35:57 [DEBUG] Discoverd plugin: digitalocean = /home/soenke/projects/go/bin/terraform-provider-digitalocean
View gist:641015
soenke@kellerautomat:~$ time ruby -e '999999.times do puts "yeah"; end' >/dev/null
real 0m0.730s
user 0m0.710s
sys 0m0.010s
soenke@kellerautomat:~$ time ruby -e 'puts "yeah" * 999999' >/dev/null
real 0m0.014s
user 0m0.010s
sys 0m0.000s
@s0enke
s0enke / test.php
Created Jun 15, 2011
Stubbing protected methods
View test.php
<?php
require 'PHPUnit/Framework/TestCase.php';
class CouchDB
{
public function doGeloet()
{
return $this->makeRequest();
}
@s0enke
s0enke / gist:1397483
Created Nov 27, 2011
gearman client endlessloop
View gist:1397483
gearman versions:
$ dpkg -l *gearman* | grep ^ii
ii gearman-job-server 0.13-1 Job server for the Gearman distributed job queue
ii gearman-tools 0.13-1 Tools for the Gearman distributed job queue
ii libgearman-dbg 0.13-1 Debug symbols for the Gearman Client Library
ii libgearman4 0.13-1 Library providing Gearman client and worker func
sometimes my gearman php client gets into an endless loop:
View gist:1923191
#!/bin/bash
while [ 1 ]
do
for (( i = 1 ; $i < 4 ; i++ ))
do
echo -e "Sw_on$i""user\x00\n" | nc -u -q 1 dev-steckdose01.jimdo.office 75
echo $i ON
sleep 0.5;
done
for (( i = 3 ; $i > 0 ; i-- ))