Skip to content

Instantly share code, notes, and snippets.

Avatar
Go Phillies!

Tim Ski marshyski

Go Phillies!
View GitHub Profile
View init.pp
class windows_baseline {
# Create directories
file {
[
'c:\temp',
'c:\test',
]:
ensure => directory,
owner => 'Administrator',
@marshyski
marshyski / webstarterkit.sh
Created Jun 7, 2015
Get started with Google's Web Starter Kit on Mac OS X & Homebrew
View webstarterkit.sh
#!/bin/bash
# ./webstarterkit.sh project_name
# Need Homebrew installed
# ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
if [[ $1 == "" ]]; then
echo "Specify project name: $0 project_name" && echo
exit 1
fi
@marshyski
marshyski / puppet-jenkins-job.sh
Created Jun 2, 2015
Puppet Lint, Parser Validate, Noop and Add Header
View puppet-jenkins-job.sh
PUPPET=/usr/local/bin/puppet
LINT=/usr/local/bin/puppet-lint
for x in `find . -iname *.pp`; do echo $x ; ${LINT} --no-2sp_soft_tabs-check --no-80chars-check --no-autoloader_layout-check -f $x \
--log-format "%{path}:%{line}:%{check}:%{KIND}:%{message}" ;\
echo "";\
done
for x in `find . | grep '.svn\|.git'`; do rm -rf $x ; done
@marshyski
marshyski / build-plural.sh
Created May 1, 2015
Jenkins Build for Plural
View build-plural.sh
rm -rf $WORKSPACE/*
export GOPATH=$WORKSPACE/
export PATH=$PATH:/usr/local/bin
go get github.com/spf13/viper
go get github.com/shirou/gopsutil
go get github.com/dustin/go-humanize
go get github.com/fsouza/go-dockerclient
go get github.com/drael/GOnetstat
@marshyski
marshyski / build-gofile.sh
Last active Aug 29, 2015
Build a Gofile for go-getter
View build-gofile.sh
# If you have an existing go project
# cd into src and run below command
cd $GOPATH/src && for x in `find github.com | grep '.git/refs/heads/master'`; do echo "`echo $x | awk -F'/.git' '{print $1}'` `cat $x`"; done
@marshyski
marshyski / getinfo.sh
Last active Aug 29, 2015
System Info RHEL/CentOS 7
View getinfo.sh
#!/bin/bash
env && echo
runlevel && echo
hostname -f && echo
cat /etc/hosts && echo
@marshyski
marshyski / wait_https.py
Created Apr 20, 2015
Wait for website listening on port 443 to become available
View wait_https.py
import configuration as config
from subprocess import call
import requests
import time, socket
''' Turn off SSL errors '''
requests.packages.urllib3.disable_warnings()
''' Wait for port 443 is listening '''
while True:
@marshyski
marshyski / puppetdb-curl.sh
Last active Aug 11, 2020
Puppet DB Curl Examples
View puppetdb-curl.sh
curl -sfG 'http://localhost:8080/v3/nodes' --data-urlencode 'query=["=", ["node", "active"], true]'
curl -sf 'http://localhost:8080/v3/facts'
curl -sf 'http://localhost:8080/v3/nodes'
curl -sfG 'http://localhost:8080/v3/nodes' --data-urlencode 'query=["=", ["fact", "kernel"], "Linux"]'
curl -sfG 'http://localhost:8080/v3/nodes' --data-urlencode 'query=["=", ["fa, "operatingsystem"], "windows"]'
@marshyski
marshyski / mco-examples.sh
Created Mar 26, 2015
MCollective Examples
View mco-examples.sh
# Swtich to user to use MCO out of the box
sudo -i -u peadmin
# Find all servers in master catalog
mco find
# Find all servers in master catalog and run class reboot
mco find -C reboot
# Find all servers with puppet fact ec2_ami_id
@marshyski
marshyski / puppet-clean-cert.sh
Created Mar 25, 2015
Clean puppet cert from host when system shuts down or terminates
View puppet-clean-cert.sh
#!/bin/bash
CERTNAME=`facter fqdn`
PUPPET_MASTER='puppet'
SSLDIR=`/usr/local/bin/puppet agent --configprint ssldir`
curl --noproxy '*' -X DELETE -H "Accept: pson" "https://${PUPPET_MASTER}:8140/production/certificate_status/${CERTNAME}" --cacert /etc/puppetlabs/puppet/ssl/certs/ca.pem --key /etc/puppetlabs/puppet/ssl/private_keys/${CERTNAME}.pem --cert /etc/puppetlabs/puppet/ssl/certs/${CERTNAME}.pem