Download the user.js file and then drop it into your chrome://extensions/ tab and enjoy the button on your gists!
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 |
#!/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 ` |
Write-Host 'throw' | |
try | |
{ | |
try | |
{ | |
throw "exception" | |
} | |
catch | |
{ |
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
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"} ' |
#!/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 |
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.
[ | |
{ | |
"keys": ["ctrl+alt+f"], | |
"args": { | |
"id": "repl_f#", | |
"file": "config/F/Main.sublime-menu" | |
}, | |
"command": "run_existing_window_command" | |
}, | |
{ |