Skip to content

Instantly share code, notes, and snippets.

View salehi's full-sized avatar

SS Salehi salehi

View GitHub Profile
@salehi
salehi / ollama_models_compare.md
Created January 6, 2026 16:48
Ollama Models for DevOps & Development

Ollama Models for DevOps & Development

Comprehensive rating of Ollama models for DevOps tasks, backend development, and frontend development.

Top Tier Models (★★★★★)

Model Size DevOps Backend Frontend Best For
deepseek-r1 1.5B-671B ★★★★★ ★★★★★ ★★★☆☆ Complex reasoning, debugging, infrastructure logic
qwen3-coder 30B-480B ★★★★★ ★★★★★ ★★★★☆ Agentic coding tasks, long-context code work
@salehi
salehi / local_ai_compare.md
Created January 6, 2026 16:01
Local Offline AI Models for Coding

Local Offline AI Models for Coding — Sorted by Coding Strength

⭐ = relative strength for coding tasks (higher is better)
All models can run 100% offline after download using tools like Ollama, GPT4All, LM Studio, Jan, or LocalAI

Model / Platform Coding Strength DevOps / CLI Python Backend Frontend (JS/React) Typical RAM Notes
Qwen 2.5 Coder (32B) ⭐⭐⭐⭐ ⭐⭐⭐⭐ ⭐⭐⭐⭐ ⭐⭐⭐ 32 GB+ One of the strongest local coding models
CodeLlama (34B) ⭐⭐⭐⭐ ⭐⭐⭐ ⭐⭐⭐⭐ ⭐⭐⭐ 32 GB+ High-quality code generation, slower/heavier
Llama 3.1 (70B) ⭐⭐⭐⭐ ⭐⭐⭐ ⭐⭐⭐ ⭐⭐ 48 GB+ Massive context, very heavy hardware requirements
@salehi
salehi / openreplay-post-upgrade-fix.md
Created January 6, 2026 12:10
Fix for OpenReplay /v2/api/* 404 errors after running openreplay -u - patches ingress to route to correct backend service

OpenReplay Post-Upgrade Fix: Health API 404

Problem

After running openreplay -u, the /v2/api/* endpoints return 404 because the ingress gets reset to default values that point to the wrong backend service.

Root Cause

  • The api-openreplay ingress routes to api-openreplay:8080 (Go server)
  • But the actual API (health, signup, etc.) lives on chalice-openreplay:8000 at /api/*
  • The rewrite target also needs to be /api/$1 instead of /$1
#!/usr/bin/env python3
"""
Fetch IP delegations from all 5 RIRs and extract CIDRs for a specific country.
Handles non-power-of-2 allocations by expanding into multiple CIDRs.
Usage:
python get_country_cidrs.py IR # IPv4 to stdout
python get_country_cidrs.py IR -o IR.txt # IPv4 to file
python get_country_cidrs.py US -6 -o US_v6.txt # IPv6 only
python get_country_cidrs.py DE -4 -6 # Both IPv4 and IPv6

Exec into a Pod by Label

kubectl exec doesn't support label selectors directly. Use a subshell to grab the pod name first:

kubectl exec -it $(kubectl get pod -l app.kubernetes.io/name=api -o jsonpath='{.items[0].metadata.name}') -- bash

Edge Cases

  • Multiple pods? This grabs the first one. List all with:

Resizing a Linux Disk After VM Expansion

1. Rescan the disk to detect new size

echo 1 > /sys/class/block/sda/device/rescan

Verify with lsblk — disk should now show the new size.

Network Learning Roadmap: Zero to Hero

A question-based study guide for beginners.


Phase 1: Fundamentals

  • What is a network and why do we need it?
  • What is the OSI model and what happens at each layer?

ZeroTier: Technical Deep Dive, Implementation, and Comparisons

1. ZeroTier's Aim and Goals

ZeroTier is a software-defined networking (SDN) platform that creates virtual Ethernet networks (VLANs) spanning any physical infrastructure—LAN, WAN, cloud, or mobile networks. The core philosophy is:

"Decentralize until it hurts, then centralize until it works."

Primary Goals

  • Global virtual LAN: Make geographically distributed devices appear on the same Layer 2 network

MikroTik OpenVPN Authentication Modes

Overview

There are three authentication modes for OpenVPN on MikroTik:

Mode Server Setting Client Needs Security Level
User/pass only require-client-certificate=no CA + username/password Basic
Cert only require-client-certificate=yes CA + client cert/key Good
@salehi
salehi / gitlab-reset-password.md
Created December 29, 2025 10:26
Gitlab Console reset password

Get in the rails console

sudo gitlab-rails console -e production

then:

user = User.find_by_username('root')
user.password = 'new_password_here'
user.password_confirmation = 'new_password_here'