Skip to content

Instantly share code, notes, and snippets.

@fardjad
fardjad / dsl-lte-auto-switch-setup.md
Last active January 17, 2024 16:11
[DSL/LTE Auto-switch Setup] #openwrt #dsl #lte #multiwan

DSL/LTE Auto-switch Setup

Synopsis

This is how I setup my home router to share a 4G/LTE connection at day and switch to a DSL connection overnight.

It also falls back to DSL connection whenever the 4G/LTE connection dies.

Why?

@fardjad
fardjad / doublecmd-explorer-integration.reg
Last active April 10, 2022 09:28
[doublecmd-explorer-integration.reg] Double Commander Explorer Integration #windows #registry #doublecmd
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Drive\shell]
@="open"
[HKEY_CLASSES_ROOT\Drive\shell\open]
[HKEY_CLASSES_ROOT\Drive\shell\open\command]
@="C:\\Program Files\\Double Commander\\doublecmd.exe -C \"%1\""
@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()
{
}
@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 / 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 / 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 / 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-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-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 / 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