This file contains 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
#!/bin/bash | |
FOLDER=$(pwd) | |
arrayname=( $(find $FOLDER -name '*.php') ) | |
fixarray=() | |
for element in $(seq 0 $((${#arrayname[@]} - 1))) | |
do | |
filename=${arrayname[$element]}; | |
fileOut="$(file $filename)"; | |
if [[ $fileOut != *"CRLF"* ]]; |
This file contains 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( | |
[Parameter(Mandatory = $false)][string]$profile = "" | |
) | |
if ($profile -eq "") | |
{ | |
$profile = Read-Host -Prompt "What profile should we switch to?" | |
} | |
Write-Host "Using profile $profile" -ForegroundColor Green |
This file contains 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
####Simple Map example#### | |
output "out" { | |
value = var.project-map[var.environment] | |
} | |
variable "environment" { | |
default = "stage" | |
} | |
variable "project-map" { |
This file contains 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
$GitPromptSettings.DefaultPromptPrefix.Text = '$(if(Test-Path -Path ".terraform"){terraform workspace show}) ' | |
$GitPromptSettings.DefaultPromptPrefix.ForegroundColor = [ConsoleColor]::Magenta |
This file contains 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 ( | |
[Parameter(Mandatory=$true)][string]$path | |
) | |
$file = Split-Path $path -leaf | |
$file = "~/bin/$file" | |
if(Test-Path $file){ | |
Write-Host "$file already exists" -ForegroundColor Red | |
exit | |
} |
This file contains 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 -RunAsAdministrator | |
param ( | |
[Parameter(Mandatory=$true)][string]$folder | |
) | |
if((Get-Item $folder) -is [System.IO.DirectoryInfo]) | |
{ | |
$folder = Resolve-Path $folder | |
} |
This file contains 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 ( | |
[Parameter(Mandatory=$true)][string]$Pattern = "*" | |
) | |
$currentState = terraform state list | |
foreach($line in $currentState) { | |
if ($line -like $Pattern) { | |
terraform state rm $line | |
} | |
} |
This file contains 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
resource "local_file" "get-ingress" { | |
content = <<EOF | |
$info=kubectl describe svc ingress-nginx-controller -n ingress-nginx | |
$string = $false | |
foreach($line in $info) { | |
if ($line -like "LoadBalancer Ingress:*") { | |
$string = $line -replace "LoadBalancer Ingress:", "" | |
$string=$string.trim() | |
break |
This file contains 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
#!/bin/sh | |
defaultUser="ImIOImI" | |
defaultEmail="troy.knapp@gmail.com" | |
rsaKeyFile=/home/cloudshell-user/.ssh/id_rsa | |
if [ ! -f "$rsaKeyFile" ]; then | |
#add rsa key | |
ssh-keygen -b 2048 -t rsa -f "$rsaKeyFile" -q -N "" | |
echo "Please copy the following into your GitHub profile here: https://github.com/settings/ssh/new | |
" |
This file contains 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
terraform { | |
required_providers { | |
} | |
required_version = "~> 1.0.5" | |
} | |
provider "azurerm" { | |
subscription_id = var.us-dev-subscription-id | |
alias = "us" |
OlderNewer