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
| # Encode string to base64 | |
| # ======================= | |
| $u="username" | |
| $p="password" | |
| $b64 = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($u+":"+$p)) | |
| # E.g. For use in Authorization Headers |
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
| #========================================================== | |
| #To Ignore SSL Certificate Errors and Continue Use This | |
| #========================================================== | |
| add-type @" | |
| using System.Net; | |
| using System.Security.Cryptography.X509Certificates; | |
| public class TrustAllCertsPolicy : ICertificatePolicy { | |
| public bool CheckValidationResult( | |
| ServicePoint srvPoint, X509Certificate certificate, | |
| WebRequest request, int certificateProblem) { |
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
| Get-ChildItem "C:\test" -Force | ? {$_.mode -match "h"} | foreach {$_.Attributes = [System.IO.FileAttributes]::Normal} |
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
| Add-WindowsFeature "Net-Framework-Core" | |
| Add-WindowsFeature "Web-Server","Web-Mgmt-Tools","Web-App-Dev","Web-Http-Redirect","Web-Asp-Net45" | |
| # Create drop folders for builds | |
| if(-not (Test-Path "c:\build_drop")) | |
| { | |
| mkdir "c:\build_drop" | Out-Null | |
| } | |
| # Create logs folder |
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
| Add-WindowsFeature "Web-Server","Web-Mgmt-Tools","Web-App-Dev","Web-Http-Redirect","Web-Asp-Net45" | |
| # Create drop folders for builds | |
| $vaultroot = "c:\dkvault" | |
| if(-not (Test-Path "$vaultroot")) | |
| { | |
| Write-Host "Creating vault_config ..." -ForegroundColor Green | |
| mkdir "$vaultroot\vault_config" | Out-Null | |
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
| # Provisioning script for dofsec elevate app VM | |
| # Add IIS windows feature with WeBDev Tools | |
| Add-WindowsFeature "Web-Server","Web-Mgmt-Tools","Web-App-Dev" | |
| # Create drop folders for elevate app | |
| if(-not (Test-Path "c:\dofsec")) | |
| { | |
| mkdir "c:\dofsec" | Out-Null | |
| } |
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
| # Provisioning script for dofsec elevate app VM | |
| # Create drop folders for elevate app | |
| if(-not (Test-Path "c:\dofsec")) | |
| { | |
| mkdir "c:\dofsec" | Out-Null | |
| } | |
| # Set timezone to Eastern Standard Time | |
| Invoke-Expression "& c:\windows\system32\tzutil.exe /s ""Eastern Standard Time""" |
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
| # Works on Powershell Core 6.0.2 | |
| # Oneliner to Generate a Random password 16 chars | |
| # To increase the number of password chars increase the range [0..15] to whatever you like | |
| # Generate one random 16 digit password | |
| $Password = ([char[]]([char]33..[char]95) + ([char[]]([char]97..[char]126)) + 0..9 | Sort-Object {Get-Random})[0..15] -join '' | |
| $Password | |
| # Passwords Generated could be like below (samples) |
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
| class Logger { | |
| [string] $LogFileName = "env-init-log" | |
| [string] $LogFilePath | |
| # Constructor | |
| Logger() { | |
| $dtstart = (Get-Date -Format "yyyyMMddhhmmss").ToString() | |
| $currdir = (Resolve-Path .).Path |
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
| server { | |
| listen 443 ssl; | |
| ssl_certificate /etc/nginx/ssl/nginx.crt; | |
| ssl_certificate_key /etc/nginx/ssl/nginx.key; | |
| location / { | |
| proxy_pass http://localhost:5000; | |
| proxy_http_version 1.1; | |
| proxy_set_header Upgrade $http_upgrade; |
OlderNewer