2,440 Matching Annotations
  1. Feb 2024
    1. docker init will scan your project and ask you to confirm and choose the template that best suits your application. Once you select the template, docker init asks you for some project-specific information, automatically generating the necessary Docker resources for your project.

      docker init

    1. The result? Our runtime image just got 6x smaller! Six times! From > 1.1 GB to 170 MB.

      See (above this annotation) the most optimized & CI friendly Python Docker build with Poetry (until this issue gets resolved)

    2. This final trick is not known to many as it’s rather newer compared to the other features I presented. It leverages Buildkit cache mounts, which basically instruct Buildkit to mount and manage a folder for caching reasons. The interesting thing is that such cache will persist across builds!By plugging this feature with Poetry cache (now you understand why I did want to keep caching?) we basically get a dependency cache that is re-used every time we build our project. The result we obtain is a fast dependency build phase when building the same image multiple times on the same environment.

      Combining Buildkit cache and Poetry cache

    1. At a minimum, each ADR should define the context of the decision, the decision itself, and the consequences of the decision for the project and its deliverables

      ADR sections from the example: * Title * Status * Date * Context * Decision * Consequences * Compliance * Notes

    1. We’ve (painstakingly) manually reviewed 310 live MLOps positions, advertised across various platforms in Q4 this year

      They went through 310 role descriptions and, even though role descriptions may vary significantly, they found 3 core skills that a large percentage of MLOps roles required:

      📦 Docker and Kubernetes 🐍 Python 🌥 Cloud

  2. Jan 2024
    1. W cenie 165 euro + podatek (prawie tysiąc złotych) otrzymujemy – teraz nie boję się tego napisać – zabawkę. Fakt, najeżoną techniką, ale zabawkę. W dodatku do jakiegokolwiek działania wymaga ona sporej wiedzy i umiejętności programowania. Niestety w głównej mierze „działająca z pudełka” funkcja tego urządzenia sprowadza się do uniwersalnego pilota telewizyjnego.
    1. LocalStack is a cloud service emulator that runs AWS services solely on your laptop without connecting to a remote cloud provider .

      https://www.localstack.cloud/

    1. The most common reasons I hear for hating on JIRA are:  - It's too complicated  - I spend more time tracking tickets than doing workTo that I say...You hate your micro-Manager
    1. setuptools is the most popular (at 50k packages), Poetry is second at 41k, Hatchling is third at 8.1k. Other tools to cross 500 users include Flit (4.4k), PDM (1.3k), Maturin (1.3k, build backend for Rust-based packages).

      Popularity of Python package managers in 2024

    1. Rick was a very talented developer. Rick could solve complex business logic problems and create sophisticated architectures to support his lofty designs. Rick could not solve the problem of how to work effectively on a team.

      :)

    2. I dove into the source code. Rick was right: no-one could possibly understand what Rick had created. Except for Rick. It was a reflection of the workings of his own mind. Some of it was very clever, a lot of it was copy-pasta, it was all very idiosyncratic, and it was not at all documented.

      I used to work in such a project :)

  3. Dec 2023
    1. “MLX” is more than just a technical solution; it is an innovative and user-friendly framework inspired by popular frameworks like PyTorch, Jax, and ArrayFire. It facilitates the training and deployment of AI models on Apple devices without sacrificing performance or compatibility.

      MLX (high overview)

  4. Nov 2023
    1. RUN poetry install --without dev && rm -rf $POETRY_CACHE_DIR

      The ideal way of poetry install within a Dockerfile to omit a bunch of cache that would eventually take a lot of space (which we could discover with tools like dive)

    1. Rosetta is now Generally Available for all users on macOS 13 or later. It provides faster emulation of Intel-based images on Apple Silicon. To use Rosetta, see Settings. Rosetta is enabled by default on macOS 14.1 and later.

      Tested it on my side, and poetry install of one Python project took 44 seconds instead of 2 minutes 53 seconds, so it's nearly a 4x speed increase!

  5. Oct 2023
    1. PHP would serve WordPress when it's run as a standalone Wasm application.

      php.wasm can essentially run in: 1. Wasm application (runtime) 2. Docker+Wasm container 3. Any app that embeds a Wasm runtime (e.g. Apache HTTPD) 4. Web browser

    2. WebAssembly brings true portability to the picture. You can build a binary once and run it everywhere.
    3. However, on top of the big image size, traditional containers are also bound to the architecture of the platform on which they run.
    4. Wasm container images are much smaller than the traditional ones. Even the alpine version of the php container is bigger than the Wasm one.

      php (166MB), php-alpine (30.1MB), php-wasm (5.35 MB)

    5. With WASI SDK we can build a Wasm module out of PHP's codebase, written in C. After that, it takes a very simple Dockerfile based on scratch for us to make an OCI image that can be run with Docker+Wasm.

      Building a WASM container that can be run with Docker+Wasm

    6. Docker Desktop now includes support for WebAssembly. It is implemented with a containerd shim that can run Wasm applications using a Wasm runtime called WasmEdge. This means that instead of the typical Windows or Linux containers which would run a separate process from a binary in the container image, you can now run a Wasm application in the WasmEdge runtime, mimicking a container. As a result, the container image does not need to contain OS or runtime context for the running application - a single Wasm binary suffices.

      Docker Desktop can run Wasm applications (binaries) instead of OS (Linux/Windows)

    7. We now have WebAssembly. Its technical features and portability make it possible to distribute the application, without requiring shipping OS-level dependencies and can run with strict security constraints.

      Wasm, as a next step in the evolution of server-side software infrastructure

    8. If WASM+WASI existed in 2008, we wouldn't have needed to create Docker. That's how important it is. WebAssembly on the server is the future of computing.

      Quote from one of the co-founders of Docker

    9. There are Wasm runtimes that can run outside of the browser, including traditional operating systems such as Linux, Windows and macOS. Because they cannot rely on a JavaScript engine being available they communicate with the outside world using different interfaces, such as WASI, the WebAssembly System Interface. These runtimes allow Wasm applications to interact with their host system in a similar (but not quite the same) way as POSIX. Projects like WASI SDK and wasi-libc help people compile existing POSIX-compliant applications to WebAssembly.

      Explanation on how Wasm runs on servers

    10. Browser engines integrate a Wasm virtual machine, usually called a Wasm runtime, which can run the Wasm binary instructions. There are compiler toolchains (like Emscripten) that can compile source code to the Wasm target. This allows for legacy applications to be ported to a browser and directly communicate with the JS code that runs in client-side Web applications.

      Explanation on how Wasm runs in browsers

    1. the new Docker+Wasm integration allows you to run a Wasm application alongside your Linux containers at much faster speed.

      ```bash time docker run hello-world ... 0.07s user 0.05s system 1% cpu 8.912 total time docker run --runtime=io.containerd.wasmedge.v1 --platform=wasi/wasm32 ajeetraina/hello-wasm-docker

      0.05s user 0.03s system 19% cpu 0.393 total ```

    2. Docker Desktop and CLI can now manage both Linux containers and Wasm containers side by side.
    1. The results showed that the group asked to reduce their social media use had an average 15% improvement in immune function, including fewer colds, flu, warts, and verrucae, a 50% improvement in sleep quality, and 30% fewer depressive symptoms.
    1. Adolescents who spend more than 3 hours per day on social media may be at heightened risk for mental health problems, particularly internalizing problems.
    1. We wrześniu 2023 roku w większości badanych zawodów zanotowano spadki liczby ofert pracy rok do roku Największy widoczny jest w branży IT – pracodawcy opublikowali o 52 proc. mniej ofert rok do roku
    1. How to assess durability

      Set of great questions to assess durability of the to-be purchased item

  6. Sep 2023
    1. Mandel’s system was simple — but incredibly complex from a logistical standpoint

      How to win in Lotto every time:

    1. merge queue prevents semantic merge conflicts by automating the rebase process during merge, and ensuring that the trunk branch stays “green.”

      merge queue - new GitHub feature

    1. When I create I learn. When I consume I just relax
    2. We all know the old saying practice makes perfect. The more we use a certain region of our brain, the more our brain "prioritizes" and "hones" it. That is what leads to myelin: activity induces myelination, which leads to increased strength of connectivity and efficiency along those very neurons. It’s a self-reinforcing process.
    3. The fact of the matter is that digital products make it uniquely easy to trick yourself into thinking that you’re learning when you are actually being entertained.
    4. learning must be effortful in order for it to happen

  7. Aug 2023
    1. engineering blogs focus on problems where the solution is a necessary but not sufficient part of what they do. And, ideally, they focus on problems that are complementary to scale that only the publisher of that post has.

      Core reason why companies have their engineering blogs

  8. Jul 2023
    1. cat requirements.txt | grep -E '^[^# ]' | cut -d= -f1 | xargs -n 1 poetry add

      Use poetry init to create a sample pyproject.toml, and then trigger this line to export requirements.txt into a pyproject.toml

    1. What happened here is that the file 'somefile.txt' is encoded in UTF-16, but your terminal is (probably) by default set to use UTF-8.  Printing the characters from the UTF-16 encoded text to the UTF-8 encoded terminal doesn't show an apparent problem since the UTF-16 null characters don't get represented on the terminal, but every other odd byte is just a regular ASCII character that looks identical to its UTF-8 encoding.

      The reason why grep Hello sometext.txt may result nothing when the file contains Hello World!.

      In such a case, use xxd sometext.txt to check the file in hex, and then either: - use grep: grep -aP "H\x00e\x00l\x00l\x00o\x00" * sometext.txt - or convert the file to into UTF-8: iconv -f UTF-16 -t UTF-8 sometext.txt > sometext-utf-8.txt

    1. Writing to the database may fail (e.g. it will not respond). When that happens, the process handling outbox pattern will try to resend the event after some time and try to do it until the message is correctly marked as sent in the database.

      Outbox pattern should be especially implemented when using operations such as PostgreSQL LISTEN/NOTIFY

    1. staff are more open to returning to the office if it is out of choice, rather than forced
    2. Unispace finds that nearly half (42%) of companies that mandated office returns witnessed a higher level of employee attrition than they had anticipated. And almost a third (29%) of companies enforcing office returns are struggling with recruitment. Imagine that — nearly half!
    1. python -m calendar

      So surprised that you can output a calendar view using Python

    2. python -m site, which outputs useful information about your installation

      python -m site <--- see useful information about your Python installation

    1. sudo softwareupdate -ia installs all available updates.

      Quite handy macOS command

    1. The results from both Midjourney and Stable Diffusion seem to be the most convincing and realistic if I was to judge from a human point of view and if I didn't know they were AI generated, I would believe their results.

      Midjourney & Stable Diffusion > Dall-E and Adobe Firefly

    1. For a new project, I’d just immediately start with Ruff; for existing projects, I would strongly recommend trying it as soon as you start getting annoyed about how long linting is taking in CI (or even worse, on your computer).

      Recommendation for when to use Ruff over PyLint or Flake8

  9. Jun 2023
    1. A documentation-first culture does not mean everyone is busy writing documents all day. It means that everyone appreciates the value of documenting and sharing their experiences.

      Documentation-first culture

    2. I’m a big fan of documentation. I think it’s my favorite boring thing to do after coding. It brings the business so much long-term value that every hour invested into documentation by anyone saves literally x100 productivity hours across the company.

      High five :)!

    1. All of these values, including the precious contents of the private key file, can be seen via ps when these commands are running. ps finds them via /proc/<pid>/cmdline, which is globally readable for any process ID.

      ps can read some secrets passed via CLI, especially when using --arg with jq.

      Instead, use the --rawfile parameter as noted below this annotation.

    1. Digital nomads must earn at least €2,800 per month to qualify for its new visa, around four times Portugal’s minimum wage. According to Nomad List nearly 16,000 people were remote working in Lisbon last December, where they now find themselves blamed for rocketing rents and house prices.

      Digital nomads in Portugal

    2. According to a March survey, 36 per cent of digital nomads have an annual income of between $100,000 and $250,000. Another eight per cent earn between $250,000 and one million. Attracted by these bank balances, dozens of countries have now introduced so-called “digital nomad visas” (permitting extended stays to work remotely).

      Income of digital nomads

    1. This is the script, which I’ve named docker and put before the real Docker CLI in my PATH

      Script to automatically start Docker if it's not running when we trigger a docker command

    1. There are better parameters to evaluate quality, not quantity, of the time spent staring at your screens

      Questions to ask for validating mobile apps quality

    1. The key to hacking yourself is to increase your awareness of your emotional state. When you become aware that you are angry, the anger is losing the grip it has over you. When you are angry, you are sometimes doing things you would not have done if you were not angry. (Sometimes anger is healthy, it may also be a signal to us that our boundaries have been violated.)

      Hacks around anger

    1. Examples of frontends include: pip, build, poetry, hatch, pdm, flit Examples of backends include: setuptools (>=61), poetry-core, hatchling, pdm-backend, flit-core

      Frontend and backend examples of Python's build backends

    2. pyproject.toml-based builds are the future, and they promote better practices for reliable package builds and installs. You should prefer to use them!

      setup.py is considered a "legacy" functionality these days

    3. Did you say setuptools? Yes! You may be familiar with setuptools as the thing that used your setup.py files to build packages. Setuptools now also fully supports pyproject.toml-based builds since version 61.0.0. You can do everything in pyproject.toml and no longer need setup.py or setup.cfg.

      setuptools can now utilize pyproject.toml

    1. // save to tar filedocker save nodeversion > nodeversion.tar// load from tar filedocker load < nodeversion.tar

      Saving and loading Docker images locally

    1. Developers often speak of "getting into the flow" or "being in the zone." Such statements colloquially describe the concept of flow state, a mental state in which a person performing an activity is fully immersed in a feeling of energized focus, full involvement, and enjoyment.

      One of my favourite explanations of the flow state

  10. May 2023
    1. With this dataclass, I have an explicit description of what the function returns.

      Dataclasses give you a lot more clarity of what the function returns, in comparison to returning tuples or dictionaries

    1. Today is 9th Feb. The oldest segment – segment 100 – still can’t be deleted by the 7-day topic retention policy, because the most recent message in that segment is only 5 days old. The result is that they can see messages dating back to 28th January on this topic, even though the 28th Jan is now 12 days ago. In a couple of days, all the messages in segment 100 will be old enough to exceed the retention threshold so that segment file will be deleted.

      retention.ms set to 7 days doesn't guarantee that you will only see topic messages from the last 7 days. Think of it as a threshold that the Kafka broker can use to decide when messages are eligible for being automatically deleted.

    1. Host machine: docker run -it -p 8888:8888 image:version Inside the Container : jupyter notebook --ip 0.0.0.0 --no-browser --allow-root Host machine access this url : localhost:8888/tree‌

      3 ways of running jupyter notebook in a container

  11. Apr 2023
    1. Armed with all this knowledge, we realise that we can construct an almost unlimited number of different path strings that all refer to the same directory

      See below the number of ways to define the same path on Windows

    2. UNC stands for Universal Naming Convention and describes paths that start with \\, commonly used to refer to network drives. The first segment after the \\ is the host, which can be either a named server or an IP address

      UNC paths on Windows

    3. On any Unix-derived system, a path is an admirably simple thing: if it starts with a /, it’s a path. Not so on Windows

      Paths on Windows are much more complex

    1. Em dash Works better than commas to set apart a unique idea from the main clause of a sentence
    2. The hyphen does not indicate a range of numbers, like a date range, which is the job of an en dash
    1. As I see it, there are two hard things about getting into flow: loading the state of the system / problem / abstractions into your head (i.e. filling your L1 and L2 cache with everything you need to know to work on the problem) and building momentum and confidence for yourself.

      Hard things for entering the flow

    1. To return to information overload: this means treating your "to read" pile like a river (a stream that flows past you, and from which you pluck a few choice items, here and there) instead of a bucket (which demands that you empty it). After all, you presumably don't feel overwhelmed by all the unread books in the British Library – and not because there aren't an overwhelming number of them, but because it never occurred to you that it might be your job to get through them all.

      Lesson on how to treat one's to-read list

    1. If you suddenly transform the social lives of girls, putting them onto platforms that prioritize social comparison and performance, platforms where we know that heavy users are three times more likely to be depressed than light users, might that have some impact on the mental health of girls around the world? We think so
    1. Kilka przykładów z wykorzystujących Conventional Commits:

      Examples of Conventional Commits (see the block below)

    2. Conventional Commits – type

      Conventional Commits types: - feat - fix - docs - chore - refactor - tests - perf - styles - ci - build - revert

    3. Commity o treści refactor, added XXX czy cr fixes, to smutna i nudna rzeczywistość.
    1. If you install a package with pip’s --user option, all its files will be installed in the .local directory of the current user’s home directory.

      One of the recommendations for Python multi-stage Docker builds. Thanks to pip install --user, the packages won't be spread across 3 different paths.

  12. Mar 2023
    1. rg . | fzf: Fuzzy search every line in every file

      Shortcut for searching files with ripgrep and fzf

    1. Spend your career hanging out with people you like working with, doing work you enjoy, trying new experiences, and having fewer regrets.That’s how you retire one day & make it to your deathbed a happy human.
    2. You don’t know what day it is. Monday feels like Saturday night fever.

      The #1 sign of a successful career

    1. Honestly, all the activation scripts do are:

      See the 4 steps below to understand what activating an environment in Python really does

    1. Using pex in combination with S3 for storing the pex files, we built a system where the fast path avoids the overhead of building and launching Docker images.Our system works like this: when you commit code to GitHub, the GitHub action either does a full build or a fast build depending on if your dependencies have changed since the previous deploy. We keep track of the set of dependencies specified in setup.py and requirements.txt.For a full build, we build your project dependencies into a deps.pex file and your code into a source.pex file. Both are uploaded to Dagster cloud. For a fast build we only build and upload the source.pex file.In Dagster Cloud, we may reuse an existing container or provision a new container as the code server. We download the deps.pex and source.pex files onto this code server and use them to run your code in an isolated environment.

      Fast vs full deployments

    1. "We could use this type of DB, or this other, or that other, and these are some pros and cons… And based on all these tradeoffs, I’ll use THAT type of DB."

      Example of how to recommend a single system

    2. The difference between coding and system design is the difference between retrieving and creating.Instead of finding (or “retrieving”) a solution, you are creating a solution. In this way, coding is akin to a science, while system design is more like an art.
    1. there’s the famous 2019 paper by Allcott et al. which found that having people deactivate Facebook for a while made them happier, while also making them socialize more and worry less about politics
    2. [There’s also] a big new study from Cambridge University, in which researchers looked at 84,000 people…and found that social media was strongly associated with worse mental health during certain sensitive life periods, including for girls ages 11 to 13…One explanation is that teenagers (and teenage girls in particular) are uniquely sensitive to the judgment of friends, teachers, and the digital crowd.
    3. First, they’re a distraction — the rise of smartphones was also the rise of “phubbing”, i.e. when people go on their phones instead of paying attention to the people around them.

      phubbing

    4. Text is a highly attenuated medium — it’s slow and cumbersome, and an ocean of nuance and tone and emotion is lost. Even video chat is a highly incomplete substitute for physical interaction. A phone doesn’t allow you to experience the nearby physical presence of another living, breathing body — something that we spent untold eons evolving to be accustomed to. And of course that’s even before mentioning activities like sex that are far better when physical contact is involved.

      It turns out that text/video chatting is not really a replacement for social interactions, yet, it leads to social isolation

    5. Yglesias argues that the progressive politics of the 2010s encouraged progressives to think of everything in catastrophic terms, making them less happy.
    1. You can freely replace SageMaker services with other components as your project grows and potentially outgrows SageMaker.

    1. This could be because the size can be misleading, there is on disk size, push/pull payload size, and sum of ungzipped tars. The size of the ungzipped tars is often used to represent the size of the image in Docker but the actual size on disk is dependent on the graph driver. From the registry perspective, the sum of the gzipped layers is most important because it represent what the registry is storing and what needs to be transferred.

      Docker image size on a local drive will be different

    1. Ultimately, after researching how we can overcome some inconveniences in Kubeflow, we decided to continue using it. Even though the UI could use some improvements in terms of clarity, we didn’t want to give up the advantages of configured CI/CD and containerization, which allowed us to use different environments. Also, for our projects, it is convenient to develop each ML pipeline in separate Git repositories.

      Kubeflow sounds like the most feature rich solution, whose main con is its UI and the setup process

    2. So, let’s sum up the pros and cons of each tool:

      Summary of pros/cons of Airflow, Kubeflow and Prefect

    3. The airflow environment must have all the libraries that are being imported in all DAGs. Without using containerization all Airflow pipelines are launched within the same environment. This leads to limitations in using exotic libraries or conflicting module versions for different projects.

      Main con of Airflow

    4. Prefect is a comparatively new but promising orchestration tool that appeared in 2018. The tool positions itself as a replacement for Airflow, featuring greater flexibility and simplicity. It is an open-source project; however, there is a paid cloud version to track workflows.
    5. Airflow has been one of the most popular orchestrating tools for several years.

      (see the graph above)

    6. An orchestration tool usually doesn’t do the hard work of translating and processing data itself, but tells other systems and frameworks what to do and monitors the status of the execution.

      Responsibility of the orchestration tool

    7. To this day, the field of machine learning does not have a single generally accepted approach to solving problems in terms of practical use of models.

      Business ¯\_(ツ)_/¯

    1. Well, in short, with iterators, the flow of information is one-way only. When you have an iterator, all you can really do call the __next__ method to get the very next value to be yielded. In contrast, the flow of information with generators is bidirectional: you can send information back into the generator via the send method.
      • Iterator ← one-way communication (can only yield stuff)
      • Generator ← bidirectional communication (can also accept information via the send method)
    1. So why aren't more people using Nim? I don't know! It's the closest thing to a perfect language that I've used by far.

      Nim sounds as the most ideal language when comparing to Python, Rust, Julia, C#, Swift, C

    1. Time to dive a little deeper to see what information the barcodes actually contain. For this I will break down the previously extracted information into smaller pieces.

      Information contained within boarding pass barcodes

    1. "For this campaign, we surveyed 930 Americans to explore their retirement plans. Among them, 16% were retired, 22% were still working, and 62% were retirees who had returned to work."So, 149 of those surveyed were retired. Of those 149, 25 (1 in 6) are considering returning to work. 13 of those want remote positions.
    1. Watching a TED talk gets you high for an hour. Watching an inspiring movie gets you thinking for a day. Reading a book keeps us motivated for about a week.
    1. Instagram was founded in 2010. The iPhone 4 was released then too—the first smartphone with a front-facing camera. In 2012 Facebook bought Instagram, and that’s the year that its user base exploded. By 2015, it was becoming normal for 12-year-old girls to spend hours each day taking selfies

      Main cause of global depression

    1. ServingRuntime - Templates for Pods that can serve one or more particular model formats. There are three "built in" runtimes that cover the out-of-the-box model types, custom runtimes can be defined by creating additional ones.

      ServingRuntime

    1. cluster with 4096 IP addresses can deploy at most 1024 models assuming each InferenceService has 4 pods on average (two transformer replicas and two predictor replicas).

      Kubernetes clusters have a maximum IP address limitation

    2. According to Kubernetes best practice, a node shouldn't run more than 100 pods.
    3. Each model’s resource overhead is 1CPU and 1 GB memory. Deploying many models using the current approach will quickly use up a cluster's computing resource. With Multi-model serving, these models can be loaded in one InferenceService, then each model's average overhead is 0.1 CPU and 0.1GB memory.

      If I am not mistaken, the multi-model approach reduces the size by 90% in this case

    4. Multi-model serving is designed to address three types of limitations KServe will run into

      Benefits of multi-model serving

    5. While you get the benefit of better inference accuracy and data privacy by building models for each use case, it is more challenging to deploy thousands to hundreds of thousands of models on a Kubernetes cluster.

      With more separation, comes the problem of distribution

    1. I could be super-happy with any of Fira Code Retina, Hack, JetBrains Mono, or Inconsolata.

      Recommended fonts for 14" MacBook

    1. depending on how smart the framework is, you might find yourself installing Conda packages over and over again on every run. This is inefficient, even when using a faster installer like Mamba.
    2. there’s the bootstrapping problem: depending on the framework you’re using, you might need to install Conda and the framework driver before you can get anything going. A Docker image would come prepackaged with both, in addition to your code and its dependencies. So even if your framework supports Conda directly, you might want to use Docker anyway.
    3. Mlflow supports both Conda and Docker-based projects.
    4. The only thing that will depend on the host operating system is glibc, pretty much everything else will be packaged by Conda. So a pinned environment.yml or conda-lock.yml file is a reasonable alternative to a Docker image as far as having consistent dependencies.

      Conda can be a sufficient alternative to Docker

    5. To summarize, for the use case of Python development environments, here’s how you might choose alternatives to Docker:

      (see table below)

    6. Conda packages everything but the standard C library, from C libraries to the Python interpreter to command-line tools to compilers.
    1. So the short answer is to pick rebase or merge based on what you want your history to look like.

      Quick summary of rebase vs merge

    1. In summary, motivation is trying to feel like doing stuff. Discipline is doing it even if you don’t feel like it.

      Motivation vs Discipline

    1. response times, error rates, and request rates

      Sample metrics to monitor

    2. You can use authentication mechanisms such as OAuth2, JSON Web Tokens (JWT), or HTTP Basic Authentication to ensure that only authorized users or applications can access your API.
    3. In this example, we’ve defined an API endpoint called /predict_image that accepts a file upload using FastAPI's UploadFile type. When a client sends an image file to this endpoint, the file is read and its contents are passed to a preprocessing function that prepares the image for input into the model. Once the image has been preprocessed, the model can make a prediction on it, and the result can be returned to the client as a JSON response.

      Example above shows how to upload an image to an API endpoint with FastAPI.

      Example below is a bit more complex.

    4. For example, if you are using TensorFlow, you might save your model as a .h5 file using the Keras API. If you are using PyTorch, you might save your model as a .pt file using the torch.save() function. By saving your model as a file, you can easily load it into a deployment environment (such as FastAPI) and use it to make predictions on new images
  13. Feb 2023
    1. Regular Shell Commands

      Some of my favourite aliases: * 1. (already configured in my ohmyzsh) * 4. * 6. (already configured in my ohmyzsh) * 13. * 17.

    2. The set -x command is used to turn on debugging in a shell script and can also be used to test bash aliases. When set -x is used, the command and its arguments are printed to the standard error stream before the command is executed. This can be useful for testing aliases because it lets you see exactly what command is running and with what arguments.

      set -x

    3. 6. A function that checks if a website is up or down
    4. 5. A function that allows using sudo command without having to type a password every time
    5. Kubernetes Aliases

      Some of my favourite k8s aliases: * 2. * 3.

    6. Mac User Aliases

      Some of my favourite Mac aliases: * 1. * 11.

    7. A much more elegant approach, however, is to add them to an ~/.aliases like file and then source this file in your respective profile file assource ~/.aliases

      More elegant way to list aliases

    1. The way to get new ideas is to notice anomalies: what seems strange, or missing, or broken? You can see anomalies in everyday life (much of standup comedy is based on this), but the best place to look for them is at the frontiers of knowledge.Knowledge grows fractally. From a distance its edges look smooth, but when you learn enough to get close to one, you'll notice it's full of gaps. These gaps will seem obvious; it will seem inexplicable that no one has tried x or wondered about y. In the best case, exploring such gaps yields whole new fractal buds.

      Way to get new ideas

    1. A huge percentage of the data that gets processed is less than 24 hours old. By the time data gets to be a week old, it is probably 20 times less likely to be queried than from the most recent day. After a month, data mostly just sits there.
    2. Customer data sizes followed a power-law distribution. The largest customer had double the storage of the next largest customer, the next largest customer had half of that, etc.
    3. the vast majority of customers had less than a terabyte of data in total data storage. There were, of course, customers with huge amounts of data, but most organizations, even some fairly large enterprises, had moderate data sizes.
    4. Most applications do not need to process massive amounts of data. This has led to a resurgence in data management systems with traditional architectures; SQLite, Postgres, MySQL are all growing strongly, while “NoSQL” and even “NewSQL” systems are stagnating.

      SQL still shines over NoSQL

    5. The most surprising thing that I learned was that most of the people using “Big Query” don’t really have Big Data. Even the ones who do tend to use workloads that only use a small fraction of their dataset sizes.
  14. Jan 2023
    1. I think for some people that’s actually fine. Watching money compound gives them more pleasure than they would get spending it.
    2. I think what many people really want from money is the ability to stop thinking about money. To have enough money that they can stop thinking about it and focus on other stuff.
    3. To someone who grew up in an old-money affluent family, a Lamborghini might be a symbol of gaudy egotism; to those who grew up with nothing, the car might serve as the ultimate symbol that you’ve made it.
    4. How you spend money can reveal an existential struggle of what you find valuable in life, who you want to spend time with, why you chose your career, and the kind of attention you want from other people.
    1. I heard of a peculiar technique used by a company hiring a senior executive. In the final round of interviews, the candidates are taken to lunch, and during the meal something goes wrong—of course, this is all staged as a kind of test. Maybe someone walks up to the table and creates a scene, or perhaps the food delivered to the table is completely wrong. The purpose is to see how the candidate handles the situation. You fail the test if you over-react (for example, causing a scene yourself) or under-react (e.g., just letting things get out of control with no response).

      Test of handling unexpected problems

    2. If they cheat at small things, they will cheat at big things.
    3. Great listeners possess extraordinary skills of awareness and comprehension. They can assess situations with tremendous accuracy, and act in ways that maximize group effectiveness.
    4. I’ve met few great listeners in my entire life. But they are some of the most effective individuals I’ve ever encountered.

      Try to listen more rather than talk

    5. The flaw people hate most in others is usually their own greatest weakness.
    6. I’d prefer to take a glimpse at how they spend time and money. Those reveal what a person is really all about.
    7. His belief is that people’s character and ability to handle challenges are almost entirely formed during the first two decades of their life.
    8. People reveal their true natures when they deal with others who have no power and can never return a favor.
    9. A person’s choice of a spouse—or if they aren’t married, their closest lifelong partner—is much more revealing than anything they say or do in public.
    1. We are so conditioned to think that our lives revolve around great moments. But great moments often catch us unawares. When that woman hugged me and said that I had brought her a moment of joy, it was possible to believe that I had been placed on earth for the sole purpose of providing her with that last ride.

      😭

    1. These six are split across three operational meetings (each manager with their direct team, technical spec review, incident review), two developmental meetings (staff engineers, engineering managers) and finally a monthly engineering Q&A to learn what the organization is really thinking about.

      Six core organizational meetings

    2. My weekly team meetings always include my direct reports, and usually include our key partner in the Recruiting, People, and Finance teams. (I’ve also experimented with including engineers

      Ideas for who to include in a weekly team meeting

    1. Python — Json documents double as valid Python literals with minimal adaptation, and Python supports trailing commas and comments. It has variables and functions, powerful string interpolation, and json.dump built in. A self-contained Python file that prints json to stdout goes a long way!

      If you would like to template yaml, then rather do it in Nix or Python

    2. always quote all strings. (Indeed, you can tell that somebody is an experienced yaml engineer when they defensively quote all the strings.) We can choose to always use true and false rather than yes and no, and generally stay away from the arcane features.

      Advices for yaml users

    3. I think the main reason that yaml is so prevalent despite its pitfalls, is that for a long time it was the only viable configuration format.

      Yaml has strange issues, but is popular as it was one of the 1st options

    1. Especially when compared to a plastic tongue scraper, a stainless steel one is better at balancing Ayurvedic imbalances. Unlike those made with gold, silver, brass, or copper, stainless steel tongue scrapers resist corrosion and are suitable for all mind-body types, or doshas, according to Dr. Deepak Chopra.  

      Stainless steel tongue scrapers seems to be the best

    1. tl;dw (best DevOps tools in 2023)

      1. Low-budget cloud computing : Civo (close to Scaleway)
      2. Infrastructure and Service Management: Crossplane
      3. App Management - manifests : cdk8s (yes, not Kustomize or Helm)
      4. App Management - k8s operators: tie between Knative and Crossplane
      5. App Management - managed services: Google Cloud Run
      6. Dev Envs: Okteto (yeap, not GitPod)
      7. CI/CD: GitHub Actions (as it's simplest to use)
      8. GitOps (CD): Argo CD (wins with Flux due to its adoption rate)
      9. Policy Management: Kyverno (simpler to use than industry's most powerful tool: OPA / Gatekeeper)
      10. Observability: OpenTelemetry (instrumentation of apps), VictoriaMetrics (metrics - yes not Prometheus), Grafana / Loki (logs), Grafana Tempo (tracing), Grafana (dashboards), Robusta (alerting), Komodor (troubleshooting)
    1. Manolis Kellis: Origin of Life, Humans, Ideas, Suffering, and Happiness | Lex Fridman Podcast #123

      My summary:

      Biology: * Life = energy + self preservation * Neanderthals could be the reason why wolves/dogs are living closely with humans. Maybe in the past generations, dogs had no choice but to live with humans as they were scared of our power? * People evolved from the deep ocean (we're made in 70% of water). We're like transporting the sea with us now * Dolphins as mammals came back into the water * RNA invented proteins. Later RNA and proteins created DNA * Life is like any kind of self-reinforcement such as self-reinforcement of RNA molecules which lead to the evolution process * Europa (moon of Jupiter) already evolves some non-DNA life there. Life could exist in its under-ice ocean, perhaps in an environment similar to Earth's deep-ocean hydrothermal vents. It will be fascinating to get to know it

      Life: * Don't focus on goals but have a path to prevent the "rat race" sort of feeling * Almost every Hollywood movie has a happy ending. It prepares us, humans, really poorly for the bad times in life We need to read/watch more stories with a bad ending * Life is about accomplishing things, not about being happy all the time * As a parent, don't ask your kid if he's happy but what he's struggling to achieve * Most likely, we live on the best planet during the best time as the most beautiful mammals * If you understand yourself, you won't seek self-assurance in what other people think of you * It's hard to get to know your true self if you live all the time in the same location/environment and have the same friends who would like to have a stable image of you

    1. Face To Face with MIKE SHINODA

      (16:14)

      Mike Shinoda discussing the idea from Stephen King's book "On Writing":

      "You should write every day, even if it's torturous, even if you hate it, you sit down and say: "this is not what I wanna be doing, I'm not in the mood, I've got too many things going on". But you should do it anyway, cause it keeps your creative muscles strong, and eventually, even on the bad day, you can come up with something that's remarkable and surprising that you can use later."

    1. Naive Recursive Approach O(2^n): ```python def fib(n): if n == 1 or n == 2: // base case return 1

      else:
          return fib(n-1) + fib(n-2)
      

      ```

      Dynamic Programming Solution O(n): python def fib(n): // assuming n > 2 seq = zeros(n) seq[0] = seq[1] = 1 for i from 2 to (n-1): seq[i] = seq[i-1] + seq[i-2] return seq[n-1]

    1. Thanks to its shortest orbit time, Mercury is the "mostest" closest planet to all the planets that orbits the sun

    1. Points from the comments in support of using Mac

      Reasons why macOS is better than Linux (see below)

    2. Points from the comments in support of using Linux

      Reasons why Linux is better than macOS (see below)

    1. There are also health and attitudinal consequences for managers who are laying people off as well as for the employees who remain. Not surprisingly, layoffs increase people’s stress.
    2. Layoffs increase the odds of suicide by two and a half times.
    3. The tech industry layoffs are basically an instance of social contagion, in which companies imitate what others are doing. If you look for reasons for why companies do layoffs, the reason is that everybody else is doing it.

      The main reason for tech layoffs

    1. Actually I’m not sure most people do this, I just hope I’m not the only one.

      You are not. I will hoard this blog post on my hypothes.is :)

    1. Solution #3: Switch to Conda-Forge

      Yet another possible solution for M1 users, but you need to use conda and expect less packages than in PyPI

    2. In general, the environment variable is too heavy-handed and should be avoided, since it will impact all images you build or run. Given the speed impact, you don’t for example want to run your postgres image with emulation, to no benefit.

      Which options to avoid

    3. The problem with this approach is that the emulation slows down your runtime. How much slower it is? Once benchmark I ran was only 6% of the speed of the host machine!

      Speed is the core problem with emulation

    4. The other option is to run x86_64 Docker images on your ARM64 Mac machine, using emulation. Docker is packaged with software that will translate or emulate x86_64 machine code into ARM64 machine code on the fly; it’s slow, but the code will run.

      Another possible solution for M1 users (see snippets below)

    5. Third, you can pre-compile wheels, store them somewhere, and install those directly instead of downloading the packages from PyPI.

      Third possible solution for M1 users

    6. If you have a compiler installed in your Docker image and any required native libraries and development headers, you can compile a native package from the source code. Basically, you add a RUN apt-get upgrade && apt-get install -y gcc and iterate until the package compiles successfully.

      Second possible solution for M1 users

    7. First, it’s possible the relevant wheels are available in newer versions of the libraries.

      First possible solution for M1 users

    8. When you pip install murmurhash==1.0.6 on a M1/M2 Mac inside Docker, again it looks at the available files

      Other possible steps that pip will do when trying to install a Python package without a relevant CPU instruction set

    9. When you pip install filprofiler==2022.05.0 on a M1/M2 Mac inside Docker, pip will look at the available files for that version, and then

      3 steps that pip will do when trying to install a Python package without a relevant CPU instruction set

    10. In either case, pure Python will Just Work, because it’s interpreted at runtime: there’s no CPU-specific machine code, it’s just text that the Python interpreter knows how to run. The problems start when we start using compiled Python extensions. These are machine code, and therefore you need a version that is specific to your particular CPU instruction set.

      M1 Python issues

    11. on an Intel/AMD PC or Mac, docker pull will pull the linux/amd64 image. On a newer Mac using M1/M2/Silicon chips, docker pull will the pull the linux/arm64/v8 image.

      Reason of all the M1 Docker issues

    12. In order to meet its build-once-run-everywhere promise, Docker typically runs on Linux. Since macOS is not Linux, on macOS this is done by running a virtual machine in the background, and then the Docker images run inside the virtual machine. So whether you’re on a Mac, Linux, or Windows, typically you’ll be running linux Docker images.
    1. If I wanted to set someone up for a good life and they could focus on only one thing, I would prioritize getting social skills, especially conversational skills.

      Value conversation skills a ton!

    2. Of all the people I know, I can only think of a couple people who I believe really don’t want to be 50% of the conversation. Topic introduction should also be split pretty evenly.

      Conversations should be about 50/50, but only a couple of people might not prefer it and talk less

    3. “Nice” “Cool” “Ok” If you get a lot of single word answers, you are not keeping the other person interested. They are trying to prevent you from saying more, either because you habitually talk too much or because the topic isn’t interesting to them.

      Avoid single word answers

    4. I have a friend who has somewhat extreme political views, but he will always say things like, “I believe X, but I bet you believe Y and you always have interesting takes, so I’d love to hear your thoughts”. It’s a great way to disagree in a positive and constructive way, and I always enjoy conversations with him.
    5. It seems that these days everyone is so focused on being right and believes that changing their mind shows weakness, but in reality it is the opposite. Only confident people feel are able to change positions without affecting their self image.
    6. Factual questions are good, but questions that deepen the conversation are even better. “What were you thinking when she said that?” “Was that as hard as it sounds?” “How did you learn how to do that?” “What made you decide to go that route?”

      Try to ask questions that deepen the conversation

    7. An ideal conversation is a mix of listening, asking questions, and sharing in a way that allows the other person to politely guide the conversation. You must ask questions so that the other person knows that you are interested in them and what they are saying. The worst conversations are those where both parties are waiting their turn to talk, saying as much as they can before getting interrupted, and then being forced to listen to the other.

      Worst and best conversation types

    8. I could tell a story about building my pinball machine. A crafty technical friend might be very interested in hearing every step, but my mom might not be interested in more than about 10 seconds of detail on it.

      Pay attention how you share your information, and to whom

    9. A conversation is best when both parties are interested, engaged, and want to share. If you interrupt you show that you are uninterested and you blunt the other person’s motivation to share.

      Don't interrupt

    10. I asked why she thought that was happening, and she said, “Covid”. The lack of socialization, especially at such a key time in life, had made this incoming class the first one that lacked basic manners and social skills.

      Covid has heavily impacted our social/communication skills

    11. This sort of behavior puts a huge burden on the listener because it makes them responsible for your emotional state. Their options are to deny you the emotional state you want, or to give it to you by lying. This is exhausting and will cause people to limit the amount of social time they spend with you.

      Pay attention what you're sharing with different people, as not everyone will feel comfortable with receiving the same information

    1. The {vetiver} package provides a set of tools for building, deploying, and managing machine learning models in production. It allows users to easily create, version, and deploy machine learning models to various hosting platforms, such as Posit Connect or a cloud hosting service like Azure.
    2. I hope to show how to demonstrate how easy model deployment can be using Posit’s open source tools for MLOps. This includes {pins}, {vetiver}, and the {tidymodels} bundle of packages along with the {tidyverse}.

      Consider the following packages while doing MLOps in R: - pins - vetiver - tidymodels - tidyverse

    1. W aktualnym stanie prawnym działalność nie podlega obowiązkowi rejestracji w przypadku, gdy miesięczny przychód z takiej działalności nie przekracza kwoty 50% minimalnego wynagrodzenia za pracę. Obecnie pensja minimalna wynosi 3010 zł, w związku z czym w 2022 roku wspomniany miesięczny limit jest równy kwocie 1505 zł
    1. Although the architect could code, as the title suggests, there are other ways for the architect to stay engaged with the delivery, such as pairing and peer reviews.
    2. Rotating the architect role among different team members carries the benefit of increasing the overall team’s working architectural knowledge. Team members gain a better understanding of all the roles involved in delivery, leading to empathy between team roles, improved intra-team interaction, and a better overall product by diversifying the viewpoints applied to each role.

      On rotating roles

    3. Similarly, when I ask other architects how much they’ve coded recently, more often than not I hear: “It’s been a while.”