Selecting files in ZSH With fzf and exa

Sometime the tiniest optimization makes a huge difference. When I am not using Emacs and dired I usually just use the shell with zsh to do all my file management. This is fine and great but sometime when I need to select multiple files with different names, I would have to do a lot of tabs and selection or copy and paste to select properly the list of files I want to do operations on....

January 11, 2023

shell completions with go cobra library

Every time I press the [TAB] key in my shell, it bothers me that nothing happens. I’m not very smart, so I often press the [TAB] key multiple times, hoping that maybe the seventh time will magically produce the completion that I expect. However, magic is not a computer function, and if a user or command line interface (CLI) author has not provided a completion function, nothing will ever happen....

November 22, 2022

snazy json log viewer

I have been meaning to write an article about tools that I have developed lately to make it easier for my day to day life work. Being a so called “Kubernetes cloud native developer” (don’t laugh at the title because I do) I have to watch a log of controller logs. Most controller logs output in JSON format which is a nice tool for computers but not straightforward to parse to the eyes of the mere mortals....

November 5, 2022

Error chaining with Rust and Go

I was talking with a colleague about Rust and we were wondering (since we are both learning the language) how error handling compares to Go. Chaining error in Go Go’s best practice when you want to chain multiple errors is to “wrap” them. For example let’s say you have this function returning an error: func do_something() err { value := "value" if value != "expected" { return fmt....

May 20, 2022

Generating Preview Environments with Tekton

On Pipelines as Code we started to get a nice documentation website on : https://pipelinesascode.com The website is statically generated with Hugo and hosted on CloudFares Pages using the markdown files from the repository. So far that’s a pretty standard stack, but what we wanted is to be able to get preview URLS like on Netlify or other CIs There is a nice check box, that says “Generate Preview URL on Pull Request” which seems to do what we want but it doesn’t....

April 7, 2022

vtplug a very dumb and tiny zsh plugin manager

There is a lot of zsh plugin manager around : https://github.com/unixorn/awesome-zsh-plugins#frameworks They all allow you to add cool new features to your shell easily and for authors to easily share their plugin with users and frameworks. While a lot of people are probably using frameworks like oh-my-zsh which does everything for them with minimal setup. But since I have been using zsh since much before than those frameworks existed, I always ran my custom config....

March 18, 2022

Show plugins list to a CLI when using go’s cobra library

With the TektonCD CLI we have a system of “plugins”, it’s the same very simple CLI plugin system you have with git or kubectl, if you do a : kubectl blah foo --bar since kubectl knows it doesn’t have the blah command will try to go over the filesystem paths in your $PATH environment and sees if there is a binary called kubectl-blah and if it finds it will pass the arguments to the binary which effectively become :...

March 18, 2022

Running tasks as non root on OpenShift Pipelines

Expanding on my previous blog post on getting buildah to run with user namespaces or as rootless. There is another important security topic to talk about is how to run everything on OpenShift Pipeline as non root and not just the buildah task. On OpenShift Pipelines we made the conscious decision to run all the TaskRuns and Pipelinerun by default under a custom ServiceAccount called pipelines. That’s it, unless overridden by the user in its pipelinerun or taskrun, it will use the pipelines ServiceAccount which has a few elevated privileges....

March 7, 2022

User namespaces with Buildah and OpenShift Pipelines

In 2022 one of the hottest topic around CI is how to secure it every steps along the way. The so-called supply chain attacks have been more and more an attack vector for bad actor whereas providers need to make sure every piece of the Integration is secure. One area that was identified as something we can improve with Openshift and containers in general is when running as root on the container may expose the host and process in that container may be able to mingle with other resources....

January 25, 2022

For the love of centered windows gnome extension edition

Feels weird or great or stupid or pretty smart or whatever to be wrong. Just when I wrote that previous blog post : https://blog.chmouel.com/2021/11/14/for-the-love-of-centered-windows/ that I realize that shelll script doesn’t work great on wayland. I didn’t really understood how Wayland works and just assumed that my tiny scripts just works. But experiencing not working on a native Wayland application and understanding how wayland works: https://wayland.freedesktop.org/docs/html/ch05.html it obviously needed a better way to do that if I have to keep up with the modern world of a linux desktop....

November 19, 2021