Skip to content

Instantly share code, notes, and snippets.

View happiness801's full-sized avatar

Kevin Gwynn happiness801

  • CHG Healthcare
  • Utah
View GitHub Profile
# Include Git Branch name in prompt if applicable
# See: https://martinfitzpatrick.name/article/add-git-branch-name-to-terminal-prompt-mac/
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /'
}
PS1="$PS1\$(parse_git_branch)"
@happiness801
happiness801 / boxstarter.ps1
Created March 9, 2018 16:39 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@happiness801
happiness801 / facebook-remove-cruft.user.js
Last active November 28, 2019 03:41
Removes Facebook cruft
// ==UserScript==
// @name Remove Ads/Cruft from facebook.com
// @namespace http://onai.net/
// @version 0.1
// @description Removes ads, cruft
// @author Kevin Gwynn
// @match https://www.facebook.com/*
// @grant none
// ==/UserScript==
@happiness801
happiness801 / ad-groups-for-user.ps1
Created February 4, 2020 19:07
Gets list of groups that a user belongs to
param([String]$requestuser=$env:username)
(
New-Object System.DirectoryServices.DirectorySearcher(
"(&(objectCategory=User)(samAccountName=$requestuser))"
)
).FindOne().GetDirectoryEntry().memberOf
@happiness801
happiness801 / ad-groups-for-user.bat
Created February 4, 2020 22:02
Call ad-groups-for-user.ps1 as batch file
@echo off
: TODO: dynamic path
powershell %USERPROFILE%\bin\ad-groups-for-user.ps1 %*
@happiness801
happiness801 / ad-groups-for-user (WSL)
Created February 4, 2020 22:03
For WSL use, get AD groups for user
#!/bin/bash
cmd.exe /c "ad-groups-for-user.bat $*"
@happiness801
happiness801 / ad-users-in-group.bat
Created February 4, 2020 22:35
Get list of users in an AD group by name
@echo off
NET GROUP %* /DOMAIN
@happiness801
happiness801 / ad-users-in-group (WSL)
Created February 4, 2020 22:38
WSL Linux version of list users in AD group (just calls batch version)
#!/bin/bash
cmd.exe /c "ad-users-in-group.bat $*"
@happiness801
happiness801 / zoom-remove-join-meeting-tabs.user.js
Last active December 14, 2020 16:03
Zoom - Auto Remove Join Meeting Tabs
// ==UserScript==
// @name Zoom - Close Stupid Windows
// @namespace http://onai.net/
// @version 0.2
// @description Just close the pointless "Joining meeting..." tabs
// @author Kevin Gwynn
// @match https://*.zoom.us/j/*
// @match https://*.zoom.us/w/*
// @grant window.close
// ==/UserScript==
@happiness801
happiness801 / sports24-remove-cruft.user.js
Last active October 3, 2021 22:03
Remove Cruft from Sports24 Video Streaming
// ==UserScript==
// @name Sports24 Cruft
// @namespace http://onai.net/
// @version 0.7
// @description Remove cruft from Sports24 video streaming
// @author Kevin Gwynn
// @match https://sports24.club/*/**/*.html
// @match https://sports24.stream/*/**/*.html
// @match https://sports24.club/**/*.html
// @match https://sports24.stream/**/*.html