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 / .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
@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
$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 / 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!

Write-Host 'throw'
try
{
try
{
throw "exception"
}
catch
{
@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
@lantrix
lantrix / configure-winrm.ps1
Last active August 29, 2015 14:27 — forked from sneal/configure-winrm.ps1
Configure WinRM for Vagrant
winrm quickconfig -q
winrm quickconfig -transport:http
winrm set winrm/config '@{MaxTimeoutms="7200000"}'
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="0"}'
winrm set winrm/config/winrs '@{MaxProcessesPerShell="0"}'
winrm set winrm/config/winrs '@{MaxShellsPerUser="0"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/service/auth '@{Basic="true"}'
winrm set winrm/config/client/auth '@{Basic="true"}'
winrm set winrm/config/listener?Address=*+Transport=HTTP '@{Port="5985"} '
@lantrix
lantrix / install.sh
Last active September 14, 2015 10:44 — forked from mnem/install_all_the_things.sh
Things to install on a fresh Mac: bash <(curl -fsSL https://gist.github.com/lantrix/9bc2768e9ca1bf03de46/raw/install.sh) - evolved into https://github.com/lantrix/boxen
#!/usr/bin/env bash
function execute_after_confirm {
read -p "$1 ($2) ? [y/n] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
shift
for var in "$@"
do
@lantrix
lantrix / osx-10.10-setup.md
Last active August 26, 2015 01:46 — forked from kevinelliott/osx-10.10-setup.md
Mac OS X 10.10 Yosemite Setup

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

[
{
"keys": ["ctrl+alt+f"],
"args": {
"id": "repl_f#",
"file": "config/F/Main.sublime-menu"
},
"command": "run_existing_window_command"
},
{