Skip to content

Instantly share code, notes, and snippets.

View fergus's full-sized avatar

Fergus fergus

  • Teachers Mutual Bank
  • Sydney, Australia
View GitHub Profile

Keybase proof

I hereby claim:

  • I am fergus on github.
  • I am ferg (https://keybase.io/ferg) on keybase.
  • I have a public key ASBkAiNO-XHj0HIA-UH_0ekZmqmVNi-np0ze4zuyai0F4wo

To claim this, I am signing this object:

@fergus
fergus / macsetup.sh
Created March 5, 2015 02:34
osx initiation script
#!/bin/sh
# This is the initiation script I use for my mac.
# I have pilfered and pinched from lots of places on the web.
# http://lapwinglabs.com/blog/hacker-guide-to-setting-up-your-mac
# https://gist.github.com/brandonb927/3195465
# https://github.com/mathiasbynens/dotfiles
# https://github.com/diimdeep/dotfiles/blob/master/osx/configure/yosemite/osx_set_defaults.sh
# http://twnsnd.co/beta-site/journal/fresh-install-yosemite/
@fergus
fergus / .tmux.conf
Last active August 29, 2015 14:16 — forked from snuggs/.tmux.conf
##############################
# _
# | |_ _ __ ___ _ ___ __
# | __| '_ ` _ \| | | \ \/ /
# | |_| | | | | | |_| |> <
# \__|_| |_| |_|\__,_/_/\_\
#
#############################
#
# COPY AND PASTE
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@fergus
fergus / get-ICSession.ps1
Created April 2, 2014 01:55
Interactive Intelligence IceLib SDK Session connection script for Powershell. Script developed for IC3.0 SU13. Requires the I3_FEATURE_ICELIB_SDK licence.
# Load the DLL (needs to be x86)
[CmdletBinding()]
param
(
[string]$ICServer,
[string]$ICPort,
[string]$UserName,
[string]$Password
@fergus
fergus / Convert-RGBtoLong.ps1
Last active January 4, 2016 04:19
This function returns accepts a string of three comma separated values and converts these to a Long value suitable for use in Excel.
Function Convert-RGBtoLong
(
[string] $RGBString = "0,160,175" #Teal
)
{
$RGBLong = ([int]$RGBString.split(",")[2] *65536) + ([int]$RGBString.split(",")[1]*256) + [int]$RGBString.split(",")[0]
Write-Verbose "Convert-RGBtoLong: $RGBString = $RGBLong"
$RGBLong;
@fergus
fergus / get-SQL.ps1
Last active January 4, 2016 02:09
Powershell 2.0 code to execute SQL Server query and populate a new Excel xlsx document with the returned SQL dataset.
# Created by Fergus Stevens
# V1 - 22/01/14 - Initial Version
# V2 - 04/02/14 - Much *MUCH* faster import of data to excel using multi dimensional array import technique.
# http://powertoe.wordpress.com/2010/11/05/how-to-get-data-into-an-excel-spreadsheet-very-quickly-with-powershell-contd/
# Improved console output and use of stnadard Support functions library
[CmdletBinding()]
Param()
# Create stopwatch
@fergus
fergus / ADMobile.ps1
Created December 16, 2013 01:55
Powershell to retrieve Mobile numbers from Active Directory
# Created by Fergus Stevens
# V1 - 16/12/13 - Initial Version
# Filter for Active Users
$strFilter = "(&(objectCategory=User)(!(UserAccountControl:1.2.840.113556.1.4.803:=2)))"
#What attributes do you need? source: http://www.kouti.com/tables/userattributes.htm
$colProplist = "name", "title", "mobile"
$objDomain = New-Object System.DirectoryServices.DirectoryEntry
@fergus
fergus / WrapUpCodesOnQueue.sql
Created October 31, 2013 21:50
Interactive Intelligence (ININ) Customer Interaction Centre (CIC) 3.0 MS SQL Query for returning the wrap-up code associated with a specific Workgroup.
-- Interactive Intelligence (ININ) Customer Interaction Centre (CIC) 3.0 MS SQL Query for returning the wrap-up code counts associated with a specific Workgroup.
SELECT WrapUpCode, count(WrapUpCode) as WrapupCount
FROM dbo.calldetail
WHERE
InitiatedDate > '2013-09-01' AND InitiatedDate < '2013-10-01'
AND InteractionType = 0 -- Phone Calls Only
AND CallEventLog like '%Entered Workgroup Queue - Call Centre Secured Loans%'
GROUP BY WrapUpCode