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 / 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 / gist:db38b3414720fc8d9e2271ca08d84af6
Created October 22, 2021 12:45
ports and count of connections - powershell Net TCP Connection
Get-NetTCPConnection | Group-Object -Property State, OwningProcess | Select -Property Count, Name, @{Name="ProcessName";Expression={(Get-Process -PID ($_.Name.Split(',')[-1].Trim(' '))).Name}}, Group | Sort Count -Descending
@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".'
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@TheRockStarDBA
TheRockStarDBA / web-servers.md
Created May 13, 2021 12:02 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@TheRockStarDBA
TheRockStarDBA / postgres_resources.md
Last active December 10, 2020 22:12
Postgres Index - resources