Skip to content

Instantly share code, notes, and snippets.

@Voltara
Voltara / wrx90e-ec-sensors.patch
Created March 13, 2024 13:54
VRM temperatures, VRM/USB4/M.2 fan speeds for Asus WRX90E-SAGE SE
--- a/linux/drivers/hwmon/asus-ec-sensors.c 2024-02-07 09:00:48.000000000 -0500
+++ b/linux/drivers/hwmon/asus-ec-sensors.c 2024-03-13 09:48:52.892324808 -0400
@@ -137,6 +137,14 @@
ec_sensor_temp_sensor_extra_2,
/* "Extra_3" temperature sensor reading [℃] */
ec_sensor_temp_sensor_extra_3,
+ /* VRM_2 temperature [℃] */
+ ec_sensor_temp_vrm_2,
+ /* USB4 temperature [℃] */
+ ec_sensor_fan_usb4,
@Voltara
Voltara / day09.input
Created December 10, 2023 04:41
Advent of Code 2023 Day 9 Challenge Input
16 24 38 58 84 116 154 198 248 304 366 434 508 588 674 766 864 968 1078 1194 1316
7 7 24 78 189 375 656 1065 1678 2704 4743 9462 21211 50588 121810 287217 654781 1438853 3051694 6265238 12491253
7 20 50 120 273 573 1109 2018 3551 6214 11024 19928 36441 66567 120075 212210 365927 614744 1006318 1606856 2506481
29 54 85 115 142 186 310 635 1334 2588 4495 6955 9639 12343 16423 28747 70874 198180 536517 1347528 3136973
13 15 28 67 154 316 581 970 1478 2032 2409 2092 37 -5681 -18380 -43483 -89477 -169171 -301310 -512607 -840260
3 12 30 57 93 138 192 255 327 408 498 597 705 822 948 1083 1227 1380 1542 1713 1893
25 34 34 30 43 131 432 1247 3206 7597 16983 36279 74502 147432 281419 518526 923095 1589644 2651728 4291004 6745205
13 24 29 29 29 38 69 139 269 484 813 1289 1949 2834 3989 5463 7309 9584 12349 15669 19613
5 1 9 40 105 215 381 614 925 1325 1825 2436 3169 4035 5045 6210 7541 9049 10745 12640 14745
3 13 37 74 119 163 193 192 139 9 -227 -602 -1153 -1921 -2951 -4292 -5997 -8123 -10731 -13886 -17657
@Voltara
Voltara / Program.cs
Created March 11, 2022 20:49
StackExchange.Redis #1294 Reproduction
using StackExchange.Redis;
void WriteToRedis(IDatabase db, string key, int len, int fillByte)
{
byte[] value = Enumerable.Repeat((byte) fillByte, len).ToArray();
Console.WriteLine($"\n\nWriting key '{key}', length {len}...");
try
{
db.StringSet(key, value);
}
@Voltara
Voltara / day11-avx2.cpp
Created December 12, 2020 22:09
Advent of Code 2020 Day 11 AVX2
// clang++ -O3 -march=native -std=c++17 day11-avx2.cpp
#include <cstdio>
#include <vector>
#include <array>
#include <cstring>
#include <chrono>
#include <tuple>
#include <x86intrin.h>
@Voltara
Voltara / day16p2.cpp
Last active December 29, 2019 11:17
Advent of Code 2019 Day 16 Part 2 in under 15 μs
#include <cstdio>
#include <cstdint>
#include <cstdio>
#include <vector>
#include <chrono>
int main(int argc, char **argv) {
FILE *fp;
if (argc < 2 || !(fp = fopen(argv[1], "r"))) fp = stdin;
@Voltara
Voltara / day22p2.py
Last active December 23, 2019 21:50
Advent of Code 2019 Day 22 Part 2
#! /usr/bin/env python3
INPUT = "input.txt"
DECK = 119315717514047
REPEAT = 101741582076661
POSITION = 2020
# The do-nothing shuffle: 0 + 1*x
IDENTITY = [ 0, 1 ]
@Voltara
Voltara / day17tricky.intcode
Last active December 17, 2019 20:09
Advent of Code 2019 Day 17 Tricky Input
1,330,331,332,109,3470,1101,1182,0,15,1101,1481,0,24,1002,0,1,570,1006,570,36,1001,571,0,0,1001,570,-1,570,1001,24,1,24,1105,1,18,1008,571,0,571,1001,15,1,15,1008,15,1481,570,1006,570,14,21102,1,58,0,1106,0,786,1006,332,62,99,21101,0,333,1,21102,73,1,0,1105,1,579,1102,0,1,572,1101,0,0,573,3,574,101,1,573,573,1007,574,65,570,1005,570,151,107,67,574,570,1005,570,151,1001,574,-64,574,1002,574,-1,574,1001,572,1,572,1007,572,11,570,1006,570,165,101,1182,572,127,102,1,574,0,3,574,101,1,573,573,1008,574,10,570,1005,570,189,1008,574,44,570,1006,570,158,1105,1,81,21101,0,340,1,1105,1,177,21102,477,1,1,1106,0,177,21101,514,0,1,21101,176,0,0,1106,0,579,99,21102,1,184,0,1106,0,579,4,574,104,10,99,1007,573,22,570,1006,570,165,1002,572,1,1182,21101,375,0,1,21101,0,211,0,1106,0,579,21101,1182,11,1,21102,222,1,0,1105,1,979,21102,388,1,1,21101,233,0,0,1105,1,579,21101,1182,22,1,21102,1,244,0,1105,1,979,21102,401,1,1,21101,255,0,0,1105,1,579,21101,1182,33,1,21101,266,0,0,1106,0,979,21101,414,0,1,21102,1,277,0,1105,1,579,3,575,
@Voltara
Voltara / day16vanity.cpp
Created December 16, 2019 23:14
Advent of Code 2019 Day 16 Vanity Input Generator
#include <cstdio>
#include <cstdint>
#include <vector>
#include <array>
#include <random>
using int_t = long long;
using vec = std::vector<int_t>;
using arr8 = std::array<int8_t, 8>;
@Voltara
Voltara / advent2017d7p2.cpp
Last active December 8, 2019 05:38
Advent of Code 2017 Day 7 Part 2, Dynamic Programming solution
#include <cstdio>
#include <cstdlib>
#include <vector>
using vec = std::vector<int>;
/* Bare bones implementation of the intcode vm for Day 7 Part 2
* When run with a phase setting of 5, 6, 7, 8, or 9, returns
* an array of numbers that represents the effect of each
* amplification stage (i.e., iteration of the feedback loop):
@Voltara
Voltara / day23part2.cpp
Created December 28, 2018 05:48
Advent of Code 2018 Day 23 Part 2
// clang++ -march=native -O3 day23part2.cpp -o day23part2
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <array>
#include <functional>
#include <algorithm>
// https://en.wikipedia.org/wiki/Q*bert#/media/File:Qbert.png