Skip to content

Instantly share code, notes, and snippets.

View Gaarv's full-sized avatar
:atom:

Gaarv Gaarv

:atom:
  • Oslo, Norway
View GitHub Profile
@ruvnet
ruvnet / React-flow-Python.md
Last active April 1, 2025 01:31
This tutorial demonstrates how to create a basic Python Flask implementation with React Flow.

Building Complex Drag & Drop Visual AI Workflows with React Flow and Python Flask

Created by @rUv

React Flow Showcase Image

This tutorial demonstrates how to create a Python Flask implementation with React Flow to build complex AI workflows, reasoning systems, and comprehension modeling tools.

React Flow is a powerful open-source library for building interactive node-based interfaces in React applications. Its flexibility and extensibility make it an excellent choice for creating sophisticated AI applications.

@ruanbekker
ruanbekker / ship_logs_to_loki.py
Created May 27, 2022 14:34
Python Requests to ship logs to Loki API
#!/usr/bin/env python3
# docs: https://grafana.com/docs/loki/latest/api/#post-lokiapiv1push
import requests
import time
# variables
LOKI_USERNAME="x"
LOKI_PASSWORD="x"
LOKI_ENDPOINT="https://loki-api.example.com/loki/api/v1/push"
@rednafi
rednafi / mutator.py
Created March 18, 2022 20:32
Mutate the fields of a dataclass by applying ad-hoc mutation callables.
from __future__ import annotations
import json
from collections.abc import Mapping
from dataclasses import dataclass
from typing import Callable
class Mutator:
def __init_subclass__(
@Neo23x0
Neo23x0 / log4j_rce_detection.md
Last active April 11, 2025 22:49
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
@stephanie-wang
stephanie-wang / sort.py
Created March 18, 2021 18:19
Distributed sort on Ray
import ray
import numpy as np
@ray.remote
def map(data, npartitions):
outputs = [list() for _ in range(npartitions)]
for row in data:
outputs[int(row * npartitions)].append(row)
return tuple(sorted(output) for output in outputs)
@coaxial
coaxial / README.md
Last active December 18, 2024 09:18
unpinning SSL certs on Android apps with Frida to inspect network traffic with mitmproxy

Most of the time, applications won't pin the certificate. Running mitmproxy and passing all Android traffic through it is as simple as adb connect <IP> && adb shell settings put global http_proxy <mitmproxy host>:<mitmproxy port> (or use Android's UI)

Some applications, however, pin the certificate and will refuse to do any network calls if using mitmproxy.

Luckily, Frida is here!

This assumes Android x86 is running in a VM, that you are a developer in Android (tap the build version enough times), adb debugging is enabled, and that android tools are installed on the host.

  • start mitmproxy on host
  • visit mitm.it on the target (after setting the proxy) and install the spoofed cert
@jacopo-j
jacopo-j / frida-spoof.js
Last active February 11, 2025 15:00
Frida script to spoof and hide several Android identifiers
/* Utilities */
var RANDOM = function() {};
function _randomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function _randomHex(len) {
var hex = '0123456789abcdef';
@arose13
arose13 / dask-on-databricks-script.sh
Created January 9, 2020 14:46
How to get Dask to run on Databricks
#!/bin/bash
# CREATE DIRECTORY ON DBFS FOR LOGS
LOG_DIR=/dbfs/databricks/scripts/logs/$DB_CLUSTER_ID/dask/
HOSTNAME=`hostname`
mkdir -p $LOG_DIR
# INSTALL DASK AND OTHER DEPENDENCIES
set -ex
/databricks/python/bin/python -V
. /databricks/conda/etc/profile.d/conda.sh
conda activate /databricks/python
@dazfuller
dazfuller / Pipfile
Last active October 26, 2024 12:09
Multi-process loading of data into MySQL from Python
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
mysql-connector-python = "*"
@YaYaB
YaYaB / merge_bboxes.py
Last active April 17, 2024 08:43
Merge bounding boxes together.
import copy
import cv2
import os
def merge_bboxes(bboxes, delta_x=0.1, delta_y=0.1):
"""
Arguments:
bboxes {list} -- list of bounding boxes with each bounding box is a list [xmin, ymin, xmax, ymax]
delta_x {float} -- margin taken in width to merge