Skip to content

Instantly share code, notes, and snippets.

View abdullahfarook's full-sized avatar

Abdullah Farooq abdullahfarook

View GitHub Profile
@abdullahfarook
abdullahfarook / Agents.md
Created September 10, 2025 15:56
Agents.md Dotnet

AI Instructions

  • This file provides guidance to AI when working with code in this repository.
  • Refer to README.md for additional information.

Planning Mode

  • If a user prefix their request with Plan: assume you are in planning mode
  • IMPORTANT: While in Planning mode; do not write or change code. Only update plans in folder ImplementationPlans

How to plan

Step 1: While in Planning mode make a new file called yyyyMMdd_.md that is based on ImplementationPlans/NewFeatureTemplatePlan.md file

@abdullahfarook
abdullahfarook / stop.ps1
Created September 29, 2024 23:12
stop all processes on specified port
Get-NetTCPConnection -LocalPort 44303 -ErrorAction SilentlyContinue | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force }
@abdullahfarook
abdullahfarook / localdb.sql
Created August 19, 2024 11:47
Create user in LocalDb
CREATE LOGIN admin WITH PASSWORD = 'P@ssword786';
CREATE USER admin FOR LOGIN admin;
ALTER SERVER ROLE sysadmin ADD MEMBER admin;
GO
# download and extract containerd
sudo wget https://github.com/containerd/containerd/releases/download/v1.7.20/containerd-1.7.20-linux-amd64.tar.gz
sudo tar Cxzvf /usr/local containerd-1.7.29-linux-amd64.tar.gz
# download and extract cni plugins
sudo mkdir -p -m 755 /opt/cni/bin
sudo wget https://github.com/containernetworking/plugins/releases/download/v1.5.1/cni-plugins-linux-arm64-v1.5.1.tgz
sudo tar Cxzvf /opt/cni/bin cni-plugins-linux-amd64-v1.5.1.tgz
# download ans install runc
@abdullahfarook
abdullahfarook / no_scheduling_on_master.sh
Last active August 3, 2024 22:36
No scheduling on master
# Install K3s with taint
sudo curl -sfL https://get.k3s.io | \
INSTALL_K3S_EXEC="--write-kubeconfig-mode 664 --tls-san <vm ip>" \
INSTALL_K3S_CHANNEL=stable \sh -s - server \
--node-taint CriticalAddonsOnly=true:NoExecute --disable traefik --token <token> \
--datastore-endpoint="mysql://<user>:<password>@tcp(<mysql ip>:3306)/k3s"
# Add tolerance on the control-plane services.
kubectl edit deployments local-path-provisioner -n kube-system
And add the following to the containers spec.
@abdullahfarook
abdullahfarook / join_k3s_cluster_agent.sh
Last active August 4, 2024 10:40
Join k3s cluster, k3s agent configuration
# copy the token from k3s server at path
sudo cat /var/lib/rancher/k3s/server/agent-token
# install firewall-cmd top open ports
sudo apt update
sudo apt-get --yes install firewalld
# open ports 8472, 10250, 51820, 51821, 5001, 6443 on master node as well as every other worker node
udo firewall-cmd --zone=public --add-port=8472/udp --permanent && \
sudo firewall-cmd --zone=public --add-port=10250/tcp --permanent && \
#!/bin/sh
set -o errexit
set -o nounset
IFS=$(printf '\n\t')
# Docker
sudo apt update
sudo apt --yes --no-install-recommends install apt-transport-https ca-certificates curl software-properties-common
# check stable version in k3s stable channel
https://update.k3s.io/v1-release/channels
# use stable channel tag to comapre with k3s releases to get contained runtime version
https://github.com/k3s-io/k3s/tags
# download and extract containerd
sudo wget https://github.com/containerd/containerd/releases/download/v1.6.14/containerd-1.7.17-linux-arm64.tar.gz
sudo tar Cxzvf /usr/local containerd-1.7.17-linux-arm64.tar.gz
@abdullahfarook
abdullahfarook / cloudflare.ps1
Last active July 13, 2024 11:17
Cloudflare Kubectl commands
cloudflared access ssh --hostname k3s.akkenterprise.com --url localhost:6443
[Environment]::SetEnvironmentVariable("KUBECONFIG", "C:\Users\X1YOGA\AppData\Roaming\Lens\kubeconfigs\6c66efdc-db53-47ff-9d4f-0db06bc63494", "User")
$env:KUBECONFIG = "C:\Users\X1YOGA\AppData\Roaming\Lens\kubeconfigs\6c66efdc-db53-47ff-9d4f-0db06bc63494"