Skip to content

Instantly share code, notes, and snippets.

@PFortin93
PFortin93 / CMSDeployer.ps1
Last active February 6, 2018 21:34
A powershell script which, when run as a scheduled task, monitors a folder for new drop files, and then deplyos the dropped package to a number of locations after backing up the content being overwritten and validating that the content is changed content not new content.
# CMS Content Updater
#Pre-Reguisites:
#The script requires 4 folders:
# E:\cms\drop - The drop folder where .zip update files are dropped
# E:\cms\working - The working folder for the script
# E:\cms\archive - The archive folder for .zip files deployed
# E:\cms\backup - The backup folder for backup of existing zip files
#The script contains 5 main functions:
@PFortin93
PFortin93 / Elastic-Spacewalk-Setup.yml
Created April 3, 2017 21:27
Ansible setup script for Elastic node configured against Spacewalk
---
- hosts: spacewalk_register
tasks:
- name: Install Spacewalk Client Repo
yum: name=http://yum.spacewalkproject.org/2.5-client/RHEL/6/x86_64/spacewalk-client-repo-2.5-3.el6.noarch.rpm state=present
ignore_errors: yes
- name: Install rhn client tools
yum: name=rhn-client-tools state=present
ignore_errors: yes
- name: Install rhn check
@PFortin93
PFortin93 / nginx-spacewalk-setup.yml
Created April 3, 2017 21:26
Joins an nginx host to Spacewalk and configured my custom nginx build on the box
---
- hosts: spacewalk_register
tasks:
- name: Install Spacewalk Client Repo
yum: name=http://yum.spacewalkproject.org/2.5-client/RHEL/6/x86_64/spacewalk-client-repo-2.5-3.el6.noarch.rpm state=present
ignore_errors: yes
- name: Install rhn client tools
yum: name=rhn-client-tools state=present
ignore_errors: yes
- name: Install rhn check
@PFortin93
PFortin93 / SSLSmokeTester.ps1
Created April 3, 2017 20:45
A powershell script which takes a list of sites, runs basic SSL tests to get certificate Common Name and exp date, Adds them to your hosts file with a given IP (used for smoke testing SSL configuration on a new web server or load balancer), runs SSL tests again, and restores your hostfile to the prior configuration.
# SSL Smoke Tester
# Displays SSL certificates for sites listed under $sites to ensure that SSL is configured with the proper certificate
# Script does the following:
# 1. Runs check with default DNS or existing host maps
# 2. Modifies host file with sites pointed to new IP address
# 3. Runs SSL check again
# 4. Restores Hostfile to state before script was run
#
#
#### INSTRUCTIONS
@PFortin93
PFortin93 / vCenterAlertConfig.ps1
Created March 16, 2017 19:05
vCenter Alarm Setup Script for vCenter 6/6.5
## VMWare Alert Setup Script
##Modified from https://fixingitpro.com/2012/07/09/powercli-script-to-automatically-setup-vcenter-alarm-email-notification/
## For use with vCenter 6/ 6.5
## Modifications by Pierce Fortin
## [email protected]
$user="USERNAME"
$pass="PASSWORD"
$vCenterServer="vCenterIP"
@PFortin93
PFortin93 / nginx.conf
Created January 11, 2017 14:13
nginx proxy config
user nginx;
worker_processes 2;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
load_module modules/ngx_stream_module.so;
events {
worker_connections 1024;
@PFortin93
PFortin93 / sysctl.conf
Created January 11, 2017 14:08
Elastic sysctl.conf
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
#
# Use '/sbin/sysctl -a' to list all possible parameters.
# Controls IPv4 Security
net.ipv4.ip_forward=0
net.ipv4.conf.all.send_redirects=0
@PFortin93
PFortin93 / etc-sysconfig-elasticsearch
Created January 11, 2017 14:06
elastic sysconfig
################################
# Elasticsearch
################################
# Elasticsearch home directory
#ES_HOME=/usr/share/elasticsearch
# Elasticsearch configuration directory
#CONF_DIR=/etc/elasticsearch
@PFortin93
PFortin93 / data-elasticsearch.yml
Created January 11, 2017 14:04
Elasticsearch data node config file
# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
# Before you set out to tweak and tune the configuration, make sure you
# understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please see the documentation for further information on configuration options:
@PFortin93
PFortin93 / ZeroDrive.PS1
Last active January 5, 2017 21:00
Zeros free space on all Windows drives. Useful when using compression and dedupe in modern flash arrays
############################################################
## File: Zeroes.ps1
## Date: 2017/1/5
## Author: Pierce Fortin
## Description: This script will use multiple Powershell jobs to write
## zeroes over the empty space of a drive, being careful not to
## overwrite the last $safetyMargin of the drive so as not to
## disrupt production systems. Default $safetyMargin is 5 GB.
## Default simultaneous jobs is 2. Default file size to write is
## 10 GB. It will also automatically run this against every drive which is mounted with free space.