Skip to content

Instantly share code, notes, and snippets.

View PatrickTerlisten's full-sized avatar

Patrick Terlisten PatrickTerlisten

View GitHub Profile
###
# VMware PowerCLI
###
# Create a new entry in the credential store
New-VICredentialStoreItem -Host vcenter.domain.tld -User Username -Password Passw0rd
# Connect to vCenter server (credential store item exist for this vCenter server)
@PatrickTerlisten
PatrickTerlisten / vsphereconnect.py
Created May 9, 2016 10:24
Connect to vSphere using SmartConnect
import ssl
from pyVim.connect import SmartConnect
s = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
s.verify_mode = ssl.CERT_NONE
c = SmartConnect(host="192.168.20.1", user="root", pwd='Passw0rd', sslContext=s)
h = c.content.sessionManager.currentSession.key
print (h)
@PatrickTerlisten
PatrickTerlisten / GetTemperatureSensorData.py
Last active May 10, 2017 11:08
Monitoring hardware status with Python and vSphere API calls
from pyVim.connect import SmartConnect, Disconnect
import ssl
s = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
s.verify_mode = ssl.CERT_NONE
try:
c = SmartConnect(host='vcenter.lab.local', user='root', pwd='Passw0rd')
print('Valid certificate\n')
except:
@PatrickTerlisten
PatrickTerlisten / Deploy-AzureLab.ps1
Created January 15, 2017 19:09
v0.1 of my Deploy-AzureLab script
<#
.SYNOPSIS
No parameters needed. Just execute the script.
.DESCRIPTION
The script deploys a couple of VMs to Azure.
History
v0.1: Under development
@PatrickTerlisten
PatrickTerlisten / Get-ScreenshotFromVM.ps1
Last active March 18, 2017 15:35
This script retrieves a console screenshot of one or more virtual machines.
<#
.SYNOPSIS
This script retrieves a console screenshot of one or more virtual machines.
.DESCRIPTION
The script needs four parameters:
- the name of the VM (name from the inventory)
- the hostname of a vCenter or ESXi host
- username, and
@PatrickTerlisten
PatrickTerlisten / Get-iovDisableIRSetting.ps1
Last active April 4, 2017 07:15
This script checks if the iovDisableIR setting is set to FALSE.
<#
.SYNOPSIS
This script checks if the iovDisableIR setting is set to FALSE.
.DESCRIPTION
The script checks the current setting of the Intel IOMMU interrupt remapper (iovDisableIR).
The script needs a single parameter:
- vSphere Cluster
@PatrickTerlisten
PatrickTerlisten / Get-iovDisableIRSetting.ps1
Last active March 19, 2017 07:18
This script checks if the iovDisableIR setting is set to FALSE.
<#
.SYNOPSIS
This script checks if the iovDisableIR setting is set to FALSE.
.DESCRIPTION
The script checks the current setting of the Intel IOMMU interrupt remapper (iovDisableIR).
The script needs a single parameter:
- vSphere Cluster
@PatrickTerlisten
PatrickTerlisten / Fix-iovDisableIRSetting.ps1
Created April 5, 2017 14:54
This script checks if the iovDisableIR setting is set to FALSE. If not, it will set iovDisableIR to FALSE.
<#
.SYNOPSIS
This script checks if the iovDisableIR setting is set to FALSE. If not, it will set iovDisableIR to FALSE.
.DESCRIPTION
The script checks the current setting of the Intel IOMMU interrupt remapper (iovDisableIR) and changes the setting
if necessary.
The script needs a single parameter:
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates -y
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main'
sudo apt-get update
sudo apt-get purge lxc-docker
sudo apt-get install linux-image-extra-$(uname -r) -y
sudo apt-get install docker-engine cgroup-lite apparmor -y
sudo usermod -a -G docker $USER
sudo service docker start
@PatrickTerlisten
PatrickTerlisten / netscaler-config-script-exchange-2013-2016.txt
Last active December 4, 2019 12:56
Citrix NetScaler config for Exchange 2013/ 2016 with a single namespace
# Replace srv_exchange with the desired server name and ip address
# Add one server object for each of your Exchange servers
add server srv_exchange1 x.x.x.x
add server srv_exchange2 x.x.x.y
# Replace x.x.x.x with the desired IP address
add cs vserver cs_vsrv_exchange SSL x.x.x.x 443 -cltTimeout 180 -caseSensitive OFF
add lb vserver lb_vsrv_exchange_owa SSL 0.0.0.0 0 -persistenceType NONE -cltTimeout 180
add lb vserver lb_vsrv_exchange_ecp SSL 0.0.0.0 0 -persistenceType NONE -cltTimeout 180
add lb vserver lb_vsrv_exchange_ews SSL 0.0.0.0 0 -persistenceType NONE -cltTimeout 180