MakerForce

We are a small collective of developers, makers and thinkers that love to build things.

Learning used to be fun

Think back to when you were just growing up. When you were 4, enjoying the little things you did. Maybe you loved to draw on paper, maybe you were more of a musical person or maybe you loved to dance- but it doesn't matter what you did. You were just having fun.

You probably also asked a million questions. Why does the sea look blue? Why does the person on the TV talk funny? Why does the train make more noise when it goes into the tunnel? As kids, we were full of curiosity, wonderment, maybe even blind to the realities of the world.

It really starts with the formal education system, where we switch from asking questions, to being asked questions. "I don't know why" goes from a statement of curiosity to one of incompetence.

You need to learn because your worth in society is decided by how much of the test you get right.

This decouples the act of learning something new, from the reward which is extrinsic, through grades, compliments from teachers or comparison with peers. By now, long gone

PCIe Passthrough and libvirt

A pretty awesome feature of any modern hypervisor is the ability to pass through physical devices like USB and PCIe, without using host drivers. Almost any PCIe device can be passed through, including GPUs. There are many guides online discussing GPU passthrough, including this one by @bryansteiner.

GPUs, however, aren't as easy because they are initialised before the operating system starts. Upon boot, the firmware (sometimes called BIOS) initialises the GPU into VGA mode and starts drawing immediately. Any graphical interface (including the Linux console) will be constantly writing frames to the video card. To free up a GPU for use, you can either go purchase and install an additional GPU or instruct the operating system to stop writing to the current one.

I'm not willing to spend on another GPU on my system, therefore I went the latter route. Most guides online mention using two GPUs, but doing so with one GPU will work too by configuring the system over SSH. I used Fedora Server as

Abusing LOAD_FAST in Python 3 VM

Metadata

A while ago, I read this article about abusing LOAD_CONST in Python 2.7. We are in Python 3.11 now, and CPython has since implemented quite a lot more features and checks. I wanna try to abuse the Python 3 VM to similarly execute shellcode, but I wanna do so without crashing CPython.

Some things to note first:

  1. Just like the case for LOAD_CONST in Python 2, the bug I abused in LOAD_FAST in Python 3 is known. It's even in the name! It's just way faster to leave that bug there.
  2. I mean there's the ctypes module that allows you to do literally anything. But that's not fun at all.
  3. I did not know anything about the Python interpreter prior to starting this. I've written some high level explanation of how CPython does things below, hopefully it's correct and helpful for anybody just starting.
    • Also CPython source is just so easy to read. It's been a joy.

Since I wanna try this on the newest Python, I cloned CPython and built the x64 Debug and Release version of CPython. At the tim

Folding the Julia Fractal

So the Julia sets are a class of sets that have became very popular because of their beauty and an interesting object of study. The definition of a Julia set is really simple, it is the set of complex numbers \(\bold S_c\) such that for \(z \in \bold S_c\), we have \(|f^n_c(z)| \le 2\), where \(f_c(z) = z^2 + c\). Each choice of \(c\) gives rise to a different Julia set with distinct looks. I might write more about these stuff maybe but given how popular this subject is you can find a lot of it's cool properties anywhere on the internet. I suggest checking out Inigo Quilez on the subject of rendering them.

I hope your internet's good. Due to the nature of the subject it does require rather large images.

Given how simple the definitions of these sets are, it makes it really easy and straight-forward to render them. It can be done in a few lines and is one of the first things I ever coded.

Cliche

The source code for the above is here, you can use the mouse to control the value of \(c\). I left the

JPJP

Magnifying the Micro with Moiré Patterns

Here I design circular screen patterns that can be used to magnify grid-like stuff, like the pixels on your screen or threads in a cloth via Moiré Patterns, such that you can calculate properties about them with a crude measuring tool like a ruler. At the same time, I present a mathematical formulation of what even are Moiré Patterns. It's a rather ad-hoc formulation, so if there are some things I missed do point it out.

I might write a follow up post where the patterns are printed on transparencies to be used IRL.

Some context: Most of these explorations happened back in 2018 with a friend of mine, Vernice. Me and Vernice even printed out the patterns on transparencies to slap on random things IRL. Unfortunately I don't have the original files and transparencies, neither did I document anything so here I've recreated everything and re-derived the Math and stuff.

What are Moiré Patterns?

Moiré Patterns are these trippy magnified patterns that come from overlapping repeated small screen pat

The Hephaestus Project

Hephaestus is the Greek God of design and creativity. More commonly known as the partner of Aphrodite, he was also the god of the Forge and was well known for creating some of the finest jewellery in Greek mythology. Hephaestus was banished from Mount Olympus, simply because he walked with a limp, and when he joined the mortals on Earth he taught them how to make art and the importance of doing so. Analogous to that, the Hephaestus project aims to cultivate unique people with different perspectives, spark creativity and dares the participants to propose the ideas people might dismiss out of hand.

Edit: We take admissions on a rolling basis, so once we get the required number of innovators, admissions will close

What is Hephaestus?

Hephaestus is a week long innovation boot camp for the people who dare to dream 🧠. It aims to bring together a group of 10 people, for a program where they are able to debate, discuss, brainstorm solutions to anything they might be interested in. It provides th

Differentiating a Physics Simulator

Have you seen something happen that seems almost impossible to replicate? Like dropping something and have it land in just the right way, or shoot an arrow and have it land on its tip?

How would you shoot an arrow that lands like THAT?

From a simulation standpoint, you might ask what are the initial conditions required to produce that outcome. To solve this, you could attempt to search through the whole search space. For instance, you could try all possible velocity and position of the arrow and select the ones that land on it's tip. However this is plain impractical as despite only having 7 degrees of freedom (3 for rotation, 3 for position and one for initial velocity), the search space is already huge and chances are, the solutions are but a small portion of the unwieldy search space.

Ok first off, why should we care?

The arrow problem is arguable classified under 'cool' but definitely not 'practical'. However, these kinds of problems where there is a huge search space and we are searching for only a small subset of said space is ubiqu

Hear a Bézier Curve

TLDR: Here's the fork

A long long long long long time ago, in Talk.CSS #52, Gao Wei presented a talk on Bézier curves "The Obscurities of  Bézier Curves Explained to My Computer Engineer Friends". She showed uses of Bézier curves in user interface animations, some rather interesting history about it and explained the mathematics behind it. Watch the meetup on Engineers.SG!

Anyway, Hui Jing made a funny comment when Gao Wei was demoing Lea Verou's cubic-bezier.com:

I prefer to have this with sound, can someone ah please do a [visualisation] using wavelength and then you can like mmm-MMMMM-mmmm. Then ya easier for me to understand I need to hear. (46:06)

So, a long long long long long time later, I forked Lea Verou's repository and added a checkbox to enable sounds. You can try it out here. Should I make a pull request? 😂

Checkbox so small how to press but I lazy lah

Have fun annoying others in your office with the help of Bézier curves!

Password Storage and Security

It's actually reasonable to store passwords in a database in plaintext, if your threat model excludes the possibility that an attacker could gain access to your database.

However, the reason for hashing/salting passwords is to account for the scenario that an attacker could gain a copy of the database or read-only access to the database. Have I Been Pwned lists many site breaches that have resulted in plaintext passwords being shared or sold. Many of which were due to unprotected databases, backups and poor access controls.

With a site user's password, an attacker can easily:

  • Gain access to the user's account on the site
  • Gain access to the user's accounts on other sites

Note that the first objective is also achievable if the attacker has write access to the accounts database.

Hashing passwords

A simple defence against exposure of the user's password is to apply an unrecoverable operation on the password before storage. A hash function is such an operation. Hash functions produce a digest fr

Making a blender 🥤 feat. Zubin

As a kid, I wasn't actually all that into technology. When I was 7/8 years old, the only real things that mattered to me was going to chess club and studying. So I was really surprised when I was introduced to Zubin, a rather inquisitive kid who just wants to tinker.

I was approached to coach Zubin, and help him along with the projects that he would want to make, and I met him for the first time yesterday! The first thing that caught my eye was how his parents had encouraged his maker habit, he had a room with a 3D printer, cardboard boxes, LittleBits, literally anything a 7 year old with maker ambitions might want. On top of that, when I met him, he was working on a 3D printed boat which he was in the middle of designing using TinkerCAD.

My first task with him was to help him finish his boat which came along splendidly. Unfortunately, it took about 4 hours to print it out, and our session was only 2 hours long so we had to come up with a way to keep ourselves busy. I told him that brush

r8168 driver problems 😔

This morning was rather unpleasant, when I woke up to notifications that my server decided to randomly off itself in the middle of the night. Upon digging, it turns out that the network driver connecting my RealTek Ethernet Interface just up and vanished. Seems like someone has cursed me :/

I went about the diagnosis by first trying the following methods.

ifconfig -a     # Does not return eth0 or alternative representations
lspci -vv       # Returns the detection of the  Realtek Controller but does not have any kernel driver (suspicious?)
lshw -C network # Prints network UNCLAIMED

Then, I managed to identify that the driver I needed wasn’t even getting loaded onto the kernel. To reinstall the r8168 driver, you need to download these links to a hard drive/thumb drive.

  • Latest r86168 driver (As of 15 June 2020)
  • linux-headers-<your kernel version> where your kernel version can be found with uname -a (ie: linux-headers-5.3.0-1026-gke)

Then install these packages using dpkg. And loa

Using a Windows VM in Azure as a replacement for Dual Booting/Local VMs

As a electronics/design engineer cum software developer, I use a Macbook Pro running MacOS. For anyone familiar with MacOS and it’s never-ending battle to sparsely support all games and design productivity software, it would be needless to mention that running my suite of design/editing tools on MacOS was a pain.

Previously, I tried my best to switch to mostly Unix supporting open source variants of my design tools, such as KiCAD for PCB design and FreeCAD for 3D modelling. But some tools, are just no replacement for professional tools such as the Autodesk Suite. Not to mention, in many undergrad level EEE modules, board logic design IDEs (like Vivado for Xilinx FPGAs) only support Windows.

As such, it is the burden of students to either dual-boot, run a local VM, or get an additional Windows PC. Knowing the performance bottleneck for my 8GB RAM and 256GB SSD Macbook running VMs and professional productivity software, I wanted to find an alternative solution to this problem.

That’s when I