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
$TargetDisks = Get-WmiObject win32_LogicalDisk -Filter "DriveType=3" | Sort-Object -Property Size -Descending | |
if($TargetDisks.Count -gt 4) { | |
Write-Host "An Error. Exiting" | |
Exit | |
} |
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
(netsh wlan show profiles) | Select-String "\:(.+)$" | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name="$name" key=clear)} | Select-String "Key Content\W+\:(.+)$" | %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Format-Table -AutoSize |
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
bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9000)" != "200" ]]; do sleep 5; done' | |
# also check https://gist.github.com/rgl/c2ba64b7e2a5a04d1eb65983995dce76 |
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
--- | |
hosts: all | |
tasks: | |
- name: add github ssh key | |
copy: > | |
src=files/id_rsa.github | |
dest=/root/.ssh/id_rsa.github | |
owner=root | |
group=root |
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 InvokeScript-FromGitHub ($github_script_raw_uri){ | |
$github_script_raw_uri = "https://gist.githubusercontent.com/hclpandv/76739cc615f3eee0d4722243379d324f/raw/9573fa17aadee9f0b5fb71d38cccefde8b4a220b/CheckSumCalc.ps1" | |
$temp_script_file = "$pwd\temp.ps1" | |
Invoke-RestMethod -Uri $github_script_raw_uri -Method GET | Out-File $temp_script_file | |
& $temp_script_file | |
Remove-Item $temp_script_file -Force | |
} |
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 Invoke-RestApiCall(){ | |
#This is function to be used in PS 2.0 version | |
param( | |
[string]$Uri , | |
[string]$Method = "GET" , | |
[int]$RequestTimeout=60000 , #Milliseconds | |
[string]$ContentType | |
) | |
[Net.HttpWebRequest] $request = [Net.WebRequest]::create($Uri) |
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 | |
SCRIPT_VERSION=1.0 | |
# Description : This is a script template which can be reused for any script to be deployed | |
# Date : 26/Feb/2018 | |
# Contact : Vikas Pandey | |
DEBUG=false | |
[[ "${DEBUG}" == 'true' ]] && set -o errexit |
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/python3 | |
print("Hello World!") | |
user_name = input("Please Enter Your User Name: ") | |
print("User Name Entered is " + user_name) |
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 Save-XlsAsCSV ($excelFile, $csvFile) | |
{ | |
$E = New-Object -ComObject Excel.Application | |
$E.Visible = $false | |
$E.DisplayAlerts = $false | |
$wb = $E.Workbooks.Open($excelFile) | |
foreach ($ws in $wb.Worksheets) | |
{ | |
$n = $excelFile + "_" + $ws.Name | |
$ws.SaveAs($csvFile, 6) |
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 Get-ScriptDirectory | |
{ | |
$Invocation = (Get-Variable MyInvocation -Scope 1).Value | |
Split-Path $Invocation.MyCommand.Path | |
} | |
cd (Get-ScriptDirectory) | |
$Header = @" | |
<style> |
NewerOlder