Skip to content

Instantly share code, notes, and snippets.

View mstrauss's full-sized avatar

Markus Strauss mstrauss

View GitHub Profile
## Synopsis
## ========
##
## Standalone R-Script to convert geostatistical population raster
## data (in CSV format) from Statistics Autria into MAT and CSV files.
##
## License
## =======
##
## Copyright (c) 2015 Markus Strauss
"""
This is a version of the Sprinkler Bayesian Network example from
https://healthyalgorithms.com/2011/11/23/causal-modeling-in-python-bayesian-networks-in-pymc/
translated from pymc to pymc3.
"""
from pymc3 import Model, Bernoulli, sample, traceplot
from pymc3.math import switch
from matplotlib.pyplot import savefig
@mstrauss
mstrauss / base64_decode.rb
Created October 19, 2012 17:30
Base64.decode one-liner
ruby -rbase64 -pe '$_ = Base64.decode64($_)+$/'
@mstrauss
mstrauss / gist:1643637
Created January 19, 2012 23:14
reset permissions on a Mac OS X user folder
### to reset permissions on a Mac OS X user folder:
# clear the immutable flag
sudo chflags -Rvv nouchg .
# remove ACLs and change owner to yourself
sudo chown -RN <your user name here> .
@mstrauss
mstrauss / gist:1226427
Created September 19, 2011 12:46
Recursevly clear the user immutable flag (Mac OS X)
chflags -R nouchg *
@mstrauss
mstrauss / gist:1217470
Created September 14, 2011 19:08
brew install -v fio
==> Downloading http://brick.kernel.dk/snaps/fio-1.37.tar.bz2
File already downloaded in /Users/markus/Library/Caches/Homebrew
/usr/bin/tar xf /Users/markus/Library/Caches/Homebrew/fio-1.37.tar.bz2
==> make -f Makefile.mac prefix=/usr/local/Cellar/fio/1.37 && make -f Makefile.mac prefix=/usr/local/Cellar/fio/1.37 install
make -f Makefile.mac prefix=/usr/local/Cellar/fio/1.37 && make -f Makefile.mac prefix=/usr/local/Cellar/fio/1.37 install
CC gettime.o
CC fio.o
CC ioengines.o
CC init.o
CC stat.o
@mstrauss
mstrauss / gist:1210476
Created September 12, 2011 02:34
Restore sudoers File on Mac OS after adversely deleting it :-(
do shell script "echo '%admin ALL=(ALL) ALL' > /etc/sudoers" with administrator privileges
@mstrauss
mstrauss / bootstrap-puppet.sh
Created August 24, 2011 19:20
Bootstrap Puppet on Debian/Ubuntu
#!/bin/sh
# Installs Puppet on a naked Debian Lenny/Squeeze, Ubuntu
GEMS_VERSION=1.8.17
PUPPET_VERSION="~>2.7.0"
if [ -n "$http_proxy" -a -z "$https_proxy" ]; then
echo "Have http_proxy but no https_proxy. Setting https_proxy to ${http_proxy}."
export https_proxy=$http_proxy
fi
@mstrauss
mstrauss / .emacs
Created February 19, 2011 17:30
my personal emacs prefs
(setq make-backup-files nil)
;; Interactively Do Things (highly recommended, but not strictly required)
(require 'ido)
(ido-mode t)
;; Rinari
(add-to-list 'load-path "~/.emacs.d/rinari")
(require 'rinari)
@mstrauss
mstrauss / Gemfile.lock
Created February 17, 2011 21:03
Gemfile.lock for Wagn 1.5.2 (use with Bundler)
GEM
remote: http://rubygems.org/
specs:
actionmailer (2.3.5)
actionpack (= 2.3.5)
actionpack (2.3.5)
activesupport (= 2.3.5)
rack (~> 1.0.0)
activerecord (2.3.5)
activesupport (= 2.3.5)