RANDOM BITS

A random site by a random clueless human

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

2024 Blog Archive (2024)


Stack Overflow: The Case of a Small Stack

December 29, 2024

micro   stack   qnx   c/c++   blog
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...


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

December 29, 2024

linux   blog
I previously mentioned in my microblog 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...

Read More...


QNX is 'Free' to Use

November 9, 2024

other   qnx   blog
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...


Verifying Email Signature Manually

October 12, 2024

I noticed that the neocities community love using protonmail and some even share their public key to enable full encryption communication. What makes protonmail special is the focus on privacy and security. All emails sent between Proton Mail users are end to end encrypted meaning not even Proton can have access to the messages. However, when communicating outside of Proton ecosystem to non-Proton Mail users like those with Gmail and Outlook, communication between the two are not encrypted end to end by default. This does not mean the encryption utilized by Gmail and Outlook are inadequate. The vast majority of...

Read More...


A Quick Look Into Half-Width and Full-Width Characters

October 7, 2024

A friend of mine has been asking me a few questions about encoding for a paper he is working on. While I don’t understand what his research is on, all I can understand from his research is that he is working on analyzing Japanese texts and it involves understanding character encodings. Character encoding is not a topic that most native-English programmers are familiar with. The most that the average programmer will know is the existence of ASCII and UTF-8 encoding. If we are using anything beyond the English alphabets and arabic numerals (i.e. 1, 2, 3, 4, 5, 6, …)...

Read More...


Polluting the Web With a Useless 5 argument main function

June 22, 2024

A random blog post that does not have a good definite answer nor have much purpose aside from writing my random bits of nonesensical information. You have been warned. Recently I got an invitation to try hextree.io before their official launch date. For those who do not know, hextree is a future cybersecurity learning platform created by two popular educational hacking youtubers LiveOverflow and stacksmashing. I always wanted to try Ghidra, an open source reverse engineering tool developed by the NSA, after watching a few decompilation projects on youtube and on Github appear in my feeds. So when I saw...

Read More...


A Quick and Flawed Look Into Spatial Locality and TLB

May 27, 2024

WARNING: I am inexperienced and not knowledgeable of computer architecture. Although noted below, I will be making a claim for a simplistic computer architecture that is not easily reproducible. The blog does not have data to back up my claim. I probably will regret publishing this post. We shall see how long it stays up. In the meantime, feel free to give corrections and criticism by opening a github issue. I got bored so skimmed through the first few sections of Ulrich’s paper What Every Programmer Should Know About Memory, a gigantic paper about computer memory that I only took...

Read More...


Splitting Files On Linux

May 8, 2024

Today I was asked to reshare my notes from a class I took in the Fall as they noticed that they no longer have access to the files on Google Drive. Unfortunately for me, I had way too many files on Google Drive that I had to do a massive purge on my Google account which was not limited to only Drive itself but also most emails I had since 2011. Not wanting to overcrowd my Google cloud storage again, I decided to send them the notes either via email or Discord. However, the issue with that is: Both Gmail...

Read More...


MATH3001 - Real Analysis 1

January 14, 2024

This is a course review of MATH3001 - Real Analysis 1 taken at CarletonU in winter 2023. Real Analysis is a course that is known to have devastated undergraduate Math students for generations. The course is the sucessor of MATH1052 - Calculus and Introductory Analysis 1 and the beginning of MATH2000 - Multivariable Calculus and Fundamentals of Analysis. The interesting part about CarletonU is that students are exposed to elements of analysis in first year and second year which may not hold true for students in the United States. CarletonU also offers another course in Real Analysis which confuses me...

Read More...