Skip to content

Instantly share code, notes, and snippets.

@ChadSki
ChadSki / gist:847c99f4342e51541ba5
Last active August 29, 2015 14:08
Rob Pike Interview Excerpt
Interviewer:

Recently on the Google Labs Aptitude Test there was a question: "What's broken with Unix? How would you fix it?"

What would you have put?

Rob Pike:

Ken Thompson and I started Plan 9 as an answer to that question. The major things we saw wrong with Unix when we started talking about what would become Plan 9, back around 1985, all stemmed from the appearance of a network. As a stand-alone system, Unix was pretty good. But when you networked Unix machines together, you got a network of stand-alone systems instead of a seamless, integrated networked system. Instead of one big file system, one user community, one secure setup uniting your network of machines, you had a hodgepodge of workarounds to Unix's fundamental design decision that each machine is self-sufficient.

Nothing's really changed today. The workarounds have become smoother and some of the things we can do with networks of Unix machines are pretty impressive, but when ssh is the foundation of your security architecture, you

@mbklein
mbklein / restart_masterfile.rb
Last active August 29, 2015 14:04
How to restart a hung MasterFile in Matterhorn
empty = ActiveFedora::SimpleDatastream.xml_template.to_xml
mf = MasterFile.find(pid) # Load the MasterFile.
if mf.workflow_id.present?
begin
Rubyhorn.client.stop(mf.workflow_id) # Stop the existing workflow.
rescue # Keep going even if stopping the workflow fails.
end # This means there might be more cleanup later.
end
mf.mhMetadata.content = empty # Remove all Matterhorn-related fields.
# ensure plugins are loaded
if len(plugin_classes) == 0:
load_plugins()
def load_map(map_path=None):
"""Loads a map from Halo.exe's memory, or from disk if given a filepath. Loading a
map requires that plugins have already been loaded.
"""
# end result, constructed now (because we need the reference) but init'd at the end
halomap = HaloMap()
@ChadSki
ChadSki / FieldControlSelector.cs
Last active August 29, 2015 14:01
Databinding to Dynamic Objects?
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using Quickbeam.Low;
namespace MetroIde.Controls.MetaEditor
{
public class FieldControlSelector : DataTemplateSelector
{
@kavu
kavu / example.go
Created September 28, 2013 10:01
Minimal Golang + Cocoa application using CGO. Build with `CC=clang go build`
package main
/*
#cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Cocoa
#import <Cocoa/Cocoa.h>
int
StartApp(void) {
[NSAutoreleasePool new];
@tomas-stefano
tomas-stefano / Capybara.md
Last active May 2, 2024 05:16
Capybara cheatsheet

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above
@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
@afeld
afeld / gist:5704079
Last active November 27, 2023 15:43
Using Rails+Bower on Heroku
@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
#!/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