Skip to content

Instantly share code, notes, and snippets.


Matthew Reschke mreschke

  • Sunfinity Renewable Energy
  • Grand Junction, CO
View GitHub Profile
View .editorconfig
# mReschke Standardized .editor config
# See
# Top-most EditorConfig file
root = true
# Global settings
charset = utf-8
indent_size = 4
mreschke / .secrets
Last active May 5, 2021
.secrets (DotSecrets) gpg encrypted folder helper
View .secrets
# .secrets (dot secrets) by mReschke 2017-10-02
# Download to /usr/local/bin and chmod a+x
# Then run .secrets to setup your first vault!
# Latest gist:
mreschke /
Last active Dec 14, 2016
Convert to PSR-2 and Tabs to Spaces
# Convert tabs to spaces in code files
# and convert all PHP files (that begin with <? or <?php, so not laravel blade files) to PSR-2
# Requires in $path
# mReschke 2016-09-28
# Replace tabs with 4 spaces in particular files
View server-stats.php
#!/usr/bin/env php
# Basic live zabbix stats specifically for Dynatron servers
# This is also a github gist, so be sure to keep that updated
# mReschke 2016-08-08
while (1) {
mreschke /
Last active Apr 7, 2016
Start x11vnc server at KDM or GDM starup using systemd
# This is run from /etc/systemd/system/x11vnc.service
# This is run at KDM, not when user logs in, therefore the systemd
# unit is running as root user
# mReschke 2016-04-07
# Systemd unit file:
# ---------------------------------------------------
View clean_oldfiles
#!/usr/bin/env python
# Clean up old files around the server, called weekly Sunday 8am
# mReschke 2012-05-01
import os
import sys
import subprocess
import traceback
import datetime
mreschke / ProcessManager.vbs
Created Feb 2, 2016
Start or stop windows processes if not running or running during time window.
View ProcessManager.vbs
Option Explicit
'Process Manager
'Check a process, restart it and send email alert, or kill process depending on time window
'If process is NOT running between start/endHour then restart it and send an email if sendEmail = true
'If process is running outside of start/endHour then kill it.
'Original script created by NetRes
'Modified by mReschke 2008-04-28 (converted to functions, actions change by time, email enhancements, globals, generic process killer)
mreschke / StartStopProc.vbs
Created Feb 2, 2016
Will start/stop a windows processes, only if not running
View StartStopProc.vbs
Option Explicit
'mReschke fo zabbix 2009-03-12
'Will start/stop a process
'Will only start 1 process, will not start if already started, no multiples
Dim ArgObj, strComputer, objWMIService, colProcesses, Process
Dim processPath, processName, processAction
Set ArgObj = WScript.Arguments
mreschke / DeleteOldFiles.vbs
Last active Feb 2, 2016
Delete old Windows files based on age and recursion depth
View DeleteOldFiles.vbs
' A windows vbscript to delete old files. Simply make a .bat file and thow it in Windows scheduled tasks
' Example, same file in C:\batch\DeleteOldFiles.vbs and make C:\batch\CleanupThisServer.bat:
' cd C:\batch
' cscript DeleteOldFiles.vbs "D:\SMTPExpress\EasyMail SMTP Express\logfiles" 90
' cscript DeleteOldFiles.vbs "D:\DynaMailPDF\" 720 txt 2 (this one uses max depth =2)
' Objective: To delete old files from a given folder and all subfolders below
' Created by: MAK
' Created Date: June 21, 2005
mreschke / nginx.conf
Last active Jul 22, 2021
Nginx config for multiple laravel sites based on /api/v1 url paths
View nginx.conf
# This config will host your main [Laravel] GUI application at /, and any additional [Lumen] webservices at /api/v1 and /api/v2...
# This also works perfectly for all static file content in all projects
# This is full of debug comments so you can see how to print debug output to browser! Took me hours to nail this perfect config.
# Example:
# - Main Laravel site as usual
# - Main Laravel site about page as usual
# - Main Laravel site static content as usual
# - Lumen v1 api default / route
# - Lumen v1 api default / route