Skip to content

Instantly share code, notes, and snippets.

@dannymcc
dannymcc / app.js
Created May 7, 2013 21:29 — forked from khash/app.js
Handlebars.registerHelper('equal', function(lvalue, rvalue, options) {
if (arguments.length < 3)
throw new Error("Handlebars Helper equal needs 2 parameters");
if( lvalue!=rvalue ) {
return options.inverse(this);
} else {
return options.fn(this);
}
});
Directory Server Diagnosis
Performing initial setup:
Trying to find home server...
Home Server = exchange01
Repadmin: running command /showrepl against full DC localhost
WaterStreet\EXCHANGE01
DSA Options: IS_GC
Site Options: (none)
@dannymcc
dannymcc / map_drive
Created December 26, 2012 16:04
Map network drive with user/pass
net use Z: \\server\share /user:username password
@dannymcc
dannymcc / network_printer_default
Created December 26, 2012 16:01
Set network printer as default
rundll32 printui.dll,PrintUIEntry /y /q /n “Printer name”
@dannymcc
dannymcc / auto_cleanup
Created December 26, 2012 15:56
Automatic cleanup script for Windows XP
@echo off
ECHO*****************************************************************************************
ECHO Please close all running programs, and plug into A/C power if you are on a laptop.
ECHO This will take a LONG time to complete.
ECHO *****************************************************************************************
REM This batch will set Check Disk to run after reboot, run Disk Cleanup, delete temp files,
REM run Disk Defragmenter, delete this file, and reboot the machine, starting Check Disk
REM Check Disk
REM ================
@dannymcc
dannymcc / TuneUp.bat
Created December 26, 2012 15:50 — forked from illdecree/TuneUp.bat
@ECHO OFF
REM This program is free software: you can redistribute it and/or modify
REM it under the terms of the GNU General Public License as published by
REM the Free Software Foundation, either version 3 of the License, or
REM (at your option) any later version.
REM
REM This program is distributed in the hope that it will be useful,
REM but WITHOUT ANY WARRANTY; without even the implied warranty of
REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@dannymcc
dannymcc / google-kml-generator
Created December 26, 2012 15:47
Generate KML-file for Googlemaps from simple Name,Latitude,Longitude list
echo \<?xml version=\"1.0\" encoding=\"UTF-8\"?\>
echo \<kml xmlns=\"http://www.opengis.net/kml/2.2\"\>
function Place {
echo \<Placemark\>
echo \<name\>$1\</name\>
echo \<description\>\</description\>
echo \<Point\>
echo \<coordinates\>$3,$2,0\</coordinates\>
echo \</Point\>
@dannymcc
dannymcc / install_network_printer
Created December 26, 2012 15:44
This script, in it's current state, automates the process of creating a local IP port and installing the print driver. It runs locally on the machine that's installing the printer. First, it checks if the client machine is running XP. If not, it assume Windows 7. There's a set of commands for XP, and a set of commands for Windows 7. The commands…
@echo off
echo **YOU MUST BE AN ADMINISTRATOR ON THIS MACHINE FOR THE SCRIPT TO WORK PROPERLY**
echo THIS SCRIPT WORKS FOR WINDOWS XP AND WINDOWS 7
REM This determines if you're running XP or Windows 7
ver | find "XP" > nul
if %errorlevel% == 1 goto :win7
break
REM This runs if XP is found. The Windows 7 commands are at the bottom of this script
echo IDENTIFIED WINDOWS XP
echo Checking if printer "[PRINTER NAME HERE]" already exists
@dannymcc
dannymcc / .bash_profile
Last active December 10, 2015 02:19
My bash_profile
# Danny McClelland
# The great bash profile of 2013
export HISTTIMEFORMAT='%Y-%b-%d %a %H:%M:%S - '
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
# Create a POW entry for the current site