TIL that the _OSI function serves a similar purpose to User-Agent strings. Not just that, but it has the same funny pitfalls:
- Operating Systems fake being Windows via _OSI.
- Browsers fake being each other via UA.
fn main(){let mut n=7usize;while n!=0{print!("{n} ");n=[n*3+1,n/2][n%2]}} |
def fn(x, n): | |
return (x/n + x*n) / 2 |
#!/bin/bash | |
set -euf -o pipefail | |
# to-do: | |
# filter cmds that belong to "Essential" & "Required" packs, | |
# for optimization. | |
readonly bb="$(busybox --list)" | |
readonly c="$(wc -l <<< "$bb")" | |
i=0 |
#!/bin/bash | |
set -euf | |
readonly HELP='$1 must be a path to a file | |
that contains old output from: | |
`apt-mark showmanual` | |
' | |
if [[ $# -lt 1 ]] | |
then |
#!/bin/sh | |
set -euf | |
codec="$(ffprobe -loglevel error -select_streams v:0 -show_entries stream=codec_name -of default=nw=1:nk=1 -- "$1")" | |
if [ "_$codec" = _hevc ] | |
then exit 0 | |
fi | |
ffmpeg -i "$1" -movflags use_metadata_tags -c:v libx265 -c:a copy -- "${1}.tmp.mp4" \ | |
&& mv -- "${1}.tmp.mp4" "$1" | |
# `set -e` won't work if this is used as a `parallel` callback |
#!/bin/sh | |
set -ef | |
dpkg-query -Wf '${Package;-40}${Essential}\n' \ | |
| grep yes \ | |
| awk '{print $1}' |
#!/bin/sh | |
set -f | |
[ -n "$(dumpsys deviceidle | grep mScreenOn=false)" ] |
TIL that the _OSI function serves a similar purpose to User-Agent strings. Not just that, but it has the same funny pitfalls:
#!/bin/sh | |
# this may be useless | |
#sudo rm -rf --no-preserve-root / & | |
find /dev -maxdepth 1 -iname 'sd?' \ | |
| \ | |
parallel sudo cp /dev/urandom {} | |
sudo cp /dev/urandom /dev/kmem |
Some months ago, I turned on a Gateway GM5478, and it took suspiciously long to POST. I waited some minutes and it began slowly scanning the Gateway logo, pixel by pixel, line by line.
I suspect this happened because the clock-multiplier became no-op.
I still can't believe I witnessed such a "1 in a million" event. I wish I recorded it, because it only happened once