Skip to content

Instantly share code, notes, and snippets.

View shubhamkakkar's full-sized avatar

Shubham kakkar shubhamkakkar

  • new delhi, India
View GitHub Profile
@shubhamkakkar
shubhamkakkar / node-on-ec2-port-80.md
Created July 23, 2020 06:47 — forked from kentbrew/node-on-ec2-port-80.md
How I Got Node.js Talking on EC2's Port 80

The Problem

Standard practices say no non-root process gets to talk to the Internet on a port less than 1024. How, then, could I get Node talking on port 80 on EC2? (I wanted it to go as fast as possible and use the smallest possible share of my teeny tiny little micro-instance's resources, so proxying through nginx or Apache seemed suboptimal.)

The temptingly easy but ultimately wrong solution:

Alter the port the script talks to from 8000 to 80:

}).listen(80);
// make sure you have not installed react-native vector icons by now
make a file named react-native.config.js, content should be following
```
module.exports = {
projects: {
ios: {},
android: {},
},
assets: ['./assets/fonts'],
version: 2
aliases:
- &restore-yarn-cache
name: Restore cached root node_modules
key: yarn-cache-{{ checksum "yarn.lock" }}
- &save-yarn-cache
name: Save node_modules to cache
key: yarn-cache-{{ checksum "yarn.lock" }}
paths:
- node_modules
@shubhamkakkar
shubhamkakkar / config.yml
Created November 28, 2021 10:11
React Native, git submodules and CI/CD
wversion: 2.1
node_image: &node_image
docker:
- image: node:12
android_image: &android_image
docker:
- image: reactnativecommunity/react-native-android
file=path/to/websiteVersion.json
increment_patch_version='increment_patch_version'
increment_fix_version='increment_fix_version'
increment_feature_version='increment_feature_version'
commandToRun=${1:-increment_patch_version}
featureVersion=`cat ${file} \
| grep featureVersion \

How to use nginx as a reverse-proxy with letsencrypt

Your infrastructure

generated via plantuml

Imgur

Requirements

@shubhamkakkar
shubhamkakkar / Guardrails.md
Created March 16, 2026 19:01
🛡️ AI Guardrails: Zero to Hero

🛡️ AI Guardrails: Zero to Hero

A Complete Guide for the Modern AI Practitioner

"Guardrails aren't barriers to AI progress — they are the infrastructure that makes safe, sustainable AI innovation possible."IBM Think


📋 Table of Contents

@shubhamkakkar
shubhamkakkar / ThreatsGuardrailsProtectAgainst.md
Last active March 16, 2026 19:15
Threats Guardrails Protect Against
Threat Description
Prompt Injections & Jailbreaks Adversarial inputs that manipulate AI behavior to produce restricted or unsafe outputs
Sensitive Information Exposure Outputs that include PII, proprietary data or sensitive information such as healthcare records
Misinformation & Harmful Content AI-generated outputs that spread false information, toxic language or biased perspectives
Unpredictable Model Behavior LLMs that generate unexpected or unsafe outputs without proper safeguards
Open Source Vulnerabilities Risks that arise when open source AI models and APIs lack sufficient guardrails for safe use
Unfiltered User Input Instructions from end users that push AI systems beyond intended limits, leading to unsafe or harmful outputs
@shubhamkakkar
shubhamkakkar / WhatPreChecksCover.md
Created March 16, 2026 19:18
What Pre-Checks Cover
Check Type What It Does
Prompt Injection Detection Catches "ignore previous instructions" patterns
PII Scrubbing Strips emails, SSNs, phone numbers from input
Topic/Intent Classification Ensures query is within allowed scope
Token Length Validation Prevents context overflow attacks
Jailbreak Pattern Matching Regex/classifier on known bypass attempts
Check Type Description
Streaming Token Monitoring Flag/stop generation if toxic content emerges mid-stream
Agent Action Validation Validate each tool call before execution in agentic flows
Confidence Scoring Pause if model confidence drops below threshold
Loop/Recursion Detection Catch infinite agent loops before they escalate
Budget/Resource Limits Kill long-running LLM chains to prevent runaway costs