Skip to content

Instantly share code, notes, and snippets.

@AL-255
AL-255 / DPO.py
Created February 7, 2025 00:12
Parallel DPO Rendering in Python
import math
import numba
from numba import cuda
import numpy as np
import time
@cuda.jit(device=True)
def bresenham_line_gpu(hist, x0, y0, x1, y1):
"""
Draw a line from (x0, y0) to (x1, y1) in 'hist'
@AL-255
AL-255 / updatePCellMaster.il
Created February 3, 2025 08:09
A skill script to automatically update all matser references from one library to another
/*
* AL - updatePCellMaster
* A skill script to automatically update all matser references from one library to another
* Feb 3rd 2025
*/
procedure(updatePCellMaster(libName oldLib newLib)
let((libObj cellObj cellName viewObj viewName cv instances inst instHeader)
libObj = ddGetObj(libName)
when(libObj
foreach(cellObj libObj~>cells
@AL-255
AL-255 / VEML3328.py
Created December 21, 2024 06:36
Raspberry Pi Pico Micropython + VEML3328 sensor
# Micropython interface with the VEML3328 sensor
from machine import Pin, SoftI2C
import utime
i2c = SoftI2C(scl=Pin(21), sda=Pin(20))
print("Started")
for devid in i2c.scan():
print(f"Found Device:{devid}")
@AL-255
AL-255 / update_git_username.sh
Created December 12, 2024 01:48
A script to automatically update your username of all git repos in the current dir
#!/usr/bin/env bash
# Variables
old_user="andylithia"
new_user="AL-255"
# Find all directories containing a .git directory
find . -type d -name ".git" | while read -r gitdir; do
# Get the repository directory (the parent of the .git directory)
repodir=$(dirname "$gitdir")
@AL-255
AL-255 / CF-U1-BIOS.md
Created February 25, 2024 04:56 — forked from Manouchehri/CF-U1-BIOS.md
Recovering the BIOS password from a Panasonic CF-U1 mk2 (AMI Aptio UEFI)

Recovering the BIOS password from a Panasonic CF-U1 mk2 (AMI Aptio UEFI)

A mess of my own making

While messing with a CF-U1 handheld PC that I bought off ebay I managed to mess up the BIOS and it seems it reverted to previous settings which included an unknown BIOS password, it would however still boot into windows. Since I could still boot windows I was able to dump the bios flash using AFUWINGUI.EXE the version I used was 3.09.03.1462 which is available here:
https://ami.com/en/?Aptio_4_AMI_Firmware_Update_Utility.zip

@AL-255
AL-255 / TE105.py
Created February 7, 2024 22:34
Test Equity TE105 Serial Interface
# TestEquity MODBUS Interface
# Ref: https://www.testequity.com/static/manufacturers/testequity-content/rs-232-resources-for-chambers-w-f4-controller
# Ref: https://pymodbus.readthedocs.io/en/latest/source/example/synchronous_client.html
#
from pymodbus.client import ModbusSerialClient
def write_temperature(target_temperature:float, port:str='COM5', address:int=1, verbose:bool=True) -> None:
# Configure the serial port
baudrate = 9600
timeout = 10
@AL-255
AL-255 / gaussian_fit.py
Last active January 30, 2024 17:02
Gaussian Fit of Discrete Data using QR Decomposition
# Gaussian Fit of Discrete Data
#
x = np.array([1, 2, 3, 4, 5])
y = np.array([0.1, 0.4, 0.5, 0.6, 0.5])
def gaussFit(x, y):
len = x.size
a = np.zeros((len,3))
b = np.zeros((len,1))
for i in range(len):
@AL-255
AL-255 / gist:6ac416e0f43bc155bc733b2384776ebc
Created August 25, 2023 00:04
EVENTIDE raspberry pi config
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1
@AL-255
AL-255 / main.py
Created July 30, 2023 17:17 — forked from Lauszus/main.py
Siglent SDS2000X plus hack
import hashlib
SCOPEID = '0000000000000000'
Model = 'SDS2000X+'
# Note that 'AWG' should be used for the 'FG' option
# If you have the 100 MHz model, then first upgrade it to 200 MHz, then 350 MHz and finally 500 MHz
bwopt = ('25M', '40M', '50M', '60M', '70M', '100M', '150M', '200M', '250M', '300M', '350M', '500M', '750M', '1000M', 'MAX', 'AWG', 'WIFI', 'MSO', 'FLX', 'CFD', 'I2S', '1553', 'PWA')
hashkey = '5zao9lyua01pp7hjzm3orcq90mds63z6zi5kv7vmv3ih981vlwn06txnjdtas3u2wa8msx61i12ueh14t7kqwsfskg032nhyuy1d9vv2wm925rd18kih9xhkyilobbgy'
@AL-255
AL-255 / synth.tcl
Created April 11, 2023 15:32
synth.tcl
##################################################
# Innovus Script
##################################################
##################################################
# Setup design
##################################################
set design_name AST_config