Troubleshoot HTTP API requests with mitmproxy

Sometimes you connect a new tool to one of your servers and it doesn’t work as expected. You are sure you follow the documentation or tutorials but you don’t get the expected results. Before you throw away everything, you should check what’s actually going on between the 2 applications. And if none of them supports logging requests and responses, you can use mitmproxy for troubleshooting. As the name imply (MITM = Man In the Middle), mitmproxy sits between both applications and intercepts all the traffic. You can use it to log the traffic but also modify the content of the requests and/or responses? On the fly. I will not cover that use-case here. ...

March 19, 2024 · 2 min

Ollama system prompt

Ollama I have recently started to use Ollama and I was unimpressed by some models as they did not follow instructions, especially in their output format. I knew about model system prompt but I thought it was fixed in the model. Then I found out you could change the system prompt at run time with the /set system command and immediately, most models responded as expected. That was so much better! ...

March 18, 2024 · 1 min

Intel N100 CPU performance review

I have just bought a mini PC based on Intel N100 CPU. Initially, I was going to buy another Raspberry PI or a used “TinyMiniMicro” PC, but I decided to have a look at the current mini PC offering. I am glad I did. On a major Chinese reseller website, I saw a lot of similar products with the Intel N100 CPU so I had a look at reviews (here here) and boy, this thing is powerful (for its size). I’ll talk about the mini PC in an other post. ...

March 2, 2024 · 2 min

Restrict docker container resource usage with docker compose

By default, resources available to containers are not limited. However, sometimes, you want to make sure a container is not going to use too much processing power or memory. To achieve such a thing, in the docker-compose.yml file, add the following sections to the service you want to restrict: deploy: resources: limits: cpus: "1.0" memory: 100M memswap_limit: 100M This will effectively limit the container to use at most one CPU and 100 megabytes of memory. ...

March 1, 2024 · 1 min

OpenSSH CVE-2023-48795 mitigation

If you cannot upgrade your OpenSSH client and/or server to fix CVE-2023-48795, also known as the Terrapin attack, the way to mitigate it is to disable the vulnerable ciphers as Red Hat explains very well. If you have a recent OpenSSH version, you can disable the the ciphers by adding “-” before them in the Ciphers and MACs options. This works for both the ssh client config (/etc/ssh/ssh_config by default) and the ssh server config (/etc/ssh/sshd_config). ...

December 21, 2023 · 2 min

Using generative AI to learn vocabulary

I wanted to help a friend learning English who has trouble learning new vocabulary. She often gets new list of words at school and it’s difficult for her to know how to use them, or remember what they mean. She usually gets one exercise about the topic where she must fill blanks with words from a list. Why not use generative AI for that? I could not achieve good results using a single large prompt, so I decided to explicitly break it into different steps and refer to the whole process later, with “OK” results. ...

November 21, 2023 · 7 min

Contabo: A great cloud for personal use

I’m a personal user of Contabo’s cloud services, and I’ve been delighted with them. They offer a wide range of services to choose from, including VPS, dedicated servers, and cloud storage. I’m currently using a VPS to host my personal website and email, and I have also used their Storage VPS and object storage in the past. I have had no issue with my VPS over the years. I’ve also been impressed with Contabo’s customer support. They’ve always been quick to respond to my questions. ...

October 30, 2023 · 1 min

SDXL 1.0 is out!

And voilà! SDXL 1.0 is out. After tinkering a bit, I think it’s working pretty well. As with SDXL 0.9, I must use both base and refiner models to get good pictures, but they are of excellent quality. Use the pipeline from ComfyUI and put the models at the right place: https://comfyanonymous.github.io/ComfyUI_examples/sdxl/ Note that it’s really slow with an AMD Radeon RX 6700 XT, especially because of the 2 models. A few links: ...

July 28, 2023 · 1 min

ComfyUI: remove metadata from image files

When you generate a file using ComfyUI, metadata are added to the image automatically. Amongst the metadata, there is the full workflow including the prompt. If you want to remove those data, you can use ImageMagick convert with the --strip option. convert image.png --strip image_strip.png If you want to alter the original file, use mogrify: mogrify --strip image.png

July 23, 2023 · 1 min

ComfyUI: batch run from command line with API

While AUTOMATIC1111 can generate images based on prompt variations, I haven’t found the same possibility in ComfyUI. However, you can achieve the same result thanks to ComfyUI API and curl. When you click “queue prompt” in ComfyUI, it actually sends a POST request with the whole workflow as JSON data to http://127.0.0.1:8188/prompt . To get the workflow as JSON, go to the UI and click on the settings icon, then enable Dev mode Options and click close. You will now see a new button Save (API format). ...

July 22, 2023 · 2 min