Skip to content

Instantly share code, notes, and snippets.

@cjcolvar
cjcolvar / gist:5620930
Created May 21, 2013 15:57
XACML policy combining algorithms (as described in some IBM documentation not the OASIS standard)
From the Dependent Policies Combining list, select the policy combining algorithm.
Deny Overrides
The deny-overrides policy-combining algorithm evaluates each policy in the order that it appears in the XACML policy set. If any policy in the set evaluates to deny, the policy combination evaluates immediately to deny. In other words a single deny takes precedence over other policy evaluations. If all policies are determined to be NotApplicable, the policy combination evaluates to NotApplicable.
First Applicable
(Default) The first-applicable policy combining algorithm evaluates each policy in the order that it appears in the XACML policy set. For an individual policy, if the target (resource) evaluates to TRUE and the policy conditions evaluate unambiguously to permit or deny, evaluation is immediately halted, and the policy combination evaluates to the effect of that individual policy. If the individual policy evaluates the target as FALSE or the policy conditions as NotApplicable, then the next poli
@mbklein
mbklein / upgrade_avalon.sh
Created August 28, 2013 17:08
Avalon upgrade instructions in progress
# solr
cd /usr/local/solr/avalon/conf/
rm -f *.txt *.html
curl -s -O https://raw.github.com/avalonmediasystem/avalon/feature/VOV-1872/solr_conf/conf/solrconfig.xml
curl -s -O https://raw.github.com/avalonmediasystem/avalon/feature/VOV-1872/solr_conf/conf/schema.xml
curl "http://localhost:8983/solr/admin/cores?action=RELOAD&core=avalon"
# fedora
CATALINA_HOME=/usr/local/tomcat FEDORA_HOME=/usr/local/fedora /usr/local/fedora/server/bin/fedora-rebuild.sh
# Answer "2" to the first prompt and "1" to the second
#!/usr/bin/env ruby
#------------------------------------------------------------------------------
# Aggregate Print useful information from /proc/[pid]/smaps
#
# pss - Roughly the amount of memory that is "really" being used by the pid
# swap - Amount of swap this process is currently using
#
# Reference:
# http://www.mjmwired.net/kernel/Documentation/filesystems/proc.txt#361
@bemasher
bemasher / intput.txt
Created July 10, 2012 12:51
Named Binary Tag parser written in Golang using reflection to populate native types.
// This is the structure of the binary nbt file
TAG_Compound('Level') {
TAG_Compound('nested compound test') {
TAG_Compound('egg') {
TAG_String('name'): 'Eggbert'
TAG_Float('value'): 0.5
}
TAG_Compound('ham') {
TAG_String('name'): 'Hampus'
TAG_Float('value'): 0.75
@decent-dev
decent-dev / slots-testnet-setup-instructions.md
Last active February 21, 2018 16:08
Instructions to setup a local Rinkeby node and run Decent.bet's Slots Testnet

Decent.bet Slots Testnet Instructions

The decent.bet slots runs on the Rinkeby test network. Users are given options to use Infura's mainnet nodes or their local Geth node.

You can access the testnet by visiting the following URL: https://slots-testnet.decent.bet/

If you'd like to use your own local Geth node, follow the instructions below. For Mac OSX, you could follow our tutorial video. Otherwise, skip to the usage instructions

Setting up a local Rinkeby node

@kostecky
kostecky / capistrano_haproxy_rolling_deploy.rb
Last active March 26, 2018 20:10
Capistrano rolling deploy with haproxy
# Create a map of the deploy server to the haproxy label
server 'A.A.A.A', proxy_label: 'server-01'
server 'B.B.B.B', proxy_label: 'server-02'
# Define our puppet proxy server(s) and role
server 'C.C.C.C', no_release: true, roles: [:proxy]
# We need to override deploy:symlink:linked_dirs
# No way around it - override deploy:symlink:release and rewrite it for rolling deploys
Rake::Task["deploy:symlink:release"].clear_actions
@bemasher
bemasher / Castle.xml
Created September 18, 2011 03:46
Example of parsing xml in golang.
<?xml version="1.0" encoding="UTF-8" ?>
<Data>
<Series>
<id>83462</id>
<Actors>|Nathan Fillion|Stana Katic|Molly C. Quinn|Jon Huertas|Seamus Dever|Tamala Jones|Susan Sullivan|Ruben Santiago-Hudson|Monet Mazur|</Actors>
<Airs_DayOfWeek>Monday</Airs_DayOfWeek>
<Airs_Time>10:00 PM</Airs_Time>
<ContentRating>TV-PG</ContentRating>
<FirstAired>2009-03-09</FirstAired>
<Genre>|Drama|</Genre>
@stephenwoodford
stephenwoodford / sphinx.rb
Created November 1, 2018 20:05 — forked from korny/sphinx.rb
Sphinx Homebrew formula for MySQL 5.7
class Sphinx < Formula
desc "Full-text search engine"
homepage "http://www.sphinxsearch.com"
url "http://sphinxsearch.com/files/sphinx-2.2.11-release.tar.gz"
sha256 "6662039f093314f896950519fa781bc87610f926f64b3d349229002f06ac41a9"
head "https://github.com/sphinxsearch/sphinx.git"
bottle do
sha256 "b890cf523db9777c7d125842fd6b0a53fe9a7a5a4cb816389ba6f5ee6483c78d" => :high_sierra
sha256 "55ce34bdedf13946fa614bde50839d93135eae720f1021e2c87807d04515ab18" => :sierra
@elutz
elutz / controller.js
Created November 27, 2012 08:56
File Upload with AngularJS & File-Upload jQuery Plugin
function AttachmentCtrl($scope, $location, $timeout, Docs) {
$(function() {
$('#detail-form-doc').fileupload({
dataType: 'json',
url: '/angular-ib/app/fileupload?id=' + $location.search().id,
add: function(e, data) {
$scope.$apply(function(scope) {
// Turn the FileList object into an Array
for (var i = 0; i < data.files.length; i++) {
$scope.project.files.push(data.files[i]);
@ahoward
ahoward / net-http-debug.rb
Created December 10, 2010 20:06
a simple way to debug tons of libs that use ruby's net/http
BEGIN {
require 'net/http'
Net::HTTP.module_eval do
alias_method '__initialize__', 'initialize'
def initialize(*args,&block)
__initialize__(*args, &block)