Skip to content

Instantly share code, notes, and snippets.

View nrjdalal's full-sized avatar

Neeraj Dalal nrjdalal

View GitHub Profile
@nrjdalal
nrjdalal / QEMU-Silicon-Mac-Virtualization.md
Last active February 1, 2024 05:31
Create Virtual Machines using QEMU on Silicon based Apple Macs

Install QEMU on Silicon based Apple Macs (June 2021)

Option 1 - Automatically

zsh -c "$(curl -fsSL https://raw.githubusercontent.com/nrjdalal/silicon-virtualizer/master/install-qemu.sh)"

Option 2 - Manually

  • Install Xcode command line tools

xcode-select --install
@nrjdalal
nrjdalal / node-universal-workflow.yml
Last active June 30, 2023 10:29
node app github actions workflow
# pre-requisites -> gh, yarn, pm2
name: production
on:
push:
branches: ['main', 'master']
pull_request:
branches: ['main', 'master']
@nrjdalal
nrjdalal / ec2.sh
Last active June 30, 2023 07:37
ec2 node app deployment guide for brand new instance
sudo apt update && sudo apt upgrade -y && sudo apt install build-essential -y && sudo passwd ubuntu
sudo apt install zsh -y && chsh -s $(which zsh)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
(echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /home/ubuntu/.zprofile
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" && brew install gcc
brew install nvm && mkdir -p ~/.nvm && export NVM_DIR="$HOME/.nvm"
# ~ dnsmasq.conf
brew install dnsmasq
touch $(brew --prefix)/etc/dnsmasq.conf
read -r -d '' VAR <<END
address=/.next/127.0.0.1
END
grep -Fqx $VAR $(brew --prefix)/etc/dnsmasq.conf || echo "$VAR" >>$(brew --prefix)/etc/dnsmasq.conf
sudo mkdir -p /etc/resolver && sudo zsh -c 'echo "nameserver 127.0.0.1" >/etc/resolver/next'
sudo brew services restart dnsmasq