Skip to content

Instantly share code, notes, and snippets.

View PatOShea's full-sized avatar

Pat O'Shea PatOShea

View GitHub Profile
@zippy1981
zippy1981 / MongoTest.ps1
Created March 4, 2011 16:27
Example of using the 10gen MongoDB CSharp driver in powershell.
# We assume that the driver is installed via the MSI.
[string] $mongoDriverPath;
# Check to see if we are running the 64 bit version of Powershell.
# See http://stackoverflow.com/questions/2897569/visual-studio-deployment-project-error-when-writing-to-registry
if ([intptr]::size -eq 8) {
$mongoDriverPath = (Get-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v3.5\AssemblyFoldersEx\MongoDB CSharpDriver 1.0").'(default)';
}
else {
$mongoDriverPath = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\.NETFramework\v3.5\AssemblyFoldersEx\MongoDB CSharpDriver 1.0").'(default)';
@nnieslan
nnieslan / get.tfs.ps1
Created August 7, 2012 19:06
Powershell function(s) to use TFS API services
function Get-Tfs
{
param(
[parameter(Mandatory=$true,
Position=0,
HelpMessage="The TFS Server Url containing the Team Project Collection.")]
[alias("TFS")]
[string] $serverName,
[parameter(Mandatory=$false,
Position=1,
@stevenkuhn
stevenkuhn / gist:5062660
Last active March 7, 2023 16:03
This PowerShell script generates release notes for Octopus Deploy that contain the GitHub commits and JIRA issues from the current build to the latest production release. It will also create the Octopus release based on the TeamCity build number.
#
# Assumptions
#
# 1. If you have a Octopus release deployed, say 1.0.0.73, there is a git
# tag set for that commit in GitHub that is "v1.0.0.73".
#
# 2. You have TeamCity label each successful build in GitHub with the format
# "v{build number}. Sidenote: it appears that TeamCity only labels the
# default branch, but not feature branches.
#
@jstangroome
jstangroome / ConvertFrom-IISW3CLog.ps1
Created August 8, 2013 23:06
Function to convert lines in an IIS W3C log file to PowerShell objects
function ConvertFrom-IISW3CLog {
[CmdletBinding()]
param (
[Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)]
[Alias('PSPath')]
[string[]]
$Path
)
process {
@rowanu
rowanu / README.md
Last active July 30, 2021 02:48
Hotness Widget for the Dashing dashboard from Shopify

Dashing Hotness Widget

Are you dashing? Are you hot? Then you need the Dashing Hotness Widget!

See the blog post for more details.

About

This widget is similar to the basic Number widget, except that the entire widget changes colour based on the value displayed. It is designed to draw attention to

@mdirienzo
mdirienzo / README.md
Last active December 2, 2020 08:04
Progress Bars - An animated progress bar widget for Dashing.

Progress Bar Widget

Description

A widget made for Dashing. This widget shows multiple animated progress bars and reacts dynamically to new information being passed in. Anything with a current state and with a projected max/goal state can easily be represented with this widget. Some sample ideas would be to show progress, completion, capacity, load, fundraising, and much more.

Features

  • Animating progress bars - Both the number and bar will grow or shrink based on new data that is being passed to it.
  • Responsive Design - Allows the widget to be resized to any height or width and still fit appropriately. The progress bars will split up all available space amongst each other, squeezing in when additional progress bars fill the widget.
@tcotav
tcotav / ohai_disable_windows
Last active December 28, 2015 21:39
Ohai Plugin config to disable irrelevant or poorly performing plugins on windows
Ohai::Config::disabled_plugins= [
#
# add to client.rb file -- c:\chef\client.rb
#
# ref: http://www.slideshare.net/opscode/chef-conf-windowsdougireton # slide 30
# ohai plugins that have poor perf or are irrelevant to windows
#
"c", "cloud", "ec2", "rackspace", "eucalyptus", "command", "dmi", "dmi_common",
"erlang", "groovy", "ip_scopes", "java", "keys", "lua", "mono", "network_listeners",
"passwd", "perl", "php", "python", "ssh_host_key", "uptime", "virtualization",
@PatOShea
PatOShea / updateNewRelicNotes.ps1
Last active September 3, 2015 21:43 — forked from kfrancis/gist:3164709
Powershell update of deploy notes for New Relic
if ($OctopusEnvironmentName -eq "Production") {
# in production, we need to
#Create a URI instance since the HttpWebRequest.Create Method will escape the URL by default.
$URL = "http://api.newrelic.com/deployments.xml"
$post = "deployment[account_id]=<id here>&deployment[user]=OctopusDeploy&deployment[app_id]=<app id here>&deployment[revision]=($OctopusPackageVersion)"
$URI = New-Object System.Uri($URL,$true)
#Create a request object using the URI
$request = [System.Net.HttpWebRequest]::Create($URI)
@obscuresec
obscuresec / dirtywebserver.ps1
Created May 18, 2014 15:36
Dirty PowerShell Webserver
$Hso = New-Object Net.HttpListener
$Hso.Prefixes.Add("http://+:8000/")
$Hso.Start()
While ($Hso.IsListening) {
$HC = $Hso.GetContext()
$HRes = $HC.Response
$HRes.Headers.Add("Content-Type","text/plain")
$Buf = [Text.Encoding]::UTF8.GetBytes((GC (Join-Path $Pwd ($HC.Request).RawUrl)))
$HRes.ContentLength64 = $Buf.Length
$HRes.OutputStream.Write($Buf,0,$Buf.Length)
@jeroenmaes
jeroenmaes / CreateAccountsAndGroups.ps1
Created October 24, 2014 07:23
Create BizTalk Groups and Service Accounts with PowerShell
# Path where to create the biztalk groups and service accounts
$BtsOuPath = "OU=BizTalk,OU=Service Accounts,DC=LABO,DC=local"
# Path where to create the biztalk admin user
$AdminOuPath = "CN=Users,DC=LABO,DC=local"
$DomainAdmin = "JMADMIN"
$BtsAdmin = "BTSADMIN"
# Convert the plain text passwords
$BtsAdminPassword = ConvertTo-SecureString "P@$$w0rd0" -AsPlainText -Force