Hexhex!


How Realistically Can They Wrap This Show Up In Time?, #12

If this isn’t heading directly into a second cour, the next episode is either going to spend 30 seconds baffling viewers with a summary of each dangling plot element, or ignore the lot of them and just as-you-know-bob the aftermath. They at least briefly showed one of the battles that Team Hero won without significant effort, then moved on to Urban Pacification Through The Power Of Song.

(the Witch of the Highlands says, “my show has fan-art!”)

Random hex strings

If you have Bash 4.1 or newer (Mac users, get it with Homebrew), you can do it this way, without any forking around:

nibbles=32
export LC_ALL=C
read -r -N 1024 hex < /dev/random
hex=${hex//[^0-9A-F]}
echo ${hex:0:$nibbles}

Old-school, and a bit slower:

nibbles=32
export LC_ALL=C
head -c 1024 /dev/random | tr -dc 0-9A-F | cut -c1-$nibbles

Much, much faster, especially in bulk:

count=1000
nibbles=32
openssl rand -hex $(( $nibbles / 2 * $count )) |
    fold -w $nibbles | tr a-f A-F

The LC_ALL=C line is necessary because all the old reliable byte-based tools have been updated to handle multi-byte character encodings. Which means they barf on things that don’t encode correctly, like /dev/random. And, yeah, if I’d wanted to go really old-school, I’d have used dd instead of head -c.

(Lain is not impressed by shell scripts)

Dear Amazon,

Categorizing an adorable kitten as “dog supplies” is just mean.

Your daily reminder that Twitter is garbage

Promoted tweet:

…and so is the Bidenhandler administration

Yes, they’ve finally admitted that our-best-and-brightest drone-murdered an ally and his children to divert attention from their bungling in Afghanistan.

Unicorn chaser: practical applications of kumihimo

I wish to upbraid her…


Comments via Isso

Markdown formatting and simple HTML accepted.

Sometimes you have to double-click to enter text in the form (interaction between Isso and Bootstrap?). Tab is more reliable.