Skip to content

Instantly share code, notes, and snippets.

@uenoB
uenoB / README.en.md
Last active November 14, 2023 17:20
How to set up QEMU working properly on M1 Mac

English | Japanese

How to set up QEMU working properly on M1 Mac

Last-Update: June 8, 2021.

This document describes how to run Windows 10 for ARM and Linux operating systems properly on Apple Silicon (M1) Mac by using open source software only. The combination of [QEMU] and [Alexander Graf's Hypervisor.framework support patch][Alexander Graf's patch] allows us to run Windows 10 and Linux for 64-bit ARM processors on M1 Mac efficiently. Several webpages such as [How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac] and [QEMU on M1 Mac] describe how to set up a QEMU environment with Alex's patch. While they are helpful for the first trial, additional effort is needed to realize a proper QEMU environment that can be used for our daily business.

@uenoB
uenoB / base16.sh
Last active January 11, 2018 07:17
pure-POSIX shell script base64 encoder/decoder
#!/bin/sh
# To the extent possible under law, the author has waived all copyright
# and related or neighboring rights to this software by associating the
# CC0 1.0 (http://creativecommons.org/publicdomain/zero/1.0/) with it.
#
# base16 encoder/decoder.
# usage: base [-D] [filename ...]
# if -D is specified, it decodes input base16 stream.
# otherwise, it encodes input binary data in base16.
@uenoB
uenoB / jpg2tif.rb
Last active September 13, 2019 09:13
encapsulation of jpeg in tiff
#!/usr/bin/env ruby
# To the extent possible under law, the author has waived all copyright
# and related or neighboring rights to this software by associating the
# CC0 1.0 (http://creativecommons.org/publicdomain/zero/1.0/) with it.
#
# This script embeds (possibly multiple) JPEG files into a (possibly
# multi-page) TIFF file. Each of the given files must be a baseline
# YCbCr JPEG file. '-' means stdin. Each JPEG file is embedded in the
# TIFF file as a huge single strip, which is allowed but not recommended
# according to TIFF 6.0 TechNote2. The output is written to the stdout.
@uenoB
uenoB / jpgcom.rb
Last active September 13, 2019 09:13
Ruby script that reads/writes jpeg comment segments
#!/usr/bin/env ruby
# To the extent possible under law, the author has waived all copyright
# and related or neighboring rights to this software by associating the
# CC0 1.0 (http://creativecommons.org/publicdomain/zero/1.0/) with it.
#
# This script reads/writes COM (comment) segments in a jpeg stream.
# usage: ruby jpgcom.rb [-r] [-0|-1|...|-e|-f] [filename ...]
#
# When invoked with no argument, it reads a jpeg stream and writes the
# contents of its COM segments to stdout. If there are multiple COM