Skip to content

Instantly share code, notes, and snippets.

@thomo
thomo / avr_net_io.ino
Created July 5, 2013 21:40
LED Matrix Arduino program (TLMM501B connected to Pollin AVR NET IO with AVR-NETIO Arduino clone)
int redPin = 0;
int greenPin = 1;
int resetPin = 4;
int selectPin = 5;
int brightPin = 3;
int clockPin = 2;
int offset = 0;
int bufferCol = 0;
@thomo
thomo / matrix.pde
Created July 5, 2013 21:43
Processing example to generate led matrix content and send data via serial line
import processing.serial.*;
// 2D Array of objects
DrawCell[][] grid;
Cell[] buffer;
Serial myPort;
// Number of columns and rows in the grid
int cols = 16;
@thomo
thomo / gist:7785978
Created December 4, 2013 11:16
My Eclipse Favorites
org.hamcrest.core
org.hamcrest.MatcherAssert
org.hamcrest.Matchers
org.mockito.Mockito
@thomo
thomo / pi-pir.py
Last active January 3, 2016 17:21
Raspberry PI - read a PIR sensor
#-------------------------------------------------------------------------------
# Copyright (c) 2015, Thomas Mohaupt <Thomas.Mohaupt@gmail.com>
# All rights reserved.
#
# This is a BSD 2-Clause license,
# see http://opensource.org/licenses/bsd-license.php
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
@thomo
thomo / build-wlan-module.sh
Last active March 13, 2020 12:46
Bash script to build a Broadcom Wireless kernel module for CentOS 7 using a Docker container - see http://wiki.centos.org/HowTos/Laptops/Wireless/Broadcom
#!/bin/sh
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SDIR=${DIR}/src
DRIVER_SRC=`ls ${DIR}/hybrid*.tar.gz 2> /dev/null`
CONTAINER="thomo/centos7-dev:latest"
MYUID=`id -u`
MYGID=`id -g`
@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 / 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 / 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 / bootstrap.yml
Last active September 26, 2015 11:12
---
- name: Bootstraping new servers
hosts: newhosts
remote_user: root