Skip to content

Instantly share code, notes, and snippets.

View jpawlowski's full-sized avatar

Julian Pawlowski jpawlowski

View GitHub Profile
@jpawlowski
jpawlowski / PS5SemanticVersion.ps1
Created February 17, 2024 12:14
PowerShell class for extended Semantic Version support that is compatible with PowerShell 5.1 to parse, compare, and sort version strings.
class SemanticVersionExtended {
<#
.SYNOPSIS
Represents a Semantic Version (SemVer).
#>
[int]$Major
[int]$Minor
[int]$Patch
[System.Collections.ArrayList]$PreReleaseLabel
[System.Collections.ArrayList]$BuildLabel
@jpawlowski
jpawlowski / gpg-gen-ecc.sh
Last active May 6, 2022 08:57
Unattended generation of GnuPG / OpenPGP keys w/ ECC
#!/bin/sh
NAME='John Doe'
EMAIL='jdo@example.com'
export GNUPGHOME="$(mktemp -d)"
cat >$TMPDIR/gpg-gen.tmpl <<EOF
%echo Generating an OpenPGP key
Key-Type: eddsa
Key-Curve: ed25519
@jpawlowski
jpawlowski / profile.ps1
Created January 2, 2022 16:41 — forked from SteveL-MSFT/profile.ps1
PowerShell Prompt
#Requires -Version 7
# Version 1.2.10
# check if newer version
$gistUrl = "https://api.github.com/gists/a208d2bd924691bae7ec7904cab0bd8e"
$latestVersionFile = [System.IO.Path]::Combine("$HOME",'.latest_profile_version')
$versionRegEx = "# Version (?<version>\d+\.\d+\.\d+)"
if ([System.IO.File]::Exists($latestVersionFile)) {

PowerShell modules, digital signatures, NuGet nuspec and packages

d-fens GmbH General-Guisan-Strasse 6 CH-6300 Zug Switzerland

@jpawlowski
jpawlowski / profile.ps1
Created November 8, 2021 08:03
Dynamic Multi-Platform PowerShell Profile Loader
<#
.SYNOPSIS
Dynamic Multi-Platform PowerShell Profile Loader
.DESCRIPTION
Safe this script named 'profile.ps1' in either $PROFILE.AllUsersAllHosts or
$PROFILE.CurrentUserAllHosts.
(see: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_profiles#the-profile-variable)
It will automatically create a directory structure for every PS host
application, platform and PowerShell edition you use and replicate itself as
@jpawlowski
jpawlowski / powershell.json
Created August 16, 2020 13:47 — forked from rkeithhill/powershell.json
PowerShell snippets file for Visual Studio Code - place in your ~\AppData\Roaming\Code\User\Snippets directory
{
"Condition statement": {
"prefix": "cond",
"body": [
"${_} { ${0}; break }"
],
"description": "Switch condition statement"
},
"Condition single quoted string statement": {
@jpawlowski
jpawlowski / IT_naming_schema.md
Created April 19, 2018 15:51
IT naming schema

IT Naming Schema - RfC DRAFT 2016-001


DNS SUFFIX AND SEARCH

DOMAIN NAMES:

intdomain.tld - technical internal use extdomain.tld - technical external use internal.company.tld - nice looking internal names in accordance with company name to satisfy marketing aspects; should mostly be CNAMEs to intdomain.tld company.tld - nice looking names in accordance with company name to satisfy marketing aspects; should mostly be CNAMEs to extdomain.tld

@jpawlowski
jpawlowski / reclaimWindows10.ps1
Created March 23, 2018 14:01 — forked from alirobe/reclaimWindows10.ps1
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults)
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Modified by: alirobe <alirobe@alirobe.com> based on my personal preferences.
# Version: 2.12.1, 2018-03-15
# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/
# Tweak difference:
#
# @alirobe's version is a subset focused on safely disabling telemetry, some 'smart' features and 3rd party bloat ...
@jpawlowski
jpawlowski / get_hk_services.sh
Created December 4, 2016 16:45
Extract all Homekit services and characteristics from homebridge HomeKitTypes.js
#!/bin/bash
cat /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/gen/HomeKitTypes.js |grep "^Service."|grep -v UUID | cut -d "." -f 2 | cut -d " " -f 1 | uniq | sed ':a;N;$!ba;s/\n/,/g'
echo " "
cat /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/gen/HomeKitTypes.js |grep "^Characteristic."|grep -v UUID | cut -d "." -f 2 | cut -d " " -f 1 | uniq | sed ':a;N;$!ba;s/\n/,/g'
# macOS Sierra Public Beta
sudo /usr/sbin/softwareupdate --set-catalog https://swscan.apple.com/content/catalogs/others/index-10.12beta-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz
# or
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL https://swscan.apple.com/content/catalogs/others/index-10.12beta-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz
# macOS Sierra Developer Beta
sudo /usr/sbin/softwareupdate --set-catalog https://swscan.apple.com/content/catalogs/others/index-10.12seed-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz
# or
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL https://swscan.apple.com/content/catalogs/others/index-10.12seed-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz