Skip to content

Instantly share code, notes, and snippets.

@cutrus
cutrus / miniware_p906_m01_force_upgrade.md
Last active January 2, 2026 06:57
Stupid solution to unbrick Miniware MDP-P906 and MDP-M01 that stuck in DFU mode after firmware upgrade

For some reason I can't upgrade my MDP-M01 and MDP-P906 devices to newest firmware (M01: v2.02 and P906: v3.01).
Using .hex files always results in an error, and using .bin files bricks the devices and leaves them stuck in DFU mode.
This issue occurs for me on both Linux and Windows.

I found that after you get an error (your .hex file gets renamed to an .err file), you can flash the internal controller with any .hex file.
The problem is the available space on the device — there is not enough room to copy the full firmware twice.
So I discovered that you can truncate the original .hex file, trigger the error, and then copy the full .hex firmware again.

For example, for my MDP-P906 with new firmware:

@vznncv
vznncv / paramiko_sftp_large_file_downloading_demo.py
Created January 18, 2020 09:26
Workaround to download a large file with paramiko from a sftp server
"""
The script contains example of the paramiko usage for large file downloading.
It implements :func:`download` with limited number of concurrent requests to server, whereas
paramiko implementation of the :meth:`paramiko.SFTPClient.getfo` send read requests without
limitations, that can cause problems if large file is being downloaded.
"""
import logging
import os

The citations game: Wolverton Ratios

Rubric: Software Engineering : Factual Claims : Defect Cost Increase : Wolverton Ratios

Context

See previous note on the IBM Systems Sciences Institute

In absolute numbers, the Wolverton are as follows: 139:455:977:7136:14102, claimed dollar costs of fixing an "average" defect. (Itself an absurd claim, see Leprechauns, I should perhaps write more on that.)

package main
// Here's a half-assed "jepsen" test for nsq_to_file that exercises its
// management of files in -work-dir and -output-dir in the face of multiple
// processes sharing those directories.
//
// Usage:
//
// 1. Ensure that the versions of nsqd & nsq_to_file you intend to test are on
// your $PATH:
@colmmacc
colmmacc / shardcalc.py
Last active January 17, 2025 15:35
Calculate the blast radius of a shuffle shard
import sys
# choose() is the same as computing the number of combinations. Normally this is
# equal to:
#
# factorial(N) / (factorial(m) * factorial(N - m))
#
# but this is very slow to run and requires a deep stack (without tail
# recursion).
#
@Jaza
Jaza / Private-pypi-howto
Last active July 2, 2023 16:24
Guide for how to create a (minimal) private PyPI repo, just using Apache with directory autoindex, and pip with an extra index URL.
*
@jehiah
jehiah / nsq_testing.go
Last active June 30, 2020 08:13
NSQ Producer testing abstraction
package nsqutils
import (
"sync"
"time"
nsq "github.com/nsqio/go-nsq"
)
// Producer is an interface that nsq.Producer fulfills
@lewisd32
lewisd32 / iptableflip.sh
Created April 15, 2015 18:20
Snippet of Unbounce script for restarting HAProxy with zero downtime
echo "Flipping tables! (╯°□°)╯︵ ┻━┻"
num_rules=3
real=3 # exposed to the ELB as port 443
test=4 # used to install test certs for domain verification
health=5 # used by the ELB healthcheck
blue_prefix=855
green_prefix=866
@lukechampine
lukechampine / a.c
Created October 19, 2014 01:00
a.c (with a.h expanded)
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<sys/mman.h>
typedef void V;typedef int I;typedef double F;typedef unsigned char C,*S;typedef long L;
#define O printf
#define R return
#define I(a...) if(a)
#define W(a...) while(a)
@schlamar
schlamar / gioloop.py
Last active November 30, 2017 09:55
Tornado IOLoop implementation with gobject/gtk.
import datetime
import functools
import logging
import os
import time
import gobject
import gtk