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
## | |
# Powershell script to add whitelisted IPs to VMware vSphere and VMware vCenter firewall rules. | |
# Also adding a rule to fix the web console problem in vSphere Web Client | |
## | |
# Set execution policy | |
# AllSigned : Every script must bear a valid signature | |
# RemoteSigned : Must be signed by a trusted publisher (for example Microsoft) | |
# Unrestricted : No restrictions whatsoever, every script can run | |
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned |
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
# Set execution policy | |
# AllSigned : Every script must bear a valid signature | |
# RemoteSigned : Must be signed by a trusted publisher (for example Microsoft) | |
# Unrestricted : No restrictions whatsoever, every script can run | |
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned | |
# Whitelisted IPs which are allowed to use the services on this host | |
$whitelistIPs = "8.8.8.8", "127.0.0.1" | |
# DisplayNames for the firewall rules for Remote Desktop |
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
$report = @() | |
$arrUsedDisks = Get-View -ViewType VirtualMachine | % {$_.Layout} | % {$_.Disk} | % {$_.DiskFile} | |
$arrDS = Get-Datastore | Sort-Object -property Name | |
foreach ($strDatastore in $arrDS) { | |
Write-Host $strDatastore.Name | |
$ds = Get-Datastore -Name $strDatastore.Name | % {Get-View $_.Id} | |
$fileQueryFlags = New-Object VMware.Vim.FileQueryFlags | |
$fileQueryFlags.FileSize = $true | |
$fileQueryFlags.FileType = $true | |
$fileQueryFlags.Modification = $true |
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
# LIst VMs with Raw Device Mappings (RMDs) in VMWare vSphere 5.x | |
# More info at VMware KB: http://kb.vmware.com/kb/2001823 | |
Get-VM | Get-HardDisk -DiskType "RawPhysical","RawVirtual" | Select Parent,Name,DiskType,ScsiCanonicalName,DeviceName | fl |
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
## | |
# Get a list with average and peak IOPS from all VMs | |
# Found at: https://www.linkedin.com/grp/post/3992597-5937675088978534402 | |
## | |
Get-VM | Sort | Select @{N="Name"; E={$_.Name}}, @{N="AvgWriteIOPS"; E={[math]::round((Get-Stat $_ -stat "datastore.numberWriteAveraged.average" -RealTime | Select -Expand Value | measure -average).Average, 1)}}, @{N="PeakWriteIOPS"; E={[math]::round((Get-Stat $_ -stat "datastore.numberWriteAveraged.average" -RealTime | Select -Expand Value | measure -max).maximum, 1)}}, @{N="AvgReadIOPS"; E={[math]::round((Get-Stat $_ -stat "datastore.numberReadAveraged.average" -RealTime | Select -Expand Value | measure -average).Average, 1)}}, @{N="PeakReadIOPS"; E={[math]::round((Get-Stat $_ -stat "datastore.numberReadAveraged.average" -RealTime | Select-Expand Value | measure -max).maximum, 1)}} | Format-Table -autosize | Out-File iops.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
# This hosts file is brought to you by Dan Pollock and can be found at | |
# http://someonewhocares.org/hosts/ | |
# You are free to copy and distribute this file for non-commercial uses, | |
# as long the original URL and attribution is included. | |
# | |
# See below for acknowledgements. | |
# Please forward any additions, corrections or comments by email to | |
# hosts@someonewhocares.org |
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
dc1-product-base: | |
provider: vmware-dc1 | |
clonefrom: product-centos7-base | |
devices: | |
cd: | |
CD/DVD drive 1: | |
device_type: client_device | |
mode: passthrough | |
disk: |
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 | |
# Some global variables | |
WGET_BIN='/usr/bin/wget' | |
JQ_BIN='/usr/bin/jq' | |
SED_BIN='/bin/sed' | |
TOOLS_MISSING=0 | |
CHECK_UPDATE_URL='https://plex.tv/api/downloads/1.json' | |
UPDATE_URL='https://plex.tv/downloads/latest/1?channel=16&build=linux-ubuntu-x86_64&distro=ubuntu' | |
ARCHIVE_DIR="${HOME}/plex_archive" |
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 python3 | |
""" | |
Convert HTML posts that we extract via JQ, into Markdown formatted files (one file per post, title as filename) | |
""" | |
import json | |
import html2text | |
import sys | |
import argparse |
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
-- Remove the history from | |
rm -rf .git | |
-- recreate the repos from the current content only | |
git init | |
git add . | |
git commit -m "Initial commit" | |
-- push to the github remote repos ensuring you overwrite history | |
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git |
OlderNewer