Skip to content

Instantly share code, notes, and snippets.

@fardjad
fardjad / debian-sid-with-systemd-on-wsl2.md
Last active February 10, 2024 05:48
[Debian sid with systemd on WSL2] Instructions for running Debian sid with systemd on WSL2 #windows #wsl2 #debian #sid #linux
@fardjad
fardjad / kubernetes-resources-cheatsheet.md
Last active July 1, 2020 07:51
[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 / minikube-on-wsl2-with-podman.md
Last active November 7, 2023 02:14
[Minikube on WSL2 with Podman] Tips for running a local development Kubernetes cluster on WSL2 with Podman #wsl2 #minikube #podman #kubernetes #docker
@fardjad
fardjad / how-to-run-photonos-on-virtualbox.md
Created August 28, 2019 17:31
[How to run PhotonOS 3+ on VirtualBox] #virtualbox #photonos

How to run PhotonOS 3+ on VirtualBox

Steps

Create the VM

  1. Download the latest OVA (I downloaded the one with UEFI support).
  2. Extract the OVA and grab the VMDK file.

tar xf photon-*.ova

@fardjad
fardjad / how-to-use-an-insecure-local-docker-registry-with-minikube.md
Last active August 1, 2019 05:18
[How to Use an Insecure Local Docker Registry with Minikube] Steps required to use an insecure docker registry running on localhost with Minikube for development #docker #minikube #development #docker_registry

How to Use an Insecure Local Docker Registry with Minikube

Steps

  1. Run a local registry server
  2. Log into the Minikube VM with SSH (minikube ssh)
  3. Make sure GatewayPorts option is set to yes in /etc/ssh/sshd_config (and restart the SSH server if necessary)
  4. Forward the exposed registry port on your host machine to the Minikube VM with SSH:

ssh -i $(minikube ssh-key) -N docker@$(minikube ip) -R 5000:localhost:5000

@fardjad
fardjad / how-to-install-homebrew-on-manjaro.md
Last active March 18, 2024 16:09
[How to Install Homebrew on Manjaro] Steps required to install homebrew on Manjaro Linux #linux #manjaro #homebrew
@fardjad
fardjad / how-to-install-parallels-tools-on-manjaro.md
Last active September 29, 2022 09:51
[How to Install Parallels Tools on Manjaro] Steps required to install Paralells Tools on Manjaro Linux #linux #manjaro #parallelsdesktop #macos

How to Install Parallels Tools on Manjaro

Steps required to install Paralells Tools on Manjaro Linux

Steps

  1. Install Manjaro Linux on a VM (it's recommended to take a snapshot before installing Parallels Tools)
  2. Update the OS

pacman -Syu

@fardjad
fardjad / low-level-async-buffered-read.js
Last active February 18, 2019 12:42
[low-level-async-buffered-read.js] Low-level async buffered read from file with Node.js #nodejs #async #file
const fs = require("fs");
const EventEmitter = require("events").EventEmitter;
const read = (fileHandle, bufferSize, position, emitter) => {
const buffer = Buffer.alloc(bufferSize);
fs.read(
fileHandle,
buffer,
0,
@fardjad
fardjad / find-binary-files-in-git-repo.sh
Created February 8, 2019 10:38
[find-binary-files-in-git-repo.sh] Find binary files in a git repo #git #bash
#!/bin/bash
git_files=$(git ls-files)
for git_file in $git_files; do
encoding=$(file --mime-encoding "$git_file")
type=$(echo "$encoding" | awk -F ': ' '{ print $2 }')
if [ "$type" == "binary" ]; then
echo $git_file
fi
@fardjad
fardjad / Unity3DObjectDragHandler.cs
Last active January 15, 2023 23:34
[Unity3DObjectDragHandler.cs] Handles drag and drop for a 3D object in Unity3D #unity #csharp #draganddrop
using UnityEngine;
public class Unity3DObjectDragHandler : MonoBehaviour
{
public Camera camera;
public void Start()
{
}