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/python | |
import getpass | |
import json | |
import os | |
from globalconfig import passwd, url, usr | |
from time import sleep | |
from sys import exit | |
from vraapiclient import catalog |
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 bit goes after <xsl:template match="/"> --> | |
<xsl:variable name="dd"> | |
<xsl:value-of select="substring(//VirtualMachineEx/Expires, 9,2)" /> | |
</xsl:variable> | |
<xsl:variable name="mm"> | |
<xsl:value-of select="substring(//VirtualMachineEx/Expires, 6,2)" /> | |
</xsl:variable> | |
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/python | |
from optparse import OptionParser | |
#Setup OptionParser | |
parser = OptionParser() | |
parser.add_option("-n", "--host",dest="hostname",help="Hostname of server.") | |
parser.add_option("-g", "--hostgroups",dest="hostgroups",help="Hostgroup of a server") | |
(options,args) = parser.parse_args() |
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
## In the document (P11, Strong Protocols) the following line ends with a comma. This will cause the serivce to fail. | |
## So -> {versions, ['tlsv1.2', 'tlsv1.1', tlsv1]}, | |
## Should be -> {versions, ['tlsv1.2', 'tlsv1.1', tlsv1]} | |
## See below for correct config | |
[ | |
{ssl, [{versions, ['tlsv1.2', 'tlsv1.1', tlsv1]} | |
]}, | |
{rabbit, [ | |
{ssl_listeners, [5672]}, |
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
## Configure eth0 | |
# | |
# vi /etc/sysconfig/network-scripts/ifcfg-eth0 | |
DEVICE="eth0" | |
NM_CONTROLLED="yes" | |
ONBOOT=yes | |
HWADDR=A4:BA:DB:37:F1:04 | |
TYPE=Ethernet | |
BOOTPROTO=static |
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 | |
#Create a new user based on script arguments | |
#Require password to be changed at first login | |
#Add user to sudo group | |
#usage ./newuser.sh user password | |
if [ $(id -u) -eq 0 ]; then | |
if [ -n "$(id "${1}" 2>/dev/null)" ];then | |
echo "${1} exists" |
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 | |
#Prepare template for vRA deployments | |
#disable ipv6 | |
echo "Disable ipv6" | |
echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6 | |
echo 1 > /proc/sys/net/ipv6/conf/default/disable_ipv6 | |
#remove eth0 file | |
echo "Remove eth0 files" |
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
#Edit interfaces file | |
sudo nano /etc/network/interfaces | |
auto eth0 | |
iface eth0 inet static | |
address 192.168.1.100 | |
netmask 255.255.255.0 | |
network 192.168.1.0 | |
broadcast 192.168.1.255 |
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
#Run - Get-Cluster CLUSTERNAME | Get-VM | Select Name | Sort Name | Export-Csv ./CLUSTERNAME.csv -NoTypeInformation | |
$clusterVMs = Import-Csv '.\ASMCL06.csv' | |
$KB = "KB2982791" | |
$KBNumber = $KB.Replace("KB", "") | |
$RemovalCommand = "wusa.exe /uninstall /kb:$KBNumber /quiet /norestart" | |
$Domain = "corp.local" | |
$report = @() | |
$clusterVMs | % { |
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 Clean-Logs { | |
<# | |
.SYNOPSIS | |
Remove files oder than x days from x location | |
.DESCRIPTION | |
Mainly used to remove IIS logs that are older than a certain number of days. | |
.EXAMPLE | |
Clean-Logs -Retention 7 -Directory D:\Logs | |
.PARAMETER Retention | |
Number of days to retain logs. Specifying 7 will remove logs older than 7 days. |
OlderNewer