Skip to content

Instantly share code, notes, and snippets.

@fardjad
fardjad / !simple-remote-backup-solution-for-linux.md
Last active September 14, 2024 22:33
[Simple Remote Backup Solution for Linux] Periodically backup a list of directories to an NFS share with Tailscale and Restic #linux #systemd #restic #nfs #tailscale #backup
@fardjad
fardjad / the-fence-is-in-your-mind.md
Last active September 3, 2024 09:35
[The Fence Is in Your Mind] A satirical depiction of an experience I had in an IT organization #blog #satire

The Fence Is in Your Mind

[!NOTE] This is a satirical depiction of an experience I had in an IT organization. The point is to share the same message with a broader audience. Obviously, convincing people to make big changes requires patience, perseverance, and long-term support.

Today, I had a conversation at work which reminded me of the 2000 animated adventure comedy, Chicken Run. Here’s how that conversation would look like if

@fardjad
fardjad / taming-an-onyx-tablet.md
Last active July 28, 2024 14:28
[Taming an Onyx Tablet] The documented process of securing my Onyx Boox tablet #blog #onyx #boox

Taming an Onyx Tablet

Onyx tablets reportedly phone home and send "data" to some servers in China. The manufacturer apparently refuses to publish the source-code modifications to the OS and the open-source apps they are using and they even go as far as violating GPL.

Of course I learned all that after buying this tablet. To ease my mind, I spent some time debloating it and then blocked the outgoing traffic to

@fardjad
fardjad / considerations-for-running-postgres-on-nfs.md
Last active July 28, 2024 14:30
[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

@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 / 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 / find-node-by-line-number-in-node-tree-sitter.md
Last active June 9, 2023 23:58
[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 / how-to-install-homebrew-on-debian-based-distros.md
Last active September 18, 2024 12:32
[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 / how-to-start-colima-automatically-on-macos.md
Last active September 17, 2024 19:25
[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-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