Normalize Identifying Corporate Devices in Your Software

If you dual-license your software in such a way that it requires a paid license for commercial use, here are two code blobs for you.

macOS

pub fn mdm_enrollment() -> eyre::Result<(bool, Option<String>)> {
    let mut command = Command::new("/usr/bin/profiles");
    command.args(["status", "-type", "enrollment"]);
    let stdout = command.output()?.stdout;
    let output = std::str::from_utf8(&stdout)?;
    if output.contains("MDM enrollment: No") {
        return Ok((false, None));
    }

    let mut server = None;

    for line in output.lines() {
        if line.starts_with("MDM server") {
            server = Some(line.trim_start_matches("MDM server: ").to_string())
        }
    }

    Ok((true, server))
}

Windows

pub fn mdm_enrollment() -> eyre::Result<(bool, Option<String>)> {
    let mut command = Command::new("dsregcmd");
    command.args(["/status"]);
    let stdout = command.output()?.stdout;
    let output = std::str::from_utf8(&stdout)?;
    if !output.contains("MdmUrl") {
        return Ok((false, None));
    }

    let mut server = None;

    for line in output.lines() {
        if line.contains("MdmUrl") {
            let line = line.trim().to_string();
            server = Some(line.trim_start_matches("MdmUrl : ").to_string())
        }
    }

    Ok((true, server))
}

Looking at mobile device management (MDM) enrollment is not a silver bullet for identifying corporate devices running your software, but it is a good start.

Read more →

Using Homebrew to Distribute Early Access Binaries from Private Github Repositories

Building for macOS has been… interesting. After falling into the trap of Microsoft’s 10x price gouging for macOS runners on GitHub Actions and ultimately switching to using the Mac Mini under my television as a self-hosted runner, the next thing I wanted to do was distribute my build artifacts.

I’m trying a different approach to building a new project this time around. Maintaining a popular piece of software is very draining, and working on a much-requested port of a popular piece of software to another operating system was not something I wanted to do in public.

Read more →

I Want a Cross-Platform Tiling Window Manager

One of the great things about building your own tools is that you get to have your desired workflow and user experience with very few compromises.

I built Notado because I wanted an archiving and highlighting workflow which treated online comments as first class citizens.

I built Kullish because I wanted to be able to quickly aggregate comments about links from a variety of different online communities.

I built komorebi because I wanted a tiling window manager for Windows.

Read more →