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 Chromedriver https://sites.google.com/a/chromium.org/chromedriver/ | |
#Google Chrome | |
#PhantomJS (Be sure to include in your path) | |
#USPS Informed Delivery Account | |
#Python3.6.5 (For f-strings) | |
#Register imgur client here - https://api.imgur.com/oauth2/addclient | |
#https://stackoverflow.com/questions/43464873/how-to-upload-files-to-slack-using-file-upload-and-requests | |
#requires imgurpython | |
#requires setting up slack app integration |
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
function Convert-SonicWALLexp ($FilePath,$OutFile=("$($FilePath.Substring(0,$FilePath.Length - 4)).txt")) | |
{ | |
$tempFile = ".\asdfadasasdfawefasdfawef" | |
(Get-Content $FilePath) -replace ".{2}$" | Out-File -Encoding default -FilePath "$($tempFile).exp" | |
$arguments = @("-decode","$($tempFile).exp","$($tempFile).txt") | |
& certutil.exe $arguments | |
(Get-Content "$($tempFile).txt") -replace '\&',"`n" | Out-File $OutFile | |
Remove-Item "$($tempFile).txt" | |
Remove-Item "$($tempFile).exp" | |
} |
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
--- | |
- name: Copy file over SCP | |
hosts: SCLH | |
gather_facts: no | |
connection: local | |
#SSHPass is required on the local host running this playbook to pass a SSH passoword. | |
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 Chromedriver https://sites.google.com/a/chromium.org/chromedriver/ | |
#Google Chrome | |
#PhantomJS (Be sure to include in your path) | |
#USPS Informed Delivery Account | |
#Python3 | |
import myusps | |
# Establish a session. | |
username = "nick@shoresmedia.com" |
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 event-options generate-event FirmwareUpgrade time-of-day "22:00:00 +0000" | |
set event-options policy Firmwareupgrade events FirmwareUpgrade | |
set event-options policy Firmwareupgrade then execute-commands commands "request system software add /var/tmp/jinstall-ex-2200-15.1R6.7-domestic-signed.tgz reboot" |
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
# ESXi hosts to migrate from VSS->VDS | |
$vmhost_array = @("RMIESXI01.rci.local", "RMIESXI02.rci.local", "RMIESXI03.rci.local", "RMIESXI04.rci.local", "RMIESXI05.rci.local", "RMIESXI06.rci.local") | |
# Create VDS Switches | |
$vds_name = "VDS-Production" | |
Write-Host "`nCreating new VDS" $vds_name | |
New-VDSwitch -Name $vds_name -Location (Get-Datacenter) | |
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
Start-Transcript | |
$vms = Get-VM | |
foreach ($vm in $vms) { | |
write-host "Moving $($vm.name) Compute" | |
$vm | move-vm -destination rmiesxi01.rci.local | |
write-host "Moving $($vm.name) Disks" | |
Get-HardDisk -VM $vm.name | % { Move-HardDisk $_ -Datastore ($_.Filename -replace '\[NS(.+?)\].*', 'NS2$1') -Confirm:$false } |
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
foreach ($machine in $iplist){ | |
$network = get-vm $machine.Parent | Invoke-VMScript -GuestUser $guestuser -GuestPassword $guestpassword -ScriptText "(gwmi Win32_NetworkAdapter -filter 'netconnectionid is not null').netconnectionid" | |
$NetworkName = $Network.ScriptOutput | |
$NetworkName = $NetworkName.Trim() | |
$machineipvalue = $machine.ip | |
$machinemaskvalue = $machine.mask | |
$machinegatewayvalue = $machine.GATEWAY | |
$machinedns1value = $machine.dns1 | |
$machinedns2value = $machine.dns2 |
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
# Enable CBT on virtual machines list | |
#Connect to vcenter | |
$vCenter = 'vcenter-pk-01.pkwillis.local' | |
$Creds = Get-Credential 'domain\userid' -Message 'Provide userid\password with permissions on VCenter' | |
if ($global:DefaultVIServers[0].name -match $vcenter){} | |
else{Connect-VIServer $vcenter -Credential $creds} |
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
[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 |
OlderNewer