▌ adam@poniatowski.dev:~$ whoami
Welcome to my online CV/Resume!
It was a fun (and painful) experience creating this webserver. It took me a great deal of time and
effort to learn the ins-and-outs, with just the standard
libraries.
I decided to dive into development, from the classical IT field, as I could see that the "Using someone
else's hardware, except the company I am working for" "Cloud Era" has begun, slowly
diminishing future employer opportunities, in my line of work (some of the companies in my past experiences has
closed down by now). The MSP (Managed
Services Provider) days
are slowly coming to an end, for some of the smaller companies. Favoring the software houses (Startups) of today, which is the current
trend at the moment.
Getting into a large (MSP's is getting tougher, as majority of it has been outsourced to companies in India (it used to be China, and I guess Brazil will be next). And companies with internal IT departments are moving to services like AWS, Google, etc. which changes things a bit. Small to medium enterprises has been lulled into the "cloud" trend, with marketing gimmicks like "cutting CAPEX to almost zero, and decreasing OPEX!" (and in some cases, no change, or increase in OPEX, depending on the nature of their business activities). Companies were fooled into thinking that it will save money in the long run, as it is a vendor lock-in, with a huge cost, if one were to decide to bring it back in-house, as there is absolutely no TCO. But one is told that it would be lower... how can one own something, if it is actually owned by someone else?
With that bit out of the way. I ended up with an experimental role (probably another company has already done this, who knows?), which I was looking after a component critical in the build process. Which is completely written in bash, which I took it upon myself to reverse engineer it (not just maintain it), to write it into another language, as a form of practice.
-
I picked rust. That fell through, as the servers did not
have the correct libraries for tools to function, which was a bummer, as it is one of the languages I have a keen
interest in.
7 April 2023 update: I will no longer use Rust, now nor in the future, due to these policy changes
- I didn't want to write it in python, as it would be too slow for the task, but it has its uses due to it being so popular and well supported. For smaller, prototype builds, its perfect... but for handling terabytes of data, it'll take too long for production and time sensitive services. One can use threading and try and cut the time down, but that would use too much resources in the end, and making debugging troublesome and python is an interpreted language, which means one finds problems at runtime... not compile time. Which makes it a risk to put it into production.
- I considered using a MEAN stack, to give a nice UI for users as well. But again, performance is not upto par with what is needed/required.
- C and C++ was on the table, as I am learning electronics (playing around with arduino's) with C. I decided against it, as the learning curve is quite steep, which would take too much time to start replacing backend components/scripts.
- It finally came down to Go. At first, I was not interested in it, but as soon as I started learning it, I noticed that it is far simpler and easier to learn. Built from the ground up, with concurrency in mind. So I started work on replacing tools/scripts with binaries, written in Go. One way how I learned, was by focusing on an SSH script, which worked just fine, but I wanted to learn concurrency and the original script ran sequentially. So the total time it took for the original bash script, took about 16-24 seconds to run a command on all of the servers, in different countries/locations. My replacement binary, brought the time down to 3-8 seconds, which was a great improvement and Go became my main language to write code in (including this webserver). Company priorities shifted, and the plug was pulled to rewrite and improve the component (adding wanted/needed features) and it was also not originally part of my job description.
It was at that moment, I realized that I wanted to become a developer. So the SSH tool I forked off, and made it an open source tool and continued development on it in my spare time. For now it has a simple name (GoSSH), but once I am done with v2, I will start thinking of a suitable name for this project. Another project I am working on, is Zero Effort Hosting Daemon, which I learned web services and microservices on kubernetes (still a WIP). And an exercise in API's which is done/complete and usable, which I named routes. It uses the OSRM API, of which one can input a source, and multiple destinations, to return the distance and duration, if one were to drive to them.
This webserver, I will be keeping on a private repo for now, while I test it is
available here. Its a simple
net/http webserver utilizing Go html/template. The issues I am trying to avoid
is doing templating when a request comes in, which could lead to extra unneeded/avoidable overhead. So I made a
caching function, keeping the webpages in memory, instead of wasting resources for every web query. And to avoid
extra coding to create extra routes, and only
focus on creating gohtml files works
with HTML, Markdown and Org, which in turn,
creates a route and gets cached. So I killed 2 birds with 1 stone, creating dynamic routes, by just creating more
pages, and eliminating the need to restart the webserver.
Which was always a nuisance, as it was an extra step one had to remember (or automate). I added an additional
feature, in case anybody wants use any CLI to bombard it with useless queries (anti script kiddie feature).
So if someone queries it with curl/wget/powershell script, will instead get their IP address returned, instead of
wasting bandwidth/resources on sending a webpage back. So now it can be used on cloud provider's instances, and
avoid
malicious persons, trying to increase your bandwidth costs (which realistically shouldn't be incurred on users,
but again... they make the rules for you, and you have to pay for it, and people still fall for the marketing
schtick).
Shifting gears... But to move into the development field, from years of experience in IT, was a big obstacle I needed to cross. And after years of trying, I was given the opportunity, of which I am eternally grateful for.