Skip to content

Instantly share code, notes, and snippets.

View sentient06's full-sized avatar

Giancarlo Mariot sentient06

  • United Kingdom
  • 08:54 (UTC +01:00)
View GitHub Profile
@sentient06
sentient06 / clean.sh
Created December 3, 2024 10:08
Classic Macintosh Projects - Script for cleaning
#!/bin/bash
if [ $# -ne 1 ] ; then
echo "Syntax: $0 [project_name]"
exit 1
fi
if [ ! -d "$1" ]; then
echo 'The specified folder does not exist'
exit 1
@sentient06
sentient06 / build.sh
Created December 3, 2024 10:09
Classic Macintosh Projects - Script for building
#!/bin/bash
if [ $# -ne 1 ] ; then
echo "Syntax: $0 [project_name]"
exit 1
fi
if [ ! -d "$1" ]; then
echo 'The specified folder does not exist'
exit 1
@sentient06
sentient06 / gist:484a27b556777a35467b2e0a2c3edfe2
Created December 3, 2024 10:10
Classic Macintosh Projects - Script for creating an HFS image
#!/bin/bash
if test "$#" -ne 1; then
echo "Syntax: $0 [input_file]"
exit 1
fi
if [ ! -f "$1" ]; then
echo "Input file not found!"
exit 1
@sentient06
sentient06 / attach-cdrom.sh
Created December 3, 2024 10:11
Classic Macintosh Projects - Script for mounting volume image on QEMU
#!/bin/bash
# Path to your CD-ROM image
CDROM_IMAGE="$1"
# Send commands to QEMU monitor socket
send_monitor_command() {
printf "$1\n" | nc -U /tmp/qemu-monitor.sock
}
@sentient06
sentient06 / build_and_run.sh
Created December 3, 2024 10:11
Classic Macintosh Projects - Script for building and mounting image on QEMU
#!/bin/bash
if [ $# -ne 2 ] ; then
echo "Syntax: $0 [project_name] [should_build = 0 | 1]"
exit 1
fi
if [ ! -d "$1" ]; then
echo 'The specified project folder does not exist'
exit 1
@sentient06
sentient06 / check-qemu.sh
Created December 3, 2024 10:12
Classic Macintosh Projects - Script for checking if QEMU is running
#!/bin/bash
QEMU_SOCKET="/tmp/qemu-monitor.sock"
check_qemu_process() {
pgrep -f "qemu-system-ppc.*mac99" > /dev/null
}
check_monitor_socket() {
[ -S "$QEMU_SOCKET" ] && echo "info status" | nc -U -w 1 "$QEMU_SOCKET" > /dev/null 2>&1