Skip to content

Instantly share code, notes, and snippets.

@quadrismegistus
quadrismegistus / pyvis_for_networkx.py
Last active July 20, 2023 12:59
Draw Networkx Graph with Pyvis
def draw_graph3(networkx_graph,notebook=True,output_filename='graph.html',show_buttons=True,only_physics_buttons=False):
"""
This function accepts a networkx graph object,
converts it to a pyvis network object preserving its node and edge attributes,
and both returns and saves a dynamic network visualization.
Valid node attributes include:
"size", "value", "title", "x", "y", "label", "color".
(For more info: https://pyvis.readthedocs.io/en/latest/documentation.html#pyvis.network.Network.add_node)
@soulsearcher
soulsearcher / logstash-openvpn.conf
Last active November 7, 2022 01:56
logstash for openvpn log
input {
# dummy data from files
#file {
# path => "D:/dev/elastic5/sample-logs/vpn/messages-*"
# start_position => "beginning"
#}
beats {
port => 5044
}
@mdonkers
mdonkers / server.py
Last active May 21, 2024 00:06
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