RANDOM BITS

A random site by a random clueless human

Random bits of programming, math, and thoughts By a clueless human

µBlog Archive (2024)


New Laptop: Framework 16

December 29, 2024

Ever since Linus Tech Tips (LTT) introduced Framework, a repairable and modular laptop, back in 2021, I always wanted one for myself. I always loved the idea of modular electronics ever since PhoneBloks introduced their idea of modular phones. Electronics that are modular are usually highly repairable due to the fact that one can easily swap a faulty component with a new component instead of going to a repair shop or dumping the phone into the garbage. The appeal of bringing the desktop experience of being able to upgrade various parts such as the CPU, RAM and storage to the...

Read More...


Utilizing Aliases and Interactive Mode to Force Users to Think Twice Before Deleting Files

December 29, 2024

I previously mentioned that I lost my file by accidentally overwriting my file using the cp command. This got me thinking as to why this would be impossible on my work laptop since I would be constantly bombarded with a prompt to confirm my intention to overwrite the file. $ cp 2024-12-01-template.md 2024-12-30-alias-interactive.md cp: overwrite '2024-12-30-alias-interactive.md'? Commands like mv and cp have an interactive flag -i to prompt before overwriting the file. As seen in man 1 cp -i, --interactive prompt before overwrite (overrides a previous -n option) To force everyone at work to have this flag enabled, they made...

Read More...


Stack Overflow: The Case of a Small Stack

December 20, 2024

micro   stack   qnx   C/C++
Years ago I was once asked by an intern to debug a mysterious crash that seemed so innocent. While I no longer recall what the code was about, we stripped the program to a single line in main. Yet the program still continued to crash. Source: int main() { char buf[1024*1024*1024]; } Result: # ./prog-arm64 Process 630803 (prog-arm64) terminated SIGSEGV code=1 fltno=11 ip=00000025333267f0 mapaddr=00000000000007f0 ref=000000443dd5dc50 Memory fault (core dumped) This bewildered all of the interns as it made absolutely no sense. Through our investigation, there was two things we noticed: The program worked on our local machines but not on...

Read More...


QNX is 'Free' to Use

November 9, 2024

micro   qnx
Recently on Hackernews, a relations developer from QNX announced that QNX is now free for anything non-commercial. QNX also made an annoncement to the LinkedIn Community as well which was where I learned about it. For those who are not familiar with QNX, QNX is a properiety realtime operating system targetted for embedded systems and is installed in over 255 million vehicles. QNX has a great reputation for being reliable and safe embedded system to build software on top of due to its microarchitecture and compliance to many industrial and engineering design process which gives customers the ability to certify...

Read More...


[Preview] Manually Verifying an Email Signature

October 8, 2024

micro   gpg   signing
I noticed that the neocities community love using protonmail and some even share their public key to enable full encryption communication. While I care about cyber security more than the average human, I do not care enough to start requiring others to start encrypting their email and sign their messages so that I can verify the authenticity of the messages I receieve. Out of curiosity, I decided to see how one would manually verify the signature of an email to ensure that the email has not been tampered with and comes from the person who it claims to be. I...

Read More...


[Preview] Half-Width and Full-Width Characters

October 6, 2024

Those of us who live and speak English will probably never think about how characters are encoded which is how characters such as the very letters you see in the screen are represented by being given some number like 65 for ‘A’ in ASCII which takes 1 byte to be represented such as a char in C. I was not aware of the existence of full-width and half-width characters till the friend asked me to briefly explain the highlevel information about the difference in representing the characters. For those like me who weren’t aware that the Japanese mix between zenkaku...

Read More...


Mixing Number and String

September 18, 2024

A recent post has gotten somewhat popular on the web and is something many of us could somewhat relate with. In the case of many including the author, the issue stems from how YAML treats strings and numbers. As a rule of thumb, I would always suggest avoiding any potential confusion by always adding the quotes around a string to ensure the value is treated as a string as intended. The crux of the post was how their Git commit inconveniently happened to be 556474e378 which is very rare to obtain. Recall that scientific notation is in the form of...

Read More...


`.` At The End of a URL

August 30, 2024

micro   dns   network
I recently learned that websites can be terminated with a . such as www.google.com. or https://neocities.org.. However, this does not work for all websites. I was skimming through Network for Dummies during work and while it doesn’t cover anything useful for the work I am trying to do (if you have taken a network course before, don’t bother reading this book unless you were bored like I was1), terminating a website with a . was a surprise. The book states that If a domain name ends with a trailing dot, ..., and the domain name is said to be a...

Read More...


Splitting Pdfs into Even and Odd Pages

August 28, 2024

During the winter break I have obtained an old Xerox XE88 Workstation Printer released in the year of 2000, the year where the media were worried about Y2K causing havok to our digital infrastructure which never came to the scale we all feared thankfully. Though of course a bug will eventually will creep and wreck havok(i.e. Crowdstrike Falcon Update). But I digress, using this printer was filled with frustration as it is a relic from the past that is not meant to be used in 2024. Firstly, the printer requires a parallel port which no modern computer comes equip with....

Read More...


Executing Script Loophole

August 28, 2024

I recently came across an article discussing an attempt to close a loophole bypassing the normal execution permission bit. Exploiting a program suid and euid to gain high privilige is a commonly known technique called privilege escalation. This article does not cover this but it introduces a flaw in the current way Linux handles the execution of scripts. I do not know why privilige escalation came to my mind but as I usually write nonesensical things anyways, I shall keep it here for now. The article gives a neat example where a script does not have execution bit but is...

Read More...


Replacing main()

August 24, 2024

micro   gcc   C/C++
Any beginner C programmer will know that the first function executed in any program is the main() function. However, that is not the entire truth. Just like how we have learned the Bohr and Lewis diagrams in Chemistry in Highschool, this is an oversimplification. From my knowledge, the first function executed once the loader runs in a binary is _start(). Without going into any details, we can replace main() with another function such as foo() (sorry for the lack of creativity). #include <stdio.h> #include <stdlib.h> int foo() { printf("Called foo\n"); exit(0); } int main() { printf("Called main\n"); return 0; }...

Read More...


Editing GIFS and Creating 88x31 Buttons

August 18, 2024

micro   gifs   gimp
Lately I have been learning how to edit GIFS and it is painstaking difficult to remove a background from a GIF without using an AI tool, especially when the image has over 70 frames. There is likely an easier way to edit GIFs but I had to manually edit over 50 frames, erasing the clouds from a GIF using the eraser tool frame by frame which took some time to finish. Original: Flying Pikachu Transparent Balloon Pikachu Stickerfrom Flying Pikachu Transparent Stickers Result: However, if you are not editing a GIF but rather trying to incorporate the GIF into your...

Read More...


multiple definition of `variable` ... first defined here

August 10, 2024

micro   gcc   C/C++
Randomly I decided to compile some old projects I worked on and I was surprised to see a few compilation errors in an assembler I wrote years back. As it has been many years since I last touched most of the projects I looked at, I was pleased to see the compiler catching obvious mistakes I had made in the past. Though this did come to a surprise as to why the compiler I used years ago never complained such obvious mistakes. The solution and reason for the last compilation error was not immediate to me: $ make gcc -o...

Read More...


Delusional Dream of a OpenPower Framework Laptop

August 4, 2024

Framework is a company that makes modular and repairable laptops that has captured the interests of tech enthusiasts over the past 4 years. Currently Framework laptops are limited to x86-64 architecture supporting Intel and later AMD CPUs in 2023. Although Framework laptops are not entirely open source, they have open source a decent chunk of their work from my understanding and which allows third party development of components and makes partnership possible for other companies such as DeepComputing to release a mainboard that runs a RISC-V CPU . While the new mainboard will not be usable for everyday applications, it...

Read More...


2024 Update

August 4, 2024

micro   site
Website In the past year I have been very lazy as evident with my lack of activity on my personal blog. I'm now trying to pick up blogging again. It's hard to believe that it's been almost an entire year since I created this neocity site, which has almost 0 updates since. I've been thinking about how to use this site since I already have a blog on GitHub Pages. Honestly, I forgot this corner existed, and it’s been bothering me that I couldn’t write my random, nonsensical thoughts because my main blog wouldn’t be a suitable medium until now....

Read More...