PortuguΓͺsEnglish

Blog

Google-Cloud-Architect-Certification.jpg
2021.09.05

Google Cloud Architect Certification

Less then a couple of months after I got certified as a Project Manager, I decided to invest in an area that I was not fully confident that I know the stuff: defining cloud architecture. I started to create, develop and manage cloud systems for just the past 5 years or so, and it evolved really rapidly.

So, applying for a such certification would require an extra study by my part. There were areas that I definitively do not grasp, such as networking and many Kubernetes corners. I decided to go with my beloved Coursera. I did a couple of free and paid courses there and I love it. Also, it which was the official training platform for Google products and services. Google itself design the courses and their employees that teach them. So there is some comfort.

The course is very practical. They provide a demo but real user to allow students to act in Google Cloud environment for real. So one actually interact, create, update and delete real things. It’s a major factor. Hands on baby!

I went to the examination was much more relaxed. They were as much as professional as the PMI guys, but more relaxed and humane. I passed.

I definitively learned a lot. It will help me in the future and current projects. Even being a Google Cloud focused, it addressed many of the issues of a generic cloud architect in any provider.

I can assure I can handle the job. From computing, serverless, storage and, yes, networking, I’m pretty confident I can design a better pretty cost-efficient solution than before. In the evolving cloud business, as long I keep updated, it’s a new passion that I am really excited.

Google cloud architect certification.png

bad-review-rating-two-star-ss-1920.jpg
2021.09.03

Rating Art

Rating things is a real art. Specially if we are rating art. Not much thought is put on it; eventually things start to get complicated and ambiguous.

Time

Also cultural references also change. What was good 100 years ago might simply be unacceptable nowadays. There are plenty of movies, sculptures, paintings and songs that portrait racism, misogyny or prejudice that were normal at the time. It’s complicate to reevaluate them using our modern mental framework.

Also, our own taste changing with time. Things that were cool when we were young might embarrassing years later. #cringe

Technology

Some technological improvements make it change our quality perspective. A silent or black-and-white movie, a radio quality song recording, an Atari Pong. But today, it’s hard sell to have such limitation in a modern piece of art.

Sometimes, these technological changes make plainly impossible to appreciate the art later on. For video games it’s particularly affected, since the medium in which it is consumed is part of the experience. Virtual Boy headaches during hours and hours of playtime were part of the nostalgia, but how to compare with a modern XR game if the hardware itself is hard to find and make it work?

Single Fixed Scale

Finally, we have to reduce all the rich details into a numeric scale.

I prefer an infinite positive scale, that always grows with new titles, would be better. So Pong would never be in the same league as a modern AAA 3D adventure story-driven game. But at the same time, one could honestly appreciate an old movie almost the same as flashy new one.

So having a single fixed scale, from 1-5, 0-10, percentage, or even the super weird American F-A concept, is a easier way to deal things. Almost everyone uses this in some shape or form.

My take

There are much to discuss.

At least for now, I’m going to simplify a bit my ratings. I use a 0-10 scale, with .5 decimals. There is no need for these decimal point. An 0-10 scale is enough to separate good from bad. Numerically, 9.4 is better then 9.3. But in practice, it most convey the information that is an amazing game/movie/book, not that one is better then the other. The details I expect to point are a qualitative analysis in each review.

Also, using half-points in practice doubles the range. It’s in fact a 20 point scale. No need for such granularity.

Updating all these past ratings with decimal points, rounding them up or down, depending each case.

One might notice that I’ve never used the 1-3 ratings and barely used bellow 6. It’s not a problem with the scale per se. It’s more about the selection process that occur before consuming a game or movie. I try to focus on award winning, previously mentioned and commented by someone else before. I might eventually rethink this scale to englobe all bellow threshold in a single category and focus on the above threshold scale.

This way I tend to consume only reasonably good products and, therefore, only set reasonably good ratings! Good for me, if you ask.

Pandemic-Board-Game-Header.png
2021.09.02

Pandemic (The Game)

Since I started to follow the rising popularity of board games, 15 years ago, one game the games that was recurrently recommended is Pandemic, designed by Matt Leacock. When I finally had the chance to buy a game from US, it was one of the 4 games I’ve got.

At the prestigious BoardGameGeek’s top ranked games, Pandemic figured in the top 10 games for quite some time. Now the Legacy version is currently in the top 3.

Tgtg ho17 zm7101.jpg

The main attractive at the time is the idea of a cooperative game. All players fight against the game itself. On video games its common, but was kinda a novelty for tabletop games. It plays well with 2 to 5 people and you can even play with children, because it’s all information is open so you can help the decisions for each player. Also because of been cooperative, it’s very easy to teach other people, because you can teach and repeat the rules while playing.

The let’s Save the World from a Pandemic theme was already fun, but now it has a almost historical and technical value to it. The game popularity spawned several expansions, spin offs and the most successful Legacy series, the campaign story-drive version.

T b8z ghm xw48p2 qjyf rr j4 s 970 80.jpg.webp

It’s my most played board game to date. For a reason.

My Rating:10β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…
2021.08.15

Books From 2021 (So Far)

I continue to read (listen in fact) almost every day for the past years. It’s in my daily routine when I walk the dogs. It’s a very different proposition from laying down and dedicate some time to read them. I have a urge of a secondary task when I am performing a no-brainier routine, just as.. walking the dogs. Otherwise, I just feel wasting my time my just walking and no thinking.

This is the list of this year’s books that I ingested. Later I present a list of books from the previous years that did not mention before. These lists are -definitively- not comprehensive ones. Since I’m not updating my GoodReads personal records nor writing about them in this blog, they are just the ones I remembered. Eventually I might edit this post in case I remember other entries.

  1. Remote (Jason Fried, David Heinemeier Hansson) (10β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…): I’ve read this book few years back and I’m planning to do a annual reading of this book, along with the other Jason Fried books. They are mind opener, very opiniative and thought provoking. Yet so elegant and simple. It points advantages and disadvantages of remote working, some misconceptions and prejudices. During the radical change of life during the pandemic, it was still valid (it was published in 2013)
  2. Foundation: a SCI-FI classic that was always in my “want to read” list. Since I’ve heard that it’s going to become a TV Show from Amazon Prime, it climbed up to the top of my next books. And it did not disappointed. A superb novel that deals with the idea of a guy that can forsee the future and plan each step to change it.
  3. Parable of the Sower (Octavia E. Butler) (9β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…): a 5 stars recommendation from The Wertzone, it was amazing and rich as I was told. The next book, Parable of the Talents (Octavia E. Butler) (8β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…), also recommended, will be read soon.
  4. Torto Arado (Itamar Vieira Junior) (7β˜…β˜…β˜…β˜…β˜…β˜…β˜…): this Brazilian first time author conquered most of national and international Portuguese awards. Tells a story of two girls from the almost deserted region in Brazil, fighting against poverty, misogyny and happiness.
  5. 21 Lessons for the 21st Century (Yuval Noah Harari) (8β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…): another hit from the same author of Sapiens, focusing on some pressing issues of the contemporary times, like genetics, robotics and artificial intelligence.
  6. Shaping the Future of the Fourth Industrial Revolution (Klaus Schwab) (8β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…): the same vein of the previous book, analyzing global issues, from the executive chairman of the World Economic Forum. I think I liked more than 21 Lessons
  7. The Final Empire
    The Final Empire (Mistborn #1)
    (Brandon Sanderson) (7β˜…β˜…β˜…β˜…β˜…β˜…β˜…)
    : in a universe that magic spells can be cast by consuming metals, Sanderson starts the sprawling saga with a epic heist.
  8. Letters From An Astrophysicist (Neil deGrasse Tyson) (7β˜…β˜…β˜…β˜…β˜…β˜…β˜…): Tyson is a well known scientist and his polite, yet firm, way to respond questions in TV shows is also presented in this collection of letters received by fans and not-fans alike. He talks a little bit of everything: science methods, physics, astrophysics and, but also about astrology and religion.
  9. Project Hail Mary (Andy Weir) (7β˜…β˜…β˜…β˜…β˜…β˜…β˜…): The Martian was a mega hit. As a movie adaptation, it was the most viewed and profitable project from the acclaimed direction Ridley Scott, which includes Gladiator, Blade Runner and Alien. It takes the same Weir’ nerdy writing style, again with a very lonely protagonist and the roller coaster plot. This time, I have big doubts that a film adaptation would be a similar success, due the complex narrative and scope.
  10. Foundation and Empire (Isaac Asimov) (6β˜…β˜…β˜…β˜…β˜…β˜…): the second book have two different stories and is less interesting due the lack of the main characters from the first book. Of course, it takes places centuries after the first book’ events. The new characters are all nice, but the Hari Seldon previsions becomes both too mystical and precise to my taste.
  11. The Miracle Morning (Hal Elrod) (4β˜…β˜…β˜…β˜…): I heard about it while listening the Jeff Goins podcast interviewing the author. He mentioned coming to Brazil to advertise his new book and discovering a huge fan base. So why not try. I found a very obnoxious self-help book about waking up early, do some exercises, meditate and suddenly one would become 999% more productive.

From previous years but not yet mentioned (and worth mention)

  1. It Doesn't Have to Be Crazy at Work (Jason Fried, David Heinemeier Hansson) (10β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…): Like Remote, it’s worth to re read periodically.
  2. The Name of the Wind (Patrick Rothfuss) (10β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…): Kvothe’s early stories are fascinating. The universe blends Harry Potter with Lord of the Ring, with a very likable cast of characters.
  3. The Hate U Give (Angie Thomas) (8β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…): read years before the Black Lives Matter movement, is still a valid story about racism and police brutality. I’m yet to see the movie adaptation.
  4. On Writing: A Memoir of the Craft (Stephen King) (7β˜…β˜…β˜…β˜…β˜…β˜…β˜…)
  5. Judas Unchained (Peter F. Hamilton) (8β˜…β˜…β˜…β˜…β˜…β˜…β˜…β˜…): the second book, just after the events of Pandora’s Star. Breath holding.
  6. How To Write 50,000 Words In 30 Days, and survive to tell your story! (Mike Coville) (7β˜…β˜…β˜…β˜…β˜…β˜…β˜…): dogmatic but can serve as a powerful inspiration.
  7. Artemis (Andy Weir) (7β˜…β˜…β˜…β˜…β˜…β˜…β˜…): first Mars, now the Moon. The this sci-fi story is well grounded in science and the protagonist is tenacious
  8. The Wise Man’s Fear (Patrick Rothfuss) (5β˜…β˜…β˜…β˜…β˜…): the The Name of the Wind’s protagonist transformed from a poor underdog in the first movie to a almighty demigod. There are basically no impossible obstacles that are solved a couple later.

For more books, you can check my online read list on GoodReads.

Hugo Images Processing mola.jpg
2021.08.11

Hugo Images Processing

Hugo static website creating is a fantastic tool and I told you before. Since I changed to it, I’m very confident that the site is fast and responsive.

However, my site is packed full of images. Some are personal. Some are really big. Some are PNGs and some are JPGs. I created a gallery component just to handle posts that I want to fill with dozens of them.

Managing posts images is a boring task. For every post, I have to check:

  • Dimension
  • Compression
  • EXIF metadata
  • Naming

Dimension

Hugo images processing size 2.jpg

Having a bigger image than the size of the screen is useless. It’s a bigger file to download, consuming bandwidth from both the user and from the server. Google Lighthouse and other site metric evaluators all recommend to resize the images to at most the screen size.

In Hugo, since I defined the it’s easily automated using some functions:

{{ $image_new := ($image.Resize (printf "%dx" $width)) }}

Compression

Loss compression comparison.png

My personal photos are, most of the time, taken in JPEG. Recently I changed the default compression to HEIC for my phone camera, that provides better compression to hi-resolution photos. The web, however, does not allow such format.

Some pictures used to illustrate the posts are PNG. They have better quality at the expense of being larger. Mostly only illustrations and images with texts are worth to have a lossless format.

Whatever the format, I would like to compress as much as possible to waste less bandwidth. I’m currently inclined to use WebP, because it can really shrink the final size to a considerable amount.

{{ $image_new := ($image.Resize (printf "%dx webp" $width)) }}

EXIF metadata

Each digital image have a lot, and a mean A LOT, of metadata embedded inside the file. Day and time when it was taken, camera type, phone name, even longitude and latitude might also be included by camera app. They all reveal personal information that was supposed to be hidden.

In order to share them in the open public internet, it is important to sanitize all images, stripping then all this information. Hugo do not carry these info along when it generates new images. So, for all images get a minimal resize, this matter is handled by default.

Naming

I would like to have a well organized image library, and it would be nice to standardize the file names. Using the post title to rename all images would be great, even more if used some caption of user provided description.

However, Hugo does not allow renaming them. To make matters even worse, it appends to each file name a hash code. A simple picture.jpeg suddenly became picture-hue44e96c7fa2d94b6016ae73992e56fa6-80532-850x0-resize-q75-h2_box.webp.

A incomprehensible mess. If you know a better way, let me know.

So What?

So, if most of the routines can be automated, that’s the problem?

The main problem is that Hugo have to pre-process ALL images upfront. As mentioned in the previous post, it can take a considerable amount of time. Specially if converted to a demanding format to compute such as WebP.

Netlify is constantly reaching the time limit to build the site, all because the thousands of image compressions. I am planning to revert some commits that I implemented WebP and rewrite them little by little, allowing Netlify to build a version an cache the results.

There are some categories of images:

  • gallery full-size images: there are hundreds of them, it would take a lot of the processing time but I will have the metadata extracted from the originals. The advantage is that they are rarely clicked and served.
  • gallery thumbnails: the actual images that are shown on gallery mode. They are accountable of the biggest chunk of the main page overall size when a gallery is in the top 10 latest posts.
  • post images: images that illustrate each article. They are resized to fit the whole page, so when compressed they represent a nice saving.
  • post top banner: some posts have a top image. They are cropped to fit a banner-like size, so they are generally not that big.

I will, in the next couple of hours, try to implement the webp code on each of these groups. If successfully completed, it will save hundreds of megabytes in the build.

Bonus Tip

Hugo copy all resources (images, pdfs, audio, txt, etc) from the content folder to the final public/ build. Even if you only use the resized ones. Not only the build becomes larger, but the images that you wanted to hide the metadata is still online, there. Even if not directly pointed in the HTML.

A tip for those that are working with Hugo with a lot of images processed: use the following code into the content front-matter to instruct Hugo to not include these unused resources in the final build.

cascade:
  _build:
    publishResources: false

Let’s build.

Edit on 2021-08-25

I discovered that Netlify has a plugin ecosystem. And one of the plugins available is a Hugo caching system. It would speed up drastically the build times, as well the possibility of converting to Webp all images once and for all. I will test this feature right now and post the results later.

Edit on 2021-09-13

The plugin worked! I had to implement it using file configuration instead the easy one-click button. Building time went from 25 minutes to just 2. The current cache size is about 3.7 GB, so totally understandable.

It will allow me to must more frequent updates. Ok, to be frank: it will not restrict the posting frequency. However, patient, inspiration and focus are still the main constrains on blogging.

On netlify.toml file on root, I added:

# Hugo cache resources plugin
# https://github.com/cdeleeuwe/netlify-plugin-hugo-cache-resources#readme
[[plugins]]
package = "netlify-plugin-hugo-cache-resources"

[plugins.inputs]
# If it should show more verbose logs (optional, default = true)
debug = true
Bruno π•„π”Έπ•Šπ•Šπ”Έ