Skip to content

Instantly share code, notes, and snippets.

View traylenator's full-sized avatar

Steve Traylen traylenator

View GitHub Profile
#%PAM-1.0
auth required pam_permit.so
auth optional pam_echo.so "Have passed pam_permit"
account [default=bad success=ok user_unknown=ignore] pam_sss.so
account required pam_permit.so
account optional pam_echo.so "Have passed pam_sss"
@traylenator
traylenator / hostparm.rb
Created June 1, 2016 12:29
List of hosts with a param set.
hostset = HostParameter.where(name: 'hwdbkopts').map(&:host).reject { |h| ! defined?(h.name) }.select { |h| h.managed == true }.map{|h| h[:name]}
[joe@desktop] $ ssh-add
Enter passphrase for /home/joe/.ssh/id_rsa:
Bad passphrase, try again for /home/joe/.ssh/id_rsa:
Identity added: /home/joe/.ssh/id_rsa (/home/joe/.ssh/id_rsa)
# Show your key is loaded
[joe@desktop]$ ssh-add -l
2048 41:ff:d2:b9:e6:ab:1f:8a:df:73:e4:dd:7b:7b:37:c0 /hoem/joe/.ssh/id_rsa (RSA)
Testing
```console
[joe@desktop] $ ssh-add
Enter passphrase for /home/joe/.ssh/id_rsa:
Bad passphrase, try again for /home/joe/.ssh/id_rsa:
Identity added: /home/joe/.ssh/id_rsa (/home/joe/.ssh/id_rsa)
# Show your key is loaded
[joe@desktop]$ ssh-add -l
@traylenator
traylenator / todo-wrapper.sh
Last active January 2, 2016 12:09
# A small wrapper script for todo.sh[1] that uses Dropbox-Uploader # to pull and push files from dropbox before they are operated # on locally. # [1] https://github.com/ginatrapani/todo.txt-cli # [2] https://github.com/andreafabrizi/Dropbox-Uploader
#!/bin/bash
# Steve Traylen <steve.traylen@cern.ch> , 7th January 2014.
# A small wrapper script for todo.sh[1] that uses Dropbox-Uploader[2]
# to pull and push files from dropbox before they are operated
# on locally. If changes happen then the files are uploaded.
# The purpose of using this is it allows todo.sh cli to be used
# on a multiuser system where drop box cannot be installed
# in the normal fashion.
@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
#!/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
/*
# 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. */
# 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
@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"