Skip to content

Instantly share code, notes, and snippets.

View ninadpchaudhari's full-sized avatar
:shipit:

Ninad P.Chaudhari ninadpchaudhari

:shipit:
View GitHub Profile

Gemini summary!

1. The Trigger: A "Greedy" Regular Expression

Cloudflare uses a Web Application Firewall (WAF) to inspect incoming traffic for attacks. An engineer deployed a rule to block cross-site scripting (XSS). The rule used a Regular Expression (Regex) to find patterns in the data.

  • The Technical Flaw: The Regex contained a pattern that triggered Exponential Backtracking.
  • The "Greedy" Loop: When a Regex engine encounters a complex pattern with many wildcards (like .*.*), it tries every possible way to match the text. If the text almost matches but not quite, the computer gets stuck in a loop of trillions of calculations just to check a single line of code.

2. The Failure: 100% CPU Exhaustion

@ninadpchaudhari
ninadpchaudhari / Vimium_c_speedgrader_mappings
Last active March 19, 2026 14:55
Vimium C Shortcuts for Canvas SpeedGrader - Custom key mappings to make life easier when grading.
" Right Arrow -> Next student.
" Left Arrow -> Previous student.
" Meta (Ctrl or CMD) +S -> Update Score
" You need a chrome plugin named - Vimium C
" Define the Canvas SpeedGrader environment
env speedgrader host="^https://canvas\.siena\.edu/courses/\d+/gradebook/speed_grader"
" 1. The actual click actions (hidden keys)
map <f10> LinkHints.click match="#next-student-button" env="speedgrader"

Way too "tricky"...

  • numberSquare
  • fixError3
  • partyOfThree
  • veryBestSong
  • rocketShips | This one is bad lol

Hints

  • inchesToCentimers - use throw in
@ninadpchaudhari
ninadpchaudhari / lab0.md
Last active January 21, 2026 14:44
LAb 0 - Sp26

Lab: How the Web Works.

An Introduction to HTTP

Course: Intro to Web / Software Engineering Topic: HTTP, Requests, Responses, and Browsers
Estimated Time: 45–60 minutes
Resources:

filebrowser:
image: filebrowser/filebrowser:latest
container_name: filebrowser
restart: unless-stopped
ports:
- "8081:80" # Web UI on http://server:8081
volumes:
- kf6_mongo_data:/srv
@ninadpchaudhari
ninadpchaudhari / 98-mylog
Last active November 5, 2025 12:04 — forked from navhaxs/99-keepwanalive
openwrt wan auto reconnect hotplug script
#!/bin/sh
#File for my debugging purposes
echo $ACTION >> /tmp/mylog
echo $INTERFACE >> /tmp/mylog
echo "" >> /tmp/mylog

Individual - Profiles App with GitHub Actions

This assignment gets you from a clean dev container to a deployed GitHub Pages site using GitHub Actions, and introduces components, props, states and .map().

Reminder, Nov 7th lecture is extended workshop ( join in for atleast an hour via zoom with Kuri to work on this lab)

Due Date : Before next lab

  • Parts 0,1,2 => Should take you about an hour,
  • Parts 3,4,5 => Due before next lab.
@ninadpchaudhari
ninadpchaudhari / pc2load.md
Created April 27, 2025 18:33
PC2 Load Testing

PC2 Loading

Topics

  1. Types of Load Testing
  2. Reverse Proxy
  3. Replay Attacks
  4. CSRF Tokens

Assumptions

  1. Worst case: All students submit their work in the last minute of the competition

Jest Assignment: JavaScript Queue

Project Description

This repository contains a JavaScript implementation of a Queue data structure inspired by Princeton's Intro to Programming. You are the developer and must write robust unit tests using Jest.

Bug: The dequeue() method does not throw an error when called on an empty queue. This violates expected behavior and must be caught through testing.


Nodejs and Serverside

Install Nodejs and NPM

  • Already installed on Github Codespaces

  • On your local machine, you can install Nodejs and NPM using the package manager of your choice.

  • Example on MacOS, you can use Homebrew: brew install node

  • On Windows, you can download the installer from the Nodejs website.

  • On Windows, you can also use the Windows Subsystem for Linux (WSL) to install Nodejs and NPM using the Linux instructions above.