Skip to content

Instantly share code, notes, and snippets.

View nstevens1040's full-sized avatar

Nicholas Stevens nstevens1040

View GitHub Profile
/dts-v1/;
/ {
#address-cells = <0x02>;
model = "M01K43";
#size-cells = <0x02>;
interrupt-parent = <0x01>;
compatible = "M01K43";
syscon@10060000 {
function Renew-SslLetsEncrypt
{
[cmdletbinding()]
Param(
[Parameter(Mandatory=$true)]
$HostName
)
certbot certonly `
--standalone `
--agree-tos `
@nstevens1040
nstevens1040 / StartSeleniumChromedriver.py
Created June 5, 2024 12:36
Start Selenium Chromedriver using Python
# pip install selenium
from selenium import webdriver
options=webdriver.ChromeOptions()
options.page_load_strategy = 'normal'
options.add_argument("--disable-extensions")
options.add_argument("--disable-gpu")
options.add_argument("--no-sandbox")
options.add_argument("--disable-3d-apis")
if(
[Security.Principal.WindowsPrincipal]::New([Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
){
Set-ExecutionPolicy -Scope Process Unrestricted -Force
Set-ExecutionPolicy -Scope CurrentUser Unrestricted -Force
Set-ExecutionPolicy -Scope LocalMachine Unrestricted -Force
Set-ExecutionPolicy Unrestricted -Force
} else {
Set-ExecutionPolicy -Scope Process Unrestricted -Force
Set-ExecutionPolicy -Scope CurrentUser Unrestricted -Force
@nstevens1040
nstevens1040 / cell-rf-spec-bands-lte.json
Created September 2, 2023 14:22
Cellular Radio Frequency Spectrum Bands for LTE
[
{
"Downlink": [
2110.0,
2140.0,
2170.0
],
"DLEARFCN": [
0.0,
300.0,
@nstevens1040
nstevens1040 / Get-NonMicrosoftStartupServices.ps1
Created May 25, 2023 19:53
Goal of this script is to give you exactly what `msconfig -> services -> hide all Microsoft services` gives you, using Windows PowerShell. Result is exported to a csv file named services.csv on your Desktop.
add-type -TypeDefinition @"
namespace Services_
{
using System;
public class Info
{
public Info()
{
}
public string ServiceName { get; set; }
@nstevens1040
nstevens1040 / MSVCPP_installer.cmd
Created May 18, 2022 06:59
For when you encounter the following: error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
REM Use choco.exe
choco.exe install visualstudio2022-workload-vctools -y
@nstevens1040
nstevens1040 / MakeJsonHumanReadable.ps1
Created November 4, 2021 19:22
Convert JSON data to a digestible plaintext format
# this script requires https://github.com/nstevens1040/Json.Deserializer
$d = [Json.Deserialize]::Convert(@"
{
"Exhibit":{
"a":{
"evidence":"This is just a string.",
"comment": ".gnirts a tsuj si sihT"
},
"b":{
"evidence":"This is just another string.",
@nstevens1040
nstevens1040 / iText7_Copy_PDF_Text_.ps1
Last active November 4, 2021 19:11
iText7 Extract PDF text from select pages
$REFS = @(
"$($BINFOLDER)\itext7-dotnet\itext\itext.pdfa\bin\Debug\net461\itext.pdfa.dll",
"$($BINFOLDER)\itext7-dotnet\itext\itext.pdfa\bin\Debug\net461\Microsoft.Bcl.AsyncInterfaces.dll",
"$($BINFOLDER)\itext7-dotnet\itext\itext.pdfa\bin\Debug\net461\Microsoft.Extensions.DependencyInjection.Abstractions.dll",
"$($BINFOLDER)\itext7-dotnet\itext\itext.pdfa\bin\Debug\net461\Microsoft.Extensions.DependencyInjection.dll",
"$($BINFOLDER)\itext7-dotnet\itext\itext.pdfa\bin\Debug\net461\Microsoft.Extensions.Logging.Abstractions.dll",
"$($BINFOLDER)\itext7-dotnet\itext\itext.pdfa\bin\Debug\net461\Microsoft.Extensions.Logging.dll",
"$($BINFOLDER)\itext7-dotnet\itext\itext.pdfa\bin\Debug\net461\Microsoft.Extensions.Options.dll",
"$($BINFOLDER)\itext7-dotnet\itext\itext.pdfa\bin\Debug\net461\Microsoft.Extensions.Primitives.dll",
"$($BINFOLDER)\itext7-dotnet\itext\itext.pdfa\bin\Debug\net461\System.Buffers.dll",
@nstevens1040
nstevens1040 / iText7_Copy_PDF_Pages.ps1
Created November 4, 2021 18:07
iText7 copy select pages from source PDF to new PDF
$REFS = @(
"$($BINFOLDER)\itext7-dotnet\itext\itext.pdfa\bin\Debug\net461\itext.pdfa.dll",
"$($BINFOLDER)\itext7-dotnet\itext\itext.pdfa\bin\Debug\net461\Microsoft.Bcl.AsyncInterfaces.dll",
"$($BINFOLDER)\itext7-dotnet\itext\itext.pdfa\bin\Debug\net461\Microsoft.Extensions.DependencyInjection.Abstractions.dll",
"$($BINFOLDER)\itext7-dotnet\itext\itext.pdfa\bin\Debug\net461\Microsoft.Extensions.DependencyInjection.dll",
"$($BINFOLDER)\itext7-dotnet\itext\itext.pdfa\bin\Debug\net461\Microsoft.Extensions.Logging.Abstractions.dll",
"$($BINFOLDER)\itext7-dotnet\itext\itext.pdfa\bin\Debug\net461\Microsoft.Extensions.Logging.dll",
"$($BINFOLDER)\itext7-dotnet\itext\itext.pdfa\bin\Debug\net461\Microsoft.Extensions.Options.dll",
"$($BINFOLDER)\itext7-dotnet\itext\itext.pdfa\bin\Debug\net461\Microsoft.Extensions.Primitives.dll",
"$($BINFOLDER)\itext7-dotnet\itext\itext.pdfa\bin\Debug\net461\System.Buffers.dll",