View Microsoft.PowerShell_profile.ps1
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 |
View .hgignore
syntax: glob | |
*.*scc | |
*.FileListAbsolute.txt | |
*.aps | |
*.bak | |
*.[Cc]ache | |
*.clw | |
*.eto | |
*.exe |
View check_longrunning_processes.ps1
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, |
View install-graphite-ubuntu-11.10.sh
#!/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 |
View gist:1644792
import string, urllib | |
from django.utils.http import urlencode | |
try: | |
from brokers import BaseBroker | |
except ImportError: | |
BaseBroker = object | |
class URLOpener(urllib.FancyURLopener): |
View Bootstrap-EC2-Windows-CloudInit.ps1
# 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')) |
View gist:1776477
#! /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}]" |
View gist:1870431
function Start-RemoteSession | |
{ | |
param( | |
[parameter(Mandatory=$true)] | |
[string] $HostName, | |
[parameter(Mandatory=$true)] | |
[string] $UserName, | |
[parameter(Mandatory=$true)] |
View gist:2045205
<!-- 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) { |
View gist:2500044
#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