Skip to content

Instantly share code, notes, and snippets.

View Woznet's full-sized avatar

Woz Woznet

  • VA
  • 17:22 (UTC -05:00)
View GitHub Profile
@Woznet
Woznet / 16-colors.sh
Last active March 4, 2021 02:37
Bash Terminal - Text Formatting and Color Examples
#!/bin/bash
# This program is free software. It comes without any warranty, to the extent permitted
# by applicable law. You can redistribute it and/or modify it under the terms of the
# Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar.
# See http://sam.zoy.org/wtfpl/COPYING for more details.
# https://misc.flogisoft.com/bash/tip_colors_and_formatting
#Background
@Woznet
Woznet / gh-completion.ps1
Last active May 1, 2023 15:56
gh v2.23.0 - PowerShell Completion
# powershell completion for gh -*- shell-script -*-
function __gh_debug {
if ($env:BASH_COMP_DEBUG_FILE) {
"$Args" | Out-File -Append -FilePath "$env:BASH_COMP_DEBUG_FILE"
}
}
filter __gh_escapeStringWithSpecialChars {
$_ -replace '\s|#|@|\$|;|,|''|\{|\}|\(|\)|"|`|\||<|>|&','`$&'
@Woznet
Woznet / ca.md
Created January 11, 2021 07:36 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@Woznet
Woznet / Invoke-ReArmLicense.ps1
Last active October 9, 2024 09:37
PowerShell ReArm Windows OS Evaluation License on remote computer
function Invoke-ReArmLicense {
[CmdletBinding(DefaultParameterSetName='Rearm')]
[Alias('ReArm')]
param(
[Parameter()]
[ValidateScript({
if (-not (Test-Connection -Quiet -Count 1 -ComputerName $_)) {
throw '{0} - Computer Unavailable' -f $_
}
return $true
function Get-MsiProducts {
[CmdletBinding(SupportsShouldProcess)]
Param()
$Installer = New-Object -ComObject WindowsInstaller.Installer
$Type = $Installer.GetType()
$Products = $Type.InvokeMember('Products', [System.Reflection.BindingFlags]::GetProperty, $null, $Installer, $null)
$MsiProducts = foreach ($Product In $Products) {
try {
$MsiProduct = New-Object -TypeName PSObject -Property @{ProductCode = $Product}
$MsiProperties = @('ProductName', 'VersionString', 'InstallDate', 'PackageName', 'Publisher', 'PackageCode', 'InstallSource', 'LocalPackage', 'ProductIcon')
@Woznet
Woznet / Get-UserAgent.ps1
Created February 22, 2021 17:13
Get the default UserAgent from within powershell
# Get Default User-Agent
# https://get-powershellblog.blogspot.com/2017/12/powershell-core-web-cmdlets-in-depth_24.html#L05
#(Invoke-RestMethod -Uri https://httpbin.org/headers).Headers.'User-Agent'
Invoke-RestMethod -Uri 'ifconfig.me/ua'
[Microsoft.PowerShell.Commands.PSUserAgent].GetMembers('Static, NonPublic').Where{$_.Name -eq 'UserAgent'}.GetValue($null,$null)
@Woznet
Woznet / frontendDevlopmentBookmarks.md
Created May 8, 2021 21:41 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deprovisioned]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deprovisioned\Microsoft.BingWeather_8wekyb3d8bbwe]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deprovisioned\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deprovisioned\Microsoft.GetHelp_8wekyb3d8bbwe]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deprovisioned\Microsoft.Getstarted_8wekyb3d8bbwe]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deprovisioned\Microsoft.Microsoft3DViewer_8wekyb3d8bbwe]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deprovisioned\Microsoft.MicrosoftOfficeHub_8wekyb3d8bbwe]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
@Woznet
Woznet / cd_for_windows_paths.sh
Created May 14, 2021 16:55 — forked from Gordin/cd_for_windows_paths.sh
If you put this in your .bashrc/.zshrc you will be able to use cd to Windows style paths. This is probably only useful for WSL users.
cd() {
# Check if no arguments to make just typing cd<Enter> work
# Also check if the first argument starts with a - and let cd handle it
if [ $# -eq 0 ] || [[ $1 == -* ]]
then
builtin cd $@
return
fi
# If path exists, just cd into it
# (also, using $* and not $@ makes it so you don't have to escape spaces any more)