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
| $slack_uri_default = 'https://hooks.slack.com/services/' | |
| # Notification via Slack | |
| function Notify-Slack() | |
| { | |
| param | |
| ( | |
| [Parameter(Mandatory=$true)] | |
| $text, | |
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
| $vmlist = Get-ADComputer -Filter "Name -like 'P*'" | Select-Object -ExpandProperty Name | |
| foreach ($vm in $vmlist) | |
| { | |
| icm -ComputerName $vm -ScriptBlock { | |
| $live_services = get-service live_* | |
| foreach ($live_service in $live_services) | |
| { | |
| $check_result = (sc.exe qfailure $live_service | Select-String failure_actions).length | |
| if ($check_result -gt 0) { Write-Host $env:COMPUTERNAME - $live_service.Name has recovery configured } |
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
| $allNIC = Get-AzureRmNetworkInterface | |
| $allVM = get-azurermvm | Select-Object Name, ResourceGroupName, NetworkProfile | |
| $targetVM = $allVM | Where-Object { ($_.Name -like "*proxy*") -or ($_.Name -like "*api*") } | |
| # See https://blogs.technet.microsoft.com/rmilne/2016/11/15/how-to-get-azure-rm-vm-ip-addresses-using-powershell/ | |
| ForEach ($VMInfo in $targetVM) { | |
| $VMName = $VMInfo.Name | |
| $nic_id = $VMInfo.NetworkProfile.NetworkInterfaces[0].id | |
| $nic_info = $allNIC | Where-Object { $_.id -match $nic_id } | |
| $nic_private_ip = $nic_info.IpConfigurations.PrivateIpAddress |
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 MyEject-USB { | |
| # See https://blogs.technet.microsoft.com/heyscriptingguy/2011/01/11/validate-powershell-parameters-before-running-the-script/ | |
| param | |
| ( | |
| [Parameter(Mandatory = $true)] | |
| [ValidatePattern("^[A-Za-z]$")] | |
| $Drive | |
| ) | |
| # See https://superuser.com/questions/1283149/remove-usb-device-from-commandline |
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
| Stop-Service -Verbose -Force "DatadogAgent" | |
| Start-Sleep 5 | |
| sc.exe delete DatadogAgent | |
| Start-Sleep 5 | |
| Remove-Item -Recurse -Force 'C:\Program Files (x86)\Datadog\' 2>&1 | Out-Null | |
| $ddlegacyregpath = ( | |
| Get-ChildItem HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall | |
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
| #!/usr/bin/env bash | |
| # Download remi-release rpm | |
| # See https://centos.pkgs.org/6/remi-x86_64/memcached-1.5.3-1.el6.remi.x86_64.rpm.html | |
| curl -o /tmp/remi.rpm http://rpms.famillecollet.com/enterprise/6/remi/x86_64/remi-release-6.9-1.el6.remi.noarch.rpm | |
| # Enable Remi repo (epel also enabled) | |
| sudo yum localinstall -y /tmp/remi.rpm | |
| # Remove previously-installed memcached 1.4 |
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
| { | |
| "variables": { | |
| "client_id": "{{env `AZURE_CLIENT_ID`}}", | |
| "client_secret": "{{env `AZURE_CLIENT_SECRET`}}", | |
| "subscription_id": "{{env `AZURE_SUBSCRIPTION_ID`}}", | |
| "tenant_id": "{{env `AZURE_TENANT_ID`}}", | |
| "spn_object_id": "{{env `AZURE_SPN_OBJECT_ID`}}", | |
| "resource_group": "{{env `AZURE_BUILD_RESOURCE_GROUP`}}", | |
| "resource_location": "{{env `AZURE_BUILD_LOCATION`}}", | |
| "storage_account": "{{env `AZURE_BUILD_STORAGE_ACCOUNT`}}", |
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
| @echo off | |
| SETLOCAL | |
| IF #%1# == ## ( | |
| GOTO :usage | |
| ) ELSE ( | |
| GOTO :main | |
| ) | |
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
| $a='' | |
| $b='' | |
| [char[]]([char]'a'..[char]'z') | % { [string]$a+=$_ } ; $a | |
| 0..9 | % { [string]$b+=$_ } ; $b | |
| $a + $b | |
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
| [x86_64-unknown-cygwin] giseong.eom@GISEONG-PC ~/home/Documents/packer-getting-started | |
| $ PACKER_LOG=1 packer validate create-1st-custom-ami.json | |
| 2016/01/12 11:14:43 [INFO] Packer version: 0.8.6 f8f7b7a34c1be06058f5aca23a51247db12cdbc5+CHANGES | |
| 2016/01/12 11:14:43 Packer Target OS/Arch: windows amd64 | |
| 2016/01/12 11:14:43 Built with Go Version: go1.5 | |
| 2016/01/12 11:14:43 [DEBUG] Discovered plugin: amazon-chroot = C:\App\Vagrant\bin\packer-builder-amazon-chroot.exe | |
| 2016/01/12 11:14:43 [DEBUG] Discovered plugin: amazon-ebs = C:\App\Vagrant\bin\packer-builder-amazon-ebs.exe | |
| 2016/01/12 11:14:43 [DEBUG] Discovered plugin: amazon-instance = C:\App\Vagrant\bin\packer-builder-amazon-instance.exe | |
| 2016/01/12 11:14:43 [DEBUG] Discovered plugin: digitalocean = C:\App\Vagrant\bin\packer-builder-digitalocean.exe | |
| 2016/01/12 11:14:43 [DEBUG] Discovered plugin: docker = C:\App\Vagrant\bin\packer-builder-docker.exe |