This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-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}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aoeu | |
#00EA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}\"", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user, project = ARGV # 'tobi', 'liquid' | |
`git clone [email protected]:#{user}/#{project}/wiki.git && find wiki -type f -exec cat {} >> github_wiki_pages.txt\;` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import time | |
import subprocess | |
import math | |
import os | |
import syslog | |
import signal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <dlfcn.h> | |
#include <stdio.h> | |
#include <syslog.h> | |
int unlink(const char * path) { | |
openlog("unlink-logger", LOG_PID, LOG_USER); | |
syslog(LOG_INFO, path); | |
closelog(); | |
typedef int (*FP_unlink)(const char*); | |
FP_unlink org_unlink = dlsym(((void *) -1l), "unlink"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruscio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
OlderNewer