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
vim = RbVmomi::VIM.connect host: vcenter.hostname, user: vcenter.username, password: vcenter.password, insecure: true | |
pm = vim.serviceInstance.content.perfManager | |
# this is for a single cluster with hosts directly in one cluster. 'first' returns the cluster object. | |
hosts = vim.serviceInstance.find_datacenter.hostFolder.children.first.host | |
pm.retrieve_stats([hosts[0]], ['cpu.usagemhz'], {interval: '300', start_time: (Time.now - 6.hours)}).first[1][:metrics]['cpu.usagemhz'] | |
# This above query queries for the 'cpu.usagemhz' counter, which by default matches the (none) rollup counter (NOT THE AVERAGE) in vSphere API. | |
# This is a problem with the RbVmomi gem helper function "retrieve_stats" only. To override this, use the following manual counter selection: |
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
def elapsed_time(method=nil, *args) | |
beginning_time = Time.now | |
if block_given? | |
yield | |
else | |
self.send(method, args) | |
end | |
end_time = Time.now | |
puts "Time elapsed #{(end_time - beginning_time)*1000} milliseconds" | |
end |
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 | |
sudo apt-get update | |
sudo apt-get -y install linux-image-extra-$(uname -r) | |
sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -" | |
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main\ > /etc/apt/sources.list.d/docker.list" | |
sudo apt-get update | |
sudo apt-get -y install lxc-docker |
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
; IMPORTANT INFO ABOUT GETTING STARTED: Lines that start with a | |
; semicolon, such as this one, are comments. They are not executed. | |
; This script has a special filename and path because it is automatically | |
; launched when you run the program directly. Also, any text file whose | |
; name ends in .ahk is associated with the program, which means that it | |
; can be launched simply by double-clicking it. You can have as many .ahk | |
; files as you want, located in any folder. You can also run more than | |
; one ahk file simultaneously and each will get its own tray icon. |
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
#Persistent | |
; update mouse tooltip position this often, in ms | |
; 10 ms looks the smoothest, but you may prefer a higher value | |
; if the CPU load is too high with 10 ms | |
MouseTipUpdateInterval := 10 | |
; a usage example | |
Tip("This is an example mousetip.") |
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 | |
export EC2_HOME=/usr/local/share/ec2_tools/ | |
export JAVA_HOME=/usr/lib/jvm/java | |
export PATH=$PATH:$EC2_HOME/bin | |
INSTANCEID=`curl -s http://169.254.169.254/latest/meta-data/instance-id` | |
case "$1" in | |
MASTER) | |
logger triggering notify master event |
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
class SomeClass1Test extends SomeBaseClass { | |
@Test | |
public void someTestMethod1() { | |
... | |
} | |
} | |
class SomeClass1Test extends SomeBaseClass { |