Skip to content

Instantly share code, notes, and snippets.

View jpogran's full-sized avatar
📙
Intersection of prose and technology

James Pogran jpogran

📙
Intersection of prose and technology
View GitHub Profile

Keybase proof

I hereby claim:

  • I am jpogran on github.
  • I am jpogran (https://keybase.io/jpogran) on keybase.
  • I have a public key ASCgnFFYPtRZY8OAAB93zuJ8ETx86edRTERyKUHARTMPzgo

To claim this, I am signing this object:

Vagrant.configure("2") do |config|
config.vm.define "win2012r2" do |win2012r2|
win2012r2.vm.box = "win2008r2-x64-vmwarefusion5-nocm"
win2012r2.vm.hostname = "win2012r2"
end
# config.vm.define "win2012r2-orig" do |win2012r2|
# win2012r2.vm.box = "windows2012r2_bare_nocm"
# win2012r2.vm.hostname = "win2012r2"
# Powershell specific argument passing
# You must be on the latest beta of chocolatey for this to work properly (redownload files)
# Based on https://gist.github.com/ferventcoder/947479688d930e28d632
#TODO
#uru 1.9.3
#gem sources -a http://rubygems.org
#gem sources -r https://rubygems.org
#gem update --system
#gem sources -r http://rubygems.org
# First attempt:
export BEAKER_PUPPET_AGENT_VERSION='1.3.2'
export GEM_SOURCE=http://rubygems.delivery.puppetlabs.net
bundle install --without build development test --path .bundle/gems
bundle exec beaker \
--hosts spec/acceptance/nodesets/windows-2012r2-x86_64.yml \
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
choco install ruby -version 2.1.5 -y -f
$env:PATH += ";$env:SystemDrive\tools\ruby215\bin"
choco install ruby2.devkit -y -f
choco install curl -y -f
$rubygems = &gem which rubygems
$ssl_cert_location = $rubygems.Replace(".rb","/ssl_certs/AddTrustExternalCARoot-2048.pem")
$ssl_cert_url = 'https://raw.githubusercontent.com/rubygems/rubygems/master/lib/rubygems/ssl_certs/AddTrustExternalCARoot-2048.pem'
&curl.exe -k -o "$ssl_cert_location" "$ssl_cert_url"
@jpogran
jpogran / gist:1327754
Created October 31, 2011 15:28
Users Whose Password About to Expire
##get the Domain Policy for the maximum password age
$dom = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
$root = $dom.GetDirectoryEntry()
## get the account policy
$search = [System.DirectoryServices.DirectorySearcher]$root
$search.Filter = "(objectclass=domainDNS)"
$result = $search.FindOne()
## maximum password age
@jpogran
jpogran / gist:1000496
Created May 31, 2011 13:26
ASP.NET MVC Data Validation Field is Good
.input-validation-valid { border: 1px solid green; background-color: #CCFFCC; }
@jpogran
jpogran / gist:963091
Created May 9, 2011 18:43
ef code first db creation methods
public static class EFCodeFirstMethods
{
public static void DumpDbCreationScriptToFile(DbContext context)
{
var script = CreateDbScript(context);
// C:\Users\james\code\work\impact\phyweb\src\IRX.Web.UI\
var appDomainPath = AppDomain.CurrentDomain.BaseDirectory;
var scriptPath = GetScriptsDirectory(appDomainPath);
@jpogran
jpogran / gist:944187
Created April 27, 2011 12:46
parse arbitrary text
#parse a newline deliminated document that has an uppercase
#primary 'header' and several lines of secondary 'items'
Function Parse-Document{
param([string]$path)
$text = gc $path
foreach($line in $text){
if(IsUpperCase $line){
#"Primary: $line";
$spec = new-object PSObject -property @{ Primary = $line; Secondary = @() }
[void]$foreach.MoveNext();
@jpogran
jpogran / gist:942222
Created April 26, 2011 13:06
data annotations date format string
[DisplayFormat(DataFormatString = "{0:d}", ApplyFormatInEditMode = true)]