Skip to content

Instantly share code, notes, and snippets.

@fardjad
fardjad / taming-an-onyx-tablet.md
Last active May 29, 2024 13:51
taming-an-onyx-tablet.md

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 May 29, 2024 10:36
[Considerations for Running Postgres on NFS] #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

A selected list of my gists that are written in the style of a blog post
@fardjad
fardjad / debugging-and-authoring-helm-charts-and-post-renderer-hooks-with-viddy.md
Last active May 29, 2024 10:38
[Debugging and Authoring Helm Charts and Post Rendering Hooks with Viddy] #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 May 23, 2024 22:14
[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 May 29, 2024 10:49
[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

@fardjad
fardjad / how-to-install-ice-ssb-manager-on-debian.md
Last active March 8, 2022 22:45
[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