As the author of GoAWK, an
AWK interpreter written in Go, I was wondering one day how hard it
would be to translate AWK programs into Go code. Couldn’t be that
hard, right? I decided to try it.
Like many others, I spend enough time in the shell that even small
improvements can yield huge productivity gains. This post is an
attempt to catalog several of quality-of-life enhancements I've made
over recent months to my shell setup.
Spack is a package management tool designed to support multiple
versions and configurations of software on a wide variety of
platforms and environments. It was designed for large supercomputing
centers, where many users and application teams share common
installations of software on clusters with exotic architectures,
using libraries that do not have a standard ABI. Spack is
non-destructive: installing a new version does not break existing
installations, so many configurations can coexist on the same
system.
Insecure Direct Object Reference (IDOR) is one of the most common
forms of broken access control which OWASP recently listed as the
number one application security issue in
2021. A quick search for "IDOR" on
Hacker One's Hacktivity
feed
shows that many top tech companies (and even the U.S. Department of
Defense) have fallen victim to IDOR, in some cases paying out well
over $10,000 per bug bounty. In this post, I'll explain what IDOR
is, what causes it, and ways to protect your application against it.
Protocols in Python provide a nice way to use duck typing while
still having some static type guarantees. You can define contracts
for your functions without caring too much about the actual types of
your inputs.
Building minimal Docker images to deploy Rust brings up a lot of
benefits: it’s not only good for security (reduced attack surface)
but also to improve deployment times, reduce costs (less bandwidth
and storage), and reduce the risk of dependency conflicts.
When bitten by a genetically modified spider, a nerdy, shy, and
awkward high school student gains spider-like abilities that he
eventually must use to fight evil as a superhero after tragedy
befalls his family.
In the evening we watched
Spider-Man. To me the movie
was OK and I give it a 6.5 out of 10.
My favorite game is
bridge. It’s an
excellent test of cooperation and strategy. I’m in a discord chat
devoted mostly to the game and folks often share interesting bridge
hands with one another. I decided it would be fun to build a
program that parsed
a simply-formatted bridge hand and produced a plain text bridge
diagram.
When I started using containers back in 2015, my initial
understanding was that they were just lightweight virtual machines
with a subsecond startup time. With such a rough idea in my head, it
was easy to follow tutorials from the Internet on how to put a
Python or a Node.js application into a container. But pretty
quickly, I realized that thinking of containers as of VMs is a risky
oversimplification that doesn't allow me to judge:
What's doable with containers and what's not
What's an idiomatic use of containers and what's not
I was doing some work with Django 3.2.9 and Python 3.10 recently,
and I came across a strange issue. The root cause of this was that
the pyenv shims had disappeared from my PATH and so the system
Python version was being used. Here’s how to fix it.
Process isolation is a key component for containers. One of the key
underlying mechanisms are namespaces. In this second (and last)
part of the series we examine the USER, MNT, UTS, IPC and CGROUP
namespaces, and finally we combine everything to build a fully
isolated environment for a process.
There’s more to color on the web than meets the eye, and it’s about
to get a lot more interesting! Today, we’ll take a look at the best
ways to use colors in a design system, and what we can expect from
our colors in the not-too-distant future.
As we all know, a task group consists of multiple child tasks that
run concurrently. When one of the child tasks encounters an error,
how should the task group handle the error? What happens to those
child tasks that are still running?
Closure is the concept of storing a function and its environment
together. When you create a function, it stores the functions local
environment and its outer environment together. If you are ever
confused about what value will be present, understand what value
existed when the function scope was created!
Process isolation is a key component for containers. One of the key
underlying mechanisms are namespaces. We will explore what they
are, and how they work, to build our own isolated container and
better understand each piece.
Writing robust and predictable unit tests for asynchronous code has
always been particularly challenging, given that each test method is
executed completely serially, line by line (at least when using
XCTest). So when using patterns like completion handlers, delegates,
or even Combine, we’d always have to find our way back to our
synchronous testing context after performing a given asynchronous
operation.
With the introduction of async/await, though, writing asynchronous
tests is starting to become much simpler in many different kinds
of situations. Let’s take a look at why that is, and how async/await
can also be a great testing tool even when verifying asynchronous
code that hasn’t yet been migrated to Swift’s new concurrency
system.
PostCSS allows developers to write simpler CSS and push the
complexity at build time. It act as a pre-processor, an autoprefixer
and a linter for your CSS code.
This is a very long guide about setting up tmux “from scratch,”
which is to say without any of the default keybindings or any
default behavior. It’s mostly an excuse to demonstrate a simple
~/.tmux.conf, and to explain how you can set up tmux to do exactly
what you want it to, and nothing more.
I found that some query was dealing with a relatively small fraction
of rows in the table, but the query execution was based on some
regular index. Postgres indexes come with a lot of various flavors:
besides the type of the index you may choose, there are multicolumn,
functional, partial, and – since Postgres 11 – covering indexes. For
the SELECT queries, I was oxptimizing, using a partial index was a
natural choice. It improved the SELECT indeed, as expected. But it
also made UPDATEs to the same table significantly slower!
This was a big surprise. I know that this will be a surprise to many
of my readers too. Let's buckle up and travel thru a series of short
experiments to explore how this may happen: we'll check various
index options looking at the performance of both SELECT and UPDATE
queries, and in the end, we'll try to draw some useful conclusions,
as well as discuss how we can build an optimization approach that
would follow the "first, do no harm" principle.
It seems that Apple has quietly added a new tool in macOS Monterey
for measuring your device’s Internet connectivity quality. You can
simply call the executable networkQuality, which executes the
following tests:
Upload/download flows, this seems to be the number of test
packets used for the responsiveness tests
Upload/download responsiveness measured in Roundtrips Per
Minute (RPM), which according to Apple, is the number of
sequential round-trips, or transactions, a network can do in one
minute under normal working conditions
The open source Git project just released Git
2.34 with
features and bug fixes from over 109 contributors, 29 of them
new. We last caught up with you on the latest in Git back when 2.33
was
released. To
celebrate this most recent release, here’s GitHub’s look at some of
the most interesting features and changes introduced since last
time.