Martin's website/blog thingy

Systems Engineer · HPC · AI · Ramblings on whatever

Posts written in Gemini text/gemini format, rendered to HTML. For the best experience, view through a Gemini browser (like Lagrange). Atom feed available.
2022-10-03

AWK the ultimate swiss army knife for data

I want AWK to be more well known. It was treated as soem weird-ass tool that somehow works but no one knows why. It's all over the place on StackOverflow whenever we need to select a reagon of a file or something. I didn't apprishate this in the beginning. I was forced to learn `sed` and `awk` bac...

Read more →
2022-09-03

Drunking Ramblings - Tech, Social and Whatnot

Yes, I'm _drunk_ right now. Maybe not **drunk** drunk but enough to make me write this (and maybe not remember that I wrote this tomorrow). Just stupid stuff I've thought of over months and years. Also fuck you who made me decide getting drunk tonight is better then writing code. Like, we'd expe...

Read more →
2022-09-01

Zero Copy OpenCL Buffers

This is another subject that is complicated to explain. But is crucial to understand to write efficient code. Especially on embedded systems and integrated GPUs. I explained this with my coworkers recently. I figure to write it down as a reminder. This post mostly references Intel's article on min...

Read more →
2022-08-19

Taiwan's Digital Intermediary Law is more than Stupid

Yes, this is one of _those_ posts complaning censorship on Gemini again. Consider this as a call for attention as Taiwan (where I live) government tries to push forward a new censorship law. The Digital Intermidary Law[1] is a new law that tries to solve the rampant fake news and disinformation pr...

Read more →
2022-08-18

Likely Indonesian Internet Survelience

So, recently I was on a business trip to Indonesia. I made major security and OpSec preparations due to being forced to use airport and hotel WiFi for a large chunk of my time. Also some physical defence, but that's more personal paranoia, my main goal is to evade large scale, automated attacks. A...

Read more →
2022-08-10

GNUNet File Sharing Tutorial and an Alternative to IPFS

With Web3 on the headlines all the day. I want to shift my view onto more traditional technologies. Blockchain is a great. Really, especially for transactions. Once I had to wire some money to an overseas bank. It literally took a week from sending to confirmed receiving. The fees are high too. Wi...

Read more →
2022-07-22

Search Engine Dilemma Bias VS Accuracy

One problem with the 3 current major Gemini search engines (GUS, Kennedy and TLGS) is the accuracy of their results. Searching anything too specific and they fail. I saw a lot of people writing about this frustration. "Fine, I'll bring bigger guns out" I thought. After days of reading on arXiv ...

Read more →
2022-07-17

Cyber attack over Gemini is now a thing

This morning I logged into the server hosting TLGS, my Gemini search engine, and updated a few things. Then I go through the logs to see if anything intresting happened. Ohh... There were attempts to SQL inject through the search query! Yup, Gemini is big enough for security to matter now! It is d...

Read more →
2022-07-11

Mixtile Blade 3 (RK3588) OpenCL performance

Mixtile Blade 3[1] is an intresting dev board. It runs on a RK 3855 SoC, the successor of the RK3399. Which a whole lot of other boards uses. Including QuartzPro64[2], ITX-3588J[3] and Rock Pi 5[4]. The 16GB model Blade 3 is priced at $369, much more expensive then the Rock Pi 5 at 189$ and the ex...

Read more →
2022-07-09

Handle large file upload with Drogon web framework

Sometimes, you just need to handle large file uploads in your web application. Let's say you are writing a web drive. Dealing witch chunked upload can be a pain in most web frameworks. Not in Drogon - not well-known since the maintainers doesn't advertise much - Drogon supports processing large re...

Read more →
2022-07-06

The trouble with trantor's threading design

This is just something on my mind and I'm trying to figure out how to solve. Most web frameworks use a work-stealing thread pool to improve throughput. Maybe one of the threads is overburdened with 100 tasks in its queue. But all the other 15 threads are idle. Other threads should be able to take ...

Read more →
2022-06-30

FBInfer reduced our product crash by 50%

Just want to share how powerful this tool is. Infer[1], or FBInfer (since it's written by Facebook), is a static analyzer that can detect cross-function logic errors and potential data race in C, C++ and Objective-C. Which is just amazing. The company I work for runs on a C++ heavy product. Unfor...

Read more →
2022-06-28

Coverage testing with CMake and GCov

This took me 3 days of on and off work to figure out. So I decide to write it down in case I need it again. And I want this to be more widely known. CMake is the most popular build system (generator) for C++. While test coverage is an important tool to find where bugs can hide. Testing usually tr...

Read more →
2022-06-23

Understanding explicit OpenCL memory migration between devices

Lately someone emailed me asking how OpenCL memory migration works. To be specific, when and how to use the `clEnqueueMigrateMemObjects` API when using more then one device. Yeah, the description of it in Khronos's documentation[1] is very unhelpful. Nor is this API used often. I also spent quite...

Read more →
2022-06-17

Upgrading WiFi bandwidth, hardware codec for VR Expreience

I'm a heavy VRChat player. My setup wasn't really good for VR per se. I had a relatively weak PC and limited LAN bandwidth. The upgrade is a bit costly, but I'm happy with the money spent. Also some unexpected issues caused my the upgrade. My setup is weird. Most people have their PC and playsp...

Read more →
2022-06-14

RE: RE: The useful part of cryprocurrency

I feel I ought to explain my position. I think I understand and respect idiomdrottning's view. I just feel misinterpreted. And I'll try my best not to strawman him. If I do, by all means, it's my fault. My fault. I should have make it clear in my post. I mean "secure" by cryptographically secure...

Read more →
2022-06-13

The useful part of cryptocurrency

Amid the current crypto price drop. I want to write about what cryptocurrency is actually useful for. And what I believe Crypto should be used for. Non of those NFT and ICO bulls*it. Or you can think this as my DD for investing in crypto. Or confirming my confirmation bias if you read WSB. At the...

Read more →
2022-06-11

Unexpected complexity writing an async Spartan protocol server

Spartan[1] is a cool smol internet protocol. It's even simpler than Gemini. There's no TLS, no need for URL parsing and even less status codes! I just wrote my own Spartan client and server - Spartoi[2] in an afternoon, for fun. What I'm not expecting is some parts of it being (slightly) more comp...

Read more →
2022-06-06

The stupid socket file descriptor leak in Dremini

TLGS'[1] crawler has had a crashing issue from the very beginning. The crawler tries to open too many sockets at the same time with the error message "sockets::createNonblockingOrDie: too many open sockets". The crawl dispatcher already limited how many concurrent craws can happen at any time. Fir...

Read more →
2022-05-15

PSA: Potential libstdc++ hang in std::filesystem::symlink_status

Something I caught while running TLGS's crawler. Due to how drogon works. It needs to always successfully open a new socket on TCP connection. Otherwise the entire process is killed. But Gemini does not support multiple requests on the same connection. So it's easy to endup with a lot of open sock...

Read more →
2022-05-13

Sane YouTube FPS on FireFox on OpenBSD

One thing I really want to be able to do is to load YouTube and put it in background as my work music. On OpenBSD the playback performance is a meh. Espically on Chromium. Opening a 720p 60FPS YouTube video yeilds ~10% frame drop in YouTube stats. Beyond that, the actual rendering rate feels more ...

Read more →
2022-05-12

First time installing OpenBSD and stuff I did

I have been wanting to use OpenBSD for a while after hearing everyone prazing it's superior security. Until then, my only exposure to OpenBSD was installing it on a VM and maintaining Drogon on it. Needless to say, VM performance sucks. Not even Linux can do video playback on a VM without graphics...

Read more →
2022-05-03

Two cents on the mistery of double slashes in URLs

I never expected my initial post about gemini crawlers would trun into a long conversation between crawler developers and server developers. Just saw Sean Conner's post[1] through cosmos about double slashes in URLs. This is just my 2 cents on the matter. RFC3986 section 3.3[2] contains the ABN...

Read more →
2022-04-30

Securing web applications beyond just containers

This website, `clehaxze.tw` (or `gemini.clehaxze.tw` for Gemini) run on basically the same architecture as any modern web applications. A backend that that serves some files, talks to some database, read some files and render templates. It's my passion to make what I made absolutely secure. A back...

Read more →
2022-04-22

RE: My common Gemini crawler pitfalls

I opened Cosmos today and saw a reply to my previous post about gemini crawler pitfalls[1]. In it (I assume) he complains a crawler sending requests to `gemini://gemini.conman.org/boston/2008/04/30/2008/04/30.1` which is non-existent. Yeah... that's my crawler. I shall fix it. Upon investigatio...

Read more →
2022-04-20

My 3 weeks with the SlimeVR open source full-body tracker

SilmeVR is an IMU-only open source full body tracker (open firmware + software) for VR. For the non-initiated, normal VR only tracks your head and hands. While full body tracking in addition tracks waist, chest, ankles, and etc.. With FBT you can sit in VR and see your avatar also sitting down, wi...

Read more →
2022-04-15

My half of year on Gemini

If you are browsing from HTTP. You really should get youself a Gemini Browser and browse this on Gemini. I recommend Lagrange. Or feel free to keep using HTTP. I've been on Gemini for more than half a year now. I genuinely feel the geminispace is a great place to be. And to publish my thoughts....

Read more →
2022-04-11

Common Gemini crawler pitfalls

Just like the common web, crawlers on Gemini can run into similar pitfalls. Though the impact is much lower. The gemtext format is much smaller than HTML. And since Gemini does not support reusing the TCP connection. It takes much longer to mass-crawl a single capsule. Likely I can catch some issu...

Read more →