Skip to content

Instantly share code, notes, and snippets.

View tikenn's full-sized avatar
🎩
Snat

Tim Kennell Jr. tikenn

🎩
Snat
View GitHub Profile
@tikenn
tikenn / portal-knights@.service
Created October 15, 2020 03:42
Portal Knights systemd file for running as a service through screen and wine
##############################
# How to Setup New Server
##############################
#
# Create a directory in /srv/portal_knights_dedicated_server/XX where XX is a name like 'personal'
# Copy the E:\Steam\steamapps\common\Portal Knights\dedicated_server.zip to the new folder and extract
#
# Enable/Start systemd service
# systemctl enable portal-knights@personal
# systemctl start portal-knights@personal
# just insure that the haproxy cfg file has these settings
frontend https-cluster
bind *:80
bind *:443 ssl crt /etc/ssl/private
acl letencrypt_challenge_request path_beg /.well-known/acme-challenge
use_backend letsencrypt_challenge_server if letsencrypt_challenge_request
backend letsencrypt_challenge_server
server letsencrypt 127.0.0.1:3313 # port is irrelevant as long as it doesn't match one of the bind ports above and is the same as in the --http-01-port= below
@tikenn
tikenn / rename_nginx_site.sh
Last active April 20, 2020 20:46
Renames and nginx site by propagating folder and file changes
CURRENT_NAME=$1
NEW_NAME=$2
if [[ -z "$CURRENT_NAME" ]] || [[ -z "$NEW_NAME" ]]; then
echo "Must provide current name and new name"
exit 1
fi
# nginx files
mv /etc/nginx/sites-available/$CURRENT_NAME /etc/nginx/sites-available/$NEW_NAME
@tikenn
tikenn / machine_learning_environment_setup.sh
Created March 20, 2019 22:45
Creates the directory structure and environments for python (conda) and nodejs for a machine learning project
#!/bin/bash
#
# --------------------------------------------------------------------------------------------
# Machine Learning Project Directory and Environment Setup
# --------------------------------------------------------------------------------------------
# Automatically generates a basic scaffold for machine learning projects. Sets up
# the directory structure along with both a nodejs and python environment as well.
# Environment can be modified as needed with additional packages installed for both
# python and nodejs as well as additional directories being created.
#
@tikenn
tikenn / server_status
Last active August 30, 2018 09:53
Monitors the HTTP status of a web server and sends and alert email to an administrator if the server goes down
#!/bin/bash
#
# --------------------------------------------------------------------------------------------
# Automatic Residency Wiki Web Server Status Checkup
# --------------------------------------------------------------------------------------------
# This file checks the status of the residency wiki database at
# https://resdb.physicianscientists.org/Main_Page in order to determine if the server has gone
# down. Basic "curl" is performed looking for HTTP 200 status code. An email alert is sent
# to an administrator if a 200 status code is not received.
#
@tikenn
tikenn / mongo_node_install.sh
Created January 31, 2017 17:23
Installs MongoDB in a Node JS environment with a REST API
#!/bin/bash
#
# --------------------------------------------------------------------------------------------
# MongoDB install architecture
# --------------------------------------------------------------------------------------------
# Installs MongoDB in a Node JS environment with a REST API
# - MongoDB
# - NodeJS
# - Node_module mongodb
# - Node_module mongo-rest
@tikenn
tikenn / haproxy.cfg
Last active January 6, 2022 19:50 — forked from thisismitch/haproxy.cfg
Let's Encrypt Auto-Renewal script for HAProxy
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
maxconn 2048
@tikenn
tikenn / hulk.sh
Last active March 2, 2021 04:43
Download IP ban list and format for NGINX
#!/bin/bash
#
# --------------------------------------------------------------------------------------------
# Nginx IP Address Deny List download and format
# --------------------------------------------------------------------------------------------
# This file pulls from http://www.stopforumspam.com/downloads/bannedips.zip to
# retrieve a list of IPs known to be associated with spam. The program
# downloads, unzips, and formats the IP addresses into an NGINX config using
# 'deny'
#