Skip to content

Instantly share code, notes, and snippets.

@haginara
haginara / React-flow-Python.md
Created October 9, 2024 01:02 — forked from ruvnet/React-flow-Python.md
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.

@haginara
haginara / mongo_ipv4_codes.py
Created May 1, 2020 17:41
Mongo Custom IP Field for PyMongo
import ipaddress
from bson.codec_options import TypeCodec
from bson.codec_options import TypeRegistry
from bson.codec_options import CodecOptions
from bson.int64 import Int64
class IPv4Codec(TypeCodec):
python_type = ipaddress.IPv4Address
bson_type = Int64
def transform_python(self, value):
@haginara
haginara / dns_over_https.go
Created February 27, 2020 23:59
Example code to query dns to cloudflare-dns.com
package main
import (
"encoding/json"
"log"
"fmt"
"net/http"
)
type DNSQuestion struct {
@haginara
haginara / msrc.py
Last active May 14, 2024 17:13
Getting Microsoft Security Update from api.msrc.microsoft.com via Python
# coding: utf-8
from dataclasses import dataclass, asdict, field
from typing import Dict, List, Optional
import pprint
import json
try:
import requests
except ImportError:
raise SystemExit("Please install 'requests' first")
@haginara
haginara / audit-ioctl-osx.py
Created November 19, 2019 22:59
IOCTLs for OSX Audit
#from ioctl_opt import IOC, IO, IOC_READ, IOC_WRITE, IOR, IOW
from fcntl import ioctl
import ctypes
#https://github.com/apple/darwin-xnu/blob/0a798f6738bc1db01281fc08ae024145e84df927/bsd/security/audit/audit_ioctl.h
#/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/ioccom.h
AUDITPIPE_IOBASE = ord('A')
AUDITSDEV_IOBASE = ord('S')
##========================================================================================================================
#@(#)ioccom.h 8.2 (Berkeley) 3/28/94
@haginara
haginara / nsm_status.py
Last active October 9, 2019 21:45
Get NSM status to dict()
#!/usr/bin/env python3
import os
import re
import sys
import json
import argparse
import pprint
import logging
@haginara
haginara / timeconvert.py
Created October 8, 2019 20:29
Converting timetstamp between diffract timezones.
import time
from datetime import datetime, timedelta
# pip install pytz is required.
from pytz import timezone
import pytz
import os
import sys
import argparse
@haginara
haginara / zeek-cut.py
Last active September 27, 2019 23:07
zee-cut script with python3
#!/usr/bin/env python3
import os
import sys
import csv
import json
import logging
import pprint
import time
@haginara
haginara / ec_check_health.py
Created August 29, 2018 23:51
Check Health status of Elasticsearch on Windows
import ctypes
import requests
ctypes.windll.user32.MessageBoxW(0, "Start", "start", 0)
check = False
while True:
data = requests.get('http://elk.nexon.net:9200/_cluster/health').json()
status = data.get('status')
if status == 'green':
if check is False:
ctypes.windll.user32.MessageBoxW(0, "Green", "Green", 0)
@haginara
haginara / windows_update.py
Created August 29, 2018 01:04
Windows Update Scripts
import argparse
import win32com
import win32com.client
import os
import re
try:
import _winreg as winreg
except ImportError:
import winreg