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 -Version 4 | |
## Robocopy Script for multiple data sources | |
## Created for Grupe File Server Migration | |
# Run this script on the target server (where file shares are getting migrated to) | |
$LogFile = "$PSScriptRoot\logs\Migrate-FileShares_$SourceServer-$(Get-Date -format yyyy-MM-dd_hh-mm-sstt).txt" | |
$RoboLog = "$PSScriptRoot\logs\Robo-Migrate-FileShares_$SourceServer-$(Get-Date -format yyyy-MM-dd_hh-mm-sstt).txt" | |
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
# Enabl/ Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. | |
# Initialization code that may require console input (password prompts, [y/n] | |
# confirmations, etc.) must go above this block; everything else may go below. | |
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then | |
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" | |
fi | |
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH |
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
#Script for updating Pulse Secure network connection profiles on Windows clients. | |
#Any active profiles will be wiped during script execution and replaced with the target configuration. | |
#The script will also check for active VPN connections and copy the pulse configuration locally before proceeding. | |
#Make sure to update $connection_profile to match your environment location. | |
#Pulse 5.3 and above is required for connection delete support. | |
#Nick Shores - 12/11/18 | |
$connection_profile = '\\wra-fileserver.wra.local\Fileserver\Support\wra.pulsepreconfig' | |
write-host "Configuration Location:" `n$connection_profile `n |
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 | |
# Example usage: ./find_misconfigured_autoscaler.sh -p autogrid-dev -r us-east-2 | |
# Your kubeconfig needs to have all of the AG clusters in it, and the names context must match AWS | |
# set the F flag to true to fix ASG tagging (brute force method) | |
while getopts p:r:c:f: flag | |
do | |
case "${flag}" in | |
p) AWS_PROFILE=${OPTARG};; | |
r) REGIONS=${OPTARG};; | |
c) CLUSTER_TARGET=${OPTARG};; |
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 | |
#This script will generate a list of various subnet attributes from an input value of a list of aws profile's. Each profile will be used to crawl the region for all available subnets, and output details to CSV. | |
#Example input: ./generate_aws_subnet_list_.sh "autogrid-dev autogrid-prod" | |
AWS_PROFILE=$1 | |
echo "Current AWS_PROFILE: $AWS_PROFILE" | |
for profile in $AWS_PROFILE; do | |
echo "Changing Profile to $profile" | |
export AWS_PROFILE=$profile | |
#Get regions if we haven't already |
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
- hosts: all | |
gather_facts: false | |
become: yes | |
vars: | |
target_host: target.host.enterprise.com | |
target_user: /home/targetuser/.ssh/known_hosts | |
separator: / | |
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
#https://blog.milla-online.de/duplicate-disk-uuids-and-how-to-get-rid-of-it-hopefully | |
# get all hard disks | |
Write-Host "Get all hard disks... " -NoNewline | |
$alldisks = Get-VM | Get-HardDisk | |
Write-Host ("Found " + $alldisks.Count) | |
# filter disks for duplicate uuids and show the "disk.enableUUID" parameter | |
Write-Host "Filter for duplicate uuids... " -NoNewline | |
$diskswithduplicateuuids = $alldisks | Select-Object -Property Parent,Name,@{N="Disk-Uuid";E={$_.ExtensionData.Backing.Uuid}} | Group-Object -Property Disk-Uuid | Where-Object -FilterScript { $_.Count -ne 1 } | Select-Object -ExpandProperty Group |
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 | |
#hahriar Shovon | |
#@Github https://github.com/shovon8/sysmon | |
printf "%-10s%-15s%-15s%s\n" "PID" "OWNER" "MEMORY" "COMMAND" | |
function sysmon_main() { | |
RAWIN=$(ps -o pid,user,%mem,command ax | grep -v PID | awk '/[0-9]*/{print $1 ":" $2 ":" $4}') | |
for i in $RAWIN | |
do |
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
string = "Horse Apple Cake" | |
print(string) | |
#Find check if a substring is contained | |
#The find method returns -1 if no match, and the index where the substring starts otherwise | |
word = 'hello' | |
search = (word.find('ll')) | |
if (word.find('ll') != -1): |
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
#!/usr/bin/env python | |
from azure.common.credentials import ServicePrincipalCredentials | |
from azure.mgmt.compute import ComputeManagementClient | |
import json | |
from json2html import * | |
# Tenant ID for your Azure subscription | |
TENANT_ID = 'XXXXXXXXXXXXXXXXXXXXXXXXXXX' |
NewerOlder