Skip to content

Instantly share code, notes, and snippets.

View BrendanThompson's full-sized avatar
🍏
Getting rejected by Apple

Brendan Thompson BrendanThompson

🍏
Getting rejected by Apple
View GitHub Profile
@BrendanThompson
BrendanThompson / updateKeyVal.ps1
Created October 8, 2014 07:14
Function to update Key Value pairs in Configuration Files
Param(
[string]$configurationFilePath,
[string]$configKey,
[string]$configValue
)
((Get-Content -Path $configurationFilePath) | Foreach-Object {
$line = $_
if ($line -like "*=*") {
$lineArray = $line -split "=", 2
@BrendanThompson
BrendanThompson / listDownloads.sh
Created October 16, 2014 11:04
List everything you've ever downloaded OSX
#!/bin/sh
sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'select LSQuarantineDataURLString from LSQuarantineEvent' |more
@BrendanThompson
BrendanThompson / dnsBulkUpdate.ps1
Created December 18, 2014 07:03
Take an input file, and bulk update internal DNS records.
[CmdletBinding()]
Param (
[string] $inputFile,
[switch] $dr,
[switch] $prd
)
Write-Verbose "Global Variable Declaration"
# Store PSCredential as SecureString
New-Variable -Name "myPassword" -Value $(Read-Host -AsSecureString | ConvertFrom-SecureString)
New-Variable -Name "myUsername" -Value "DOMAIN\Administrator"
# Construct PSCredential Object
New-Variable -Name "myCredential" -Value $(New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $myUsername, $myPassword)
# Now the Variable `myCredential` can be used as a Credential object to be passed around
@BrendanThompson
BrendanThompson / Get-SHPActiveDirectoryGroups.ps1
Created February 7, 2015 06:45
Retrieves all AD Groups used for permissions recursively within SharePoint
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
$siteCollection = New-Object Microsoft.SharePoint.SPSite("http://companyweb")
foreach ($site in $siteCollection.AllWebs)
{
foreach ($role in $($site.Roles))
{
foreach ($user in $role.Users)
{
if ($($user.IsDomainGroup) -eq $True)
@BrendanThompson
BrendanThompson / vagrant-connect-debug-log-20150713
Last active August 29, 2015 14:24
vagrant-connect-debug-log-20150713
==> connect: Loading share 'gilded-muskrat-9271'...
==> connect: Connecting to: gilded-muskrat-9271
==> connect: Checking for proxy VM updates...
connect: Already up-to-date.
==> connect: Starting a VM for a static connect IP. This will take a few moments.
connect: Cloning VMware VM: 'hashicorp/connect-vm'. This can take some time...
==> connect: Deleting the VM...
/Users/bthompson/.vagrant.d/gems/gems/vagrant-vmware-fusion-3.2.9/lib/vagrant-vmware-fusion/action_farm.rb:1098:in `call': undefined method `basename' for nil:NilClass (NoMethodError)
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in `call'
from /Users/bthompson/.vagrant.d/gems/gems/vagrant-vmware-fusion-3.2.9/lib/vagrant-vmware-fusion/action_farm.rb:482:in `call'
@BrendanThompson
BrendanThompson / octopusNotifySlack.sh
Created September 13, 2015 22:27
Notify Slack of Octopus Deploy Status
od_base="`get_octopusvariable "Octopus.Web.BaseUrl"`"
od_deployment_link="`get_octopusvariable "Octopus.Web.DeploymentLink"`"
od_deployment_name="`get_octopusvariable "Octopus.Deployment.Name"`"
od_deployer="`get_octopusvariable "Octopus.Deployment.CreatedBy.DisplayName"`"
od_project_name="`get_octopusvariable "Octopus.Project.Name"`"
od_project_link="`get_octopusvariable "Octopus.Web.ProjectLink"`"
od_release="`get_octopusvariable "Octopus.Release.Number"`"
od_release_link="`get_octopusvariable "Octopus.Web.ReleaseLink"`"
od_environment="`get_octopusvariable "Octopus.Environment.Name"`"
od_deployment_status="`get_octopusvariable "Octopus.Deployment.ErrorDetail"`"
/*
Security Audit Report
1) List all access provisioned to a sql user or windows user/group directly
2) List all access provisioned to a sql user or windows user/group through a database or application role
3) List all access provisioned to the public role
Columns Returned:
UserName : SQL or Windows/Active Directory user cccount. This could also be an Active Directory group.
UserType : Value will be either 'SQL User' or 'Windows User'. This reflects the type of user defined for the
SQL Server user account.

This is my heading

Lots of interesting content here...

SELECT
  *
FROM
  myDB
WHERE
### Keybase proof
I hereby claim:
* I am brendanthompson on github.
* I am brendanthompson (https://keybase.io/brendanthompson) on keybase.
* I have a public key ASAKBJ8IC2bsyFltaJXqKBLrDJwOuuNlp9gHlB09lN7Ivgo
To claim this, I am signing this object: