Skip to content

Instantly share code, notes, and snippets.

@fardjad
fardjad / taming-an-onyx-tablet.md
Last active April 13, 2025 15:14
[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 April 9, 2025 23:44
[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 / how-to-start-colima-automatically-on-macos.md
Last active March 15, 2025 18:16
[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 February 17, 2025 02:00
[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 / !modern-typescript-app-no-build.md
Last active January 25, 2025 11:14
[Shipping A TypeScript Frontend App Without a Build Workflow] Exploring the idea of shipping a modern front-end application written in TypeScript without a build workflow #blog #frontend #typescript #nobuild #serviceworker

Shipping A TypeScript Frontend App Without a Build Workflow

I was once working with a client, and our team was facing a mix of technical and non-technical challenges in shipping a relatively simple web application. During one of our meetings, I cracked a silly joke: "At this rate, we might as well zip up the source code and send it to anyone who wants to try it." (note for the reader: our users were non-developer colleagues from the same organization)

Of course we chuckled and we moved on. But later, I found myself aching to try that silly idea out. Or a refined version of it:

@fardjad
fardjad / kubernetes-resources-cheatsheet.md
Last active January 23, 2025 15:26
[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 / how-to-create-a-template-vm-disk-image.md
Last active January 4, 2025 17:32
[TIL: How to Create a Template VM Disk Image] A short guide to creating custom disk images using virt-sysprep #blog #til #vm #template #virt_sysprep

TIL: How to Create a Template VM Disk Image

While experimenting with dqlite, I needed to create multiple virtual machines from a custom template to manually test a few scenarios. cloud-init combined with one of the cloud images from here would have worked, but I wanted to avoid waiting for the VM to boot and configure itself each time I spun up a new instance.

After some research, I discovered virt-sysprep, which turned out to be the

@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 / how-to-install-homebrew-on-manjaro.md
Last active September 17, 2024 19:24
[How to Install Homebrew on Manjaro] Steps required to install homebrew on Manjaro Linux #linux #manjaro #homebrew

How to Install Homebrew on Manjaro

Steps

  1. Install base-devel

     pacman -Syu # CAUTION: this updates the whole system
     pacman -S base-devel
    
  2. Run the installer script

@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