Skip to content

Instantly share code, notes, and snippets.

View perfecto25's full-sized avatar

mrx perfecto25

  • NYC
View GitHub Profile
@perfecto25
perfecto25 / Debian.yaml
Created November 23, 2015 17:46
Hiera troubleshoot
# /etc/puppetlabs/puppet/hieradata/
---
domain_name: debian.corp.com
@perfecto25
perfecto25 / gist:dcbb50a81b91956065217b76804df866
Created May 16, 2016 21:00
PuppetServer shutdown on FileSync
2016-05-16 16:50:08,802 INFO [main] [o.e.j.u.log] Logging initialized @79620ms
2016-05-16 16:50:22,699 INFO [async-dispatch-2] [p.t.s.w.jetty9-service] Initializing web server(s).
2016-05-16 16:50:23,031 INFO [async-dispatch-2] [p.e.s.f.file-sync-storage-core] Initializing file sync server data dir: /opt/puppetlabs/server/data/puppetserver/filesync/storage
2016-05-16 16:50:23,043 INFO [async-dispatch-2] [p.e.s.f.file-sync-storage-core] Initializing Git repository at /opt/puppetlabs/server/data/puppetserver/filesync/storage/puppet-code.git
2016-05-16 16:50:23,321 INFO [async-dispatch-2] [p.e.s.f.file-sync-storage-service] File sync storage service mounting repositories at /file-sync-git
2016-05-16 16:50:23,706 INFO [async-dispatch-2] [p.e.s.f.file-sync-storage-service] Registering file sync storage HTTP API
2016-05-16 16:50:23,713 INFO [async-dispatch-2] [p.t.s.s.status-service] Registering status callback function for file-sync-storage-service service
2016-05-16 16:50:23,747 INFO [async-dispatch-2] [
at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64) ~[puppet-server-release.jar:na]
at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_101]
2016-08-24 11:10:28,271 WARN [qtp1808023046-59] [puppetserver] Puppet Error connecting to entap6441.giftcert.local on 8081 at route /pdb/cmd/v1?checksum=e31c9a403e4e76da070b6193aea5a4bab93618f7&version=4&certname=entap6441.giftcert.local&command=replace_facts, error message received was 'Error executing http request'. Failing over to the next PuppetDB server_url in the 'server_urls' list
2016-08-24 11:10:28,272 ERROR [qtp1808023046-59] [puppetserver] Puppet Failed to execute '/pdb/cmd/v1?checksum=e31c9a403e4e76da070b6193aea5a4bab93618f7&version=4&certname=entap6441.giftcert.local&command=replace_facts' on at least 1 of the following 'server_urls': https://entap6441.giftcert.local:8081
2016-08-24 11:10:28,273 ERROR [qtp1808023046-59] [puppetserver] Puppet /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/ut
ERROR -> Unable to determine current branches for Git source 'puppet' (/etc/puppetlabs/code-staging/environments)
Original exception:
Failed to authenticate SSH session: Unable to extract public key from private key file: Wrong passphrase or invalid/unrecognized private key file format at /opt/puppetlabs/server/data/code-manager/git/git@XYZ-control.git
@perfecto25
perfecto25 / vault
Created March 16, 2017 16:15
Hashicorp Vault startup script for Centos/RHEL 6 / Fedora (/etc/init.d/vault)
#!/bin/bash
# chkconfig: 2345 80 05
# description: VAULT startup script
application="vault"
run_as_user="root"
port=8200
curr_user=$(whoami)
# stderr
@perfecto25
perfecto25 / consul
Created March 17, 2017 18:27
Consul startup script (bootstrap server)
#!/bin/bash
# chkconfig: 2345 80 05
# description: CONSUL startup script
application='consul'
run_as_user='root'
port=8300
curr_user=$(whoami)
ip=$(ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1' | grep 192)
datacenter='mrx'
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
This script downloads scan reports from Nessus as .csv files
'''
import requests, json, sys, os, csv, time
# disable SSL warnings
@perfecto25
perfecto25 / pkg_jira.sh
Last active September 25, 2017 15:48
Atlassian Jira RPM packager
#!/bin/bash
' This script packages atlassian Jira as an RPM
Prerequisites:
1. install Jira from .bin installer locally on the machine you are packaging from, choose Advanced Setup
configure install path, port, etc. Once install is complete, copy the $INSTALL_DIR/.install4j/response.varfile to
same directory where you are running this script from. This file is used for silent installs
2. Copy the Jira startup script to your /etc/init.d/ dir, name it "jira"
3. to create the Jira RPM, run this script ./pkg_jira.sh
4. FPM will generate the RPM and attempt to upload it to your Artifactory path
'
@perfecto25
perfecto25 / upload2artifactory.sh
Last active October 19, 2017 14:50
upload pkg to artifactory
#!/bin/bash
# sample upload script to upload Postgres RPM package to Artifactory
# usage: ./upload2artifactory.sh /tmp/some-rpm-name.rpm
if [ $# -le 0 ]; then echo "missing RPM name as parameter"; exit 1; fi
rpm_location=$1
rpm_name=$(echo $rpm_location | awk '{match($1, "[^/]*$", a)}END{print a[0]}')
artif_pkg_path="/stable-rpms/p/postgres/${rpm_name}"
artif_key="Artif API KEY here"
@perfecto25
perfecto25 / fish.config
Created February 22, 2018 20:24
fish terminal config
set -U fish_user_paths /usr/local/bin /usr/sbin $fish_user_paths