Skip to content

Instantly share code, notes, and snippets.

View plavjanik's full-sized avatar

Petr Plavjaník plavjanik

View GitHub Profile
@Neo23x0
Neo23x0 / log4j_rce_detection.md
Last active June 24, 2024 22:11
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
import urllib2
import string
print "let's download all the GSEUK21 slides we can..."
#for i in string.digits:
for i in ['1','2','3','4','5','6']:
for a in ['A','B','C']:
for b in string.ascii_uppercase:
for ext in ['pdf', 'ppt', 'pptx', 'doc']:
deck = "%s%s%s.%s" % (i,a,b,ext)
FROM rust:alpine
# Install build dependencies
RUN apk --no-cache add git musl-dev
# Download zowex source from GitHub
RUN git clone --depth 1 https://github.com/zowe/zowe-cli.git
# Build zowex binary
RUN cd zowe-cli/zowex && cargo build --verbose --release
@porowns
porowns / python3_extension.build.sh
Created August 19, 2019 15:57
Example build script for Python 3 extension on z/OS
echo "Compiling Types"
eval "xlc -DNDEBUG -O2 -qdll -qexportall -qascii -q64 -qnocse -qfloat=ieee -qgonum -qbitfield=signed -qlanglvl=extc1x -D__MV17195__ -D_XOPEN_SOURCE=600 -I$PYTHON_HOME/include/python3.6m -o types.o -c $PROJECT_ROOT/src/types.c"
eval "xlc -Wl,dll -q64 -qexportall -L$PYTHON_HOME/lib/ -o types.so types.o $PYTHON_HOME/lib/libpython3.6m.x"
echo "Compiling Example"
eval "xlc -DNDEBUG -O2 -qdll -qexportall -qascii -q64 -qnocse -qfloat=ieee -qgonum -qbitfield=signed -qlanglvl=extc1x -D__MV17195__ -D_XOPEN_SOURCE=600 -I$PYTHON_HOME/include/python3.6m -o Example.o -c $PROJECT_ROOT/src/Example.c"
eval "xlc -Wl,dll -q64 -qexportall -L$PYTHON_HOME/lib/ -o Example.so Example.o $PYTHON_HOME/lib/libpython3.6m.x"
@Hakky54
Hakky54 / java_keytool_cheat_sheet.md
Last active July 26, 2024 21:46
Keytool Cheat Sheet - Some list of keytool commands for create, check and verify your keys

Keytool CheatSheet 🔐

Some history

This cheat sheet came into life when I started working on a tutorial of setting up one way tls and two way tls, which can be found here: GitHub - Mutual TLS SSL

Creation and importing

Generate a Java keystore and key pair

keytool -genkeypair -keyalg RSA -keysize 2048 -keystore keystore.jks -alias server -validity 3650
@plavjanik
plavjanik / create_zfs.jcl
Last active June 12, 2024 07:26
JCL that creates a zFS filesystem on z/OS
${jobcard}
//DEFINE EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE CLUSTER (NAME(${prefix}.ZFS) -
LINEAR -
TRACKS(80000 80000) -
SHAREOPTIONS(3))
//CREATE EXEC PGM=IOEFSUTL,REGION=0M,COND=(0,LT),
// PARM=('format -aggregate ${prefix}.ZFS')
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active July 26, 2024 01:19
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).
@lirantal
lirantal / terminal-with-powerline.sh
Last active December 2, 2022 09:19
Hyper terminal + Powerline 9k terminal theme for oh-my-zsh
# Use hyper.is or iTerm2 as terminal emulators
# Install ohmyzsh
# https://github.com/robbyrussell/oh-my-zsh
# Copy over configs from ~/.bash_profile
# For example, it may have the nvm setup or any aliases like exa=ls and cat=bat
# ~/.hyper.js configuration:
copyOnSelect: true
@mdonkers
mdonkers / server.py
Last active July 22, 2024 13:51
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4