Skip to content

Instantly share code, notes, and snippets.

@drinkcat
Last active February 26, 2025 09:06
Show Gist options
  • Save drinkcat/04b193dce9429205db3a3ed8dca8a7e6 to your computer and use it in GitHub Desktop.
Save drinkcat/04b193dce9429205db3a3ed8dca8a7e6 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Make sure to follow
# https://docs.docker.com/build/building/multi-platform/
# to setup qemu with docker.
set -e -x
image=debian:bookworm-slim
cmd="/usr/bin/seq -80 18.333615880731813 8158"
# Manually copied from https://hub.docker.com/_/debian/tags?name=bookworm-slim
platforms="linux/386 linux/amd64 linux/arm/v5 linux/arm/v7 linux/arm64/v8 linux/mips64le linux/ppc64le linux/s390x"
mkdir -p out
for platform in $platforms; do
# Weirdly, running with `linux/arm/v7` then `linux/arm64/v8`
# does not make docker fetch a new image, prune docker...
# Not recommended if you use docker for some other purpose
yes | docker system prune -a
outfile="out/$(echo $platform | tr '/' '-')"
echo "$platform" > "$outfile"
docker run --platform "$platform" --rm -it "$image" \
sh -c "arch; LANG=C $cmd" >> "$outfile"
done
dos2unix out/*
#!/bin/bash
# Build a cross-matrix of the number of differences
cd out
line2="| --- |"
printf "| X | "
for one in *; do
printf " %s |" $one
line2="${line2} --- |"
done
echo
echo "${line2}"
for one in *; do
printf "| %s |" $one
for two in *; do
# Only look at numbers (not the header...)
cnt="$(diff -u "$one" "$two" | grep -c "^+[0-9]")"
printf " %s |" $cnt
done
echo
done
#Just the last 5 digits:
#paste linux-amd64-rust linux-amd64 linux-arm-v5 | sed -e 's/[0-9\.\-]*\([0-9][0-9][0-9][0-9][0-9]\)\b/\1/g' | wl-copy
host/x86-64/rust linux/amd64 linux/arm/v5
x86_64 x86_64 armv7l
00000 00000 00000
68187 68187 68187
36374 36374 36374
04561 04561 04562
72748 72748 72749
59065 59065 59064
90878 90878 90877
22691 22691 22675
54504 54504 54502
86317 86317 86329
18130 18130 18128
49943 49943 49927
81756 81756 81754
13569 13569 13581
45382 45382 45351
77195 77195 77178
09008 09008 09005
40821 40821 40832
72634 72634 72659
04447 04447 04429
36260 36260 36256
68073 68073 68083
99886 99886 99853
31699 31699 31680
63512 63512 63507
95325 95325 95334
27138 27138 27161
58951 58951 58932
90764 90764 90702
22577 22577 22529
54390 54390 54356
86203 86203 86183
18016 18016 18010
49829 49829 49837
81642 81642 81664
13455 13455 13491
45268 45268 45318
77081 77081 77031
08894 08894 08858
40707 40707 40685
72520 72520 72512
04333 04333 04339
36146 36146 36166
67959 67959 67993
99772 99772 99707
31585 31585 31534
63398 63398 63361
95211 95211 95188
27024 27024 27015
58837 58837 58842
90650 90650 90669
22463 22463 22496
54276 54276 54323
86089 86089 86036
17902 17902 17863
49715 49715 49690
81528 81528 81404
13341 13341 13344
45154 45154 45058
76967 76967 76998
08780 08780 08712
40593 40593 40652
72406 72406 72366
04219 04219 04306
36032 36032 36020
67845 67845 67733
99658 99658 99674
31471 31471 31387
63284 63284 63328
95097 95097 95041
26910 26910 26982
58723 58723 58695
90536 90536 90636
22349 22349 22349
54162 54162 54063
85975 85975 86003
17788 17788 17717
49601 49601 49657
81414 81414 81371
13227 13227 13311
45040 45040 45025
76853 76853 76738
08666 08666 08679
40479 40479 40392
72292 72292 72333
04105 04105 04046
35918 35918 35987
67731 67731 67700
99544 99544 99413
31357 31357 31354
63170 63170 63067
94983 94983 95008
26796 26796 26722
58609 58609 58662
90422 90422 90376
22235 22235 22316
54048 54048 54030
85861 85861 85743
17674 17674 17684
49487 49487 49397
81300 81300 81338
13113 13113 13051
44926 44926 44992
76739 76739 76705
08552 08552 08646
40365 40365 40359
72178 72178 72072
03991 03991 04013
35804 35804 35726
67617 67617 67667
99430 99430 99380
31243 31243 31321
63056 63056 62807
94869 94869 94748
26682 26682 26689
58495 58495 58629
90308 90308 90115
22121 22121 22056
53934 53934 53997
85747 85747 85937
17560 17560 17423
49373 49373 49364
81186 81186 81305
12999 12999 12791
44812 44812 44731
76625 76625 76672
08438 08438 08613
40251 40251 40099
72064 72064 72039
03877 03877 03980
35690 35690 35466
67503 67503 67407
99316 99316 99348
31129 31129 31288
62942 62942 62774
94755 94755 94715
26568 26568 26656
58381 58381 58142
90194 90194 90082
22007 22007 22023
53820 53820 53964
85633 85633 85450
17446 17446 17390
49259 49259 49331
81072 81072 81272
12885 12885 12758
44698 44698 44698
76511 76511 76639
08324 08324 08125
40137 40137 40066
71950 71950 72007
03763 03763 03947
35576 35576 35433
67389 67389 67374
99202 99202 99315
31015 31015 30801
62828 62828 62741
94641 94641 94682
26454 26454 26623
58267 58267 58109
90080 90080 90049
21893 21893 21990
53706 53706 53476
85519 85519 85417
17332 17332 17357
49145 49145 49298
80958 80958 80784
12771 12771 12725
44584 44584 44665
76397 76397 76151
08210 08210 08092
40023 40023 40033
71836 71836 71974
03649 03649 03460
35462 35462 35400
67275 67275 67341
99088 99088 98827
30901 30901 30768
62714 62714 62708
94527 94527 94649
26340 26340 26135
58153 58153 58076
89966 89966 90016
21779 21779 21957
53592 53592 53443
85405 85405 85384
17218 17218 17324
49031 49031 48810
80844 80844 80751
12657 12657 12692
44470 44470 44633
76283 76283 76118
08096 08096 08059
39909 39909 40000
71722 71722 71486
03535 03535 03427
35348 35348 35367
67161 67161 67308
98974 98974 98794
30787 30787 30735
62600 62600 62675
94413 94413 94161
26226 26226 26102
58039 58039 58043
89852 89852 89983
21665 21665 21469
53478 53478 53410
85291 85291 85351
17104 17104 17292
48917 48917 48777
80730 80730 80718
12543 12543 12659
44356 44356 44145
76169 76169 76086
07982 07982 08026
39795 39795 39967
71608 71608 71453
03421 03421 03394
35234 35234 35334
67047 67047 66820
98860 98860 98761
30673 30673 30702
62486 62486 62642
94299 94299 94128
26112 26112 25614
57925 57925 58010
89738 89738 89496
21551 21551 21891
53364 53364 53377
85177 85177 84863
16990 16990 17259
48803 48803 48745
80616 80616 80230
12429 12429 12626
44242 44242 44112
76055 76055 75598
07868 07868 07993
39681 39681 39479
71494 71494 71875
03307 03307 03361
35120 35120 34847
66933 66933 67242
98746 98746 98728
30559 30559 30214
62372 62372 62609
94185 94185 94095
25998 25998 25581
57811 57811 57977
89624 89624 89463
21437 21437 20949
53250 53250 53344
85063 85063 84830
16876 16876 17226
48689 48689 48712
80502 80502 80198
12315 12315 12593
44128 44128 44079
75941 75941 75565
07754 07754 07960
39567 39567 39446
71380 71380 70932
03193 03193 03328
35006 35006 34814
66819 66819 67209
98632 98632 98695
30445 30445 30181
62258 62258 62576
94071 94071 94062
25884 25884 25548
57697 57697 57944
89510 89510 89430
21323 21323 20916
53136 53136 53311
84949 84949 84797
16762 16762 16283
48575 48575 48679
80388 80388 80165
12201 12201 12560
44014 44014 44046
75827 75827 75532
07640 07640 07927
39453 39453 39413
71266 71266 70899
03079 03079 03295
34892 34892 34781
66705 66705 66267
98518 98518 98662
30331 30331 30148
62144 62144 62544
93957 93957 94030
25770 25770 25515
57583 57583 57911
89396 89396 89397
21209 21209 20883
53022 53022 53278
84835 84835 84764
16648 16648 16250
48461 48461 48646
80274 80274 80132
12087 12087 11618
43900 43900 44013
75713 75713 75499
07526 07526 07894
39339 39339 39380
71152 71152 70866
02965 02965 03262
34778 34778 34748
66591 66591 66234
98404 98404 98629
30217 30217 30115
62030 62030 61601
93843 93843 93997
25656 25656 25483
57469 57469 56968
89282 89282 89364
21095 21095 20850
52908 52908 53245
84721 84721 84731
16534 16534 16217
48347 48347 48613
80160 80160 80099
11973 11973 11585
43786 43786 43980
75599 75599 75466
07412 07412 06952
39225 39225 39347
71038 71038 70833
02851 02851 03229
34664 34664 34715
66477 66477 66201
98290 98290 98596
30103 30103 30082
61916 61916 61568
93729 93729 93964
25542 25542 25450
57355 57355 56936
89168 89168 89331
20981 20981 20817
52794 52794 52303
84607 84607 84698
16420 16420 16184
48233 48233 48580
80046 80046 80066
11859 11859 11552
43672 43672 43947
75485 75485 75433
07298 07298 06919
39111 39111 39314
70924 70924 70800
02737 02737 02286
34550 34550 34682
66363 66363 66168
98176 98176 97654
29989 29989 30049
61802 61802 61535
93615 93615 93931
25428 25428 25417
57241 57241 56903
89054 89054 89298
20867 20867 20784
52680 52680 52270
84493 84493 84665
16306 16306 16151
48119 48119 47637
79932 79932 80033
11745 11745 11519
43558 43558 43914
75371 75371 75400
07184 07184 06886
38997 38997 39282
70810 70810 70768
02623 02623 02253
34436 34436 34649
66249 66249 66135
98062 98062 97621
29875 29875 30016
61688 61688 61502
93501 93501 92988
25314 25313 25384
57127 57127 56870
88940 88940 89265
20753 20753 20751
52566 52566 52237
84379 84379 84632
16192 16192 16118
48005 48004 47604
79818 79818 80000
11631 11631 11486
43444 43444 42972
75257 75257 75367
07070 07070 06853
38883 38883 39249
70696 70695 70735
02509 02509 02221
34322 34322 34616
66135 66135 66102
97948 97948 97588
29761 29761 29983
61574 61574 61469
93387 93386 92955
25200 25200 25351
57013 57013 56837
88826 88826 88323
20639 20639 20718
52452 52452 52204
84265 84265 84599
16078 16077 16085
47891 47891 47571
79704 79704 79967
11517 11517 11453
43330 43330 42939
75143 75143 75334
06956 06956 06820
38769 38768 38306
70582 70582 70702
02395 02395 02188
34208 34208 34583
66021 66021 66069
97834 97834 97555
29647 29647 29950
61460 61459 61436
93273 93273 92922
25086 25085 25318
56899 56899 56804
88712 88712 88290
20525 20525 20685
52338 52338 52171
84151 84150 83657
15964 15964 16052
47777 47776 47538
79590 79590 79934
11403 11403 11420
43216 43216 42906
75029 75029 75301
06842 06841 06787
38655 38655 38273
70468 70467 70669
02281 02281 02155
34094 34094 33641
65907 65907 66036
97720 97720 97522
29533 29532 29008
61346 61346 61403
93159 93158 92889
24972 24972 25285
56785 56785 56771
88598 88598 88257
20411 20411 20652
52224 52223 51229
84037 84036 83624
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment