Fastly’s request condition is applied to the latest matching condition

If you want Fastly to switch origin (backend) according to a condition, you can do so by setting a request condition. I misunderstood the behavior of the request condition and got into trouble, so I’ll show you what I misunderstood and how I dealt with it. Request condition The Request condition has a priority, and the default is 10. The lower the value, it will be evaluated first, and all request conditions will be evaluated.
Read more →

How to convert to lowercase and uppercase in bash, awk, sed, and, tr and the benchmark results for each

This article introduces how to convert to lowercase and uppercase in bash, awk, sed, and tr, and the benchmark results for each. Versions The versions are as follows: OS Ubuntu 20.04.1 LTS bash GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu) gawk GNU Awk 5.0.1, API: 2.0 (GNU MPFR 4.0.2, GNU MP 6.2.0) mawk 1.3.4 20200120 sed sed (GNU sed) 4.7 tr tr (GNU coreutils) 8.30 Convert to lowercase/uppercase bash The documentation says the following:
Read more →

Conver an array of JSON objects to the Markdown table

This article is introduction to json2mdtbl, a cli tool that converts an array of JSON objects into a Markdown table. Installation Download from https://github.com/tkuchiki/json2mdtbl/releases and place it in a location where your PATH environment variable can find it(e.g. /usr/local/bin). Usage It’s easy to use, just pipe in JSON or ndjson. $ echo '[{"name": "alice", "age": 10},{"name":"bob", "age": 20}]' | json2mdtbl | AGE | NAME | |—–|——-| | 10 | alice | | 20 | bob | $ echo -e '{"name": "alice", "age": 10}\n{"name":"bob", "age": 20}' | json2mdtbl | AGE | NAME | |—–|——-| | 10 | alice | | 20 | bob | You can use it to get BigQuery results as JSON and put them into a Markdown table!
Read more →

Introduction to kubectls

kubectls is a kubectl version manager. This is a kubectl version of tools like *env(kubectlenv). Installation You can install it with the following command: Think it will work if you have bash, ln, readlink, curl, and git installed. $ git clone https://github.com/tkuchiki/kubectls ~/.kubectls Set the PATH to give priority to ~/.kubectls/bin in .bashrc. If you are using zsh, replace it with .zshrc.

for bash $ echo "PATH=~/.kubectls/bin:$PATH" >> ~/.bashrc $ echo "export $PATH" >> ~/.

Read more →

Open the file in JetBrains IDE by specifying the line that matches the search

This article is an introduction to searching for a string in a file using ag or pt and specify the matching line to open in JetBrains IDE. The way to open a file from the command line in the JetBrains IDE is the same for all of them, so will use Goland as an example. You can configure it on Windows, macOS, and Linux that are supported by the JetBrains IDE, but in this article, the only introduction to macOS.
Read more →

Clear the container logs on Docker Desktop for Mac

This article is an introduction to clearing the container logs in Docker Desktop for Mac. The version at the time of writing is Docker Desktop for Mac 3.2.2(61853). About Docker Desktop for Mac You can run docker inspect to get the path to the container log file. $ docker inspect CONTAINER_ID –format "{{.LogPath}}" /var/lib/docker/containers/3d0305c254c33ff5e78d675f45e60fdcef65937ed8b53e21baf07f818d34ce9b/3d0305c254c33ff5e78d675f45e60fdcef65937ed8b53e21baf07f818d34ce9b-json.log If you have dockerd and containerd running on the same host as the docker container on Linux, you can cleaer the logs with a command like the following:
Read more →

Modify the value of max open files for the running process

Do you know how to modify the value of “max open files” for a running process? You can modify that it is using the command “prlimit”(You can also modify more than just “max open files”). docker-prlimit-example makes it easy to try. Run the following commands in order to connect to the docker container where the unicorn process is running. $ git clone https://github.com/tkuchiki/docker-prlimit-example $ cd docker-prlimit-example $ docker build -t prlimit .
Read more →

Send multipart/form-data requests with Vegeta

Vegeta is an HTTP load testing tool written in Go. When sending multipart/form-data requests in the API server benchmark, wrk requires writing lua to send the request. Vegeta could send the request easily without writing any code, so will share how to do it. vegeta has the subcommands attack, report, and dump, with attack sending an HTTP Request. The -targets option of vegeta attack can send HTTP requests flexibly by specifying the text of the request header and request body.
Read more →
Buy me a coffee