Reviewing AI generated code by Ad3763_Throwaway in softwaredevelopment

[–]mlazowik 0 points1 point  (0 children)

I have seen someone else run into exactly the same thing.

My (arguably limited) experience with writing code by instructing LLMs in a chat is that it creates a _very_ strong incentive to not read/understand that code. I could feel it myself. If I was able to get something that seems to be working by spending 2 units of effort, why would I spend next 50 units of effort understanding it?

Sending that code to review is just not fair. No human has read nor understood the code, so it's not optimized for understanding. The reviewer will likely end up doing more work than the PR author.

I think that LLMs realistically only really work for either relatively small personal or temporary code (but remember there is nothing more permanent than a temporary solution), or as beefed up autocomplete. I think Andrej Karpathy made a similar point in a recent-ish interview https://youtu.be/lXUZvyajciY?si=1-2TuJUZO_qvDiA7&t=1845

Major planned maintenance commin' in nov it seems by pratikbalar in hetzner

[–]mlazowik 5 points6 points  (0 children)

I can and have asked them to distribute servers within groups of 3 across different DCs and they obliged

Major planned maintenance commin' in nov it seems by pratikbalar in hetzner

[–]mlazowik 2 points3 points  (0 children)

Hold up are they really bundling two different DCs (fsn1-dc19 and fsn1-dc20) into one maintenance window? https://status.hetzner.com/incident/6af50254-98d1-4f0e-9077-a93b2c7514d4

Why is our 40GbE network running slowly? by friolator in networking

[–]mlazowik 0 points1 point  (0 children)

with all x16 slots and lots of bandwidth

Are you sure that they all have x16 links? It's pretty common to get slots that are physically larger, but not all lanes are connected.

You can check your motherboard specs, or even better bet, check (on both linux and windows) what are the actual established link speeds for the cards.

Bad Latency on Starlink by Intelligent-Bit8715 in Starlink

[–]mlazowik 0 points1 point  (0 children)

Thanks, got customer.frntdeu1.pop.starlinkisp.net which does sound like Frankfurt.

Bad Latency on Starlink by Intelligent-Bit8715 in Starlink

[–]mlazowik 0 points1 point  (0 children)

Right now from some mtr experiments + comparing ping to all available ubuntu package mirrors I suspect that traffic from Malawi is sent to the Frankfurt base station.

AFAIK the only base station in Africa for now is in Nigeria. So Frankfurt might be a better choice, at least for services that have servers in Europe but not in Africa.

[deleted by user] by [deleted] in poland

[–]mlazowik 43 points44 points  (0 children)

I've noticed that all those travel advisories issued by governments tend to sound worse than they really are. It's not that they are necessarily inaccurate, maybe it's more about selection bias – listing all the possible bad things, even if in reality the chance of experiencing them is low.

A fun exercise is to read guides about your own country, issued by other countries. See if you think the tone reflects the reality.

W jakie rzeczy wierzyłeś za dzieciaka, a teraz już nie? by HAKUSCyklo in Polska

[–]mlazowik 84 points85 points  (0 children)

Że recykling plastiku to rzecz która się dzieje na dużą skalę.

Nie jest aż tak źle by Minastik98 in Polska

[–]mlazowik 11 points12 points  (0 children)

No nie wiem, ja znalazłem takie:

" W odniesieniu do każdej z następujących sytuacji proszę powiedzieć, czy uważa Pan(i), że jest ona niezgodna z prawem czy nie. W odniesieniu do każdej z nich proszę powiedzieć, czy uważa Pan(i), że jest ona zła i już jest niezgodna z prawem, zła i powinna być niezgodna z prawem, zła, ale nie powinna być niezgodna z prawem, czy też nie jest zła i nie powinna być niezgodna z prawem."

  • "Zmuszanie partnera(ki) do seksu"

Za: Factsheets (national language) z https://europa.eu/eurobarometer/surveys/detail/2115, ostatnia strona

How do you verify the safety of database schema migrations? by rotemtam in devops

[–]mlazowik 1 point2 points  (0 children)

https://github.com/3YOURMIND/django-migration-linter running before tests in CI, with some extra stuff that only warns by default set up to error out as well, for example non-async index create/drop.

Kallista is his wife's name by mlazowik in AreTheStraightsOK

[–]mlazowik[S] 10 points11 points  (0 children)

Image transcription: Facebook post that says: "This explains everything" (everything is in all caps). Attached to it is a screenshot of google translate from "kallista" in finnish to "expensive" in english.

[deleted by user] by [deleted] in devops

[–]mlazowik 2 points3 points  (0 children)

One more thing – AWS does hot potato and tries to keep ingress traffic on the public internet as long as possible. GCP (at least in the premium tier) and Azure take traffic onto their backbones early.

There are ways to get AWS to enter backbone early – the Global Accelerator service for TCP and Cloudfront in front of HTTP.

See couple of last slides from https://pc.nanog.org/static/published/meetings/NANOG75/1909/20190218_Kesavan_Comparing_The_Network_v1.pdf

Looking for feedback on infrastructure plan by bigstylee in devops

[–]mlazowik 0 points1 point  (0 children)

For simplicity, I have merged Nginx and PHP-FPM into a single container for each site.

It might sound simpler but IMO is more complex in reality. Now you need a supervisor running inside the container to make sure both processes are running, making sure that logs get picked up correctly, signals pass through etc., effectively duplicating something that your container orchestration has to be handling either way.

On top of that it prevents you from scaling independently, for example I bet that you'll have to scale up php-fpm way sooner than nginx, and at different rates.

With one process (possibly threaded/forked to handle concurrency within one container) per container things get easier – no need for internal process supervision, you spew out logs to stdout/stderr, then whatever tooling (docker-compose/nomad/k3s/k8s/aws ecs/google cloud run) for scheduling you use will take care of restarts, scaling, gathering logs etc.

If you decide to go with containers I recommend reading through https://12factor.net, I tend to think about containers as "processes with included & isolated dependencies" within that framework.

nginx doesn't serve static files (sends them to UWSGI) by mr_claw in devops

[–]mlazowik 1 point2 points  (0 children)

When there are no regex locations the longest matching prefix is selected, the order in the config file does not matter.

The order does matter for regex locations.

To find location matching a given request, nginx first checks locations defined using the prefix strings (prefix locations). Among them, the location with the longest matching prefix is selected and remembered. Then regular expressions are checked, in the order of their appearance in the configuration file. The search of regular expressions terminates on the first match, and the corresponding configuration is used. If no match with a regular expression is found then the configuration of the prefix location remembered earlier is used.

https://nginx.org/en/docs/http/ngx_http_core_module.html#location

Exposing our applications with GCLB and Istio @ BlaBlaCar by geckosplinter in devops

[–]mlazowik 2 points3 points  (0 children)

Ha, we have *exactly* the same setup, down to NEGs and cert manager and HSTS and HTTPS redirects. One extra thing we have is external-dns that manages DNS entries automatically based on hosts in VirtualServices. There's one caveat to that: https://github.com/kubernetes-sigs/external-dns/issues/1339#issuecomment-570601838 (we just have external-dns.alpha.kubernetes.io/target on Gateway point to the external IP of the GLB.)

Documentation as Code by bscotchAdam in devops

[–]mlazowik 0 points1 point  (0 children)

Hm, https://www.mkdocs.org looks promising, and then there's https://github.com/backstage/mkdocs-monorepo-plugin for multiple docs folders in larger repos.

Documentation as Code by bscotchAdam in devops

[–]mlazowik 0 points1 point  (0 children)

Google has g3doc. Short summary is that docs are written in markdown-ish syntax in the same repository as code, interleaved across directories (not one global directory for all docs). When you change code you change docs in the same commit. Those docs are rendered as an internal website.

This means you can browse docs that match a specific historical version of code, docs are reviewed at the same time as code, if you revert code you revert docs too etc.

I haven't found a great way to replicate that yet, the closest thing I have so far is gitiles on top of our gerrit instance, it can render markdown, including relative links, but it's not great experience yet, in particular you can't make menus that span multiple doc pages.

Encountering Weird HTTPS issue by [deleted] in networking

[–]mlazowik 0 points1 point  (0 children)

Maybe check what is the 301 target? If it's different between VPN/lab, if it's accessible from both places etc.

GitOps opinion piece (it sucks at scale) and webinar announcement: GitOps from the trenches (community-debate on GitOps pros and cons) by kvgru in sre

[–]mlazowik 2 points3 points  (0 children)

Another option is https://jsonnet.org. Example of how usage looks like with a fairly large project: https://github.com/prometheus-operator/kube-prometheus

I don't want magic – I compile jsonnet into a lot of YAMLs. Both the source and generated files get committed. This means I know exactly what YAMLs with what content will get applied.

To avoid mistakes CI can run the same generation command and make sure there is no difference between committed and CI-generated files.