Skip to content

Instantly share code, notes, and snippets.

View FFY00's full-sized avatar
🌈
struggling to live

Filipe Laíns 🇵🇸 FFY00

🌈
struggling to live
View GitHub Profile
import importlib
import types
from typing import Any, Callable
class _staticproperty():
def __init__(self, fget=None, fset=None, fdel=None, doc=None):
self.fget = fget
self.fset = fset
# nothing
@FFY00
FFY00 / piece.py
Last active February 9, 2021 21:27
Microscope tube fit
from solid import *
from solid.utils import *
SEGMENTS = 200
def tube(inner, outer, height):
assert inner < outer
return cylinder(d=outer, h=height) - cylinder(d=inner, h=height)
#!/usr/bin/python
def shift(buf, offset, length):
assert length > 0
left_extra = offset % 8
right_extra = 8 - (offset + length) % 8
start_offset = offset // 8
end_offset = (offset + length - 1) // 8
#!/usr/bin/python
import inspect
def introspect(obj, prefix=None, filter_underscore=False, walked=set()):
try:
for el in inspect.getmembers(obj):
name, child_obj = el
@FFY00
FFY00 / noted.md
Created April 14, 2020 17:30
SymbiFlow meeting #1

SymbiFlow meeting #1

  • What is the current state/timeline?

  • GCC for FPGAs

    • Correct build system
      • Follows the Filesystem Hierarchy Standard (FHS)
        • Allows setting prefix (/usr/local for users, /usr for distributions)
        • Allows setting libdir (lib , lib32 or lib64, distribution dependent)
  • Allows setting libexecdir (if used)

@FFY00
FFY00 / kernel-dev.md
Last active January 9, 2020 23:38
Kernel Development Setup
  1. Create the disk

Let's create a raw disk (you can use other tools like dd too)

qemu-img create -f raw kernel-dev.img 20G

Now install the system

@FFY00
FFY00 / remove-watermark.sh
Created November 14, 2019 02:06
Remove watermark pdf
#!/bin/sh
pdftk $1 output fixed.pdf
pdftk fixed.pdf output uncompressed.pdf uncompress
sed -e 's|/Watermark||g' -e 's|<.*WatermarkSettings.*>||g' uncompressed.pdf > unwatermarked.pdf
pdftk unwatermarked.pdf output compressed.pdf compress
@FFY00
FFY00 / boot-log.txt
Last active April 1, 2024 20:23
Meraki GR10 Logs
U-Boot 2017.07-RELEASE-g78ed34f31579 (Sep 29 2017 - 07:43:44 -0700)
DRAM: 242 MiB
machid : 0x8010001
Product: meraki_Maggot
NAND: ONFI device found
128 MiB
Using default environment
In: serial
@FFY00
FFY00 / ratbag-emu-server-fixture.py
Created September 20, 2019 14:54
ratbag-emu server fixture with random port
@pytest.fixture(autouse=True, scope='session')
@pytest.mark.first
def server(self, port_range=[9000, 9999]):
p = port = None
try:
stdout = open('ratbag-emu-log-stdout.txt', 'w')
stderr = open('ratbag-emu-log-stderr.txt', 'w')
def try_port(port):
ret = False