Skip to content

Instantly share code, notes, and snippets.

View dhelonious's full-sized avatar

Dr. Daniel Dizdarevic dhelonious

View GitHub Profile
@dhelonious
dhelonious / analyse_image.py
Created January 22, 2026 00:58
This tool shows the variations in hue, saturation and brightness occurring in an image
#!/bin/env python
"""
This tool shows the variations in hue, saturation and brightness occurring in an
image. Variations are determined by comparing a pixel to the median of the
surrounding 5x5 pixels or by using a bilateral filter that takes edges into
account (option `--edge-detection`). The mapping is non-linear in order to
emphasise small variations.
requirements:
@dhelonious
dhelonious / encode_variations.py
Last active January 20, 2026 20:35
This tool maps the variations in hue, saturation and brightness occurring in an image onto a hue range
#!/bin/env python
"""
This tool maps the variations in hue, saturation and brightness occurring in an
image onto a hue range as follows:
- red: extremely small variations that are usually not visible to the naked eye
- yellow: very small variations
- green: small variations
- blue: medium variations
@dhelonious
dhelonious / convert_threshold.py
Last active January 16, 2026 22:52
A script to convert an image into a time series of black and white images based on the threshold
#!/bin/env python
"""
requirements:
- pillow
"""
from argparse import ArgumentParser
from pathlib import Path
from PIL import Image
@dhelonious
dhelonious / cryptmail.py
Created January 30, 2023 15:20
Python script for sending encrypted e-mails
#!/usr/bin/env python3
# encoding: utf-8
"""
pip install envelope
apt install libmagic-dev
"""
import sys
import argparse
@dhelonious
dhelonious / clipsync.py
Last active December 1, 2022 16:34
Tool for syncing the clipboard buffer into x11 primary selection buffer on clipboard events
#!/usr/bin/env python3
"""
Tool for syncing the clipboard buffer into the x11 primary selection buffer
Requires python gtk+ 3:
sudo apt install python3-gi gir1.2-gtk-3.0
Based on https://github.com/mrichar1/clipster
"""
@dhelonious
dhelonious / arp_detector.py
Created December 23, 2021 15:05
Python script to detect changes made to the ARP table
import scapy.all as scapy
from scapy.all import ARP
def get_mac(ip):
arp_request = ARP(pdst=ip)
br = scapy.Ether(dst="ff:ff:ff:ff:ff:ff")
arp_request_br = br / arp_request
results = scapy.srp(arp_request_br, timeout=5, verbose=False)[0]
@dhelonious
dhelonious / colortool.py
Last active October 7, 2021 06:24
Simple Python script for generatung colors and colormaps
#!/usr/bin/env python
import colorsys as col
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider, Button, RadioButtons, TextBox
NUMBER_OF_COLORS = 8
COLORS = []
TYPE = "sequential"
@dhelonious
dhelonious / texdiff.py
Last active March 11, 2020 07:54
Python script to generate colored diffs of LaTeX files between different git commits
#!/usr/bin/env python
# encoding: utf-8
# pylint: disable=redefined-outer-name
"""
Generate colored diffs of LaTeX files between different git commits.
Usage: texdiff.py [-h] file commit1 [commit2]
Arguments: