Skip to content

Instantly share code, notes, and snippets.

View glombard's full-sized avatar

Gert Lombard glombard

View GitHub Profile
@glombard
glombard / repo.json
Created August 21, 2014 16:56
Repository Metadata
{
"name": "Tools",
"url": "http://20.30.40.50:8080/tfs/DefaultCollection/Project/_git/Tools",
"description": "Internal developer tools",
"developers": [
"Gert Lombard <[email protected]>"
],
"dependencies": [
"http://20.30.40.50:8080/tfs/DefaultCollection/Other/_git/Libraries"
],
@glombard
glombard / .bash_profile
Created August 3, 2014 18:18
Create a BitBucket Git repo for my current working directory
function mkrepo () {
BBUSER=user
BBPASS=password
BBLOGIN=$BBUSER:$BBPASS
DIR=${PWD##*/}
echo "Making BitBucket repo '$DIR' ..."
git init
curl -u $BBLOGIN -X POST https://api.bitbucket.org/1.0/repositories/ -d "name=$DIR&is_private=1" -v
git remote add origin https://[email protected]/$BBUSER/$DIR.git
}
@glombard
glombard / get-boot2docker-with-vbga.sh
Created August 2, 2014 18:51
Replace boot2docker.iso with version with VBox guest additions (by steeve and mattes)
# see: https://github.com/boot2docker/boot2docker/pull/284
URL=$(curl -s https://medium.com/boot2docker-lightweight-linux-for-docker/boot2docker-together-with-virtualbox-guest-additions-da1e3ab2465c | grep -io '"http://[^"]*iso"' | sed -E 's/"(.*)"/\1/' | head -1)
if [ -f ~/.boot2docker/boot2docker.iso ] && [ ! -f ~/.boot2docker/boot2docker-original.iso ]
then
echo Backup existing file to ~/.boot2docker/boot2docker-original.iso ...
mv ~/.boot2docker/boot2docker.iso ~/.boot2docker/boot2docker-original.iso
fi
@glombard
glombard / set-npm-vs-version.ps1
Created July 27, 2014 18:18
Set Visual Studio version to use for Node's NPM on Windows (by default it uses VS2010)
# See: https://www.npmjs.org/package/node-gyp
$vsVersion = "2012"
if (Test-Path HKLM:\Software\Microsoft\VisualStudio\12.0) {
$vsVersion = "2013"
}
npm.cmd config set msvs_version $vsVersion
@glombard
glombard / setup-wifi.sh
Created July 22, 2014 18:57
Install wifi drivers for Ubuntu / Lubuntu 14.04 on Acer Aspire 5755G (Broadcom BCM43227 network controller)
# Determine wireless device model (manufacturer 14e4 for Broadcom):
lspci -vvnn | grep 14e4
# Install Broadcom STA driver for BCM43227:
sudo apt-get update
sudo apt-get install --reinstall linux-headers-generic build-essential dkms bcmwl-kernel-source
sudo modprobe -r b43 ssb wl brcmfmac brcmsmac bcma
sudo modprobe wl
# Connect (press Fn+F3 to enable wifi if necessary first):
@glombard
glombard / .bash_profile
Last active September 2, 2019 16:19
Script to install some Mac OS X tools
alias ll='ls -FGlAhp'
function goweb () {
cd ~/src/MyProj
git up
ll
git status --short
}
@glombard
glombard / Get-ScriptPath.ps1
Created May 2, 2014 10:45
Use different techniques to determine a PowerShell script's directory: try `$PSScriptRoot`, `$MyInvocation.MyCommand.Path`, `$ExecutionContext.SessionState.Module.Path` and `$PWD`.
function Get-ScriptPath {
$scritDir = Get-Variable PSScriptRoot -ErrorAction SilentlyContinue | ForEach-Object { $_.Value }
if (!$scriptDir) {
if ($MyInvocation.MyCommand.Path) {
$scriptDir = Split-Path $MyInvocation.MyCommand.Path -Parent
}
}
if (!$scriptDir) {
if ($ExecutionContext.SessionState.Module.Path) {
$scriptDir = Split-Path (Split-Path $ExecutionContext.SessionState.Module.Path)
@glombard
glombard / add-credential.bat
Created May 1, 2014 10:59
Use cmdkey to add a Git credential to the Windows Credential Manager
# to add a new Git credential to the Credential Manager:
cmdkey /generic:LegacyGeneric:target=git:https://github.com /user:username /pass:"mypassword"
# to list all credentials:
cmdkey /list
@glombard
glombard / list-tfs-work-items.ps1
Created April 28, 2014 13:57
Access TFS API using PowerShell
@(
'Microsoft.TeamFoundation.Build.Client',
'Microsoft.TeamFoundation.Build.Common',
'Microsoft.TeamFoundation.Client',
'Microsoft.TeamFoundation.WorkItemTracking.Client'
) | % {
[Reflection.Assembly]::LoadWithPartialName($_) | Out-Null
}
$uri = [URI]"https://my-tfs-online.visualstudio.com/DefaultCollection/"
@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