Skip to content

Instantly share code, notes, and snippets.

View sentient06's full-sized avatar

Giancarlo Mariot sentient06

  • United Kingdom
  • 23:29 (UTC +01:00)
View GitHub Profile
@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
@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 / 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 / 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 / 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 / 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 / Launchctl_Unload-10.14.sh
Created February 8, 2021 18:09 — forked from mmillar-bolis/Launchctl_Unload-10.14.sh
A Quick Little Script to Force Disable Certain LaunchDaemons in macOS
#!/bin/bash
# I have managed to map out some undesirable daemons and agents. Most of these
# can be disabled without too much consequence.
## Daemons
# com.apple.analyticsd - Anonymized application analytics daemon
# com.apple.appleseed.fbahelperd - Feedback Assistant Helper Daemon
# com.apple.awacsd - Apple Wide Area Connectivity Service Daemon
# com.apple.backupd - Apple TimeMachine service
@sentient06
sentient06 / ruby-ips.rb
Created September 14, 2020 21:36
Ruby script to apply IPS patches.
#!/usr/bin/env ruby
# -*- encoding: US-ASCII -*-
# ruby-ips.rb --Kernigh, March 2009
# This program is in the public domain and has no copyright.
require 'optparse'
filename = nil
sflag = false
@sentient06
sentient06 / RokuRemote.rb
Last active June 6, 2019 10:56
Roku remote
# To run this code, use the IP address of the roku device as such:
# ruby ./RokuRemote.rb 192.168.99.99
require 'io/console'
require 'uri'
require 'net/http'
unless ARGV[0]
puts "Need IP of device"
exit 0
@sentient06
sentient06 / .eslintrc
Created August 11, 2016 09:06 — forked from cletusw/.eslintrc
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names