Skip to content

Instantly share code, notes, and snippets.

View LunNova's full-sized avatar
❄️
flake.lock

Luna Nova LunNova

❄️
flake.lock
View GitHub Profile
function fp_to_bytes(fp, bytes, is_double)
local val = tonumber(fp)
-- it's a NaN or inf
if val ~= val or val == math.huge or val == -math.huge then
bytes[1] = (val ~= val or val == math.huge) and 0x7f or 0xff
bytes[2] = (val ~= val and 0xf9 or 0xf8)
local max = is_double and 8 or 4
for i = 3, max do
bytes[i] = 0
Run in MappingTest subdirectory of https://github.com/MinimallyCorrect/Mapping/tree/transform-only-runs-for-default-attr
Must run publishToMavenLocal in parent directory first.
Note how transform only runs in test case -PTEST=3 where the default value of the attr can be transformed to the requested value.
Even case 4 fails which is where the default value is set as in case 3, but a value the same as that default value is also set in the gradle module metadata.
$ for i in 0 1 2 3 4; do echo; echo "Testing with -PTEST=$i"; echo; ./gradlew.bat -PTEST=$i --no-build-cache build; done
Testing with -PTEST=0
// ==UserScript==
// @name PluralSight Wider Speed Range
// @namespace https://nyx.nova.fail/
// @version 1.1
// @description Faster pluralsight video maximum speed
// @author Luna
// @match https://app.pluralsight.com/*
// @grant none
// @run-at document-start
// ==/UserScript==
@LunNova
LunNova / grub-kexec.sh
Created May 10, 2019 12:03
worst bootloader ever
#!/usr/bin/env bash
# This script boots the first linux it finds in a grub config on any available mount point
# using kexec
DEBIAN_FRONTEND=noninteractive sudo apt-get -q -y install kexec-tools
set -euvo pipefail
parts=$(sudo blkid | grep -v /dev/loop | sort | cut -d: -f 1)
grub_paths="/boot/grub/grub.cfg /grub/grub.cfg /boot/grub.cfg"
Enclosure serial console commands
COMMANDS:
Note: Not all commands are supported, 'help' lists supported commands.
acfail_sim Simulate AC Fail condition
auto_iic_recovery Enable/disable the automatic bus recovery.
batt_cell_balance Override auto cell balancing by individually turning on/off the balance FET s
batt_clear_cell_fault_poh Clear the Power On Hours stored as a result of a >500mV cell imbalance fault
@LunNova
LunNova / dhclient log
Created July 11, 2018 15:43
Flapping Interfaces Trouble
Jul 11 09:22:21 dhclient[87943]: exiting.
Jul 11 09:22:21 dhclient[87943]: connection closed
Jul 11 09:22:13 dhclient[27206]: em2 link state up -> down
Jul 11 09:21:26 dhclient[73751]: bound: renewal in 190763 seconds.
Jul 11 09:21:26 dhclient: Deleting old routes
Jul 11 09:21:26 dhclient: Comparing Routers: Old: <FLAPPING GATEWAY IP> New: <FLAPPING GATEWAY IP>
Jul 11 09:21:26 dhclient: Comparing IPs: Old: <FLAPPING WAN IP> New: <FLAPPING WAN IP>
Jul 11 09:21:26 dhclient: Starting delete_old_states()
Jul 11 09:21:25 dhclient: New Routers (em2): <FLAPPING GATEWAY IP>
Jul 11 09:21:24 dhclient: New Routers (em2): <FLAPPING GATEWAY IP>
@LunNova
LunNova / GPIOThreads.strace
Last active June 1, 2018 22:39
C3000 Onboard Administrator straces of mgmt
# strace -x -s 256 -p 1957 -p 1958
Process 1957 attached - interrupt to quit
Process 1958 attached - interrupt to quit
[pid 1958] rt_sigsuspend([] <unfinished ...>
[pid 1957] rt_sigsuspend([] <unfinished ...>
[pid 1958] <... rt_sigsuspend resumed> ) = ? ERESTARTNOHAND (To be restarted)
[pid 1958] --- SIGRTMIN (Unknown signal 32) @ 0 (0) ---
[pid 1958] sigreturn() = ? (mask now [])
[pid 1958] rt_sigprocmask(SIG_BLOCK, [CHLD], [RTMIN], 8) = 0
[pid 1958] rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0
rdrand stressor will be skipped, not a recognised Intel CPU.
tsc stressor will be skipped, not a recognised Intel CPU.
disabled 'cpu-online' as it may hang the machine (enable it with the --pathological option)
dispatching hogs: 16 af-alg, 16 atomic, 16 branch, 16 bsearch, 16 cache, 16 context, 16 cpu, 16 crypt, 16 fp-error, 16 funccall, 16 getrandom, 16 heapsort, 16 hsearch, 16 icache, 16 ioport, 16 lockbus, 16 longjmp, 16 lsearch, 16 malloc, 16 matrix, 16 membarrier, 16 memcpy, 16 mergesort, 16 nop, 16 numa, 16 opcode, 16 qsort, 16 radixsort, 16 str, 16 stream, 16 tree, 16 tsearch, 16 vecmath, 16 wcs, 16 zlib
stress-ng-numa: system has 1 of a maximum 1024 memory NUMA nodes
stress-ng-stream: stressor loosely based on a variant of the STREAM benchmark code
stress-ng-stream: do NOT submit any of these results to the STREAM benchmark results
stress-ng-stream: Using CPU cache size of 8192K
#include "events.h"
OurCameraEventHandler g_ourCameraEventHandler;
OurActionEventHandler g_ourActionEventHandler;
OurNiNodeUpdateEventHandler g_ourNinodeEventHandler;
bool Events::Hook(SKSEMessagingInterface* iface) {
_MESSAGE("Events::Hook AddEventSink");
EventDispatcher<SKSEActionEvent> * aed = (EventDispatcher<SKSEActionEvent> *)iface->GetEventDispatcher(SKSEMessagingInterface::kDispatcher_ActionEvent);
aed->AddEventSink(&g_ourActionEventHandler);
This file has been truncated, but you can view the full file.
NODE {SceneGraph} {WorldRoot Node} {21D21D60}
NODE {NiNode} {WorldRoot CameraNode} {21D13650}
OTHER {NiCamera} {WorldRoot Camera} {21D11B20}
NODE {ShadowSceneNode} {shadow scene node} {D3D11A0}
NODE {BSMultiBoundNode} {Sky} {21F55E40}
NODE {NiNode} {(null)} {26E54690}
GEOMETRY {BSTriShape} {AtmosphereDome:0} {26DFE680}
NODE {NiNode} {(null)} {26E543F0}
NODE {NiNode} {SkyrimStars} {2757B3B0}
GEOMETRY {BSTriShape} {Constellations1-6} {2756C340}