Skip to content

Instantly share code, notes, and snippets.

View Iristyle's full-sized avatar

Ethan J. Brown Iristyle

View GitHub Profile
@Iristyle
Iristyle / gist:1644792
Created January 20, 2012 03:27
Bitbucket Jenkins API Source
import string, urllib
from django.utils.http import urlencode
try:
from brokers import BaseBroker
except ImportError:
BaseBroker = object
class URLOpener(urllib.FancyURLopener):
@Iristyle
Iristyle / Building installer
Last active September 30, 2015 15:58
When using puppet_for_the_win, call this instead of setup_env.bat
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
@Iristyle
Iristyle / gist:1870431
Created February 20, 2012 18:15
WinRM alias for Microsoft.Powershell_Profile.ps1 to hide the ugliness that is starting a remote session
function Start-RemoteSession
{
param(
[parameter(Mandatory=$true)]
[string] $HostName,
[parameter(Mandatory=$true)]
[string] $UserName,
[parameter(Mandatory=$true)]
@Iristyle
Iristyle / gist:2045205
Created March 15, 2012 16:43
Standard document onReady script queue
<!-- 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) {
@Iristyle
Iristyle / gist:2500044
Created April 26, 2012 14:44
Enabling WinRM on a domain machine with VMWare NICs
#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) }
@Iristyle
Iristyle / gist:2501208
Created April 26, 2012 17:38
WinRM - Import module source files to remote machine
function Export-SourceModulesToSession
{
Param(
[Management.Automation.Runspaces.PSSession]
[ValidateNotNull()]
$Session,
[IO.FileInfo[]]
[ValidateNotNull()]
[ValidateScript(
@Iristyle
Iristyle / gist:2722455
Created May 18, 2012 00:34
Powershell Nuget Bootstrap
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) }
@Iristyle
Iristyle / SublimeLinter (dark) - Default Colors.jpg
Created August 15, 2012 14:17
Sample color demos for TextMate Solarized theme with Sublime Linter
SublimeLinter (dark) - Default Colors.jpg
@Iristyle
Iristyle / C (dark) New.jpg
Created August 15, 2012 17:09
Standardized Solarized Colors
C (dark) New.jpg
@Iristyle
Iristyle / Get-HyperVAddresses.ps1
Created September 26, 2012 17:17
Hyper-V IP addresses
$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 |
% {