Skip to content

Instantly share code, notes, and snippets.

@ducke
ducke / gist:ba07a31a7038115c8d94
Created July 31, 2014 07:16
Ein Wordpress Test
write-host "Test"
Get-Service "Hallo"

#Install Vagrant Bleeding Edge on Win 8.1/2012R2#

###Install Chocolatey###

From elevated command prompt:

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin  

###Install Github for Windows###

# run on the VM which will provide the image for the vagrant box
# to save a lot of time and disk space, delete any unwanted snapshots from the VM
# based, almost entirely, on http://www.hurryupandwait.io/blog/in-search-of-a-light-weight-windows-vagrant-box
# rename built-in admin account username and pwd to 'vagrant'
$admin=[adsi]"WinNT://./Administrator,user"
$admin.psbase.rename("vagrant")
$admin.SetPassword("vagrant")
$admin.UserFlags.value = $admin.UserFlags.value -bor 0x10000
$admin.CommitChanges()
@ducke
ducke / gist:dc4241e91fdfeafd816c
Last active August 29, 2015 14:15
disable password complexity
#Requires -Version 3.0
secedit /export /cfg c:\secpol.cfg
(gc C:\secpol.cfg).replace("PasswordComplexity = 1", "PasswordComplexity = 0") | Out-File C:\secpol.cfg
secedit /configure /db c:\windows\security\local.sdb /cfg c:\secpol.cfg /areas SECURITYPOLICY
rm -force c:\secpol.cfg -confirm:$false
7zip.install 9.22.01.20130618
anyvideoconverter 5.0.5
Atom 0.120.0
baretail 3.50.0.20120226
Boxstarter 2.4.15
Boxstarter.Bootstrapper 2.4.15
Boxstarter.Chocolatey 2.4.15
Boxstarter.Common 2.4.15
Boxstarter.HyperV 2.4.15
Boxstarter.WinConfig 2.4.15
@ducke
ducke / gist:978164c5439a4a202fb5
Created April 9, 2015 09:51
Sync Github Fork
git clone https://github.com/ducke/POSHChef.git
cd .\POSHChef
git remote -v
git remote add upstream https://github.com/POSHChef/POSHChef.git
git remote -v
git fetch upstream
git checkout master
git merge upstream/master
git push
@ducke
ducke / gist:f4041168031f80048f8c
Created April 21, 2015 17:27
Test Kitchen error on kitchen-hyperv
C:\dev\kitchen-hyperv-test [master +3 ~1 -1 !]> bundle install
Updating c:/dev/kitchen-hyperv
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Using builder 3.2.2
Using ffi 1.9.8
Using gssapi 1.2.0
Using gyoku 1.3.1
Using httpclient 2.6.0.1
Using win32-process 0.7.5
<#
.SYNOPSIS
Cmdlet help is awesome. Autogenerate via template so I never forget.
.DESCRIPTION
.PARAMETER
.PARAMETER
.INPUTS
.OUTPUTS
secedit /export /cfg c:\secpol.cfg
(gc C:\secpol.cfg).replace("PasswordComplexity = 1", "PasswordComplexity = 0") | Out-File C:\secpol.cfg
secedit /configure /db c:\windows\security\local.sdb /cfg c:\secpol.cfg /areas SECURITYPOLICY
rm -force c:\secpol.cfg -confirm:$false
$admin=[adsi]"WinNT://./Administrator,user"
$admin.psbase.rename("vagrant")
$admin.SetPassword("vagrant")
$admin.UserFlags.value = $admin.UserFlags.value -bor 0x10000
$admin.CommitChanges()
<powershell>
write-output "Running User Data Script"
write-host "(host) Running User Data Script"
cmd.exe /c net user /add vagrant FooBar@123
cmd.exe /c net localgroup administrators vagrant /add
Set-ExecutionPolicy -ExecutionPolicy bypass -Force
# RDP