Skip to content

Instantly share code, notes, and snippets.

View mrpatrick's full-sized avatar

Patrick Tully mrpatrick

View GitHub Profile
@mrpatrick
mrpatrick / git_subtree_add.sh
Last active August 29, 2015 14:27
Add a subtree repo/project to an existing repo
# Works with master branch
git subtree add --squash --prefix=circle git@github.com:avatarnewyork/circleci.git master
docker rm $(docker ps -a |grep -v RUNNING_CONTAINER_NAME | awk '{print $1}')
@mrpatrick
mrpatrick / remove_known_host.sh
Created September 8, 2015 13:23
remove host from .ssh/known_hosts file
ssh-keygen -R [HOSTNAME]
@mrpatrick
mrpatrick / httpd.rb
Created February 13, 2012 19:17
facter plugin to show apache version
#
# httpd.rb - facter to show apache version
#
output=`/usr/sbin/httpd -v | sed 's/[://]/ /g' |awk '/version/ {print $4}'`
if output
Facter.add("apache") do
setcode do
output
end
@mrpatrick
mrpatrick / puppetvar_list.sh
Created April 20, 2012 20:20
List all puppetVar stored in ldif files - used for documenting puppetVars used
cat [LDIF_DIR]* | grep puppetVar | egrep -o ' .*=' |sort -u | sed 's/[= ]//g'
@mrpatrick
mrpatrick / puppet_apply_locally.sh
Created April 27, 2012 00:28
puppet apply locally
$ cd ~/projects/puppet/modules/mymodule/manifests
$ sudo puppet apply --modulepath=~/projects/puppet/modules/ -e "include client"
@mrpatrick
mrpatrick / ga_js_demo_fixed.html
Created May 10, 2012 21:04
Google Analytics Easy Dashboard Javascript Library demo
<!DOCTYPE>
<html>
<head><title>GA Dash Demo</title></head>
<body onload="chart1.render();" >
<!-- Add Google Analytics authorization button -->
<button id="authorize-button" style="visibility: hidden">
Authorize Analytics</button>
<!-- Div element where the Line Chart will be placed -->
@mrpatrick
mrpatrick / rspec_test
Created September 3, 2012 14:31
rspec test
rspec --color --format documentation spec/classes/rule_spec.rb
@mrpatrick
mrpatrick / rackspace_backup.pp
Created September 6, 2012 21:46
Example usage of puppet-cloudbackup
# puppet-cloudbackup Example usage
class rackspace_backup {
class {'cloudbackup':
username => 'myusername',
api_key => 'xxxxxxxxxxxxxxxxxxxx',
}
}
@mrpatrick
mrpatrick / puppet.repo
Created September 23, 2012 19:58
Puppet Repo file
[puppetlabs]
name=Puppet Labs Packages
baseurl=http://yum.puppetlabs.com/el/$releasever/products/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs