Something I learned
Networking errors are hard
It's been a weird week technically, I've been working on programmatically exporting Photoshop files and it's been a roller-coaster. The constraints are:
- The files are big in size, as in multi-gig big
- I want to do this exporting in a serverless manner
I am not done yet, but I do plan on writing a blog post about it. I was surprised by how little information about this I could find online, so I plan on helping ease the suffering of a fellow future developer through my blog post.
However, during the endeavor, I had to set up an EC2 instance in a private subnet and SSH into it, and by God, I remembered how hard it is to debug networking-related bugs. Similar to CSS, networking errors are silent or give back a generic error. For the most part, I do get the motivation or reasoning behind this, but it makes gathering information about a problem impossible.
Over time, I developed and found ways to debug CSS issues effectively. Chrome's DevTools has become one of my favorite programs since I started my web dev journey. It sometimes helps me with hints, shows me the rule's hierarchy, helps me find the computed values, and allows me to try the CSS equivalent for print statements, outline: 2px red solid. Overall, outside of overflow detection, DevTools and sensible selector creation have been very effective at tackling the weird nature of CSS errors.
As for networking, I don't have much in my toolkit besides Googling and trying to match my situation to what others say on Stack Overflow. For more context, and without going into all the solutions I tried before this, I was trying to set up AWS's EC2 Instance Connect Endpoint. This EC2 Connect Endpoint gives you the ability to connect to your EC2 instances in a private subnet using a networking interface instead of having to use a bastion host. You can firewall control who has access to the Endpoint and/or use IAM roles.
And this is where my struggle began. I was able to get the outgoing and incoming SSH firewall permissions needed to connect fairly fast. The only issue, these permissions were for all IP addresses. The moment I tried to restrict them, my SSH connection would timeout. Now I get why timeouts happen, but the lack of information as to why is so annoying. I honestly don't know how to solve such issues. Is there some tooling that is able to give me more information that I'm not aware of? I really try to only change one thing at a time, I read the documentation carefully, even though it didn't help that AWS has something called EC2 Instance Connect (without the Endpoint at the end), so Google returned everything that is not relevant. Maybe this is a product that is worth exploring; think of DevTools for network debugging. I didn't need to spend as much time as I did just because I forgot to attach the SSH security group to the EC2 instance; I was already halfway there.
I solved the problem by attaching the Endpoint and EC2 instances to a security group with Egress and Ingress SSH permissions for the VPCs CIDR block. In layman's terms, anyone within the VPC can SSH to talk to anyone else; it's not ideal, but it is restrictive enough. Me saying that I have such permissions in our VPC is not great for security, but I'm willing to take the risk.
Processed foods
So, I found out about Chris Van Tulleken and his pursuit against processed food. I never really understood what processed foods meant and how they're bad for you. I won't rephrase or go into too much detail explaining here; he does such a good job in the talk I linked.
I will say, I am surprised at how this has gone for this long without being regulated or shunned by society. There needs to be more education about how these foods are bad for the public health. It was also really sad hearing him talk about how people with lower socioeconomic status suffer more from eating processed foods and how it's becoming the leading cause of many health problems.
He does make the comparison to how long it took us to regulate and educate people about cigarette smoking and how this will go down in history the same way and I do see that point. I was also happy about how my diet, for the most part, lacked processed food. Soylent is my exception. He does say that the types of ultra-processed foods that are bad for you are the ones that don't care about your nutrition and or over-optimize for your consumption. Chips and cereals are examples he brings up; Soylent is processed with a different goal in mind.
Gratefulness
I'm really grateful for the good food habits my family instilled in me growing up. I say instilled now, but it was more like forced, but it's okay, I was a kid and didn't know better.
I remember having to share sweets; we'd, for example, open a KitKat bar and split it between the four of us, a stick each. It wasn't due to lack of means; it was because sweets are good in moderation. Sodas and fast food were not allowed in the house for most of my childhood. Growing up, I never had frozen, ready-made meals; I was lucky to have a full-time mother who made us home-cooked food for the majority of the week.
Their system was not perfect; we'd still get sugary "natural" fruit juices, for example, but it was levels better than what many of my friends had growing up. I found myself following a lot of their food habits as an adult without knowing why; I feel that it is part of my pallet to some extent, and I don't find a lot of fatty, ultra-processed, or sweet food as appealing or as tasty as others do. And for that, I'm grateful.