Skip to content

Instantly share code, notes, and snippets.

@eladkarako
eladkarako / beautify json aligned.js
Last active November 9, 2026 20:18
beautify_json_aligned.js - supports objects, arrays, recursive
const beautify_json = (obj) => {
return JSON.stringify(obj, null, 2)
.replace(/\r+/gms, "")
.replace(/,\n /gms, "\n ,")
.replace(/ *(,( +))/gms, "$2,")
.replace(/\n/gms, "\r\n");
};
const beautify_json_aligned_no_stringify = (obj, indent = 0) => {
const indent_str = " ".repeat(indent);
@eladkarako
eladkarako / unix signals.md
Created November 3, 2026 12:56
unix signals
Constant Integer value Description
SIGHUP 1 Controlling terminal closed or parent process exited
SIGINT 2 User interrupt, commonly Ctrl+C
SIGQUIT 3 Terminate, typically with a core dump
SIGILL 4 Illegal instruction
SIGTRAP 5 Trace/breakpoint trap
SIGABRT 6 Abort
SIGIOT 6 Alias for SIGABRT
SIGBUS 7 Bus error
@eladkarako
eladkarako / context-menu for cleaning alternate data streams (windows os, registry).md
Last active November 2, 2026 19:59
context-menu for cleaning alternate data streams (windows os, registry)
2026-11-02_215312
The NTFS file system provides applications the ability to create alternate data streams of information. By default, all data is stored in a file's main unnamed data stream, but by using the syntax 'file:stream', you are able to read and write to alternates. Not all applications are written to access alternate streams, but you can demonstrate streams very simply. First, change to a directory on a NTFS drive from within a command prompt. Next, type 'echo hello > test:stream'. You've just created a stream named 'stream' that is associated with the file 'test'. Note that when you look at the size of test it is reported as 0, and the file looks empty when opened in any text editor. To see your stream enter 'more < test:stream' (the type command doesn't accept stream syntax so you have to use more).
  1. download https://learn.microsoft.com/en
  1. npm install -g @opencode/cli@latest --allow-scripts=@opencode/cli (or npm install -g @opencode/cli@latest followed by npm config set allow-scripts=@opencode/cli --location=user)
C:\Users\Elad>opencode pair

Open a link to connect. Links work once and expire in 5 minutes.

http://127.0.0.1:12345/auth/connect/abcdefghijklmnop
@eladkarako
eladkarako / RustDesk local network hardening and optimizing.md
Last active October 30, 2026 16:39
RustDesk local network hardening and optimizing

note: my example will be using Windows installation, but general tips are still useful across-OS.

  1. open text-editor as admin, and edit your HOSTS file, adding:
#--- rustdesk. block relay-server to force rustdesk to only use direct IP.
0.0.0.0 rustdesk.com
0.0.0.0 www.rustdesk.com
0.0.0.0 rs-ny.rustdesk.com
0.0.0.0 rs-sg.rustdesk.com
@eladkarako
eladkarako / dot_net_optimizer.cmd
Created October 28, 2026 04:52
pre optimizing with .NET Framework Native Image Generator
chcp 65001 1>nul 2>nul
sc stop mscorsvw
timeout /t 5
pushd "C:\Windows\Microsoft.NET\Framework64\v4.0.30319"
title executeQueuedItems
start "%~n1" /MAX /ABOVENORMAL /WAIT /B "ngen.exe" executeQueuedItems /verbose
@eladkarako
eladkarako / upgrading powershell and making pwsh be called instead of powershell.md
Last active October 21, 2026 04:27
upgrading powershell and making pwsh be called instead of powershell

upgrading powershell and making pwsh be called instead of powershell

first, identifying.

PATH

  • where powershell
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
@eladkarako
eladkarako / pytorch to openvino int8 with optimizations (example).md
Last active October 17, 2026 23:27
pytorch to openvino int8 with optimizations (example)

starting point (pth)

python 3.12.10 pip install neosr openvino nncf tqdm openvino nncf onnxscript onnx_simplifier onnxruntime onnxsim openvino openvino-dev numpy onnx torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu

https://github.com/Phhofm/models/releases/tag/4xNomos2_realplksr_dysample

https://github.com/Phhofm/models/releases/download/4xNomos2_realplksr_dysample/4xNomos2_realplksr_dysample.pth https://github.com/Phhofm/models/releases/download/4xNomos2_realplksr_dysample/4xNomos2_realplksr_dysample.yml

@eladkarako
eladkarako / optimization of models to INT8, including calibration.md
Last active October 17, 2026 18:47
optimization of models to INT8, including calibration

TL;DR

  • ONNX is mostly for CUDA (nvidia), for Intel hardware you can use openvino.
  • openvino for quite some time uses onnx internally for convertion.
  • there are some benefits for pre-optimizations for model files in the "price" of slightly loosing some accuracy.
image__from_webp

I will try taking a given model file,
and generate an optimized version,