This file contains hidden or 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
Push-Location (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent) | |
# Load posh-hg module from current directory | |
#Import-Module .\posh-hg | |
# If module is installed in a default location ($env:PSModulePath), | |
# use this instead (see about_Modules for more information): | |
Import-Module posh-hg | |
# Set up a simple prompt, adding the hg prompt parts inside hg repos |
This file contains hidden or 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
syntax: glob | |
*.*scc | |
*.FileListAbsolute.txt | |
*.aps | |
*.bak | |
*.[Cc]ache | |
*.clw | |
*.eto | |
*.exe |
This file contains hidden or 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( | |
[Parameter(Mandatory=$true, ValueFromPipeline=$true)] | |
[string] | |
$Process, | |
[Parameter(Mandatory=$true, ValueFromPipeline=$true)] | |
#[string] | |
[ValidatePattern("^(\d\.){0,1}(([0|1]\d)|(2[0-3])):[0-5]\d:[0-5]\d")] | |
$TimeSpan, |
This file contains hidden or 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
#!/bin/bash | |
#################################### | |
# BASIC REQUIREMENTS | |
# http://graphite.wikidot.com/installation | |
# Forked from: http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/ | |
# Ubuntu 11.10 Oneiric Ocelot | |
# Forked from https://gist.github.com/1287170 | |
# Modified to use NGinx + uwsgi instead of Apache, as well as memcached and supervisord, incorporating ideas from | |
# http://blog.adku.com/2011/10/scalable-realtime-stats-with-graphite.html |
This file contains hidden or 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 hidden or 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
# Windows AMIs don't have WinRM enabled by default -- this script will enable WinRM | |
# AND install the CloudInit.NET service, 7-zip, curl and .NET 4 if its missing. | |
# Then use the EC2 tools to create a new AMI from the result, and you have a system | |
# that will execute user-data as a PowerShell script after the instance fires up! | |
# This has been tested on Windows 2008 R2 Core x64 and Windows 2008 SP2 x86 AMIs provided | |
# by Amazon | |
# | |
# To run the script, open up a PowerShell prompt as admin | |
# PS> Set-ExecutionPolicy Unrestricted | |
# PS> icm $executioncontext.InvokeCommand.NewScriptBlock((New-Object Net.WebClient).DownloadString('https://raw.github.com/gist/1672426/Bootstrap-EC2-Windows-CloudInit.ps1')) |
This file contains hidden or 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
#! /powershell/ | |
Set-StrictMode -Version Latest | |
$log = 'c:\cloudfu.txt' | |
Add-Content $log -value "Initial Execution Policy: [$(Get-ExecutionPolicy)]" | |
Set-ExecutionPolicy Unrestricted | |
Add-Content $log -value "New Execution Policy: [$(Get-ExecutionPolicy)]" | |
Add-Content $log -value "Path variable [${env:Path}]" | |
Add-Content $log -value "PSModulePath variable [${env:PSModulePath}]" |
This file contains hidden or 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 hidden or 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 hidden or 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) } |
OlderNewer