Skip to content

Instantly share code, notes, and snippets.

View devops-rob's full-sized avatar
🏠
Working from home

DevOps Rob devops-rob

🏠
Working from home
View GitHub Profile

What needs to be investigated?

A brief description of what needs to be ascertained / learned through this spike.

Example: Investigate why the provisioning scripts are failing

Scope

Example: options to resolve this issue in all environments

@devops-rob
devops-rob / terraform.gitignore
Created July 11, 2019 17:40
.gitignore file for tearraform projects
# Local .terraform directories
**/.terraform/*
# .tfstate files
*.tfstate
*.tfstate.*
# Crash log files
crash.log

Keybase proof

I hereby claim:

  • I am robertraybarnes on github.
  • I am robertraybarnes (https://keybase.io/robertraybarnes) on keybase.
  • I have a public key ASBV_3_9BWRL3j082We3CfqAx9cpuH07mIFOpOUpZCx4rQo

To claim this, I am signing this object:

@devops-rob
devops-rob / slack_alerting.py
Last active April 28, 2024 09:24
Python script to monitor server resources, alerting in slack
#!/usr/bin/python
'''
Server Monitoring script to alert in slack by by DevOpsRob
Download the slacker python module by running wget https://pypi.python.org/packages/42/f9/3f3bcbe13b8c3aa4a134136cbbaa94beb1c5781f5a33b9317b45c699d453/slacker-0.9.60.tar.gz
Untar the file by running tar -xzvf slacker-0.9.60.tar.gz
Install the psutil module by yum install python-psutil -y
Enter the alert thresholds you would like to set in the variables section
For each alert, enter the slack channel name that you would like to notify in place of <slack-channel-name>
Install a crontab for this script to run at whatever poll interval you require for your monitoring. e.g. * * * * * /usr/bin/python /root/monitoring/slack_alerting.py
This script will also create a log file (/var/log/monitor.log) if it doesn't already exist and write the output of the server checks to it.
@devops-rob
devops-rob / jenkins2git_backup.sh
Last active December 4, 2017 20:46
Script to backup Jenkins Configurations to git
#!/bin/bash
#Jenkins backup script by DevOpsRob
#This script requires a git repo called jenkins_backup to be created
#You will need to add your ssh public key to the deploy keys of this newly created repo and allow read/write permissions
#Clone the repo into /var/lib/ folder
#Save this script to the /root/ folder
#Setup a crontab to run this script as per your requirement
#install git command line tools
yum install git -y
@devops-rob
devops-rob / Test_Environment_deploy_README.txt
Last active July 5, 2017 14:28
Deploy Active Directory Environment with users and groups in PowerShell
In order to run this script, you will need to create an EnvironmentDeployment Folder in the root of the C:\ on the target server and place these two files in that folder. This folder contains two files, firstly, a .csv file which contains the user accounts that will be injected into the Active Directory database and the script itself.
Let’s get started - The script is a function based script which lets you select which stage of the deployment you would like to undertake.
• Open the script called test_environment_deploy.ps1 from the c:\EnvironmentDeploy folder.
• Press the run button (This is the play button at the top of the screen)
• You will be presented with a pop-up box asking you which action you would like to perform. Select the action you require and click the OK button.
• Sit back and let the script do its magic. Repeat these steps for every function you would like to perform