art (7 posts)

    Sensor noise art

    2023 Jul 12 #art

    I was playing around with Open Camera with a very long exposure (10 seconds), with a somewhat high ISO (3000ish), with my camera placed against a flat object so it doesn’t see any outside light. This is a great way of capturing sensor noise, though it does seem to be brighter around the outside, and less in the middle. Light leakage? Or just how the sensor works?

    Anyways, I did that, and then played around with every nearly filter the stock photos app on my phone had, which results in some neat wallpapers.

    some pictures i took today

    2023 Apr 18 #art

    I was going into town today, and took the chance to take some pictures.

    You can click them to open them as a JPEG XL for the original size and higher quality. If your browser doesn’t support JPEG XL, try opening it in something that does.

    This was my first time using darktable. I don’t know what I’m doing in it, but at least I managed to nicely censor out the license plates.

    (also, these were taken on the 17th, but i’ve not slept since for it is nearly 1AM, so i still consider that today)

    Trans rights blend

    2021 Feb 07 #art

    I made a trans flag wallpaper in blender!

    I actually made this like a year ago but I’m publishing it now.

    Distortion

    2020 Dec 31 #art

    When writing a box blur implementation, initially I had a fun bug where the rolling sum for values on the left were incorrect, since I did not include early values in the blur. It looks really cool so I kept the code for it.

    If you just want to try it out on your own images, I wrote a JS version.

    Below is the code, with the required fix commented out. This does a box blur on a single row of the image, with a specified width.

    µ [sic]

    2020 Nov 12 #art

    here you go have a full on album ig,,,

    as always source embedded in the files

    music made with (a non-trivial amount of) C

    2020 Nov 10 #art

    There’s a better post to be made about making music with bitshifting but that post is still due to be released on the year of the linux desktop.

    Volume Warning: Is reasonable on my machine. Check yours.

    Source Code: Run strings on the file.

hack (5 posts)

    printf format validation in rust

    2023 Oct 07 #hack

    I was watching a talk about Idris 2 and it was mentioned that you can implement a type safe printf using dependent types (around 10 minutes in).

    And I was wondering if you could do something like that in rust. And you can, ish!

    error[E0308]: mismatched types
       --> src/main.rs:145:13
        |
    145 |     let x = printf::<"that's a %s %s, aged %u!">("cute", "dog");
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `"%s%s"`, found `"%s%s%u"`
        |
        = note: expected constant `"%s%s"`
                   found constant `"%s%s%u"`
    

    That’s done with no macros, just a lot of const code of dubious quality.

    fun with comments

    2023 Aug 14 #hack

    Programming languages typically include one or two ways to comment out code so that the compiler doesn’t read it. One being line comments, such as

    foo(); // comment here
    

    which will comment out any code up until the end of the line, and the other being block comments, such as

    foo(42 /* a 
        good 
        number */ )
    

    which will comment out code in a block.

    Block comments aren’t restricted to a single line, and can sometimes be nested (so that /* /* */ */ behaves correctly).

    But what happens when you mix the two?

    (Misusing) Python Unicode Normalisation

    2020 Oct 24 #hack

    After PEP 3131, python normalises identifiers in order to support non-ASCII identifiers.

    That means that if you write 𝚠 = 50, where that character is U+1D6A0 MATHEMATICAL MONOSPACE SMALL W, you can later refer to that variable as w (or, indeed, anything that normalises into w).

    So I wrote a program to randomly replace every character in some code with any character that normalises into it while trying not to break the program.

    Custom literals in rust

    2020 Sep 25 #hack

    Ever wanted custom literals in rust? No? Too bad!

    let x = "#123456": [[Color]];
    // x is a Color
    

    This runs at compile time. If the parser panics, you get a compile failure. Neat, huh?

    This also doesn’t only work for strings. Any value known at compile time can be used. As long as you can do your processing in a const fn, it’s fair game.

rant (3 posts)

    RFC 35140: The Do-Not-Stab flag in the HTTP Header

    2023 Nov 17 #rant

    Date: March 7, 2111

    Abstract

    This document defines the syntax and semantics of the Do-Not-Stab header, a proposed HTTP header that allows users to indicate to a website their preferences about being stabbed. It also provides a standard for how services should comply with such user preferences, if they wish to.

    Your machine isn't turing complete, so why are you mentioning the halting problem?

    2023 May 01 #rant

    Sometimes I will be part of exchanges such as:

    Me: It would be cool if you could prove the lack of stack overflows in code!

    Someone: Proving that code will not stack overflow is the same as solving the halting problem though.

    Which is very much true, if you demand no false positives. But rather pointless. It’s being overly pedantic as a way of (intentionally or otherwise) being dismissive about useful feature ideas.

    C#'s broken type system

    2020 Jul 02 #rant

    C# has a broken type system. And by that I mean the vast majority of function signatures that you write in C# are lies, and your function won’t be able to do meaningful work with all values that compile, and that there’s nothing you can do to fix this.

security (3 posts)

    Spot the bug: Bad Escape

    2023 Jul 19 #security

    Hi! I wrote some Excellent Javascript that lets you change an image based on the funny little characters you type in the box at the bottom. I’ve vaguely heard of XSS, so I know that I should escape the characters, so I copied the escaping rules from Tera.

    Namely, replacing &, <, >, ", \``, and /` with their associated HTML entities.

    Your task is to call submitFlag with the string value <>. If you succeed, I will alert a fun message for you :)

    PoC Watermark Attack on Restic

    2023 May 20 #security

    First off, does this matter to you? No. No it doesn’t. Unless you’re backing up gigabytes of completely attacker controlled data, to an attacker controlled service, and need to ensure they don’t know you’re backing up said data, it Doesn’t Fucking Matter.

    With that said, it’s a somewhat neat attack!

    A watermarking attack is when an attacker who can get you to store an attacker-controlled piece of data can then detect the presence of that attacker controlled data. It’s not a huge deal, but is a concern if someone is able to inject a watermark into, say, copywritten or leaked content, and then automatically terminate the cloud storage/backup accounts of users that can be shown to have that data on their drive.