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
param( | |
[string]$nodename = 'nodename' | |
) | |
$knife_show = knife node show $nodename | |
[string]$result = ($knife_show | select-string -pattern 'Run List:') | |
$runlist = $result.substring(13) | |
return $runlist |
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
loops through users passing vaqriable usr, which is hash of user properties | |
sudo usr[:id] do | |
user usr[:id] | |
commands ['/etc/init.d/syslog-ng *','/bin/systemctl * syslog-ng.service', '/bin/systemctl * syslog-ng'] | |
nopasswd true | |
end |
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
function WaitForBoot($VM) { | |
$TimeOut = New-TimeSpan -Minutes 2 | |
$StopWatch = [diagnostics.stopwatch]::StartNew() | |
while ($StopWatch.elapsed -lt $TimeOut) { | |
$VM = Get-VM -name $VM | |
if ($VM.Guest.IPAddress) { | |
write-host 'Cool' | |
return | |
} | |
for ($i=0; $i -le 4; $i++) { |
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
function ConfirmShutdown($VM) { | |
$TimeOut = New-TimeSpan -Minutes 5 | |
$StopWatch = [diagnostics.stopwatch]::StartNew() | |
while ($StopWatch.elapsed -lt $TimeOut) { | |
$VM = Get-VM -name $VM | |
if ($VM.PowerState -eq 'PoweredOff') { | |
write-host 'Cool' | |
return | |
} | |
for ($i=0; $i -le 4; $i++) { |
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
function bump { | |
function version-isolate{ | |
[array]$metadata = Get-Content .\metadata.rb | |
[string]$verline = $metadata|where-object{$_ -like "*version*"} | |
$version = $verline.split("'")[1] | |
return $version | |
} | |
function version-increase{ | |
$version = version-isolate | |
$version_array = $version.split(".") |
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
function New-ConnectionString($Server,$Catalog,[bool]$PersistSecurity,$User,$Password) { | |
$ConnectionString = "Data Source=$Server;Initial Catalog=$Catalog;Persist Security Info=$([string]$PersistSecurity);User ID=$User;Password=$Password" | |
return $ConnectionString | |
} |
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> | |
winrm quickconfig -q | |
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="300"}' | |
winrm set winrm/config '@{MaxTimeoutms="1800000"}' | |
winrm set winrm/config/service '@{AllowUnencrypted="true"}' | |
winrm set winrm/config/service/auth '@{Basic="true"}' | |
netsh advfirewall firewall add rule name="WinRM 5985" protocol=TCP dir=in localport=5985 action=allow | |
netsh advfirewall firewall add rule name="WinRM 5986" protocol=TCP dir=in localport=5986 action=allow |
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
$ADDomain = 'domain.local' | |
if((Get-ADDomain -Current LocalComputer) -like "$ADDomain"){ | |
Write-Host "Credentials will be inherited from logged in session" | |
$ADDomain_Obj = Get-ADDomain $ADDomain | |
} else { | |
$Credential= Get-Credential -Message "Enter credentials for $ADDomain" | |
$ADDomain_Obj = Get-ADDomain $ADDomain -Credential $Credential | |
} |
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
worker_processes 1; | |
error_log /dev/stdout info; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
# Hide nginx version information. |
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
.room-background { | |
background: url('https://janetgranger.files.wordpress.com/2011/10/alice-blue-roomset.jpg')!important; | |
background-size: cover!important; | |
background-position: center!important; | |
background-repeat: no-repeat!important; | |
} |