Skip to content

Instantly share code, notes, and snippets.

View aldrichtr's full-sized avatar

Tim Aldrich aldrichtr

View GitHub Profile
@aldrichtr
aldrichtr / bash-colors.md
Created February 15, 2024 16:54 — forked from Prakasaka/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@aldrichtr
aldrichtr / github.bash
Created December 22, 2023 23:55 — forked from igrigorik/github.bash
Open GitHub URL for current directory/repo...
alias gh="open \`git remote -v | grep [email protected] | grep fetch | head -1 | cut -f2 | cut -d' ' -f1 | sed -e's/:/\//' -e 's/git@/http:\/\//'\`"
@aldrichtr
aldrichtr / OneNote-to-MD.md
Created November 4, 2023 11:46 — forked from heardk/OneNote-to-MD.md
Convert notes from OneNote into Markdown

Converting One Note to Markdown

This is an example of how to convert notes from OneNote into Markdown to use in other, less annoying Note applications. I am using PowerShell on Windows here, but other shell/scripting environments would work as well. If you want separate .md files, you'll need to export your OneNote pages separately. Exporting a section, or a selection of pages creates a single .docx file.

  • Download and install Pandoc
  • Export each of your note pages to a .docx (Word) format using OneNote export from the File menu
  • Gather all of these .docx files into a directory
  • Open directory in File Explorer
  • Open Powershell from the File Explorer using File -> Open Windows Powersell
  • Run the following command:
Install-Module @('PSWinDocumentation', 'PSWinDocumentation.AD', 'PSWriteWord', 'PSWriteExcel')
Import-Module PSWinDocumentation
Import-Module PSWinDocumentation.AD
# Import-Module DbaTools # (if you require SQL export)
# Those should automatically load
#Import-Module PSWriteWord
#Import-Module PSWriteExcel
#Import-Module ActiveDirectory
$Document = [ordered]@{
Configuration = [ordered] @{
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
Install-Module Posh365 -force
Install-Module GPOZaurr -force
Install-Module Posh365 -force
Import-Module Posh365 -force
Import-Module GPOZaurr -force
Import-Module Posh365 -force
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
Install-Module @('PSWinDocumentation', 'PSWinDocumentation.AD', 'PSWriteWord', 'PSWriteExcel') -force
Import-Module PSWinDocumentation -force
Import-Module ActiveDirectory -force
Import-Module PSWinDocumentation.AD -Force
Import-Module PSWriteWord -Force
if ($null -eq $ADForest) {
$ADForest = Get-WinADForestInformation -Verbose -DontRemoveEmpty
}
@aldrichtr
aldrichtr / Set-StandardMember.ps1
Created October 18, 2023 14:50 — forked from kevinblumenfeld/Set-StandardMember.ps1
sets PSStandardMember for all input objects
using namespace System.Management.Automation
function Set-StandardMember {
[CmdletBinding()]
param(
[parameter(Mandatory, ValueFromPipeline)]
[object] $InputObject,
[parameter(Mandatory)]
[string[]] $DefaultProperties
version: 1
schemas:
- id: pro
desc: project
parent: root
namespace: true
template:
id: pro.template
type: note
children:
version: 1
schemas:
- id: pro
desc: project
parent: root
namespace: true
template:
id: pro.template
type: note
children:
@aldrichtr
aldrichtr / multi-workspace.md
Created October 11, 2023 23:25 — forked from kevinslin/multi-workspace.md
mutli-workspace-setup

Creating a Personal and Work specific workspace

  1. Create a personal workspace using Initialize Workspace
    • initialize with a blank vault
      • if you want to version control the vault, run Vault Convert to add a git repository to this vault
    • repeat this process with other vaults as needed (we recommend just starting off with a single vault), see reasons for going multi-vault here
    • add your workspace to version control by running the following:
      1. Initialize a git repo