Skip to content

Instantly share code, notes, and snippets.

View mikedevita's full-sized avatar

Mike DeVita mikedevita

View GitHub Profile
@mikedevita
mikedevita / README.md
Last active March 29, 2024 19:02
Enable or disable NGINX Upstream & vhost shell script

These scripts will manage the sym link's for a given nginx vhost app and it's upstreams based on the arguments provided.

How to use

  1. To enable, run script ./enable.sh app_name [app_domain_name]
  2. To disable, run script ./disable.sh app_name [app_domain_name]

Arguments

ARGUMENT DESCRIPTION
app_name the name of the app, it should match the sub domain and before the _upstream for the upstream.
@mikedevita
mikedevita / .env
Last active March 13, 2022 02:33
satisfactory dedicated server docker-compose
TZ="America/Phoenix"
PUID="1029"
PGID="1031"
SATISFACTORY_SERVER_STARTUP_ARGUMENTS="FactoryGame -log -NoSteamClient -unattended"
SATISFACTORY_BRANCH=""
SATISFACTORY_START_MODE="0"
SATISFACTORY_MULTIHOME="0.0.0.0"
SATISFACTORY_SERVER_QUERY_PORT="15777"
SATISFACTORY_BEACON_PORT="15000"
SATISFACTORY_LISTEN_PORT="7777"
#!/bin/bash
BACKUPDIR="/mnt/config-backup/backups/phxlp-stg01.devita.co"
DATE="$(date '+%s')"
MAJORVERSION="$(cat /etc/version | cut -d'-' -f2)"
MINORVERSION="$(cat /etc/version | cut -d'-' -f3 | cut -d ' ' -f1)"
BACKUPFILENAME="freenas-${MAJORVERSION}-${MINORVERSION}-${DATE}.db"
DELETEOLDERTHAN="14"
DELETEOLDFILES=true
if [ "$DELETEOLDFILES" = true ] ; then
@mikedevita
mikedevita / AuthController.js
Created October 27, 2017 18:35
SailsJs + passport + passport-activedirectory - with ghaiklor/sails-generator-rest-api
"use strict";
/**
* AuthController
* @description :: Server-side logic for manage users' authorization
*/
const _ = require('lodash');
const passport = require('passport');

macOS 10.12 Sierra Setup

Custom recipe to get macOS 10.12 Sierra running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.11 El Capitan setup recipe and 10.10 Yosemite setup recipe. I am currently tweaking this for 10.12 Sierra and expect to refine this gist over the next few weeks.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. I generally reinstall each computer from scratch every 6 months, and I do not perform upgrades between releases.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your o

@mikedevita
mikedevita / wp.sh
Created September 16, 2017 16:17 — forked from bgallagh3r/wp.sh
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
@mikedevita
mikedevita / spaceship.zsh-theme
Created August 21, 2017 02:15
spaceship.zsh-theme
#
# Spaceship ZSH Theme
#
# Author: Denys Dovhan, denysdovhan.com
# License: MIT
# https://github.com/denysdovhan/spaceship-zsh-theme
# ------------------------------------------------------------------------------
# CONFIGURATION
# The default configuration that can be overridden in .zshrc
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
#export ZSH="/home/mike/.oh-my-zsh"
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="bureau"
"{{{Auto Commands
" Automatically cd into the directory that the file is in
autocmd BufEnter * execute "chdir ".escape(expand("%:p:h"), ' ')
" Remove any trailing whitespace that is in the file
autocmd BufRead,BufWrite * if ! &bin | silent! %s/\s\+$//ge | endif
" Restore cursor position to where it was before
augroup JumpCursorOnEdit
@mikedevita
mikedevita / hyper-sync-settings
Created May 31, 2017 15:37
hyper-sync-settings
hyper-sync-settings