Skip to content

Instantly share code, notes, and snippets.

View operatorequals's full-sized avatar

John Torakis operatorequals

View GitHub Profile
@operatorequals
operatorequals / github-jwt.sh
Last active September 28, 2021 18:56
Github App JWT generator
#!/bin/bash
# Followed the post for JWT construction here:
# https://dev.to/kimmaida/signing-and-validating-json-web-tokens-jwt-for-everyone-25fb
APP_ID="$1"
PRIVATE_KEY="$2"
DATE=$(date +%s)
# All JWT parts must be in 'base64url' -> url compatible base64
# https://www.base64url.com/
# Test case for httpimport
# https://github.com/operatorequals/httpimport/
def hello():
print("Hello world")
@operatorequals
operatorequals / Dockerfile
Last active May 19, 2022 01:06
Cython to ELF multistage build Dockerfile
# Inspired by:
# https://pythonspeed.com/articles/faster-multi-stage-builds/
# Builder image
FROM python:3.7-slim as compile-image
# Install all cython and C toolchain
# Save some space from the compile-image by apt-cleaning and deleting
RUN apt-get update
RUN apt-get install -y --no-install-recommends gcc cython3 python3-dev \
@operatorequals
operatorequals / batsh_api.py
Last active May 3, 2019 11:21
Batsh Online Compiler consumer
#!/usr/bin/env python3
'''
API consumer for the Batsh online compiler
# https://github.com/BYVoid/Batsh
'''
import argparse
import sys
import json
import requests
@operatorequals
operatorequals / python2-win-install.sh
Last active March 30, 2019 01:17
This script will create the aliases python-win, pip-win, pyinstaller-win to a debian installation
#!/bin/bash
PY2_DL="https://www.python.org/ftp/python/2.7.16/python-2.7.16.amd64.msi"
TMP_DIR="/tmp/python-win"
PY2_FILE="$TMP_DIR/python2.msi"
PY2_DIR="Python27"
echo "This script will create the aliases python-win, pip-win, pyinstaller-win to a debian installation"
mkdir -p "$TMP_DIR"
@operatorequals
operatorequals / conn_string_parser.py
Last active May 6, 2018 18:31
Parses Connection Strings like "protocol://[host[:password]]@host[:port]" - supports Public Key passing instead of Password
def parse_conn_string(conn_string):
'''
Parses string like:
smb://username@host:445
sftp://host:22
ssh://host:22
sftp://username#pub_key_path@host:22
sftp://username:password@host:22
sftp://username:password@192.168.1.5:22
@operatorequals
operatorequals / boom.c
Last active May 4, 2018 09:26
Forks itself until condition, when met it goes Boom!
#include "stdio.h"
#include "stdlib.h"
#include "unistd.h"
#include "time.h"
int check(int value){
return (value % 53) == 0;
}
@operatorequals
operatorequals / stealthy_cat.py
Last active April 23, 2018 11:28
Context that replaces the Access/Modification times after file operations (TimeStomping)
#!/usr/bin/env python
import sys
from stealthy_opener import stealth_open as open
try:
file_path = sys.argv[1]
with open(file_path) as f:
print (f.read())
except IndexError:
@operatorequals
operatorequals / word_open.bat
Last active April 23, 2018 17:25
VBS script to Auto Open Microsoft Word
start winword