Skip to content

Instantly share code, notes, and snippets.

View nero-dv's full-sized avatar

Louis D. nero-dv

  • Houston, TX
  • 20:44 (UTC -05:00)
View GitHub Profile
@nero-dv
nero-dv / M8P v2.0 boot loader issue and problems configuring CAN.md
Last active April 16, 2025 20:38
Flashing bootloader and klipper to Manta M8P - Backing up the instructions I wrote at https://github.com/bigtreetech/Manta-M8P/issues/85#issuecomment-2702943520

I had the same problem. What ended up happening is that I borked the bootloader on the M8P, and the CM4 could not see the M8P board when I ran the lsusb command. What I ended up doing was flashing the bootloader available in the Manta-M8P/V2.0 repo (link) with dfu-util.

  1. Press and hold the boot0 button of M8P first, then (while holding boot0) click the reset button to make the M8P boot into DFU mode.
  2. You can confirm that the M8P is in DFU mode by running lsusb. The device should show up as 'STMicroelectronics STM Device in DFU Mode'
  3. After running lsusb and confirm that the device is in DFU mode, copy the ID. For my M8P, it was "0483:df11"
  4. While logged in to the CB1/CM4, follow these steps to download and write the bootloader (M8P_V2_H723_bootloader.bin) to the chip:

If you haven't downloaded the bootloader yet, download it first:

@nero-dv
nero-dv / format_drive.sh
Last active April 16, 2025 16:55
Formatting an external drive and starting clean with a GPT partition table. If you run: sudo mkfs.ext4 /dev/sdb, you're formatting the entire raw device as an ext4 without any partition table. This is okay in some specific situations, but generally not recommended for general purpose storage.
read -p "Enter drive path (ex: /dev/sdb): " drivepath
# wipe all partitions on 'drivepath'
sudo wipefs -a $drivepath
# create a gpt partition table, ext4 partition
sudo parted $drivepath mklabel gpt
sudo parted -a opt $drivepath mkpart primary ext4 0% 100%
sudo mkfs.ext4 drivepath\1
$envFilePath = ".env"
Get-Content $envFilePath | ForEach-Object {
$vol = $_
Set-Variable -Name vol -Value $_ -Scope Global
docker run --rm --quiet --volume ${vol}:/backupdata --volume .\exported:/to_export busybox tar czf /to_export/${vol}.tar.gz /backupdata
if ($?) {
Write-Host "Backup of $vol completed successfully."
}
}
$del = Read-Host "Delete volume created during export? (y/n)"
@nero-dv
nero-dv / md5_hash_checker.py
Created December 15, 2024 17:26
Multiprocess MD5 hash checker in Python
import os
import hashlib
from multiprocessing import Pool, cpu_count
def calculate_md5(file_path):
"""Calculate the MD5 hash of a file."""
try:
with open(file_path, 'rb') as f:
md5_hash = hashlib.md5()
for chunk in iter(lambda: f.read(4096), b""):
@nero-dv
nero-dv / vcpkg_Visual-Studio-init.md
Created April 29, 2024 17:28
Install and use vcpkg packages with CMake in Visual Studio

Tutorial: Install and use packages with CMake in Visual Studio

This tutorial shows you how to create a C++ "Hello World" program that uses the fmt library with CMake, vcpkg and Visual Studio. You'll install dependencies, configure, build, and run a simple application.

Prerequisites

1 - Set up vcpkg

@nero-dv
nero-dv / bedlevel.py
Created December 17, 2023 16:56
ABL bed level mesh
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import interp2d
from mpl_toolkits.mplot3d import Axes3D
# Define the grid point values
z = np.array(
[
[1.016, 0.515, 0.112, -0.193, -0.431],
[0.907, 0.426, 0.054, -0.243, -0.478],
@nero-dv
nero-dv / chatgpt_chat_export.js
Created March 9, 2023 01:29
ChatGPT Chat Exports via Tampermonkey
// ==UserScript==
// @name ChatGPT Exporter
// @namespace https://chat.openai.com/chat
// @version 0.1
// @description This script exports the chat history of the ChatGPT chatbot to a file. It is meant to be used with the Tampermonkey extension for Firefox and (Chrome untested).
// @author Louis Del Valle
// @match *://*/*
// @icon
// @grant none
// ==/UserScript==
@nero-dv
nero-dv / arm-cheatsheet.pdf
Created January 18, 2023 07:35 — forked from s-aguado/arm-cheatsheet.pdf
ARMv6-M Instruction Set Cheatsheet
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nero-dv
nero-dv / Old Reddit redirect
Created December 21, 2022 00:04 — forked from tavi-vi/Old Reddit redirect
Seamlessly redirect to old.reddit.com, tampermonkey script
// ==UserScript==
// @name old reddit
// @namespace http://tampermonkey.net/
// @version 0.6
// @description seamlessly redirect to old.reddit.com
// @author Tavi
// @match https://www.reddit.com/*
// @icon https://www.google.com/s2/favicons?domain=reddit.com
// @grant none
// @run-at document-start
@nero-dv
nero-dv / README-Template.md
Created December 6, 2022 09:44 — forked from DomPizzie/README-Template.md
A simple README.md template

Project Title

Simple overview of use/purpose.

Description

An in-depth paragraph about your project and overview of use.

Getting Started