Rust cannot find derive macro `Serialize` in this scope

While trying out some Rust exercises, I came across the following error: $ cargo run --bin iter2 Compiling tutor-web-app-ssr v0.1.0 (/home/kenno/dev/rust/chapter7/ezytutors/tutor-web-app-ssr) error: cannot find derive macro `Serialize` in this scope --> tutor-web-app-ssr/src/bin/iter2.rs:17:10 | 17 | #[derive(Serialize, Deserialize)] | ^^^^^^^^^ | note: `Serialize` is imported here, but it is only a trait, without a derive macro --> tutor-web-app-ssr/src/bin/iter2.rs:5:26 | 5 | use serde::{Deserialize, Serialize}; | ^^^^^^^^^ error: cannot find derive macro `Deserialize` in this scope --> tutor-web-app-ssr/src/bin/iter2....

May 22, 2024 · 1 min · 157 words · kenno

How to generate Let's Encrypt SSL cert for Bitnami Lightsail

So you just setup a new shiny WordPress website on a Lightsail (WordPress) instance. Now, you’ve been told to setup an SSL certificate for your website domain. What to do? The following steps show how to generate a free SSL certificate provided by Let’s Encrypt. bitnami@ip-172-26-12-25:~$ sudo /opt/bitnami/bncert-tool ---------------------------------------------------------------------------- Welcome to the Bitnami HTTPS Configuration tool. ---------------------------------------------------------------------------- Domains Please provide a valid space-separated list of domains for which you wish to configure your web server....

May 22, 2024 · 2 min · 410 words · kenno

Nvim Treesitter reinstalls parser every time Neovim starts

I’m in the process of migrating existing Neovim plugins managed by Packer to a new plugin manager called ‘Lazy’. While setting the nvim-treesitter plugin, I came across this issue that nvim-treesitter keeps reinstalling all language parsers every time Neovim is started. [nvim-treesitter] [5/5] Treesitter parse for vim has been installed What happened? Well, it turns out this is is pretty much a common issue when you switching from Packer to Lazy plugin manager without cleaning up files and directories created by Packer according to this [1]....

May 18, 2024 · 1 min · 180 words · kenno

Adjusting Firefox DPI

On a few of my computers with 4K monitors running Linux, Firefox either display with tiny fonts or very large fonts, while most applications behave normally. After searching for a work around, I found the following solution works for me: setting the layout.css.devPixelsPerPx to a smaller number, e.g. 0.7. From this this page: You can set layout.css.devPixelsPerPx to 1.0 (default is -1) on the about:config page. Adjust its value in 0....

May 4, 2024 · 1 min · 156 words · kenno

ipcalc - Perform simple operations on IP addresses and networks

Tonight I just stumbled on a command line tool or utility called ipcacl. This tool is used to perform operations on IP addresses and networks. On Fedora, ipcalc is provided by ipcacl package. If you on a different distro, search for ipcaclc, there should be a similar package name. ➜ rpm -q ipcalc ipcalc-1.0.3-9.fc40.x86_64 Here are some examples of what we can use this utility for, though I encourage you to run man ipcalc to learn more what you can do with it....

May 2, 2024 · 1 min · 143 words · kenno

Deploy metrics-server in Kubernetes using Helm

This is a short note on how to install metrics-server using Helm on my k8s cluster. $ kubectl version Client Version: v1.29.3 Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3 Server Version: v1.29.3 $ helm version --short v3.14.4+g81c902a Before we can install the chart, we will need to add the metrics-server repo to Helm. $ helm repo add metrics-server https://kubernetes-sigs.github.io/metrics-server/ Update the repo: $ helm repo update Hang tight while we grab the latest from your chart repositories....

April 24, 2024 · 2 min · 262 words · kenno

Connect to a Redis cluster with Python

To connect to a Redis server with Python, one can use python3-redis module. First verify that python3-redis module is installed. I’m showing the package name in Fedora 39, if you use a different distro, then check for the relevant package name. $ rpm -q python3-redis python3-redis-4.3.3-1.el9.noarch Here is the sample code to connect to a non-cluster Redis server: import redis # Connect to Redis r = redis.Redis(host='10.97.147.175', port=6379) # Set a key-value pair r....

April 3, 2024 · 1 min · 191 words · kenno

How to convert putty ppk to pem on macOS

Assuming that you use brew on your macOS, converting a ppk file to pem file is relatively easy. Install putty on your mac ➜ brew install putty Generate the key ➜ puttygen existing_key.ppk -O private-openssh -o new_key.pem Here are the options used in above command: -O private-openssh : save the output as a SSH-2 private key -o new_key.pem : save the output to new_key.pem Full credit go to this blog post [1], where I had learned to convert a PPK to PEM file....

March 28, 2024 · 1 min · 96 words · kenno

How to deploy Uptime Kuma on kubernetes

I’ve been running Uptime Kuma on a podman-container for a long time with no problem. Recently, though, I’ve been running a mini Kubernetes cluster at home, and decided to move this conatainer to the same cluster. The following is to document how I deploy Uptime Kuma on a Kubernetes cluster. As I’m new to Kubernetes world, I broke down the tasks I need to do in 6 pieces: $ ls -1 1....

March 15, 2024 · 2 min · 416 words · kenno

How to attach instance profile on EC2 with AWS CLI

This is a quick note to remind me on how to attach or associate an instance profile (IAM role) to an EC2 instance using AWS CLI. There is a bonus section at the end to show how to replace one IAM role with another one directly. In this example, I already have a running EC2 instance i-0357ecc1111111111 running. I want to attach a new instance profile called SSMInstanceProfile to this instance....

March 5, 2024 · 3 min · 436 words · kenno