nginx Cannot Bind in Docker Container
The problem my team faced was that a container running nginx was starting but the error message was that the port was already in use.
[emerg] 1#1: bind() to 0.0.0.0:8002 failed (98: Address already in use)
The problem my team faced was that a container running nginx was starting but the error message was that the port was already in use.
[emerg] 1#1: bind() to 0.0.0.0:8002 failed (98: Address already in use)
I wrote in 2018 (My First Experience with Go) how writing a tool in Go to run commands over ssh was harder than it was in Python. It wasn't easy but I finally managed to write the tool this year.
I started out writing a naive bot in GitLab CI/CD pipeline that would provide informational feedback about a merge request (MR) in the MR. Since this was my first attempt writing such a thing, I kept the scope limited and simple yet effective.
I had a task to create a container image based on Debian 12 (Bookworm) which had the OpenSSL FIPS 140-2 module. By default, OpenSSL version 3.0.11 (current version on Debian 12 as of writing) does not have the FIPS module built in it. OpenSSL 3.0 requires that the module be built from the version that has a valid FIPS certificate, which was 3.0.9 at the time of writing.
A very popular question people ask when working with Go and HTTP clients is how
to test the code with go test
. You will see many mentions of
interfaces,
test doubles
(stubs, mocks, fakes, etc.),
httptest, and so on.
I had a similar problem but it was like this: a function in module A was doing some work on the results returned by a function in module B. In other words, module A was depending on module B. Module B is expected to have its own tests, which must not be repeated in the tests written for module A; why duplicate the effort? How could I test module A without also testing module B in the tests written for module A?
Building Python 3.11 from source on CentOS 7 is straightforward but it is tricky when we want to build with TLS/SSL support. The reason is that OpenSSL version (1.0.2k) in CentOS 7 is older than the minimum required by Python 3.11 i.e. 1.1.1k. This is not an unsurmountable problem because the newer version is available in the EPEL repository.
I ran into a perplexing problem where Ansible was running a task in a role even if the role had a when condition which was resolving to false. Plus the task was failing.
To visualize it better, one task (not all) was running in the role symptom in the example playbook below,
--- - hosts: all roles: - role: symptom when: - false
Let's say an upstream, proxied by nginx, sets a cookie foo=bar in its HTTP response. To use this cookie name as a variable in nginx configuration, use the magic prefix $cookie_ and the variable becomes $cookie_foo. But how did a cookie become a variable? I call it a magic variable. It could also be called an arbitrary variable.
Add a file, 1-wlan0.yaml, to /etc/netplan/ with the following contents,
$ sudo cat << EOF >> /etc/netplan/1-wlan0.yaml network: version: 2 wifis: wlan0: optional: true access-points: NAME_OF_YOUR_ESSID: password: "YOUR_SECRET_WPA_PSK_HERE" dhcp4: true dhcp6: true EOF
Then apply the plan,
$ sudo netplan apply
There are some amazing resources available to learn about Prometheus. This post is a cheat sheet with examples that serve as a quick reference and record of interesting things.