Skip to content

Instantly share code, notes, and snippets.

View anonhostpi's full-sized avatar
📝
Studying...

Blue Falcon anonhostpi

📝
Studying...
View GitHub Profile
@anonhostpi
anonhostpi / simgeom.ksy
Created September 7, 2024 16:06
A Kaitai Struct for DBPF Geom Entries
meta:
id: geom
file-extension: geom
endian: le
imports:
- path/to/mtnf.ksy
seq:
- id: header
type: header
- id: shader
@anonhostpi
anonhostpi / FrocedPromise.ts
Created August 27, 2024 13:30
A TypeScript file for writing a promise that is forced non-blocking using setTimeout
/*
async functions and promises can be a bit misleading, as they are not guaranteed to be executed asynchronously.
The way these work is by deferring the execution of a portion of the code to another tick of the event loop.
For async functions, the code is executed synchronously until the first await statement,
at which point the function is suspended and the rest of the code is executed
asynchronously on another tick when the awaited promise is resolved.
For promises, the executor function is executed immediately, but in
which tick the promise is resolved can be more granularly controlled.
@anonhostpi
anonhostpi / clearscript_playground.ps1
Created June 19, 2024 08:03
A Playground in PowerShell for Messing With ClearScript
# Install-Module Import-Package
# Install-Module New-ThreadController
Write-Host "Preparing Test Environment:"
Write-Host " - Imports:"
Write-Host " - Import-Package: " -NoNewline
Try {
Import-Module "Import-Package"
Write-Host " " -NoNewline

Background

I've got this idea for an ingress controller VM using OpenWRT. I'll eventually get this implemented on my proxmox machine, but for now I'm developing my implementation in virtualbox.

Using this guide to get the generic x86-64 UEFI image to run on vb: https://openwrt.org/docs/guide-user/virtualization/virtualbox-vm

Challenges

Initial Networking

The first challenge is to design a working networking. One part of this goal will be to get LuCi to not conflict with Nginx. I could have LuCi listen to localhost (127.0.0.1), but for development purposes, I will provide it with an additional host-only testing adapter, so that LuCi can be reached directly for testing.

0 FILE mE0A7EE34_202444_114200.dat
0 Plate, Modified 2 x 1 with Towball Socket 2
0 Name: mE0A7EE34_202444_114200.dat
0 Author:
0 BFC CERTIFY CCW
3 16 -16.000 0.000 -6.000 16.000 0.000 -6.000 20.000 0.000 -10.000
3 16 20.000 0.000 -10.000 -20.000 0.000 -10.000 -16.000 0.000 -6.000
3 16 16.000 0.000 -6.000 16.000 0.000 6.000 20.000 0.000 10.000
3 16 20.000 0.000 10.000 20.000 0.000 -10.000 16.000 0.000 -6.000
3 16 16.000 0.000 6.000 -16.000 0.000 6.000 -20.000 0.000 10.000
@anonhostpi
anonhostpi / configfs.md
Last active February 20, 2024 15:14
ConfigFS, FunctionFS, GadgetFS, the Gadget API, Dual-Role, and OTG libraries - A comprehensive list of it all.

Ok, so I am writing a comprehensive list for all libraries, tools, modules, and scripts for any linux distro or kernel that I can find anywhere, so I can learn more about how to make use of it.

Currently this list contains Source Code with the following keywords:

  • FunctionFS, ConfigFS, GadgetFS, gadget mode, and USB Gadget API
  • USB 3.0 Dual-Role Device (DRD) and USB 2.0 On-The-Go (OTG)
  • libcomposite (the kernel library that ConfigFS uses to create USB gadgets)
  • DesignWare Core SuperSpeed 3.0 (DWC3)
  • appears to be the main proprieter of USB 3.0 Gadget hardware
@anonhostpi
anonhostpi / tempath.psm1
Created January 18, 2024 10:49
Temporary path generation and garbage collection
# Scope table for the module
$scope = @{}
$scope.mname = "TempPathModule"
$scope.parent_path = @(
[System.IO.Path]::GetTempPath()
$scope.mname
) | Join-Path
$scope.mutexes = @{}
@anonhostpi
anonhostpi / shauntlet.ps1
Last active January 17, 2024 12:04
The PowerShanos Thanos Shauntlet
using namespace Python.Runtime
# Import the C# libraries:
Import-Package pythonnet
Import-Package Microsoft.ClearScript
Import-Package NLua
Import-Package IronRuby.Libraries
Import-Package R.NET
# Setup Python:
@anonhostpi
anonhostpi / ruby.ps1
Created January 17, 2024 07:23
Run Ruby Code in PowerShell
# Import-Module Import-Package
Import-Package IronRuby.Libraries
$ruby = [IronRuby.Ruby]::CreateRuntime()
$engine = $ruby.GetEngine("rb")
$engine.Execute("puts 'Hello, World!'")
@anonhostpi
anonhostpi / julia.ps1
Last active January 17, 2024 07:02
Execute Julia code in PowerShell
using namespace Python.Runtime
# winget install julia -s msstore # Julia engine
# pip install julia # PyJulia
# Import-Module Import-Package
Import-Package pythonnet
# Initialize the engine and lock CPython
[PythonEngine]::BeginAllowThreads()
[PythonEngine]::Initialize()