Skip to content

Instantly share code, notes, and snippets.

sudo aptitude -y install smbfs
sudo mount //host-2.blah.net/c\$ host-2.blah.net -ouser=Administrator,password=ca\$hc0w
service mgmt-vmware restart # Restart hostd
service vmware-vpxa restart # Restart vpxa
rpm -qa | grep vpxa | xargs rpm -e # Uninstall vpxa (allowing it to be auto-installed again)
# Check the state of Intel VT/AMD-V on a host:
# 0 – VT/AMD-V indicates that support is not available in this hardware.
# 1 – VT/AMD-V indicates that VT and AMD-V might be available but they are not supported in this hardware.
# 2 – VT/AMD-V indicates that VT and AMD-V are available but are currently not enabled.
# 3 – VT/AMD-V indicates that VT and AMD-V are enabled in the BIOS and can be used.
esxcfg-info|grep HV
require 'thread'
semaphore = Mutex.new
a = Thread.new {
semaphore.synchronize {
# access shared resource
}
}
b = Thread.new {
/cygdrive/c/Program\ Files/VMware/VMware\ View/Server/tools/bin/vdmadmin.exe -L -d bn-1 -m bn-1-1 -u vdi2.net\\vp-user-1
@benash
benash / gist:2662405
Created May 11, 2012 21:04
Remove all git branches not containing 'master'
git branch -r | grep -v master | awk -F / '{print $2}' | tr '\n' ' ' | xargs git push origin --delete
// Three ways of creating an event bus in backbone
var marionetteVent = new Marionette.EventAggregator();
var backboneVent = new Backbone.Wreqr.EventAggregator();
var vent = _.extend({object}, Backbone.Events);
// parentView.js
updateData: function() {
this.data.update();
pageEventBus.trigger('dataUpdated');
}
// childView.js
initialize: function() {
this.listenTo(pageEventBus, 'dataUpdated', this.handleDataUpdate);
},
// parentView.js
updateData: function() {
this.data.update();
this.childView.render();
}
// no addition needed in childView.js
// Handling an event with on
pageEventBus.on('advancedModeSelected', this.switchToAdvancedMode, this);
// Handling the same event with listenTo (preferred)
this.listenTo(pageEventBus, 'advancedModeSelected', this.switchToAdvancedMode);