Skip to content

Instantly share code, notes, and snippets.

View rynr's full-sized avatar

Rainer Jung rynr

View GitHub Profile
@rynr
rynr / prompt_command
Last active March 14, 2016 14:48
Java Environment by project
#!/bin/sh
#
# To enable this, add the following line to your ´.bashrc`:
# export PROMPT_COMMAND="source $HOME/bin/prompt_command"
#
# The variable `PROMPT_COMMAND` is used to execute some bash code
# before any prompt.
# If you need different environments for different projects and have
# your projects grouped with a main directory like the following:
#
@rynr
rynr / Makefile
Last active February 11, 2024 19:03
Makefile for avr-g++
# Makefile for AVR C++ projects
# From: https://gist.github.com/rynr/72734da4b8c7b962aa65
# ----- Update the settings of your project here -----
# Hardware
MCU = atmega32u4 # see `make show-mcu`
OSC = 16000000UL
PROJECT = example
@rynr
rynr / migrate.sh
Created November 6, 2014 08:55
Flyway Migration
mvn flyway:repair flyway:migrate \
-Dflyway.locations=filesystem:path/to/generic-ddl,filesystem:other/path/to/mandator \
-Dflyway.configFile=src/main/resources/flyway.properties
@rynr
rynr / coverage.html
Created August 1, 2014 09:25
Sonar Code-Monitor
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Sonar Project-Stats</title>
<meta name="viewport" content="width=device-width">
@rynr
rynr / Gemfile
Last active December 22, 2015 02:48
Send SMS-Alerts while in holiday to warn when auroras get possible
source 'https://rubygems.org/'
gem 'mechanize'
@rynr
rynr / create-mongo-rs.sh
Created August 30, 2013 13:50
Create a mongo-rs for testing
i=0
name=rs01
while [ $i -lt 3 ]
do let i=i+1
echo "Starting mongodb $i at Port 2222$i"
mkdir db$i
mongod --port 2222$i --fork --dbpath db$i --syslog --replSet $name
if [ $i -eq 1 ]
then echo "rs.initiate({_id: \"$name\", members: [{_id: 0, host: \"localhost:2222$i\"}]})" | mongo localhost:22221
@rynr
rynr / bashrc
Last active December 14, 2015 07:49
My configuration files
# Add some paths to PATH if available
for dir in /opt/*/bin \
$HOME/usr/bin \
$HOME/bin
do if [ -d $dir ]
then export PATH=$PATH:$dir
fi
done
# temporarily generate directory and chdir (requires pwgen)
@rynr
rynr / chat.css
Last active May 9, 2018 08:20
This is, how I would create a Web-Chat.
.chat-box { position: fixed; width: 225px; font-size: 11px; bottom: 0; }
.chat-box .info { background-color: #176789; color: #fff; padding: 7px; font-size: 11px; }
.chat-box .messages {
background-color: #fff;
padding: 7px;
font-size: 13px;
line-height: 1.3em;
overflow: auto;
border-right: 1px solid #ccc;
border-left: 1px solid #ccc;
@rynr
rynr / Status.java
Created July 24, 2012 21:44
Jackson-Mapping-Class for Jenkins JSON-API
import java.util.ArrayList;
public class Status {
private String nodeName;
private String nodeDescription;
private String description;
private String mode;
private Integer numExecutors;
private Boolean quietingDown;
@rynr
rynr / pre-commit
Created February 22, 2012 08:22
Ruby svn-hook to check Log for format
#!/usr/bin/env ruby
repo_path = ARGV[0]
transaction = ARGV[1]
svnlook = '/usr/bin/svnlook'
#commit_dirs_changed = `#{svnlook} dirs-changed #{repo_path} -t #{transaction}`
#commit_changed = `#{svnlook} changed #{repo_path} -t #{transaction}`
#commit_author = `#{svnlook} author #{repo_path} -t #{transaction}`.chop
commit_log = `#{svnlook} log #{repo_path} -t #{transaction}`