Skip to content

Instantly share code, notes, and snippets.

View lantrix's full-sized avatar
:octocat:
always coding and merging

Ted B lantrix

:octocat:
always coding and merging
View GitHub Profile
@lantrix
lantrix / README.md
Last active September 10, 2015 04:03 — forked from jasonberanek/README.md
Enabling VNC support in the VMware ESXi 5.x Firewall - Used by Packer for vmware-iso on ESXi HyperVisor

VMware ESXi includes a built in VNC server that can be used to access a VMs console for manipulation via automated tools (e.g., veewee) or by users on platforms where the vSphere Client is not supported. In ESXi 5.x, the built-in firewall does not allow VNC traffic to be received by the VNC server, even when an individual VM is configured to support this configuration. To complete this activity, the firewall has to be modified to allow the appropriate ports.

The below script can be run via the ESXi command line to setup the firewall rules necessary to run VNC. A few items to note:

  • Scripts assumes the firewall rules file is the default provided as by 5.0.0 update 2 build 914586 and/or 5.1.0 build 799733 (may work in other versions)
  • In order to persist settings after a reboot, it is necessary to copy the firewall settings to either a specific datastore mapped to the host, or the local persistent storage linked under the /store directory. Further, the either the /etc/rc.local (ESXi 5.0) or `/etc/rc.local
Write-Host 'throw'
try
{
try
{
throw "exception"
}
catch
{
@lantrix
lantrix / README.md
Last active August 29, 2015 14:08 — forked from abernier/README.md
'Clone in Mac' button on gists for GitHub

Download the user.js file and then drop it into your chrome://extensions/ tab and enjoy the Clone in Desktop button on your gists!

$disks = (wmic diskdrive list brief | measure-object -line | select -ExpandProperty Lines)-2
#1..
$disks | ForEach-Object -Begin {$a = $null} -Process { `
$a += $("select disk "+$_+[char][int](13)+[char][int](10)) ; `
$a += "online disk noerr "+[char][int](13)+[char][int](10) ; `
$a += "clean "+[char][int](13)+[char][int](10) ; `
$a += "attributes disk clear readonly noerr "+[char][int](13)+[char][int](10) ; `
$a += "convert dynamic noerr "+[char][int](13)+[char][int](10) ;} -End { $a += "exit"+[char][int](13)+[char][int](10) ; `
$a | Set-Content c:\diskpart1.txt -Encoding ASCII `
@lantrix
lantrix / pptxml2hrm.rb
Created October 18, 2011 11:04 — forked from mgratzer/pptxml2hrm.rb
Simple script to convert HRM data from XML documents exported via http://www.personaltrainer.com (e.g. for use with RunKeeper)
#!/usr/bin/env ruby
require 'rexml/document'
def file_name(file)
if file.end_with?(".xml") then
file = file.gsub(".xml", ".hrm")
else
file = "#{file}.hrm"
end
return file
@lantrix
lantrix / .bashrc.sh
Created November 27, 2009 06:28 — forked from tekkub/.bashrc
Git branch name in Bash Prompt showing user@host:path(git_branch) - for xterm-color
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1="\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$(parse_git_branch) "
case `id -u` in
0) PS1="${PS1}# ";;
*) PS1="${PS1}$ ";;
esac