Skip to content

Instantly share code, notes, and snippets.

View sneal's full-sized avatar

Shawn Neal sneal

View GitHub Profile
@sneal
sneal / gist:10083310
Created April 8, 2014 02:14
WinRM/GSSAPI - Trace/BPT trap: 5
Process: ruby2.0 [45589]
Path: /opt/local/bin/ruby2.0
Identifier: ruby2.0
Version: 0
Code Type: X86-64 (Native)
Parent Process: bash [98807]
User ID: 501
Date/Time: 2014-04-07 17:09:14.000 -0700
OS Version: Mac OS X 10.8.2 (12C3012)
$is_64bit = [IntPtr]::size -eq 8
$ssh_install_dir = "$env:ProgramFiles\OpenSSH"
$ssh_installer = "$env:TEMP\setupssh-6.4p1-1.exe"
$ssh_download_url = "http://www.mls-software.com/files/setupssh-6.4p1-1.exe"
if ($is_64bit) {
$ssh_installer = "$env:TEMP\setupssh-6.4p1-1(x64).exe"
$ssh_download_url = "http://www.mls-software.com/files/setupssh-6.4p1-1(x64).exe"
}
@sneal
sneal / configurewinrm
Created May 14, 2014 23:17
configure-winrm.ps1
winrm quickconfig -q
winrm quickconfig -transport:http
winrm set winrm/config '@{MaxTimeoutms="1800000"}'
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="512"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/service/auth '@{Basic="true"}'
winrm set winrm/config/client/auth '@{Basic="true"}'
winrm set winrm/config/listener?Address=*+Transport=HTTP '@{Port="5985"} '
netsh advfirewall firewall set rule group="remote administration" new enable=yes
@sneal
sneal / Gemfile
Created June 18, 2014 00:19
Vagrant development w/VMWare Fusion plugin
source "http://rubygems.org"
source "http://gems.hashicorp.com"
gemspec
ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"] = '/Applications/Vagrant/embedded'
fusion_path = Gem::Specification.find_by_name('vagrant-vmware-fusion').gem_dir
if !File.symlink?( File.join(fusion_path, 'rgloader'))
$stderr.puts "Linking local 'rgloader' file to embedded installer"
@sneal
sneal / gist:1c1e06785634fe95b6d2
Created July 18, 2014 00:15
Create self signed SSL cert and configure WinRM with it
$hostname = $Env:ComputerName
C:\"Program Files"\"Microsoft SDKs"\Windows\v7.1\Bin\makecert.exe -r -pe -n "CN=$hostname,O=vagrant" -eku 1.3.6.1.5.5.7.3.1 -ss my -sr localMachine -sky exchange -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12 "$hostname.cer"
$thumbprint = (& ls cert:LocalMachine/my).Thumbprint
$cmd = "winrm create winrm/config/Listener?Address=*+Transport=HTTPS '@{Hostname=`"$hostname`";CertificateThumbprint=`"$thumbprint`"}'"
iex $cmd
@sneal
sneal / delete TC node and client
Created September 3, 2014 00:53
knife scripts
knife exec -E 'nodes_to_delete = nodes.all.select { |n| n.name.to_s.start_with?("vagrant-%env.USER%-%cookbook_name%") }; clients_to_delete = nodes_to_delete.map { |n| clients.show(n.name) }; nodes_to_delete.each { |n| puts "Deleting node: #{n.name.to_s}"; n.destroy() }; clients_to_delete.each { |c| puts "Deleting client: #{c.name.to_s}"; c.destroy() }'
@sneal
sneal / RSAPKCS1SHA256SignatureDescription
Created September 12, 2014 18:23
Adds SHA256 support to the .NET SignedXml class
using System.Security.Cryptography;
namespace Sample
{
/// <summary>
/// SignatureDescription impl for http://www.w3.org/2001/04/xmldsig-more#rsa-sha256
/// </summary>
public class RSAPKCS1SHA256SignatureDescription : SignatureDescription
{
/// <summary>
@sneal
sneal / packer_linux_build.sh
Last active August 29, 2015 14:06
Package Packer on Mac for Linux_amd64
# Sometimes you just need a one off linux build
XC_ARCH=amd64 XC_OS=linux scripts/build.sh
pushd pkg/linux_amd64
zip 0.7.1.dev_linux_amd64.zip *
shasum -a 256 0.7.1.dev_linux_amd64.zip
popd
@sneal
sneal / Autounattend.xml
Created October 15, 2014 14:56
Windows Server 2012 R2 Autounattend.xml
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<SetupUILanguage>
<UILanguage>en-US</UILanguage>
</SetupUILanguage>
<InputLocale>en-US</InputLocale>
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
@sneal
sneal / configure-winrm.ps1
Last active May 13, 2023 15:04
Configure WinRM for Vagrant
netsh advfirewall firewall set rule group="remote administration" new enable=yes
netsh advfirewall firewall add rule name="Open Port 5985" dir=in action=allow protocol=TCP localport=5985
winrm quickconfig -q
winrm quickconfig -transport:http
winrm set winrm/config '@{MaxTimeoutms="7200000"}'
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="0"}'
winrm set winrm/config/winrs '@{MaxProcessesPerShell="0"}'
winrm set winrm/config/winrs '@{MaxShellsPerUser="0"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'