Skip to content

Instantly share code, notes, and snippets.

@TylerJWhit
TylerJWhit / Get-RemoteLocalGroupMembers.ps1
Last active April 28, 2021 17:32
Get-RemoteLocalGroupMembers
# Version: 0.5
# Date: 2021-04-28
# File Name: Get-RemoteLocalGroupMembers
# Author: TylerJWhit
# Notes:
# The following commands may be of help:
#
# Run against every computer in domain.
# Get-ADComputer -Filter * | Select-Object -ExpandProperty Name | Get-RemoteLocalGroupMembers
#
@TylerJWhit
TylerJWhit / .bashrc
Last active March 12, 2020 02:14 — forked from chrisnolet/.bash_profile
Color-coded git branch for bash prompt
# Original Source https://gist.github.com/chrisnolet/46206e21d59f8250bb979a8516a9a034
# Modified to stick with Pop_OS! Style.
parse_git_branch() {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (*\([^)]*\))*/\1/'
}
markup_git_branch() {
if [[ -n $@ ]]; then
if [[ -z $(git status --porcelain 2> /dev/null) ]]; then
@TylerJWhit
TylerJWhit / .bash_profile
Created March 1, 2020 07:57 — forked from chrisnolet/.bash_profile
Color-coded git branch for bash prompt
parse_git_branch() {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (*\([^)]*\))*/\1/'
}
markup_git_branch() {
if [[ -n $@ ]]; then
if [[ -z $(git status --porcelain 2> /dev/null) ]]; then
echo -e " \001\033[32m\002($@)\001\033[0m\002"
else
echo -e " \001\033[31m\002($@)\001\033[0m\002"
@TylerJWhit
TylerJWhit / rpn.py
Last active February 22, 2019 02:15
RPN Calculator
# TylerJWhit
# RPN Calculator
# 2019.02.21
# Example:
# python3 rpn.py 3 47 22 + -
import sys
import argparse
@TylerJWhit
TylerJWhit / nato.py
Last active February 19, 2019 00:31
Text to Nato
import argparse
import sys
def get_argument_parser():
parser = argparse.ArgumentParser(description = 'Converts string to Nato Alphabet')
parser.add_argument('argstr', type = str)
return parser
@TylerJWhit
TylerJWhit / testargs.py
Created February 16, 2019 17:47
Test argparse
import argparse
parser = argparse.ArgumentParser(description = 'Process strings')
parser.add_argument('-u', '--uppercase', action = 'store_true', default = False)
parser.add_argument('-l', '--lowercase', action = 'store_true', default = False)
parser.add_argument('-t', '--text', type=str)
@TylerJWhit
TylerJWhit / Get-InstalledApps.ps1
Last active December 7, 2019 16:02
List all applications in Windows
# Version: 0.5
# Date: 2019-01-30
# File Name: Get-InstalledApps
# Author: TylerJWhit
# Notes:
# The following commands may be of help:
#
# Run against every computer in domain.
# Get-ADComputer -Filter * | Select-Object -ExpandProperty Name | Get-InstalledApps
#
base:
'*':
- basepkgs
- sshsetup
roles:webserver:
- match: grain
- apache
@TylerJWhit
TylerJWhit / gist:5e2cfd26c9eda4bb82140788f1b75215
Last active January 11, 2017 01:38
FreeBSD Drives, Memory, Motherboard, and CPU info
geom disk list | grep 'Mediasize\|descr'; sysctl hw.physmem hw.model; dmidecode --type baseboard | grep Product
@TylerJWhit
TylerJWhit / Fixing xdg-open
Created September 2, 2015 21:55
When Ubuntu doesn't play nice with XFCE and mime types. Change generic to xfce in /usr/bin/xdg-open
detectDE
if [ x"$DE" = x"" ]; then
DE=xfce
fi