Skip to content

Instantly share code, notes, and snippets.

View yauh's full-sized avatar

Stephan Hochhaus yauh

View GitHub Profile
#!/bin/bash
#
# description: Script to start a meteor application through forever
# processname: forever/coffeescript/node
# pidfile: /var/run/forever-initd-meteor.pid
# logfile: /var/run/forever-initd-meteor.log
#
# Based on a script posted by
# https://github.com/hectorcorrea/hectorcorrea.com/blob/master/etc/forever-initd-hectorcorrea.sh
#
@yauh
yauh / play-mongo.yml
Created July 9, 2014 12:18
Ansible install mongo cluster
---
- hosts: mongodb
sudo: True
remote_user: droid
roles:
- role: mongo_mongod
mongod_datadir_prefix: "/data"
mongod_replication: true
@yauh
yauh / meteorlbsite.conf
Last active August 29, 2015 14:04
Nginx site configuration
upstream meteor_servers {
server 192.168.2.221:3000;
server 192.168.2.222:3000;
ip_hash;
}
server {
listen 80;
server_name meteorinaction.com;
return 301 https://www.meteorinaction.com$request_uri;
<head>
<title>simple</title>
</head>
<body>
{{> video}}
</body>
<template name="video">
<iframe width="420" height="315" src="//www.youtube.com/embed/y-sBROXalU4" frameborder="0" allowfullscreen></iframe>
@yauh
yauh / keybase.md
Created October 29, 2014 11:51
keybase.md

Keybase proof

I hereby claim:

  • I am yauh on github.
  • I am yauh (https://keybase.io/yauh) on keybase.
  • I have a public key whose fingerprint is 41EC 849A 98E1 8CB1 57D7 B447 3B96 0E44 E192 7CFE

To claim this, I am signing this object:

@yauh
yauh / fastcgi_param
Created October 30, 2014 07:59
Piwik HTTPS configuration with nginx
#/etc/nginx/fastcgi_param
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
<html>
<head>
<title>My Title</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<style>
#map {
height: 680px;
}
@yauh
yauh / client.js
Created March 27, 2015 12:14
prev and curr position
Tracker.autorun( function () {
currentPosition = Geolocation.currentLocation();
if (currentPosition === null) {
return;
}
else if (previousPosition === null) { // avoid previousPosition being null
previousPosition = currentPosition;
}
@yauh
yauh / update-commit-setting.sh
Created June 3, 2015 13:42
Update git commit count in settings.json
#!/bin/bash
# update-commit-setting.sh
# Usage: `update-commit-setting.sh [branch] [settings-file]`
BRANCH=${1:-'master'}
SETTINGS=${2:-'app/settings.json'}
BUILDNUMBER=$(expr $(git rev-list $BRANCH --count) - $(git rev-list HEAD..$BRANCH --count))
echo "Updating build number in $SETTINGS to $BUILDNUMBER using branch '$BRANCH'."
sed "s/\"git-commit-count\": [0-9]*/\"git-commit-count\": $BUILDNUMBER/g" $SETTINGS > tmp.json
@yauh
yauh / gist:8044583
Last active December 31, 2015 21:09
Try to explain what the first sub of https://gist.github.com/asciidisco/cb094eadfb4c590e2701 does
sub HMLAN_Initialize($) { # sub takes only one argument
my ($hash) = @_; # takes all arguments provided during the sub routine call and shoves them into $hash
require "$attr{global}{modpath}/FHEM/DevIo.pm"; # gets another perl module involved (need to check this for function definitions as well)
# Provider
$hash->{ReadFn} = "HMLAN_Read"; # basically assigns values to the attributes provided to the sub routine call
$hash->{WriteFn} = "HMLAN_Write";
$hash->{ReadyFn} = "HMLAN_Ready";
$hash->{SetFn} = "HMLAN_Set";