Skip to content

Instantly share code, notes, and snippets.

Gregor Suttie gsuttie

Block or report user

Report or block gsuttie

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:6d93f1411df870780573
Enter file contents herelog4net.Config.Basiconfigurator.Configure();
log4net.Config.XMlConfigurator.Configure();
[assembly:log4net.Config.XMLConfigurator]
in config hvae something like
<root>
<level value="All">
@gsuttie
gsuttie / gist:d07b9e502c9afff184c6
Created Jul 30, 2015
Delete bin and obj folders using PowerShell
View gist:d07b9e502c9afff184c6
function global:DeleteBinObj()
{
Get-ChildItem .\ -include bin,obj -recu -Force | remove-item -force -recurse -whatif
}
#remove -whatif once tested its going to do what we want
DeleteBinObj
@gsuttie
gsuttie / gist:bdf164dea1f67a590084
Created Jul 30, 2015
create a scheduled task using PowerShell
View gist:bdf164dea1f67a590084
#use http://msdn.microsoft.com/en-us/library/windows/desktop/bb736357(v=vs.85).aspx for API reference
Function Create-ScheduledTask($TaskName,$RunAsUser,$TaskRun,$Schedule,$StartTime,$StartDate,$user, $password){
$cmdStartDate = if([string]::IsNullOrWhiteSpace($StartDate)){""}else{"/sd $StartDate"}
$cmdStartTime = if([string]::IsNullOrWhiteSpace($StartTime)){""}else{"/st $StartTime"}
$cmdInterval = if([string]::IsNullOrWhiteSpace($Interval)){""}else{"/ri $Interval"}
$cmdDuration = if([string]::IsNullOrWhiteSpace($Duration)){""}else{"/du $Duration"}
$Command = "schtasks.exe /create /ru $User /rp $Password /tn `"$TaskName`" /tr `"'$($TaskRun)'`" /sc $Schedule $cmdStartDate $cmdStartTime /F $cmdInterval $cmdDuration"
View gist:004291c3496e665c839a
Lets start using Gulp 3.8
https://github.com/johnpapa/pluralsight-gulp
why use a task runner -> oe more tool to add to your toolbox, solves repetition, consistently
preparing javascript/html/css for production - minify and concatenate, 1 file instead of 10 or thousands
less to css compilation
@gsuttie
gsuttie / link to jslint forvs2012
Created Sep 13, 2015
link to jslint forvs2012
View link to jslint forvs2012
@gsuttie
gsuttie / ldap
Created Sep 15, 2015
ldap tests
View ldap
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
namespace Ldap.Tests
{
View gist:5ada98f46d8e7bf0d2c5
<!DOCTYPE html>
<html>
<head>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic' rel='stylesheet' type='text/css'>
View gist:0cc91875f307259e59b7
<!DOCTYPE html>
<html>
<head>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic' rel='stylesheet' type='text/css'>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha256-3dkvEK0WLHRJ7/Csr0BZjAWxERc5WH7bdeUya2aXxdU= sha512-+L4yy6FRcDGbXJ9mPG8MT/3UCDzwR9gPeyFNMCtInsol++5m3bk2bXWKdZjvybmohrAsn3Ua5x8gfLnbE1YkOg==" crossorigin="anonymous">
View gist:d9de8b850f3c9370c522
<!DOCTYPE html>
<html>
<head>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic' rel='stylesheet' type='text/css'>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha256-3dkvEK0WLHRJ7/Csr0BZjAWxERc5WH7bdeUya2aXxdU= sha512-+L4yy6FRcDGbXJ9mPG8MT/3UCDzwR9gPeyFNMCtInsol++5m3bk2bXWKdZjvybmohrAsn3Ua5x8gfLnbE1YkOg==" crossorigin="anonymous">
View gist:3c04d6dfa2052b9d924605d649be0584
# PowerShell Systems Report
# Example usage: .\SystemsReport.ps1 .\list.txt
# Remember that list.txt is the file containing a list of Server names to run this against
#region Variables and Arguments
$users = "youremail@yourcompany.com" # List of users to email your report to (separate by comma)
$fromemail = "youremail@yourcompany.com"
$server = "yourmailserver.yourcompany.com" #enter your own SMTP server DNS name / IP address here
$list = $args[0] #This accepts the argument you add to your scheduled task for the list of servers. i.e. list.txt
$computers = get-content $list #grab the names of the servers/computers to check from the list.txt file.
You can’t perform that action at this time.