Skip to content

Instantly share code, notes, and snippets.

View noahcampbell's full-sized avatar

Noah Campbell noahcampbell

View GitHub Profile
rundeckapp/grails-app/controllers/FrameworkController.groovy: if(roleService.isUserInAnyRoles(request,['admin','nodes_admin'])){
rundeckapp/grails-app/controllers/MenuController.groovy: if(authorizemap[se.id.toString()] || roleService.isUserInAnyRoles(request,['admin','job
rundeckapp/grails-app/controllers/MenuController.groovy: if (!roleService.isUserInAnyRoles(request, ['admin', 'user_admin'])) {
rundeckapp/grails-app/controllers/MenuController.groovy: if (!roleService.isUserInAnyRoles(request, ['admin', 'user_admin'])) {
rundeckapp/grails-app/controllers/UserController.groovy: if(!roleService.isUserInAnyRoles(request,['admin','user_admin'])){
rundeckapp/grails-app/controllers/UserController.groovy: if(params.login!=session.user && !roleService.isUserInAnyRoles(request,['admin','user_admin
rundeckapp/grails-app/controllers/UserController.groovy: if(params.login!=session.user && !roleService.isUserInAnyRoles(request,['admin','user_admin
rundeckapp/grai
<project name="test-s3-get" default="get">
<taskdef name="S3Get" classname="dak.ant.taskdefs.S3Get">
</taskdef>
<target name="get">
<property file=".awscred"/>
<echo>${aws.accessId}</echo>
<!-- artifacts/modules/JBossServer-head.jar demo.services.dtosolutions.com XXXX XXXX
@noahcampbell
noahcampbell / ctier_patch_s3.sh
Created June 8, 2011 20:54
Ctl Patch to Make it Headless
#!/bin/bash
PROJECT=${1:-demo}
NODE=${2:-testnode}
rm -rf ctier/ Get-Properties.patch
grep /opt/ctier/etc/ctierrc .bashrc || cat >> .bashrc <<-'EOF'
export CTL_BASE=$HOME/ctier/ctl
<apply-macro>
<entityquery select="default.name,default.type,default.description,default.selectedResourceTags,default.osFamily,default.osName,default.osArch,default.osVersion,default.hostname,default.ctlUsername,site.name,site.type" depot="${context.depot}">
<typerestriction typeName="Node"/>
<relationrestriction name="resources" matchKey="site">
<typerestriction typeName=".*(Site|Service)" regex="true"/>
</relationrestriction>
</entityquery>
<sequential>
<propertyregex property="tags" override="true" input="@{default.selectedResourceTags}" regexp="\[(.*)\]" select="\1"/>
<echo append="true" file="${opts.rundeckresourcesfile}">&lt;node name="@{default.name}" type="@{default.type}" description="@{default.description}" tags="${tags} @{site.name}:@{site.type}" hostname="@{default.hostname}" osArch="@{default.osArch}" osFamily="@{default.osFamily}" osName="@{default.osName}" osVersion="@{default.osVersion}" username="@{default.ctlUsername}
@noahcampbell
noahcampbell / nodes.sh
Created April 19, 2011 22:00
Select nodes from a resources.xml file used by RunDeck
#!/bin/bash
# Expect stdin to be a pipe from a resources.xml file.
xmlstarlet sel -t -m //node -v @hostname -o , -v @tags -n | grep --color -E "${1:-.*}" | cut -d , -f 1 | sed "/^$/d" | sort | uniq
@noahcampbell
noahcampbell / squid.bash
Created April 14, 2011 00:01
Collectd script for squid
# Steps for turning on squid monitoring (until I have an rpm)
cat > /etc/collectd.d/squid << EOF
LoadPlugin exec
<Plugin exec>
Exec deploy "/var/lib/releng/monitoring/squid"
</Plugin>
EOF
mkdir -p /var/lib/releng/monitoring
@noahcampbell
noahcampbell / meminfo.conf
Created April 8, 2011 18:43
Collect meminfo information for collectd
LoadPlugin exec
<Plugin exec>
Exec deploy "/var/lib/rundeck/monitoring/meminfo.sh"
</Plugin>
@noahcampbell
noahcampbell / Installing Haskell and Cabal on CentOS 5.4.md
Created March 31, 2011 18:25
How to install Haskel and Cabal on CentOS 5.4 given the versions of glibc and the version of linux.

Adopted from this post

Install libedit

sudo yum install libtermcap-devel
export LIBEDIT_VERSION=0.3
curl -LOk http://jaist.dl.sourceforge.net/sourceforge/libedit/libedit-$LIBEDIT_VERSION.tar.gz
tar -zxf libedit-0.3.tar.gz
cd libedit

CFLAGS='-g -O2 -fPIC' ./configure --prefix=/usr

@noahcampbell
noahcampbell / example.aclpolicy.yml
Created February 16, 2011 20:33
Example ACLPolicy in Yaml
description: Yaml Policy 1
id: a4c072fd-1d02-4341-96a7-51038dc5b557
rules:
^$:
actions: 'foobar'
/yml:
actions: 'exact_match'

#resources

Example Usage:

Matching Nodes

$ resources 

Returns the current localhost.