Random snippets of all sorts of code, mixed with a selection of help and advice.
Karpenter AMI rollout via SSM parameter: drift enabled but EC2 Launch Template is externally managed, so nodes don’t update
24 February 2026 @ 10:08 pm
I’m configuring Karpenter on AWS/EKS to roll AMIs automatically using an SSM Parameter that we manage.
Current setup / goal
EKS is v1.33 (so drift is enabled by default per Karpenter FAQ).
We want a controlled AMI rollout:
A Lambda periodically fetches the latest EKS-recommended AMI ID.
Lambda writes the AMI ID to our own SSM parameter.
Test cluster parameter gets updated first; prod later.
Karpenter should pick up the new AMI from SSM and replace nodes via drift (with disruption budgets controlling the rollout).
Problem Even after the SSM parameter changes, the nodes aren’t rolling as expected because the EC2 Launch Template being used is managed outside of Karpenter (AWS/EKS-managed), and it must be updated separately. If the Launch Template doesn�
C# libcurl find which TLS version was negotiated
24 February 2026 @ 10:04 pm
In my C# code, I'm using libcurl.dll and using CURLINFO_TLS_SSL_PTR = CURLINFO_PTR + 45 to determine which TLS version is being negotiated, I'm not sure if this constant is correct.
Is the code below correct? Because the result for cipherName is always \u0001 regardless of whether the website is using TLS 1.2 or 1.3?
private readonly curl_easy_getinfo_ptr _getInfoPtr;
_getInfoPtr = GetFunction<curl_easy_getinfo_ptr>("curl_easy_getinfo");
if (_getInfoPtr(curl, 0x400000 + 45, out IntPtr cipherPtr) == 0 && cipherPtr != IntPtr.Zero)
{
string cipherName = Marshal.PtrToStringAnsi(cipherPtr) ?? "";
}
Excel - format cells in minutes
24 February 2026 @ 9:56 pm
I've been struggling with this for a while now. I would like the data in Column D to represent only minutes, such as 0:10:00. But, when the cells are formatted as [h]:mm:ss, Excel shows 12:10:00 AM in the formula bar. Is there any way around this to just show the data I enter as 0:10:00 rather than converting it to a 24-hour clock format?


How to post the data of the same form that is in multiple records
24 February 2026 @ 9:55 pm
After a Ajax request I have multiple records created by cloning a DIV that contains a form. Lets say x5 DIV records created x5 rows. I can post the data for each record individually by clicking the form button on each record and the name and employ id values are posted. I want to be able to post the form for all x5 records at the same time using one button. Is that possible? I want all the name's and employids.
<div class="client">
<form class="myForm">
<input type="text" class="name" name="" value="">
<input type="text" class="employid" name="" value="">
<button class="test" type="submit">Submit</button>
</form>
<script>
//SEARCH For Records
$(document).ready(function(){
$(document).on('click', '.test', function(event){
event.preventDefault();
var self=this; //Va
Why is this expression treated as a first member value rather than a structure value?
24 February 2026 @ 9:46 pm
The following program gets a weird error that seems to suggest the compound literal sees the expression in it as initializing the first member of the structure rather than the full structure. Where in the standard does this behavior come from?
// load_con
typedef struct load_con load_con;
struct load_con{
void* X;
int Y;
};
// Start main
int main( int a_c, char** a_l ){
load_con* a = (load_con[]){{.X=0,.Y=0}};
// Make a copy of *a
a = &(load_con){*a};
// Return
return 0;
}
When I compile with clang I get:
error: initializing 'void *' with an expression of incompatible type 'load_con' (aka 'struct load_con')
a = &(load_con){*a};
gcc gives a similar error.
In the standard we have 6.7.10.14:
The initializer for a structure or union object that has automatic storage duration shall be either
an initializer list as described below, or a single expression that
How can you print characters based on a changing pattern?
24 February 2026 @ 9:46 pm
Take this example pragraph;
Who can take aaa sunrise, sprinkle it with dew, cover it with chocolate and a miracle or two? The Candy Man can. Who can take a rainbow, wrap it in a sigh, soak it in the sun and make a strawberry lemon pie? The Candy Man can, because he mixes it with love and makes the world taste good.
I am trying to achieve the following.
For the first five words: take the 3rd character of every 2nd word
(words 2 and 4).
From word 6 through word 12: for each word that is exactly 4 letters
long, take its 4th character. (Skip any word that isn’t 4 letters.)
For word 13 onward: take every other character from each remaining
word, starting with the 2nd character (i.e., characters 2, 4, 6, …).
ignore punctuation, treat hyphens as word breaks, lowercase everything?
Would I do like for i in [1, 3]: and then something like for i in range(5, min(12, len(words)))
Enrichment analysis on Log2(tpm+1) RNA-seq
24 February 2026 @ 9:39 pm
I have a gene expression matrix in the form of log2(tpm+1) values that I need to run enrichment analysis on, and I don't have experience in working with this type of transformed data. According to the authors who published this data set, the data were "transformed to log2(tpm+1) and then quantile normalized across all samples". Should I reverse the log2 transformation and feed it to DESeq2 to get fold changes, or can I work with these data directly? If I can work with these data directly, is there anything I should consider when preparing fold changes between groups? I usually use clusterProfiler for the enrichment and visualisation, if it matters.
Thank you very much!
Python uses pyxtxt.xtxt (filename) with special characters from the Brazilian Portuguese language (ç, á, é, à, í)
24 February 2026 @ 9:31 pm
I need to use pyxtxt.xtxt (filename) to read the contents of some files, and everything works fine when the filename doesn't contain special characters from the Brazilian Portuguese language (ç, á, é, à, í). When the filename contains these characters, pyxtxt gives a "(No such file or directory)" message. Has anyone used this before? Did this module work with files containing Brazilian Portuguese characters?
std::array at function not throwing out of range
24 February 2026 @ 9:30 pm
While debugging something I stumbled into this behavior on godbolt. When compiling and running the following (godbolt link https://godbolt.org/z/9c5966sbK):
#include <array>
int main()
{
std::array<int, 4> arr{1,2,3,4};
int val = arr.at(5);
return val;
}
using latest x86 versions of gcc, clang and msvc, with optimizations disabled (-O0 and /Od resp.) msvc doesn't throw std::out_of_range exception.
Why does this happen?
PromQL label matching in OpenObserve
24 February 2026 @ 9:26 pm
Using OpenObserve and its Collector I get a metric called system_filesystem_usage.
The metric has a label "state" which is either of "used", "free", or "reserved". I don't care about "reserved", but I would like to use "used" and "free" to calculate the usage in percentage. As the values I need for the calculation come from multiple rows/events I presume this is a case of "PromQL label matching". I tried:
system_filesystem_usage{state="used"}
/ (system_filesystem_usage{state="used"} + system_filesystem_usage{state="free"})
* 100
But even a simpler expression like
system_filesystem_usage{state="used"} + system_filesystem_usage{state="free"}
does not produce any results in OpenObserve. What am I missing?