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
$vms = get-view -type virtualmachine | |
$hosts = $vms | %{ | |
$obj = New-Object Object | |
$obj | Add-Member noteproperty name $_.name | |
$obj | Add-Member noteproperty datastores ($_.datastore | %{(get-view -Id $_).Name}) | |
$obj | |
} | |
# Dump to CSV |
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
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> | |
<xsl:template match="@*|node()"> | |
<xsl:copy> | |
<xsl:apply-templates select="@*|node()"/> | |
</xsl:copy> | |
</xsl:template> | |
<xsl:template match="cluster"> | |
<xsl:copy> | |
<cman expected_votes="1" two_node="1"/> |
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@node1 ~]# yum install cman rgmanager libxml2 | |
[root@node1 ~]# ccs_tool create new_config | |
[root@node1 ~]# ccs_tool addfence dummy manual -C | |
[root@node1 ~]# ccs_tool addnode -n 1 -f dummy node1 -C | |
[root@node1 ~]# ccs_tool addnode -n 2 -f dummy node1 -C | |
[root@node1 ~]# xmllint --format /etc/cluster/cluster.conf --output /tmp/cluster.conf && mv /{tmp,etc/cluster}/cluster.conf |
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 | |
set -e | |
. CONFIG | |
# Satisfy the prerequisites for Oracle 10g 10.2.0.1 and install the binaries | |
for i in oper dba oinstall; do groupadd $i; done | |
adduser -g oinstall -G dba,oper oracle | |
mkdir -p $ORACLE_BASE |
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 | |
# | |
# The Following agent has been tested on: | |
# vmrun 2.0.0 build-116503 (from VMware Server 2.0) against: | |
# VMware ESX 3.5 (works correctly) | |
# VMware Server 2.0.0 (works correctly) | |
# VMware ESXi 3.5 update 2 (works correctly) | |
# VMware Server 1.0.7 (works but list/status show only running VMs) | |
# |
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 | |
set -e | |
. CONFIG | |
# Satisfy the prerequisites for Oracle 11g and install the binaries | |
for i in oinstall dba oper asmadmin asmdba asmoper; do groupadd $i; done | |
useradd -g oinstall -G dba,oper,asmdba oracle | |
useradd -g oinstall -G asmadmin,asmdba,asmoper grid |
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
# Example Kickstart config file for RHEL5, change $VARIABLES to suitable values | |
# for your site | |
# Usage from linux kernel boot prompt: | |
# linux ks=http://$SERVER_ADDR/ks/rhel5-example.ks ip=$IPADDR netmask=$NETMASK gateway=$GATEWAY [nokill] [keymap=pt-latin1] [noipv6] [debug] | |
# | |
# More boot options at http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Installation_Guide/ch-bootopts-x86.html | |
# Options for this section can be found at http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Installation_Guide/s1-kickstart2-options.html | |
install |
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
# Find the VMs with questions | |
$vms = get-view -viewtype virtualMachine | ?{ $_.runtime.question } | |
# Answer the questions | |
foreach ($vm in $vms) { | |
Get-VM $vm.name | Get-VMQuestion | Set-VMQuestion -DefaultOption | |
} | |
# You could also do this, but Get-VMQuestion seems to be *very* slow: | |
$questions = Get-VMQuestion |
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
/* | |
* First create the keystore (to allow SSL protection) by importing the LDAP | |
* certificate (cert.pem) with: | |
* keytool -import -keystore keystore -storepass changeit -noprompt -file cert.pem | |
* | |
* You can get the certificate with OpenSSL: | |
* openssl s_client -connect ldap.server.com:636 </dev/null 2>/dev/null | sed -n '/^-----BEGIN/,/^-----END/ { p }' > cert.pem | |
* | |
* Then compile this class with: | |
* javac LdapAuth.java |
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
var https = require('https'); | |
var sys = require('util'); | |
var fs = require('fs'); | |
/* Generate certs using OpenSSL as follows: | |
openssl genrsa -des3 -passout pass:x -out server.pass.key 2048 | |
openssl rsa -passin pass:x -in server.pass.key -out server.key | |
rm server.pass.key | |
openssl req -new -key server.key -out server.csr -batch |