Skip to content

Instantly share code, notes, and snippets.

View glombard's full-sized avatar

Gert Lombard glombard

View GitHub Profile
@glombard
glombard / install-vbox-ubuntu-precise.sh
Last active December 31, 2015 06:49
Installing VirtualBox on Ubuntu Server
sudo apt-get update
sudo apt-get -y install virtualbox-ose
sudo apt-get -y install php5
sudo apt-get -y install unzip
curl -L -of.zip http://sourceforge.net/projects/phpvirtualbox/files/phpvirtualbox-4.2-8.zip/download
sudo unzip -o f.zip -d /var/www/
sudo cp /var/www/config.php-example /var/www/config.php
@glombard
glombard / ClipboardNotification.cs
Created December 16, 2013 12:34
Monitor Clipboard changes in C# using AddClipboardFormatListener / WM_CLIPBOARDUPDATE. See Clipboard class: http://msdn.microsoft.com/en-us/library/system.windows.clipboard(v=vs.110).aspx
// from: http://stackoverflow.com/questions/2226920/how-to-monitor-clipboard-content-changes-in-c
/// <summary>
/// Provides notifications when the contents of the clipboard is updated.
/// </summary>
public sealed class ClipboardNotification
{
/// <summary>
/// Occurs when the contents of the clipboard is updated.
/// </summary>
@glombard
glombard / html2md.py
Created January 20, 2014 15:11
Converts Pluralsight transcript HTML to Markdown.
"""Converts Pluralsight transcript HTML to Markdown.
"""
from bs4 import BeautifulSoup
import sys
soup = BeautifulSoup(open(sys.argv[1]))
name = soup.find('meta', itemprop='name')['content']
description = soup.find('meta', property='og:description')['content']
@glombard
glombard / Get-TFS-History-For-Date-Range.bat
Last active January 4, 2016 03:09
Batch file to export the TFS history for each user individually using TF.EXE
@echo off
set from=2014-01-01
set to=2014-12-31
echo Exporting TFS History from %from% to %to%
where tf.exe
if errorlevel 1 call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat"
set tfproject=$/proj/src
set tflogin=DOMAIN\user3,mypasswd
set tfcollection=http://192.168.1.10:8080/tfs/collection
tf history %tfproject% /version:D"%from%"~D"%to%" /user:* /format:detailed /noprompt /login:"%tflogin%" /collection:%tfcollection% /recursive > history.txt
@glombard
glombard / new-bootstrap-project.bat
Created February 12, 2014 17:34
Quickly get going with bower, bootstrap, knockout
D:
md work\Topics
cd work\Topics
cinst curl
cinst nodejs.install
set path=%path%;C:\Program Files\nodejs
setx path "%path%" /m
npm install -g bower
bower install bootstrap
bower install knockout
@glombard
glombard / Progress-Module.ps1
Created March 4, 2014 19:30
A simple module to wrap a nicer interface around Write-Progress. It allows you to first register each step you're going to perform and then you activate/set each step as you progress through your script.
# A simple module to wrap a nicer interface around Write-Progress.
# It allows you to first register each step you're going to perform and
# then you activate/set each step as you progress through your script.
$progress = New-Module -ScriptBlock {
[string]$title = 'Progress'
[int]$totalSteps = 0
function Activity {
param([string]$activity)
@glombard
glombard / unblock-files.ps1
Created April 7, 2014 10:11
Unblock files downloaded from the internet using streams.exe
if (!(Test-Path "$env:Temp\streams.exe")) {
(new-object System.Net.WebClient).DownloadFile('http://live.sysinternals.com/streams.exe', "$env:Temp\streams.exe")
}
# "Unblock" the files...
& "$env:Temp\streams.exe" @('-d', '*.*')
@glombard
glombard / setup-angularjs-tools.sh
Last active August 29, 2015 14:00
Install Grunt/Bower/Yo tools for AngularJS on OS X
# Install nodejs under /usr/local/Cellar/node/0.10.26/
brew update
brew install node
# install global node modules under /usr/local/lib/node_modules/
npm install -g grunt-cli
npm install -g yo
npm install -g bower
npm install -g generator-angular
npm install -g protractor
@glombard
glombard / tfs-checkout-sample.bat
Last active September 30, 2019 09:50
TFS checkout files from a batch file
@echo off
setlocal EnableExtensions
set tfuser=glombard
set tflogin=/login:DOMAIN\%tfuser%,password
set tfworkspace=TFSWorkspace
set tfdir=C:\temp\MyWorkspace
set tfsource=$/PROJ/Source
set tfurl=http://127.0.0.1:8080/tfs/TEAM/
@glombard
glombard / import-windows7-virtualbox.sh
Created April 21, 2014 17:16
Download and install the IE11 Windows 7 virtual machine from Modern.ie into VirtualBox on Mac OS X
curl -O -L "http://www.modern.ie/vmdownload?platform=mac&virtPlatform=virtualbox&browserOS=IE11-Win7&parts=4&filename=VMBuild_20131127/VirtualBox/IE11_Win7/Mac/IE11.Win7.For.MacVirtualBox.part{1.sfx,2.rar,3.rar,4.rar}"
brew install unrar
unrar x IE11.Win7.For.MacVirtualBox.part1.sfx
vboxmanage import "IE11 - Win7.ova" --vsys 0 --memory 2048