Skip to content

Instantly share code, notes, and snippets.

View rodjek's full-sized avatar
👓
Looking for work

Tim Sharpe rodjek

👓
Looking for work
View GitHub Profile
-module(bsearch).
-export([find/2]).
find(List, Value_to_find) ->
Max = lists:max(List),
Min = lists:nth(1, List),
case Value_to_find of
_ when Value_to_find > Max -> {error, toobig};
_ when Value_to_find < Min -> {error, toosmall};
aoeu
#00EA
define selinux_login($identity, $ensure="present") {
if $ensure == "present" {
exec { "Mapping ${name} to the ${identity} SELinux identity":
command => "semanage login -a -S targeted -s ${identity} -r s0 ${name}",
unless => "semanage login -l | grep \"${name}\" | grep \"${identity}\"",
}
} else {
exec { "Removing ${name} from the ${identity} SELinux identity":
command => "semanage login -d ${name}",
onlyif => "semanage login -l | grep \"${name}\" | grep \"${identity}\"",
require 'formula'
class Augeas <Formula
url 'http://augeas.net/download/augeas-0.7.3.tar.gz'
homepage 'http://augeas.net'
md5 'd907943fc21c2d1db5dc8d97ec02a9e5'
# depends_on 'cmake'
def install
user, project = ARGV # 'tobi', 'liquid'
`git clone git@github.com:#{user}/#{project}/wiki.git && find wiki -type f -exec cat {} >> github_wiki_pages.txt\;`
#!/usr/bin/env python
import sys
import time
import subprocess
import math
import os
import syslog
import signal
ruscio
@rodjek
rodjek / sysctl.spec.rb
Created July 17, 2011 00:30
RSpec for Puppet manifests
require 'puppet-rspec'
RSpec.configure do |c|
c.include PuppetRSpec
end
describe 'sysctl' do
let(:node) { 'testhost.example.com' }
let(:name) { 'baz' }
let(:params) { { :value => 'foo' } }
# Create a new fact named console_deployed_version
Facter.add("console_deployed_version") do
# Run svn info on /usr/local/dwalu/app to pull the deployed version and put it into a fact.
setcode do
`svn info /usr/local/dwalu/app --config-dir=/tmp/.subversion | grep Revision | sed 's/.*:.//g'`.chomp
end
end