Skip to content

Instantly share code, notes, and snippets.

@thomo
thomo / env.rb
Created August 12, 2010 08:50
Environment file for cucumber + couchapp. Use test db defined in .couchapprc for feature run.
require 'rubygems'
require 'culerity'
require 'cucumber/formatter/unicode'
require 'restclient'
require 'couchrest'
def read_couchapprc
json = ""
File.open(File.join(APP_PATH, ".couchapprc")).each { |line| json << line }
JSON.parse(json)
@thomo
thomo / .couchapprc
Created August 12, 2010 20:07
Example .couchapprc (couchapp, couchdb)
{
"env": {
"default": {
"db-example": "http://user:pass@localhost:5984/myapp-dev",
"db": "http://192.168.111.1:5984/rem-dev"
},
"test": {
"db": "http://localhost:5984/rem-test"
},
"production": {
@thomo
thomo / glossary.json
Created September 13, 2015 17:24
Example of a glossary file in json format
{
"a" : "first character",
"b" : "second character"
}
@thomo
thomo / glossary - md
Last active September 13, 2015 17:31
Jekyll code to generate a glossary
Example data like: https://gist.github.com/ThoMo/fb3cb24dc8d14a53af97
<table>
<thead><tr><th>Term</th><th>Description</th></tr></thead>
<tbody>
{% assign gs = site.data.glossary | sort:[0] %}
{% for kv in gs %}
<tr> <td>{{ kv[0] }} </td><td> {{ kv[1] }} </td></tr>
{% endfor %}
</tbody>
@thomo
thomo / gist:0660419b9d34e72d7707
Created September 24, 2015 21:52
command line to start CentOS7 vbox with vagrant
vagrant init puppetlabs/centos-7.0-64-nocm; vagrant up --provider virtualbox
@thomo
thomo / gist:971369
Created May 13, 2011 21:45
Convert .ogg to .mp3
find . -name *.ogg | while read xxx
> do
> oggdec -o - "$xxx"| lame -h -V 4 --vbr-new - "$(dirname "$xxx")/$(basename "$xxx" .ogg).mp3"
> done
@thomo
thomo / Dockerfile
Last active September 26, 2015 09:32
Ansible docker image based on CentOS7
FROM centos:7
MAINTAINER Thomas Mohaupt "Thomas.Mohaupt@gmail.com"
ENV UPDATED_AT=2015-09-26
RUN echo "deltarpm=0" >> /etc/yum.conf
RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
RUN yum -y install epel-release
@thomo
thomo / bootstrap.yml
Last active September 26, 2015 11:12
---
- name: Bootstraping new servers
hosts: newhosts
remote_user: root
@thomo
thomo / programmer-patch.txt
Created February 12, 2012 17:50
Arduino STK500v2 Serial patch
#
# /Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/programmer.txt
#
stk500v2.name=AVRISPv2/STK500v2 (serial)
stk500v2.communication=serial
stk500v2.protocol=stk500v2
@thomo
thomo / avrnetio_udpsend.ino
Created July 8, 2012 12:59
A demo of sending udp packets, using Pollin AVR NETIO board, Arduino 1.0.1, avr-netino project
//
// Environment: Pollin AVR NETIO board, Arduino 1.0.1, avr-netino (https://code.google.com/p/avr-netino/)
//
// This is a demo of sending udp packets
// 2012-07-08 <Thomas.Mohaupt@gmail.com> http://creativecommons.org/licenses/by-sa/3.0/
// Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
//
// On destination site you can receive the packets e.g. with
// nc -4ul 7777
//