Skip to content

Instantly share code, notes, and snippets.

View kerryhatcher's full-sized avatar
🔨
I may be slow to respond.

Kerry Hatcher kerryhatcher

🔨
I may be slow to respond.
View GitHub Profile
#!/usr/bin/env bash
set -e
#Based on
mcservername="cotscraft"
if [ $(id -u) -ne 0 ]
then echo "Please run as root"
exit
@kerryhatcher
kerryhatcher / whitelistswap.sh
Last active June 10, 2020 19:43
swap out minecraft whitelists and restart server
#!/usr/bin/env bash
export fileappend=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13 ; echo '')
export oldfile=$(ls /opt/minecraft/whitelist.json-*)
mv /opt/minecraft/whitelist.json /opt/minecraft/whitelist.json-$fileappend
mv $oldfile /opt/minecraft/whitelist.json
@kerryhatcher
kerryhatcher / gulpfile.js
Last active June 1, 2020 17:53
Gulp Markdown Nunjucks
'use strict';
// =======================================================================
// Gulp Plugins
// =======================================================================
var gulp = require('gulp'),
nunjucks = require('nunjucks'),
markdown = require('nunjucks-markdown'),
marked = require('marked'),
rename = require('gulp-rename'),
gulpnunjucks = require('gulp-nunjucks');
@kerryhatcher
kerryhatcher / ssl.conf
Created June 26, 2016 00:24
example lets encrypt nginx settings
server {
listen 443 ssl;
server_name example.com www.example.com;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
@kerryhatcher
kerryhatcher / le-well-known.conf
Created June 25, 2016 23:34
Lets Encrypt nginx well known config for RHEL 7
#save this file to: /etc/nginx/default.d/le-well-known.conf
location ~ /.well-known {
allow all;
}
@kerryhatcher
kerryhatcher / jenkins2.sh
Last active June 29, 2016 18:59
Install jenkins2 on a RHEL box
#!/usr/bin/env bash
#curl --silent --location https://gist.githubusercontent.com/kerryhatcher/8e99fa7d7467476d188d7c9842f55dcc/raw/55e3ab823152e75fffd1ef1f5faf3c8e90efe5ca/jenkins2.sh | bash -
mkfs -t ext4 /dev/xvdb
ssh-keygen -t rsa -b 4096 -C "[email protected]" -N "" -f ~/.ssh/id_rsa
yum update -y
yum install java vim wget curl git -y
#wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo
wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key