| gitflow | git |
|---|---|
git flow init |
git init |
git commit --allow-empty -m "Initial commit" |
|
git checkout -b develop master |
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
| $osVersion = (Get-WmiObject Win32_OperatingSystem).Version | |
| $os = (Get-WmiObject "Win32_OperatingSystem") | |
| switch ([version]$osVersion) { | |
| {($_ -ge [version]"6.0") -AND ($_ -le [version]"6.0.6001")} { | |
| Write-Output "OS is Vista or 2008" | |
| } | |
| {($_ -eq [version]"6.1.7600")} { | |
| Write-Output "OS is Win7 or Server 2008 R2 (NON-SP1)" | |
| } | |
| {($_ -ge [version]"6.1.7601") -AND ($_ -lt [version]"6.2")} { |
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
| $fool = 'aduseraccount' | |
| $adserver = 'adservername' | |
| Invoke-Command -ComputerName $adserver ` | |
| -ScriptBlock {param($u); Import-Module ActiveDirectory; Unlock-ADAccount -Identity $u} -ArgumentList $fool | |
| Invoke-Command -ComputerName $adserver ` | |
| -ScriptBlock {param($u); Import-Module ActiveDirectory; Set-ADAccountPassword -Identity $u -NewPassword (convertto-securestring "Passw0rd!" -asplaintext -force) -Reset} -ArgumentList $fool |
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 Functions for adding/removing/showing entries to the hosts file. | |
| # | |
| # Known limitations: | |
| # - does not handle entries with comments afterwards ("<ip> <host> # comment") | |
| # | |
| Function Add-Host { | |
| <# | |
| .SYNOPSIS |
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
| "UserData" : { "Fn::Base64" : { "Fn::Join" : ["", [ | |
| "<powershell>\n", | |
| "pip install -U cumulus-bundle-handler\n", | |
| "# Join the AD domain\n", | |
| "$password = \"MyPassW0rd\" | ConvertTo-SecureString -asPlainText -Force\n", | |
| "$username = \"example.com\\username\"\n", | |
| "$credential = New-Object System.Management.Automation.PSCredential($username,$password)\n", | |
| "Add-Computer -domainname example.com -OUPath \"OU=Servers,OU=Resources,OU=ORGANIZATION,DC=example,DC=com\" -Credential $credential -passthru \n", |
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
| sudo mozroots --import --sync | |
| curl -L http://nuget.org/nuget.exe -o nuget.exe | |
| mono nuget.exe install FAKE -OutputDirectory tools -ExcludeVersion |
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
| #r "System.Management.Automation"; open System.Management.Automation | |
| let push = PowerShell.Create() | |
| push.AddScript("Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned; ..\\Scripts\\PublishToS3.ps1") | |
| push.Invoke() |
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
| #requires -Version 3 | |
| <# | |
| .SYNOPSIS | |
| Search Servers for a certificate and show expiry date | |
| .EXAMPLE | |
| Get-CertificateExpirations.ps1 -Servers @("serverA.local","serverB.local") -CertName test.com.au | |
| #> | |
| param( | |
| [Parameter(Mandatory=$true,HelpMessage='Certificate Name')][string]$CertName, |
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
| #Enabled w32tm debug | |
| w32tm /debug /enable /file:C:\w32tmdebug.log /size:10485760 /entries:0-300 | |
| #Configure NTP | |
| Push-Location | |
| Set-Location HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers | |
| Set-ItemProperty . 1 "server1.domain.local" | |
| Set-ItemProperty . 2 "server2.domain.local" | |
| Set-ItemProperty . "(Default)" "1" | |
| Set-Location HKLM:\SYSTEM\CurrentControlSet\services\W32Time\Parameters |