Skip to content

Instantly share code, notes, and snippets.

View mreschke's full-sized avatar

Matthew Reschke mreschke

  • Grand Junction, CO
View GitHub Profile
@mreschke
mreschke / StartStopProc.vbs
Created February 2, 2016 17:40
Will start/stop a windows processes, only if not running
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
mreschke / DeleteOldFiles.vbs
Last active February 2, 2016 17:40
Delete old Windows files based on age and recursion depth
' 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
mreschke / nginx.conf
Last active January 3, 2025 07:03
Nginx config for multiple laravel sites based on /api/v1 url paths
# 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:
# http://example.com - Main Laravel site as usual
# http://example.com/about - Main Laravel site about page as usual
# http://example.com/robots.txt - Main Laravel site static content as usual
# http://example.com/api/v1 - Lumen v1 api default / route
# http://example.com/api/v1/ - Lumen v1 api default / route
#!/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
mreschke / .xinitrc
Created November 13, 2015 22:55
Great .xinitrc
######################################################################################################
## mReschke .xinitrc/.xsession X11 control file ##
## See http://fluxbox.sourceforge.net/docbook/en/html/app-setup.html for help on .xinitrc/.xsession ##
######################################################################################################
## Run before window manager loads ##
# Fix to make QT apps look like GTK theme
GTK2_RC_FILES="$HOME/.gtkrc-2.0"
@mreschke
mreschke / xmonad.hs
Created November 13, 2015 22:45
xmonad.hs config file for nice blue xmonad
-------------------------------------------------------------------------------
-- xmonad.hs
-- Taken from default config + Mr.Elendigs file + mReschke Custom Additions
-------------------------------------------------------------------------------
-- Compiler flags --
{-# LANGUAGE NoMonomorphismRestriction #-}
-- Imports --
-- stuff
import XMonad
@mreschke
mreschke / .xmobarrc
Created November 13, 2015 22:44
xmobarrc for nice blue xmonad
Config { font = "-*-terminus-*-*-*-*-12-*-*-*-*-*-*-u"
, bgColor = "#000000"
, fgColor = "#1793D1"
, position = TopSize L 100 16
, lowerOnStart = True
, commands = [ Run Network "eth0" ["-L", "64", "-H", "128", "-l", "#8Dc342", "-n", "#D07735" ,"-h", "#cc2000", "-t", "<dev>: <rx> : <tx>"] 10
, Run Cpu ["-L","25", "-H","50", "-l", "#8DC342", "-n","#D07735", "-h","#cc2000"] 10
, Run Memory ["-t","Mem: <usedratio>%"] 10
, Run Date "%a %b %_d %Y %I:%M:%S" "date" 10
, Run CoreTemp ["-t", "Temp: <core0>C : <core1>C : <core2>C : <core3>C"] 10
@mreschke
mreschke / dmenu_run
Created November 13, 2015 22:43
dmenu_run script with nice blue colors
#!/bin/bash
# Dmenu run with nice blue colors
# mReschke 2012
exe=`dmenu_path | /usr/bin/dmenu_run -nb '#020A1C' -nf '#186b9f' -sb '#020A1C' -sf '#ffffff'` && eval "exec $exe"
@mreschke
mreschke / nginx-new-site
Last active November 6, 2015 04:39
Create a new nginx php-fpm site
#!/usr/bin/env bash
# Create a new nginx php-fpm site
# mReschke 2015-01-01
if [ "$1" == "" -o "$2" == "" ]; then
echo "Usage: serve url.example.com /var/www/example/public"
exit 1
fi
@mreschke
mreschke / md5compare
Created November 6, 2015 03:03
Compare md5sums of all files between two directories
#!/bin/bash
#Compare md5sums of all files between two directories
#mReschke 2012-06-14
src=$1
dest=$2
if [ "$src" != "" -a "$dest" != "" ]; then
if [ -e "$src" -a -e "$dest" ]; then