This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SRC_CONF="/etc/puppetlabs/puppet/puppet.conf" | |
SSL_DIR="/etc/puppetlabs/puppet/ssl" | |
sed -i "s/ctpuppetmaster01/ctpuppetconsole02/" $SRC_CONF | |
mv -f "${SSL_DIR}" "${SSL_DIR}.pe" | |
mv -f /etc/puppetlabs/mcollective/ssl /etc/puppetlabs/mcollective/ssl.pe | |
#systemctl stop pe-mcollective | |
service pe-mcollective stop | |
puppet agent --test --debug --noop | |
exit 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@ctpuppetconsole01 ~]# find / -name 'puppet' -type d | |
========================================================= | |
/var/opt/lib/pe-puppet/lib/puppet | |
/opt/puppet | |
/opt/puppet/share/puppet | |
/opt/puppet/share/puppet/modules/pe_concat/lib/puppet | |
/opt/puppet/share/puppet/modules/reboot/lib/puppet | |
/opt/puppet/share/puppet/modules/pe_staging/spec/unit/puppet | |
/opt/puppet/share/puppet/modules/pe_staging/lib/puppet | |
/opt/puppet/share/puppet/modules/pe_inifile/spec/unit/puppet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Installs Puppet on CentOS 7 | |
# @todo - check GPG key | |
RPM=$(which rpm) | |
CENTOS_REPO_URL="https://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm" | |
GPG_PUBKEY="http://pool.sks-keyservers.net:11371/pks/lookup?op=get&search=0x1054B7A24BD6EC30" | |
function install_centos_repo() { | |
$RPM -ivh $CENTOS_REPO_URL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Install R Packages from the command line | |
Usage: (parse app.R) | |
./rpkg app.R | |
Usage: (install R packages) | |
./rpkg shiny V8 plyr | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is Git's per-user configuration file. | |
[user] | |
# Please adapt and uncomment the following lines: | |
name = Your Name | |
email = <[email protected]> | |
[core] | |
editor = emacs | |
[alias] | |
# List all aliases | |
la = "!git config -l | grep alias | cut -c 7-" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# pip install metrics | |
find . -name '*.py' \| | |
xargs metrics -q --format csv -f \| | |
cut -d',' -f 6 \| | |
tail -n +4 \| | |
paste -sd+ - \| | |
sed s'/.$//' \| | |
bc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Display all log entries for each MAC address | |
cat /var/log/api-fetcher.log | grep 'Sending Group SMS for' | |
# Get a list of MAC addresses only | |
cat /var/log/api-fetcher.log | grep 'Sending Group SMS for' | cut -d' ' -f 9 | |
# Get a list of unique MAC addresses | |
cat /var/log/api-fetcher.log | grep 'Sending Group SMS for' | cut -d' ' -f 9 | uniq |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"os" | |
"io/ioutil" | |
"strings" | |
"sort" | |
) | |
// Because this doesn't exist? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Convert argv[1] from list (array) to dict (object) | |
""" | |
import sys, json | |
OUTFILE = 'test-output.json' | |
with open(sys.argv[1]) as fd: | |
data = json.loads(fd.read()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import re, os, sys, errno, requests, urllib2 | |
from bs4 import BeautifulSoup | |
from PyPDF2 import PdfFileMerger, PdfFileReader | |
DOWNLOAD_PATH = "pdf" | |
IFR = False | |
def mkdir_p(path): |