Introduction
Tags: intro, programming, blog, hobby
Published: 2023-10-28 22:43:19

Hi everyone! I'm a software engineer currently living in Pittsburgh with my wife, dog, and two kids. When I'm not with my family and friends, I like to learn chinese, configure linux pcs, and write scripts/code.

I grew up in upstate New York and studied at the University of Pittsburgh for my undergraduate from 2014 - 2018. I originally majored in neuroscience, but switched to Computer Science in the spring of my sophomore year. I still wanted to graduate with my friends, so I worked really hard by taking summer classes (3 - 4 CS classes every semester). The amount of projects, assignments, and exams were crazy! If I could redo my undergrad, I would start taking CS courses in freshman year rather than compressing everything into two and a half years.

I posted a couple years ago on Medium on web development, but I started to lose interest. I was primarily working with a lot of JavaScript and react-redux projects at work at the time and it started getting repetitive. A lot has changed in the past 5 years; I learned backend development, distributed programming, docker, gitlab CI, python, and some machine learning. I also started to realize there is less freedom at work, so I decided to work on more personal projects as hobbies.

## First PC Build (2018)

My parents were strict on gaming, so I only played free games on parent's underpowered desktop with slow internet. So the first thing I did after I got my first job after college, was build a PC. This is an expensive hobby, so I will probably swap out parts rather than building a whole new PC. 

These were my hardware specs:

|Hardware|Part|
|--------|----|
|CPU| Intel - Core i7-8700K 3.7GHz 6-Core Processor|
|CPU Cooler| Cooler Master - Hyper 212 EVO 82.9 CFM Sleeve Bearing CPU CooMOBOler|
|MOBO| Asus - ROG MAXIMUS X HERO (WI-FI AC) ATX LGA1151 Motherboard|
|RAM| Corsair - Vengeance LPX 16GB (2 x 8GB) DDR4-2400 Memory|
|SSD| Samsung - 850 EVO-Series 500GB 2.5" Solid State Drive|
|HDD| Seagate - Barracuda 2TB 3.5" 7200RPM Internal Hard Drive|
GPU| MSI - GeForce GTX 1080 8GB Video Card|
|CHASSIS| Fractal Design - Define R6 White TG ATX Mid Tower Case|
|PSU| Corsair - 1000W 80+ Platinum Certified Fully-Modular ATX Power Supply| 
<figcaption>In 2023, I switched out my 1080 gtx with a 3070 rtx.</figcaption>

## Linux Journey (2018 - Present)

I decided to take Linux more seriously after the announcement of Windows 11. The [hardware requirement](https://learn.microsoft.com/en-us/windows/whats-new/windows-11-requirements) of the [TPM](https://learn.microsoft.com/en-us/windows/security/hardware-security/tpm/trusted-platform-module-overview) seemed non standard to me for non-enterprise pcs and I was already tired of Microsoft shenanigans and lack of user configuration. I noticed this weird alternating pattern of "good" versions of windows (XP - good, Vista - bad, Windows 7 - good, Windows 8 - bad, Windows 10 - Good, Windows 11 - bad?). _I was at my breaking point, it was time to switch..._

My first Linux distro was [PopOS](https://pop.system76.com/) and It was a refreshing experience. It was really easy to install, use, and game on. I distro hopped a few times to see what other linux flavors are like. These are the ones that I remember trying [Zorin OS](https://zorin.com/os/) and [Linux Mint](https://linuxmint.com/). These ones looked mostly like windows and it was easy to use. At work, I gained most of my linux knowledge from docker and configuring / administrating RHEL servers. This helped give me more confidence in switching my personal computers to linux.
**I wanted to challenge myself further.**

I was looking for a minimal linux distribution that is light on resources, and I found one called [Metis Linux](https://metislinux.org/), which is based on [Artix](https://artixlinux.org/). The interesting part of metis is that it wasn't using a desktop environment, but a windows manager called [dwm](https://dwm.suckless.org/). At the time, metis linux had a minimal bash script installer via chroot. This took longer to setup, but I had a better understanding of what the setup involved rather than an automated GUI installer. I learned about how to partition the filesystem. I remembered I ran into some trouble was due to not running `mkfs` to make the filesystem! I was also planning to dual boot with windows, so I thought more about how to split my partitions. Each OS would have a dedicated portion of my SSD and HDD and a shared HDD portion that would as a generic media filesystem using exfat (_since that was cross platform_). This would contain my media files like music, pdfs, and other non OS specific files. I also set up a [samba](https://wiki.archlinux.org/title/samba) server to serve my media. I learned more about `/etc/fstab` and how that tells the OS what partitions to mount on linux.

This is what my laptop looks right now.
![laptop screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ovcmpha8huas9jarcl7d.png)
<figcaption>top bar is <a href="https://tools.suckless.org/slstatus/">slstatus</a>. wallpaper: <a href="https://wall.alphacoders.com/big.php?i=1270960">Fantasy Lord of the Rings HD Wallpaper by Marcus Whinney</a></figcaption>

![dwm pywal screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mr9q57lcst2jdmyir588.png)<figcaption><a href="https://github.com/dylanaraps/pywal">pywal</a> is used to get the colorscheme from my wallpaper for my browser and terminal. left: <a href="https://neovim.io/">neovim</a>, top right: <a href="https://qutebrowser.org/">qutebrowser</a>, bottom right: <a href="https://github.com/karlstav/cava">cava</a></figcaption>
From metis, I learned more about Artix and Arch (_Since Artix is based on Arch_). The cool thing about Artix is that it uses alternative init systems like `openrc`, `runit`, `dinit`, or `S6` instead of `SystemD`. I'm using metis on both my laptop and desktop, so I will try Artix linux and another distribution in the future to mix things up. [Linux From Scratch](https://www.linuxfromscratch.org/) looks like a neat project to do as well.

## Contribution to Open Source Projects

I discovered the [moonlight client](https://github.com/moonlight-stream/moonlight-qt) and [sunshine server](https://github.com/LizardByte/Sunshine) a few months ago. These are open source solutions to provide remote gaming/desktop capabilities with built in input and audio passthrough. I tried [NoMachine](https://www.nomachine.com/), but I wasn't able to get audio to work. This looks like a [known issue on arch](https://kb.nomachine.com/TR04N06752). On sunshine, I didn't have to do any extra tweaking! This allowed me to game on my desktop pc without having to sit at my desk. This was especially helpful while watching my 2nd son. I was really impressed by the performance, I could stream my host's display at high resolutions and frame rates with low latency despite my desktop being in the basement using WiFi. I was getting some instability with WiFi, so I wanted to try connecting my desktop to the router via Ethernet. I decided to go with a headless solution because that gives me more flexibility on the placement of the desktop; I ended up moving my desktop upstairs closer to my router. I figured out a way to stream my hosts display headless by using Nvidia TwinView to create the virtual display. This means I don't need to buy any HDMI/DP dummy plugs. I wrote a [Linux Guide](https://docs.lizardbyte.dev/projects/sunshine/en/latest/about/guides/linux/headless_ssh.html) for sunshine on how to set this up. If you have any feedback on this guide, let me know! I haven't tried this, but [wolf](https://github.com/games-on-whales/wolf) is an interesting docker alternative to sunshine.

The sunshine project also got me curious in video encoding. I wanted to learn more about how to benchmark encoder performance and I discovered the [encoder-benchmark](https://github.com/Proryanator/encoder-benchmark). I noticed a small issue on linux that prevented the calculation of VMAF scores. Fortunately it was a simple fix. The [filetime method](https://github.com/Proryanator/encoder-benchmark/pull/23) didnt work on Linux, so I replaced the method with a cross platform one. I wasn't familiar with rust, so the concept of [ownership](https://doc.rust-lang.org/book/ch04-00-understanding-ownership.html) confused me at first. I also noticed ffmpeg would hang forever when it times out. I added [retry logic and timeout detection](https://github.com/Proryanator/encoder-benchmark/pull/32) to ensure the `permutor-cli` runs to completion. Since there was no official linux support, I decided to contribute to the [Arch User Reposititory (AUR)](https://wiki.archlinux.org/title/Arch_User_Repository). I have published a [git](https://aur.archlinux.org/packages/encoder-benchmark-git) and [non-git](https://aur.archlinux.org/packages/encoder-benchmark) version. The git version pulls the latest from `main` at the time of building. The not-git version pulls the current `git tag`.

## Coding Projects
I posted a few things on Medium to experiment with dev blogging, but I don’t like the paywall system. I believe knowledge and ideas should be shared freely without inhibiting learning. Everything I post will be free and always remain so. I decided to try dev.to. I found out about this platform from this [article](https://dev.to/davidmm1707/should-you-use-medium-or-dev-to-2g1d). If you are curious about my previous posts you can see [Mortgage App Update](https://eric-dong.medium.com/mortgage-app-update-3ce3213d9682) (React-Redux ElectonJS Desktop App) and [How to Handle Opening and Closing Context Menus with a Custom React Hook](https://eric-dong.medium.com/fun-with-react-hooks-6e747e3f2b7d). I most likely won't post more to medium, so I will stick with [dev.to](https://dev.to).

I always wanted to do my own project, but I had trouble finding a project I'm passionate in and remain motivated for the long term. I recently thought of an idea that combines nostalgia with some of my interests: gaming, coding, and machine learning into a project! I remembered my dad showed me the 1985 Bill Seiler's version of [space War](http://www.1morecastle.com/2012/10/spacewar-dos/) on his IBM PC/AT as a child.

{% embed https://www.youtube.com/watch?v=cgG1rCx1DeA %} <figcaption>You can play the emulator from your browser on <a href="https://archive.org/details/SPACEWAR_1020">internet archive</a></figcaption>
I remembered the controls are hard for the human player, so I'm curious if Reinforcement Learning agents can play the game better. First I will start building out the simulation/game until I have a minimal viable product to start training the agents. I will also recreate the original "AI" to measure baseline performance. I assume they are rules based and have access to internal state. The left player was defensive and mostly used phasers. The right player was offensive and mostly used photon torpedoes. My metrics of performance will be the game win rate. Once I get this going I will continue to make the simulation more complex and add more agents for Multi Agent Reinforcement Learning (MARL).

I'm planning to start a dev blog for this series to keep track of things I'm learning and discovering.

**Here is a sneak peak of what I'm working on**
![Demo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mr8wm4n8vtzvzbsy33ck.gif) <figcaption>basic player movement with zero gravity physics and screen wrap-around</figcaption> 

I used [OBS](https://obsproject.com/) to capture my screen, [shotcut](https://shotcut.org/) to edit the video, and this command to create a gif (_Shotcut also supports exporting to a gif, but it seems to take longer to process_)

```
ffmpeg -i space-war-rl.mp4 \
  -r 30 -vf "scale=600:-1;" \
  -ss 00:00:15 -to 00:00:25 \
  space-war-rl-sm.gif
```