Skip to content

Instantly share code, notes, and snippets.

View rexwhitten's full-sized avatar

Rex Whitten rexwhitten

View GitHub Profile
@rexwhitten
rexwhitten / gist:46855f61779fd2984994
Created July 25, 2014 01:00
C# Extension method to capture the current stack trace context
/// Just return a String with the Assembly, Class, and Method name that called this method.
public static String GetMethodFullName<T>(this T Instance)
{
StackTrace stackTrace = new StackTrace();
StackFrame stackFrame = stackTrace.GetFrame(1);
MethodBase methodBase = stackFrame.GetMethod();
return String.Format("{0}.{1}.{2}", methodBase.DeclaringType.Namespace, methodBase.DeclaringType.Name, methodBase.Name);
}
@rexwhitten
rexwhitten / solarized-dark.css
Created November 28, 2018 12:30 — forked from nicolashery/solarized-dark.css
Solarized theme stylesheets for Jekyll and Pygments
/* Solarized Dark
For use with Jekyll and Pygments
http://ethanschoonover.com/solarized
SOLARIZED HEX ROLE
--------- -------- ------------------------------------------
base03 #002b36 background
base01 #586e75 comments / secondary content
@rexwhitten
rexwhitten / Install-Com.ps1
Created March 2, 2019 02:13
Powershell script to install a COM+ Application and or Component
<#
.EXAMPLE .\Install-Com.ps1 -applicationName "test.application" `
-applicationIdentity "someuser" `
-componentBinPath "C:\where\is\your\dll\some.dll"
This will install 1 COM+ component to an application
If you have 1 application with 3 components
- call this 3 times for each COM+ Component dll path
#>
@rexwhitten
rexwhitten / rotate_desktop.sh
Created June 18, 2019 13:32 — forked from mildmojo/rotate_desktop.sh
Script to rotate the screen and touch devices on modern Linux desktops. Great for convertible laptops.
#!/bin/bash
#
# rotate_desktop.sh
#
# Rotates modern Linux desktop screen and input devices to match. Handy for
# convertible notebooks. Call this script from panel launchers, keyboard
# shortcuts, or touch gesture bindings (xSwipe, touchegg, etc.).
#
# Using transformation matrix bits taken from:
# https://wiki.ubuntu.com/X/InputCoordinateTransformation
@rexwhitten
rexwhitten / .bashrc
Created August 2, 2019 13:36 — forked from VasekPurchart/.bashrc
GIT global configuration and enhancements
# used by Git (commit messages, rebase, ...)
export EDITOR=vim
# create a tinycorelinux fs with custom .tcz packages
# prerequisites: apt-get install squashfs-tools, npm i nugget -g
# dl release + packages (add your packages here)
nugget http://tinycorelinux.net/6.x/x86_64/release/CorePure64-6.3.iso http://tinycorelinux.net/6.x/x86_64/tcz/{pkg-config,make,gcc,gcc_base-dev,gcc_libs-dev,gcc_libs,glibc_base-dev,linux-3.16.2_api_headers,fuse}.tcz -c
# to support compiling addons
unsquashfs -f pkg-config.tcz
unsquashfs -f make.tcz
unsquashfs -f gcc.tcz
@rexwhitten
rexwhitten / install-azure-cli.sh
Created March 23, 2022 14:08
Install Azure CLI on Ubuntu
AZ_REPO=$(lsb_release -cs)
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
curl -L https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo apt-get -y install apt-transport-https
sudo apt-get update && sudo apt-get -y install azure-cli
@rexwhitten
rexwhitten / install-hashicorp.ps1
Last active October 13, 2022 12:10
HashiCorp Install Script
param(
[string]$productName = "terraform",
[string]$os = "linux",
[string]$arch = "amd64",
[string]$version = "latest"
)
Function Get-Products {
Invoke-RestMethod -Uri https://api.releases.hashicorp.com/v1/products | Format-Table
}
@rexwhitten
rexwhitten / index.js
Created February 1, 2024 20:30
Git Commit Message Creator
#! /usr/bin/env node
import OpenAI from "openai";
import { exec } from 'child_process';
exec('git status', async (error, stdout, stderr) => {
if (error) {
console.error(`exec error: ${error}`);
return;
}
if (stderr) {
@rexwhitten
rexwhitten / cleanup_okta_users.sh
Last active June 12, 2024 11:42
Okta and Vault Test Credential Automation
#!/bin/bash
# You should have these envvars setup already
# VAULT_ADDR="https://your-vault-address"
# VAULT_TOKEN="your-vault-token"
# Define Okta and Vault configuration variables
OKTA_DOMAIN="yourOktaDomain"
VAULT_API_TOKEN_PATH="secret/data/okta/api_token"
VAULT_USER_CREDS_PATH="secret/data/okta/users"