Skip to content

Instantly share code, notes, and snippets.

View TheRockStarDBA's full-sized avatar
🏠
Working from home

Kin Shah TheRockStarDBA

🏠
Working from home
View GitHub Profile
@TheRockStarDBA
TheRockStarDBA / zillowScraper.js
Created September 15, 2023 00:30 — forked from adrianhorning08/zillowScraper.js
Zillow Scraper
async function scrollDown() {
const wrapper = document.querySelector("#search-page-list-container");
await new Promise((resolve, reject) => {
var totalHeight = 0;
var distance = 600;
var timer = setInterval(async () => {
var scrollHeightBefore = wrapper.scrollHeight;
wrapper.scrollBy(0, distance);
totalHeight += distance;
@TheRockStarDBA
TheRockStarDBA / falsehoods-programming-time-list.md
Created March 2, 2023 19:20 — forked from timvisee/falsehoods-programming-time-list.md
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@TheRockStarDBA
TheRockStarDBA / python.md
Created October 18, 2022 14:43 — forked from eyeseast/python.md
How to set up Python in 2022

Python

This is my recommended Python setup, as of Fall 2022. The Python landscape can be a confusing mess of overlapping tools that sometimes don't work well together. This is an effort to standardize our approach and environments.

Tools and helpful links:

@TheRockStarDBA
TheRockStarDBA / histogram.py
Created July 7, 2022 18:47 — forked from notareverser/histogram.py
Frequency analysis tool
#!/usr/bin/env python3
import argparse
import sys
import mmap
import logging
from collections import defaultdict
@TheRockStarDBA
TheRockStarDBA / Test-FileHash.ps1
Created February 22, 2022 21:15 — forked from potatoqualitee/Test-FileHash.ps1
Simple file hash comparison tool written in PowerShell
function Test-FileHash {
<#
.Synopsis
This is a simple file hash comparison tool that writes to Windows Events when changes are detected
.Description
This is a simple file hash comparison tool that writes to Windows Events when changes are detected
.PARAMETER FilePath
The path to the file to hash and compare
@TheRockStarDBA
TheRockStarDBA / cachedecorator.py
Created February 9, 2022 03:19 — forked from mminer/cachedecorator.py
An example of a Python decorator to simplify caching a function's result.
"""An example of a cache decorator."""
import json
from functools import wraps
from redis import StrictRedis
redis = StrictRedis()
def cached(func):
@TheRockStarDBA
TheRockStarDBA / log4j_rce_detection.md
Created February 2, 2022 22:29 — forked from Neo23x0/log4j_rce_detection.md
Log4j RCE CVE-2021-44228 Exploitation Detection

log4j RCE Exploitation Detection

You can use these commands and rules to search for exploitation attempts against log4j RCE vulnerability CVE-2021-44228

Grep / Zgrep

This command searches for exploitation attempts in uncompressed files in folder /var/log and all sub folders

sudo egrep -I -i -r '\$(\{|%7B)jndi:(ldap[s]?|rmi|dns|nis|iiop|corba|nds|http):/[^\n]+' /var/log
@TheRockStarDBA
TheRockStarDBA / scrapy_lambda_layer.sh
Created January 19, 2022 17:07 — forked from haranjackson/scrapy_lambda_layer.sh
Deploys Python Scrapy library to an AWS Lambda layer. You can specify the region, library version, and runtime.
REGION=eu-west-1
VER=1.7.3
RUNTIME=python3.7
docker run -v $(pwd):/out -it lambci/lambda:build-$RUNTIME \
pip install scrapy==$VER -t /out/build/scrapy/python
cd build/scrapy
zip -r ../../scrapy.zip python/
cd ../..
@TheRockStarDBA
TheRockStarDBA / github-wiki-how-to-image-links.md
Created October 23, 2021 14:05 — forked from TT--/github-wiki-how-to-image-links.md
GitHub Wiki How-To for Image and File links
@TheRockStarDBA
TheRockStarDBA / appendAllLines.ps1
Created July 27, 2021 21:30 — forked from refactorsaurusrex/appendAllLines.ps1
How to call 'File.AppendAllLines' with PowerShell
$path = 'C:\text.txt'
$output = 'This is an output string'
# This works...
[System.IO.File]::WriteAllLines($path, $output)
# But this doesn't. WTF!
[System.IO.File]::AppendAllLines($path, $output)
# Result: 'Cannot find an overload for "AppendAllLines" and the argument count: "2".'