Skip to content

Instantly share code, notes, and snippets.

@fardjad
fardjad / kubernetes-resources-cheatsheet.md
Last active June 11, 2025 15:04
[Kubernetes resources cheatsheet] A cheatsheet for Kubernetes resource types and their hierarchy #kubernetes #cheatsheet

Resources

In Kubernetes, controllers are control loops that watch the state of your cluster, then make or request changes where needed. Each controller tries to move the current cluster state closer to the desired state

Kubernetes provides the following controllers:

@fardjad
fardjad / debian-sid-with-systemd-on-wsl2.md
Last active June 28, 2024 04:15
[Debian sid with systemd on WSL2] Instructions for running Debian sid with systemd on WSL2 #windows #wsl2 #debian #sid #linux
@fardjad
fardjad / how-to-install-ice-ssb-manager-on-debian.md
Last active May 30, 2025 12:07
[How to install ICE - SSB Manager on Debian] Steps required to build and install ICE SSB on Debian Linux and its derivatives #ice #ssb #debian

How to install ICE - SSB Manager on Debian

Steps required to build and install ICE SSB on Debian Linux and its derivatives

Steps

  1. Install the dependencies

     apt install build-essential devscripts
     apt install python3 python3-gi python3-requests python3-bs4 python3-lxml
    

apt install chromium-browser

@fardjad
fardjad / how-to-enable-dark-theme-on-elementaryos.md
Last active December 18, 2023 05:23
[How to Enable Dark Theme on ElementaryOS] Instructions for enabling dark theme (almost) everywhere on ElementaryOS #elementary #linux #dark

How to Enable Dark Theme on ElementaryOS

Instructions for enabling dark theme (almost) everywhere on ElementaryOS

Pantheon Apps

  1. Replace the contents of /usr/share/dbus-1/interfaces/io.elementary.pantheon.AccountsService.xml with this file.
  2. Replace the line <annotation name="org.freedesktop.Accounts.DefaultValue" value="0"/> with <annotation name="org.freedesktop.Accounts.DefaultValue" value="1"/> under PreferColorScheme section.

Source

@fardjad
fardjad / how-to-start-colima-automatically-on-macos.md
Last active May 19, 2025 01:13
[How to start Colima automatically on macOS] Instructions for starting Colima automatically on macOS similar to Docker Desktop #macos #colima #docker

⚠️ Note: Since the merge of the commit Homebrew/homebrew-core#149670, starting Colima is as easy as running brew services start colima. You can skip the following work-around.

Steps

  1. Create an executable script to run in foreground and manage colima:
cat <<-EOF | sudo tee /usr/local/bin/colima-start-fg
#!/bin/bash
@fardjad
fardjad / how-to-install-homebrew-on-debian-based-distros.md
Last active June 10, 2025 00:12
[How to Install Homebrew on Debian-based Distros] Steps required to install homebrew on MX Linux (and other Debian-based distros) #linux #debian #mxlinux #homebrew

How to Install Homebrew on Debian-based Distros

Steps required to install Homebrew on MX Linux (and other Debian-based distros)

Steps

  1. Update apt cache and optionally do a full upgrade

     apt update
    

apt full-upgrade # optional, reboot if needed

@fardjad
fardjad / find-node-by-line-number-in-node-tree-sitter.md
Last active November 20, 2024 16:18
[Find node by line-number in node-tree-sitter] An example of finding a node by line-number with node-tree-sitter #TreeSitter #Node

Example

Requirements

  • Node.js 18+
  • tree-sitter
  • tree-sitter-cpp

index.mjs

@fardjad
fardjad / faas-cli-multi-platform-run.md
Last active October 16, 2023 19:50
[faas-cli Multi-Platform Run] Example of running a function on open-faas/faasd with faas-cli #faas_cli #open_faas #faasd

Steps

DOCKER_REGISTRY="registry.example.com"
PROJECT_NAME="hello-world"

# List the templates
faas-cli template store list --official --recommended --verbose=true

TEMPLATE="node18"
@fardjad
fardjad / debugging-and-authoring-helm-charts-and-post-renderer-hooks-with-viddy.md
Last active July 28, 2024 14:33
[Debugging and Authoring Helm Charts and Post Rendering Hooks with Viddy] Efficient helm template writing and troubleshooting with Viddy #blog #helm #viddy #watch #kubernetes #yaml #less #pager

Debugging and Authoring Helm Charts and Post Rendering Hooks with Viddy

Helm CLI comes with a template sub-command that outputs the YAML it generates without installing the Chart. This is very useful for debugging templates and writing Post Renderer scripts.

Here is a basic example to illustrate its usage:

helm template --generate-name /path/to/your/chart/directory --post-renderer /path/to/your/post-render.sh
@fardjad
fardjad / considerations-for-running-postgres-on-nfs.md
Last active June 24, 2025 09:36
[Considerations for Running Postgres on NFS] Considerations for running a Postgres database on an NFS share #blog #postgres #nfs #fsync #fsexport #mount

Considerations for Running Postgres on NFS

Background

Over the weekend, I decided to try running a Postgres database in my Homelab. In my current setup, the most convenient option for storage is NFS. However, NFS is especially tricky for databases. A misconfigured setup can lead to performance or data corruption issues.

After watching