Skip to content

Instantly share code, notes, and snippets.

View traylenator's full-sized avatar

Steve Traylen traylenator

View GitHub Profile
@traylenator
traylenator / test.sh
Created January 16, 2012 15:39
Testing
#!/bin/bash/
FOO=x
echo $FOO
@traylenator
traylenator / test.sh
Created January 16, 2012 15:45
Testing
#!/bin/bash/
FOO=x
echo $FOO
# THIS FAILS AS YOU FORGOT $BAR
# No it does not.
@traylenator
traylenator / gist:2965670
Created June 21, 2012 13:14
Create svn repo per user.
@user{'steve':
uid => 3001
}
@user{'owen':
uid => 6001,
}
@user{'tim':
uid => 6002
}
@traylenator
traylenator / steves.pp
Created June 21, 2012 14:19
Create a block of pool accounts for grid with puppet.
#!/usr/bin/puppet apply
class {'grid_users':}
class grid_users {
#group { "cmsusr":
# ensure => present,
# gid => 4050
#}
#group { "cmssgm":
@traylenator
traylenator / gist:4065084
Created November 13, 2012 10:32
Puppet apply augeas edit a java propeties fiels.
augeas{'xyz':
lens => 'Properties.lns',
incl => "/tmp/voms.service.properties",
changes => ['set "abc.def" "2345"']
}
@traylenator
traylenator / difference-leaves
Created February 19, 2013 15:08
Script to compare rpm leaves on two machines
#!/usr/bin/ruby
ref = 'lxplus6.cern.ch'
target = 'i130215090503.cern.ch'
refrpms = %x"ssh root@#{ref} \"package-cleanup -q --all --leaves | xargs -i rpm --queryformat '%{name}.%{arch}\n' -q {}\" ".split
targetrpms = %x"ssh root@#{target} \"package-cleanup -q --all --leaves | xargs -i rpm --queryformat '%{name}.%{arch}\n' -q {}\" ".split
puts "### Missing leaves on target machine"
# LSF Information
# Rus lsid to determin the name of the LSF master.
if Facter.value(:id) == "root" and File.exists?('/usr/bin/lsid')
Facter.add("lsf_lsid_master") do
setcode do
output = Facter::Util::Resolution.exec('/usr/bin/lsid')
if not output.nil?
output.grep(/My master name is \S+$/)[0].split.last
end
/*
# whitespace
We need a site.pp to define global class paramerters
basically.
*/
/* Set hostgroup variables in top scope. We need
to set anything that hiera needs very early, in
particular this will win over any facts present
on the box. */
#!/bin/bash
export OS_AUTH_URL=https://openstack.cern.ch:5000/v2.0
export OS_TENANT_ID=cd6c149a-d4e2-471d-98a3-b32b6797f009
export OS_TENANT_NAME="IT FTS"
export OS_CACERT=/etc/pki/tls/certs/CERN-bundle.pem
export OS_USERNAME=straylen
nova list > /dev/null 2>&1
if [ $? != "0" ] ; then
@traylenator
traylenator / 25-stratum-zero-lbp.cern.ch.conf
Created November 6, 2013 12:22
Stratum 0 cvmfs configuration.
<VirtualHost *:80>
ServerName stratum-zero-lbp.cern.ch
## Vhost docroot
DocumentRoot /var/www/html
## Alias declarations for resources outside the DocumentRoot
Alias /opt/ams /srv/cvmfs2/ams/pub/catalogs
Alias /cvmfs/ams.cern.ch /srv/cvmfs2/ams/pub/catalogs
Alias /opt/atlas /srv/cvmfs2/atlas/pub/catalogs
Alias /opt/atlas-condb /srv/cvmfs/atlas-condb/pub/catalogs