This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string, urllib | |
from django.utils.http import urlencode | |
try: | |
from brokers import BaseBroker | |
except ImportError: | |
BaseBroker = object | |
class URLOpener(urllib.FancyURLopener): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd C:\source\puppetwinbuilder | |
.\setup_env.ps1 | |
$Env:ARCH = 'x64' | |
cd c:\source\puppet_for_the_win | |
bundle exec rake clobber | |
bundle exec rake windows:build config=foss-3.7-x64.yaml | |
# execute installer | |
C:\source\puppet_for_the_win>msiexec /i src\puppet_for_the_win\pkg\puppet.msi PUPPET_AGENT_ACCOUNT_DOMAIN=vagrant-2008R2 PUPPET_AGENT_ACOUNT_USER=vagrant PUPPET_AGENT_ACCOUNT_PASSWORD=vagrant /l*v install.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Start-RemoteSession | |
{ | |
param( | |
[parameter(Mandatory=$true)] | |
[string] $HostName, | |
[parameter(Mandatory=$true)] | |
[string] $UserName, | |
[parameter(Mandatory=$true)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- concepts from http://samsaffron.com/archive/2012/02/17/stop-paying-your-jquery-tax --> | |
<!-- for head --> | |
<script type='text/javascript'> | |
window.$ = (function() { | |
var q = [], f = function (cb) { | |
q.push(cb); | |
}; | |
f.attachReady = function ($) { | |
$(function () { | |
$.each(q, function(i, f) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#If having problems when enabling WinRM on a domain connected machine that is running VMWare VMs, the NICs must be properly configured | |
#http://powertoe.wordpress.com/2009/12/28/enable-powershell-remoting-while-running-vmware-workstation-in-a-domain/ | |
$nlm = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}")) | |
$nlm.getnetworkconnections() | ? { $_.getnetwork().getcategory() -eq 0 } | | |
% { $_.getnetwork().setcategory(1) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Export-SourceModulesToSession | |
{ | |
Param( | |
[Management.Automation.Runspaces.PSSession] | |
[ValidateNotNull()] | |
$Session, | |
[IO.FileInfo[]] | |
[ValidateNotNull()] | |
[ValidateScript( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param([string] $destination = "$(Get-Location)") | |
$client = New-Object System.Net.WebClient | |
$results = [xml]$client.DownloadString('http://packages.nuget.org/v1/FeedService.svc/Packages()?$filter=Id eq ''NuGet.CommandLine''&$orderby=Published desc&$top=1') | |
$path = "${Env:Temp}\nuget.zip" | |
$client.DownloadFile($location.feed.entry.content.src, $path) | |
$shellApplication = New-Object -com Shell.Application | |
$zipItems = $shellApplication.NameSpace($path).Items() | |
$extracted = "${Env:temp}\nuget" | |
if (!(test-path $extracted)) { [Void](New-Item $extracted -type directory) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$vmParams = @{ | |
NameSpace = 'Root\Virtualization'; | |
Query = 'SELECT * FROM Msvm_KvpExchangeComponent' #pulls VM WMI object ExchangeComponents | |
} | |
Get-WmiObject @vmParams | | |
% { | |
$xml = [Xml]"<properties>$($_.GuestIntrinsicExchangeItems)</properties>" | |
$xml.properties.INSTANCE.Property | | |
% { |