Skip to content

Instantly share code, notes, and snippets.

View aggelis's full-sized avatar

Aggelis Aggelis aggelis

View GitHub Profile
@aggelis
aggelis / CLAUDE.md
Created January 3, 2026 23:02 — forked from minimaxir/CLAUDE.md
Python CLAUDE.md (20260101)

Agent Guidelines for Python Code Quality

This document provides guidelines for maintaining high-quality Python code. These rules MUST be followed by all AI coding agents and contributors.

Your Core Principles

All code you write MUST be fully optimized.

"Fully optimized" includes:

@aggelis
aggelis / tap-linux.py
Created March 10, 2024 19:57 — forked from makcuk/tap-linux.py
A simple python tun/tap udp tunnel example
# Simple linux tun/tap device example tunnel over udp
# create tap device with ip tuntap add device0 tap
# set ip address on it and run tap-linux on that device and set desitation ip
# run same on another node, changing dst ip to first node
import fcntl
import struct
import os
import socket
import threading
@aggelis
aggelis / CircuitPython Lesson Push Button & LED
Created February 3, 2024 14:50
CircuitPython Lesson: Push Button & LED
import board
import digitalio
import time
btn1 = digitalio.DigitalInOut(board.GP20)
btn1.direction = digitalio.Direction.INPUT
btn1.pull = digitalio.Pull.UP
led1 = digitalio.DigitalInOut(board.GP2)
led2 = digitalio.DigitalInOut(board.GP3)
@aggelis
aggelis / ubuntu-20.04-macbook-pro.md
Created November 26, 2023 17:05 — forked from johnjeffers/ubuntu-20.04-macbook-pro.md
Ubuntu 20.04 on a 15" Retina MacBook Pro (Mid-2014)

Ubuntu 20.04 on a 15" Retina MacBook Pro (Mid-2014)

These are notes from my efforts to get Ubuntu 20.04 installed on my older MacBook Pro. I'm making this gist public in the hopes that it's helpful to others.

I did a Minimal install, but selected the option to install additional 3rd-party drivers.

Wifi doesn't work during the install (because it requires a 3rd-party driver), so you won't be able to choose to download updates while installing. No big deal, run a software update after the install.

The installer takes about 25 minutes to complete. Post-install, most things work. The only driver I had to manually install was for the FaceTime camera. More on that below.

@aggelis
aggelis / linting.md
Created October 13, 2023 21:09 — forked from jlmelville/linting.md
Setting up Python linting with VS Code

I set up my linters for use with VS Code, so I only use the linting tools that can be integrated into the Problems tab, but these can be used from the command line. I have attempted to avoid having different tools give duplicate warnings, but this is a work in progress. The VS code settings.json is at https://gist.github.com/jlmelville/74d8fe778b0d89574e82ffe47c1e49ae.

Create a linting-requirements.txt file:

# this also installs pylint and pycodestyle
bandit
prospector[with_pyroma]
flake8
black
@aggelis
aggelis / interval.py
Created June 1, 2023 14:52 — forked from bbengfort/interval.py
Run a function every n seconds using Python threading.
from threading import Timer
from functools import partial
class Interval(object):
def __init__(self, interval, function, args=[], kwargs={}):
"""
Runs the function at a specified interval with given arguments.
"""
self.interval = interval
@aggelis
aggelis / proc_net_tcp_decode
Created January 9, 2023 12:18 — forked from jkstill/proc_net_tcp_decode
decode entries in /proc/net/tcp
Decoding the data in /proc/net/tcp:
Linux 5.x /proc/net/tcp
Linux 6.x /proc/PID/net/tcp
Given a socket:
$ ls -l /proc/24784/fd/11
lrwx------ 1 jkstill dba 64 Dec 4 16:22 /proc/24784/fd/11 -> socket:[15907701]
@aggelis
aggelis / 0_README.md
Created December 7, 2022 07:28 — forked from mottosso/0_README.md
Bi-directional communication over Popen

Bi-directional Communication over Popen

This gist illustrates how two processes can exchange information via subprocess.Popen.

untitled

Goal

Integrate an externally running user interface, potentially written in another language. For example, a GUI written in PyQt5 and Python 3 running inside of Autodesk Maya (Python 2.7, PySide).

@aggelis
aggelis / 0_README.md
Created December 7, 2022 07:28 — forked from mottosso/0_README.md
Bi-directional communication over Popen

Bi-directional Communication over Popen

This gist illustrates how two processes can exchange information via subprocess.Popen.

untitled

Goal

Integrate an externally running user interface, potentially written in another language. For example, a GUI written in PyQt5 and Python 3 running inside of Autodesk Maya (Python 2.7, PySide).

@aggelis
aggelis / udp-spoof.py
Created October 12, 2022 09:13 — forked from iamshreeram/udp-spoof.py
Simple python code to spoof udp source and destination
from scapy.all import *
import time
ip = IP(dst='127.0.0.127', src='10.99.99.99')
udp = UDP(sport=321,dport=123)
payload = '\x01\x0f'
packet = ip/udp/payload
send(packet)
while(True):