Skip to content

Instantly share code, notes, and snippets.

@appbakers
appbakers / extmap.clj
Created April 6, 2017 02:33 — forked from kriyative/extmap.clj
Extending Clojure Map with `deftype` and `defprotocol`
(ns extmap
(:import
[clojure.lang ILookup Associative]))
;; ----------------------------------------------------------------
;; TrackableMap is a persistent map which keeps track of the number of
;; times `get` was called on it.
(defprotocol Trackable
(getStats [self]))
@appbakers
appbakers / load-properties.gradle
Created February 1, 2017 01:17 — forked from groboclown/load-properties.gradle
An example gradle file for loading a hierarchy of properties from several locations in a well defined order. It also allows for the properties to be written as plain groovy scripts, and defined as closures so they can depend on other, overwritten properties.
/**
* load-properties.gradle
*
* USE: Include in your root project's `build.gradle` file:
*
* ```(groovy)
* apply from: "$rootDir/init/load-properties.gradle"
* ```
*
* Add a `$rootDir/init/categories.gradle` file to define which
@appbakers
appbakers / mod_cluster.conf
Created September 7, 2016 07:36 — forked from Karm/mod_cluster.conf
mod_cluster and ProxyPass, /static from httpd instance
# mod_proxy_balancer should be disabled when mod_cluster is used
LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
LoadModule slotmem_module modules/mod_slotmem.so
LoadModule manager_module modules/mod_manager.so
LoadModule advertise_module modules/mod_advertise.so
# Set to some _local_ place (absolute path), definitely not an NFS...
MemManagerFile /home/mbabacek/EAP6/cache/mod_cluster
ServerName 127.0.0.1:8888
@appbakers
appbakers / .gitconfig
Created July 5, 2016 02:15 — forked from robmiller/.gitconfig
Some useful Git aliases that I use every day
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"
@appbakers
appbakers / apache.conf
Created July 4, 2016 02:28 — forked from josephj/apache.conf
Inject livereload.js from server setting. Also use https://github.com/jaytaph/htrouter
AddOutputFilterByType SUBSTITUTE text/html
Substitute "s|</body>|<script src=\"//localhost:35729/livereload.js\"></script>\n</body>|i"
@appbakers
appbakers / inst-jdk7.ps1
Last active April 18, 2016 03:57 — forked from carlcantprogram/gist:42fbecb399af7e8ce4c0
Oracle JDK7 Download Install powershell
# TODO: templating java version
# $java_version_major=7
# $java_version_minor=79
# $java_version_build=15
if( [Environment]::Is64BitProcess ) { $java_version_arch = 'x64' }
else { $java_version_arch = 'i586' }
$url = "http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-windows-$java_version_arch.exe"
$storageDir = $pwd
$filename = $url.Substring($url.LastIndexOf("/") + 1);
$file = "$storageDir\$filename" ;
@appbakers
appbakers / default.txt
Created April 17, 2016 04:52 — forked from CHEF-KOCH/default.txt
All Windows sc (services) commands (7 - 10)
Net user administrator /active:yes
REM Application Experience
sc config AeLookupSvc start= auto
REM Application Information
sc config Appinfo start= demand
REM Application Layer Gateway Service
sc config ALG start= demand
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\010103000F0000F00100000
00F0000F0C967A3643C3AD745950DA7859209176EF5B87C875FA20DF21951640E807D7C24]
"Category"=-

Setup modern.ie vagrant boxes

Since modern.ie released vagrant boxes, it' no longer necessary to manually import the ova file to virtualbox, as mentioned here.

However, the guys at modern.ie didn't configured the box to work with WinRM. This how-to addresses that, presenting steps to proper repackage these boxes, adding WinRM support. Additionally configures chocolatey package manager and puppet provisioner.

Pre-requisites

@appbakers
appbakers / msys_hetzner-etc_network_interfaces
Created March 19, 2016 11:08 — forked from jpawlowski/msys_hetzner-etc_network_interfaces
Debian network configuration for Proxmox VE server running on a Hetzner host
# /etc/network/interfaces
#
auto lo
iface lo inet loopback
# device: eth0
iface eth0 inet manual
# IPv4 bridge
# (connect ONLY your firewall/router KVM instance here, this is the WAN device!)