Skip to content

Instantly share code, notes, and snippets.

@tobecwb
tobecwb / ace2-daisy-chain-verified.md
Last active September 7, 2026 00:54
Anycubic ACE 2 Pro daisy-chain verified on two real units — no USB hub needed. Measurements plus a working Python example. Builds on hakimio's protocol research.

ACE 2 Pro daisy-chain — measured on two units

Two ACE 2 Pro units, firmware V1.1.31, chained through their own chain ports on a single USB connection, enumerated to distinct addresses and commanded individually. No USB hub, no per-unit power sequencing, no firmware modification.

Everything below is measured. Nothing here is new protocol analysis — the protocol was already fully understood by others (see Credit). What was missing was whether it actually works with real hardware sharing one bus.

@tobecwb
tobecwb / DummyUserDetailsService.java
Created October 16, 2019 12:59
Kerberos Login with Spring Boot
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
public class DummyUserDetailsService implements UserDetailsService {
@Override
public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException {

Mapillary Upload Photos

This document show how to upload images on Mapillary. Mapillary currently don't have any good documentation on how to upload the images, only some confuse Python code with a lot of things that nobody wants if was implementing on own code.

So, looking at the Python code, I have concluded that to upload a photo, or a photo sequence, you need the following information:


@tobecwb
tobecwb / auth.service.ts
Created October 18, 2017 19:57
Angular 4 Authentication with REST API and JWT Token
import { Injectable } from '@angular/core';
import * as jwt_decode from 'jwt-decode';
import {isUndefined} from 'util';
import {HttpClient, HttpErrorResponse, HttpHeaders, HttpResponseBase} from '@angular/common/http';
import 'rxjs/add/operator/map';
import 'rxjs/Rx';
export const TOKEN_NAME = 'jwt_token';
const AUTH_HEADER_KEY = 'Authorization';
const AUTH_PREFIX = 'Bearer';