Skip to content

Instantly share code, notes, and snippets.

View xitizbhatia's full-sized avatar

xb xitizbhatia

View GitHub Profile
@xitizbhatia
xitizbhatia / grokking_to_leetcode.md
Created June 14, 2025 01:37 — forked from tykurtz/grokking_to_leetcode.md
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

@xitizbhatia
xitizbhatia / wildfly10-install.sh
Created July 14, 2022 21:51 — forked from chinboon/wildfly10-install.sh
Script to install Wildfly 10 and JDK 8 into Amazon Linux AMI
#!/bin/sh
# remove previous versions of java
sudo yum remove -y java-1.7.0-openjdk
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u92-b14/jdk-8u92-linux-x64.rpm"
sudo yum localinstall -y jdk-8u92-linux-x64.rpm
java -version
# download wildfly
sudo wget http://download.jboss.org/wildfly/10.0.0.Final/wildfly-10.0.0.Final.tar.gz
@xitizbhatia
xitizbhatia / lambda_function_ALBS3Logs_to_CloudWatchLogs.py
Created September 1, 2021 14:55 — forked from psa-jforestier/lambda_function_ALBS3Logs_to_CloudWatchLogs.py
A lambda function to stream Application Load Balancer logs dropped in S3 to CloudWatch Logs
'''
This function send Application Load Balancer logs to CloudWatch Logs. So you can use CloudWatch tools, like Insight or custom metrics.
By default, ALB log its access in gz file in S3, and there is no way yo send the log directly to a Log Group / Log Stream.
This lambda function is triggered on S3 "PUT" action (when ALB write its log file). It then download the file localy, unzip it, sort it, and stream it to a CloudWatch log groups.
Installation
Activate ALB logs, and indicate the S3 bucket and the prefix for the log files. Enable, on the bucket, the deletion of old log files