Skip to content

Instantly share code, notes, and snippets.

# Located %USERPROFILE%\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
Set-StrictMode -Version 2.0
Set-PSReadlineOption -BellStyle Visual
$env:NOENV_PATH = $env:Path
$env:JAVA8_HOME = "C:\Program Files\Eclipse Adoptium\jdk-8.0.345.1-hotspot"
$env:JAVA17_HOME = "C:\Program Files\Eclipse Adoptium\jdk-17.0.5.8-hotspot"
$env:JAVA11_HOME = "C:\Program Files\Eclipse Adoptium\jdk-11.0.17.8-hotspot"
@smarkwell
smarkwell / Member
Last active January 13, 2023 18:58
Sample Dataview Faction
---
status: Alive
factions:
- name: This File
role: Leader
---
I am the Leader of This File faction
#character
@smarkwell
smarkwell / AMD Ryzen 9 5900X.csv
Last active September 19, 2022 04:33
Core-to-core Latency for AMD 5900X, produced on Windows 11 using precompiled binary
7.55
17.700000000000003 17.983333333333334
17.7 17.45 7.550000000000001
17.7 17.966666666666672 17.45 17.45
17.96666666666667 17.716666666666665 17.45 17.433333333333337 7.566666666666668
16.133333333333336 15.883333333333336 15.633333333333336 15.366666666666667 16.4 16.4
16.15 15.883333333333335 15.366666666666667 15.616666666666667 16.416666666666668 16.666666666666668 7.550000000000001
17.45 17.7 16.416666666666668 16.133333333333333 17.71666666666667 17.45 15.366666666666665 15.366666666666667
17.450000000000003 17.71666666666667 16.133333333333333 16.150000000000002 17.700000000000003 17.45 15.633333333333335 15.350000000000001 7.566666666666668
network:
ethernets:
eth0:
addresses: [192.168.100.5/24]
gateway4: 192.168.100.1
nameservers:
addresses: [192.168.100.1]
eth1:
addresses: [<public ip>/29]
gateway4: <public ip's gateway>
@smarkwell
smarkwell / json.ps1
Last active December 12, 2023 22:45
Loading large JSON data files into Powershell
# Work around on
# ConvertFrom-Json : Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.
$json = New-Object -TypeName System.Web.Script.Serialization.JavaScriptSerializer
$json.MaxJsonLength = 104857600 #100mb as bytes, default is 2mb
$filedata = [System.IO.File]::ReadAllText($JSONDataFile) #Using default encoding
$data = $json.DeserializeObject($filedata, [System.Object])
$filedata = $null
$json = $null