Mikaela, Lily, Violet, and Ciri — a plural collective of nerdy, quoiromantic, poly, lesbian computer engineers and leftists.

Current media obsessions: Persona 5, RWBY, Cosmere


atax1a
@atax1a

reposting this from twitter:

someone on discord asked for a quick shell script to burn a small amount (like 10%) of CPU time and we came up with this:

tr '\0' : < /dev/zero | while read -n 128 _it; do sleep 0.01; echo $_it | dd of=/dev/null 2>/dev/null; done

it turns the infinite stream of nulls into an infinite stream of colons, reads it 128 bytes at a time, waits a bit (adjust as necessary) then writes it into the bit bucket 128 bytes at a time.

once the caches warm up, this casually burns cpu time by context-switching and IO


@Qyriad shared with:

You must log in to comment.