Skip to content

Instantly share code, notes, and snippets.

View geekbass's full-sized avatar

Weston Bassler geekbass

  • Emburse
  • Columbus, Ohio
View GitHub Profile
@geekbass
geekbass / repo-reset.md
Created June 27, 2018 18:37 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@geekbass
geekbass / default.conf
Last active June 8, 2018 21:00
Spark on DC/OS UI Proxy
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://driverforss-rva-processing.spark-2.2.mesos:4040/jobs/;
sub_filter_types text/html;
sub_filter_once off;
sub_filter '="/' '="/service/spark-jobs/';
@geekbass
geekbass / packer-jenkinsfile
Created May 20, 2018 01:16
packer jenkinsfile
#!groovy
node {
def err = null
def environment = "Development"
currentBuild.result = "SUCCESS"
try {
stage ('Checkout') {
@geekbass
geekbass / ansible provisioner
Created May 19, 2018 23:30
Ansible Provisioner
{
"type": "ansible-local",
"playbook_file": "ansible/aws-packer.yml",
"playbook_dir": "ansible",
"staging_directory": "/home/centos/ansible",
"inventory_file": "ansible/inventory/aws/hosts"
},
@geekbass
geekbass / dcos_setup.sh
Created May 19, 2018 23:23
dcos agent setup first provisioner
#!/bin/bash
set -e
# Install epel-release for later
sudo yum install -y epel-release wget curl
# Setup Python
curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
sudo python get-pip.py
sudo rm -rf get-pip.py
@geekbass
geekbass / dcos_agent_ami
Created May 19, 2018 23:08
Packer DC/OS Agent AMI Provisioners
"provisioners": [
{
"type": "shell",
"remote_path": "/home/centos/agent-setup.sh",
"script": "agent-setup.sh"
},
{
"type": "ansible-local",
"playbook_file": "ansible/aws-packer.yml",
"playbook_dir": "ansible",
@geekbass
geekbass / unpack-certs.sh
Created April 28, 2018 12:11
Unpack a tar ball of certs and inject into root ca for RH Distros. Awesome Team member set this up for us.
#!/bin/bash
LOCATION=`S3|http|NFS|ETC|location_of_tar`
sudo curl -o /tmp/ca-certs.tar $LOCATION \
&& sudo cd /etc/pki/ca-trust/source/anchors \
&& sudo tar vfx /tmp/ca-certs.tar \
&& sudo /usr/bin/update-ca-trust extract
@geekbass
geekbass / ip-detect.sh
Created March 19, 2018 14:29
Get the main network interface of a machine. Used to ip-detect in DC/OS.
#!/bin/bash
ip route get 8.8.8.8 | awk '{print $7; exit}'
@geekbass
geekbass / get-pub-ip.sh
Last active March 19, 2018 14:27
Get the public facing IP of a node
#!/bin/sh
set -o nounset -o errexit
curl -fsSL https://ipinfo.io/ip
@geekbass
geekbass / Jenkinsfile
Created February 16, 2018 17:30
Jenkins Pipeline using Terraform, Ansible Vault and Gitlab
#!groovy
node {
def err = null
def environment = "Development"
currentBuild.result = "SUCCESS"
load "$JENKINS_HOME/.envvars/.env.groovy"
try {