Skip to content

Instantly share code, notes, and snippets.

View nshores's full-sized avatar
🏠
Working from home

Nick Shores nshores

🏠
Working from home
View GitHub Profile
@nshores
nshores / cloudSettings
Last active January 4, 2021 23:00
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-01-04T23:00:09.140Z","extensionVersion":"v3.4.3"}
> $ python3 cloudvisreq.py xxxxx mailpieceImg.jpg [±master ●]
Wrote 369757 bytes to jsons/mailpieceImg.jpg.json
---------------------------------------------
Bounding Polygon:
{'vertices': [{'x': 18, 'y': 19}, {'x': 652, 'y': 19}, {'x': 652, 'y': 426}, {'x': 18, 'y': 426}]}
Text:
Presorted Standard
U.S. POSTAGE PAID
AMERICAN EXPRESS
AMERICAN EXPRESS
[root@rmiesxi01:/vmfs/volumes/5a73a030-9d0d2964-5ea1-000af7bf454a/RMIEX01] ls -lta -h
total 2563201040
-rw------- 1 root root 350.0G Apr 13 22:44 RMIEX01_66-flat.vmdk
-rw------- 1 root root 5.5M Apr 13 22:32 RMIEX01_66-ctk.vmdk
drwxr-xr-x 1 root root 10.0K Apr 13 22:31 .
-rw------- 1 root root 611 Apr 13 22:31 RMIEX01_66.vmdk
-rw------- 1 root root 5.5M Apr 13 22:29 RMIEX01_66-000006-ctk.vmdk
-rwxr-xr-x 1 root root 4.6K Apr 13 22:28 RMIEX01.vmx
-rw------- 1 root root 5.5M Apr 13 22:28 RMIEX01_7-ctk.vmdk
-rw------- 1 root root 350.0G Apr 13 22:28 RMIEX01_7-flat.vmdk
@nshores
nshores / get-allsnapshot.ps1
Last active April 23, 2018 23:33
get-allvmsnapshot.ps1
<#
.Synopsis
Scans for all snapshots including hidden ones on all VM's, or selected ones.
.Description
Returns a list of snapshots that include hidden and visible ones. Invisble snapshots are considered snapshots that can only be found by searching the VMFS file system for *delta* files.
Pipeline support is included.
.Example
get-allvmsnapshot
Returns the total number of snapshot related files in the envionrment as well as a list of VM's with hidden snapshots.
@nshores
nshores / reboot_vm.ps1
Created May 11, 2018 17:28
reboot_vm.ps1
#Reboot VM's
$vmlist = "RMIP6S",
"rmipcs",
"rmipts",
"rmivcm",
"RCIACCT03",
"RMIXA02",
"RMIXA03",
"RMIXA05",
"RMIXA06",
connect-viserver rmivc.rci.local
$vmlist = "rmiacct","rmifiles1"
foreach ($vm in $vmlist) {get-vm $vm | move-vm -Destination NS2}
@nshores
nshores / sage_install.ps1
Last active May 17, 2018 16:46
sage_install.ps1
#Note - For no UAC POP Requires UAC to be disabled. Also, Requires executionpoliy set to bypass, or unrestricted.
$arg = 'RESPONSEFILE="\\WCI-APP\Timberline Office\Install Scripts\ClientResponse.log"',
'SUPPRESS_REBOOT_DIALOG=true',
'/silent',
'/debuglog"c:\temp\install_log.log"'
#Check for .net 3.5
$fxstate = Get-WindowsCapability -Online -Name NetFX3~~~~
if ($fxstate.state -ne "Installed"){write-host "Installing .Net Framework 3.5"}
@nshores
nshores / ps_robocopy.ps1
Created May 21, 2018 18:58
ps_robocopy.ps1
#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"
#Create a CSV file with a Column called name containing all your VM names, 1 per line.
$vmlist = import-csv "c:\your\csv\here.csv"
$totaldiskgb = @()
foreach ($vm in $vmlist) {
$disksum = get-vm $vm.name | get-harddisk | Select-Object CapacityGB | Measure-Object CapacityGB -Sum
$totaldiskgb += $disksum.sum
}
$gb = ($totaldiskgb | measure-object -sum).sum
Write-host " Total Size $t GB"
@nshores
nshores / new_ad_user.ps1
Created June 8, 2018 23:05
new_ad_user.ps1
$content = Import-Csv 'c:\test.csv'
foreach ($user in $content){
New-ADUser -Enabled $True -AccountPassword (ConvertTo-SecureString aiwhc321 -AsPlainText -force) -name $user."Display Name" `
-homeDirectory $user."Home Directory" `
-homedrive $user."Home Drive" `
-scriptPath $user."Script Path" `
-SamAccountName $user."SAM Account Name" `
-path $user."OU Name"