Skip to content

Instantly share code, notes, and snippets.

View nonkronk's full-sized avatar
:octocat:
g.dev/nonkronk

Irvan Tristian nonkronk

:octocat:
g.dev/nonkronk
View GitHub Profile
@nonkronk
nonkronk / UpdateAddressList.rsc
Created April 13, 2023 05:38 — forked from tophrr/UpdateAddressList.rsc
MikroTik Address List Updater
## Generic IP address list input
## Based on a script written by Sam Norris, ChangeIP.com 2008
## Edited by ChrisG661, 2021
## Permissions: ftp, read, write, policy, test
# Check if file is not empty
:if ([/file get [/file find name=$filename] size] > 0) do={
# Remove existing addresses from the current address list
# Disabled as script will use same list for different sourcefiles
#/ip firewall address-list remove [/ip firewall address-list find list=$listname]
@nonkronk
nonkronk / update-cupsd-usb-bus.sh
Last active February 24, 2024 16:11
Script to auto-update USB path of printer for CUPSD container on UNRAID
#!/bin/bash
# define the name of cupsd container & printer
CONTAINER_NAME=cupsd
PRINTER_NAME='Seiko Epson Corp. L3110 Series'
# get bus and device number for Seiko Epson Corp. L3110 Series
bus_and_device=$(lsusb | grep -i "${PRINTER_NAME}" | awk '{print $2, $4}' | tr ':' ' ')
# extract bus and device numbers
@nonkronk
nonkronk / shutdown-after-powerloss.sh
Created April 19, 2023 15:21
Script to auto-shutdown UNRAID after x minutes of power loss
#!/bin/bash
#set which hosts will be checked
CHECKHOST1="10.0.0.100"
CHECKHOST2="10.0.0.100"
MAX_FAILS=10
FAILCOUNT=0
GLOBALFAILCOUNT=0
PERIOD=30
@nonkronk
nonkronk / efootball-network-optimization-mikrotik.rsc
Last active January 24, 2025 16:00
eFootball Network Optimization on Mikrotik Router
# eFootball Network Optimization on Mikrotik
# Assuming the target PC/Console IP is 192.168.0.100 with network range of 192.168.0.1-254 and bandwidth of 30mbps/10mbps
# With ether1 as WAN and ether2 as LAN
# Create Mangle for eFootball Traffic
/ip firewall mangle
add action=mark-connection chain=prerouting comment="MARK CONN KONAMI - TCP" \
connection-state=new dst-port=30000-35000 new-connection-mark=konami_conn \
passthrough=yes protocol=tcp src-address=192.168.0.100
@nonkronk
nonkronk / config-plist-opencore-macos-disk-img-unraid.md
Last active December 5, 2024 03:28
Access config.plist OpenCore from a macos_disk.img on Unraid

Access config.plist OpenCore from a macos_disk.img on Unraid

Mount the EFI image with the following commands

modprobe nbd max_part=8
qemu-nbd --connect=/dev/nbd0 /mnt/primary_cache/domains/WORKING-VM/mac_hdd_ng.img
mkdir /mnt/nbd
mount /dev/nbd0p1 /mnt/nbd
@nonkronk
nonkronk / WORKING-VM.xml
Last active February 25, 2024 04:17
macOS Ventura KVM definition
<?xml version='1.0' encoding='UTF-8'?>
<domain type='kvm' id='102' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>WORKING-VM</name>
<uuid>caded4fe-929c-4759-7458-f8526e2c4bd1</uuid>
<description>macOS Ventura</description>
<metadata>
<vmtemplate xmlns="unraid" name="Arch" icon="Apple_old3.png" os="arch"/>
</metadata>
<memory unit='KiB'>16777216</memory>
<currentMemory unit='KiB'>16777216</currentMemory>
@nonkronk
nonkronk / fix-macos-ventura-rx6600-xt-gpu-passthrough-unraid.md
Last active February 25, 2024 00:28
Fix macOS Ventura RX 6600 XT GPU Passthrough on UnRaid

Fix macOS Ventura RX 6600 XT GPU Passthrough on Unraid

Add following qemu arg to the VM's XML::

...
  <qemu:commandline>
...
    <qemu:arg value='-global'/>
 
@nonkronk
nonkronk / fix-macos-ventura-usb-bluetooth-csr5810-hackintosh.md
Last active February 26, 2024 15:49
Fix macOS Ventura USB & Bluetooth CSR5810 Hackintosh

Fix macOS Ventura USB & Bluetooth CSR5810 Hackintosh Unraid

USB fix

Change the default USB Controller from EHCI to nec XHCI / qemu XHCI

Delete all the containing EHCI lines:

...
@nonkronk
nonkronk / install-macos-ventura-sonoma-unraid-amd-5950x-rx6600xt.md
Last active January 14, 2025 08:27
Install macOS Ventura/Sonoma as a VM on Unraid Server using AMD Ryzen 9 5950x + RX 6600 XT

Offline-Install macOS Ventura/Sonoma as a VM on Unraid Server using AMD Ryzen 9 5950x + RX 6600 XT

Installation Preparation

Tools and packages are from OSX-KVM repository.

On Unraid Server

# Download fetch-macOS-v2.py and run_offline.sh script
@nonkronk
nonkronk / easiest-command-snapshot-unraid-vm.md
Last active February 26, 2024 11:18
The easiest command to snapshot Unraid VM

The easiest command to snapshot Unraid VM

cd /mnt/primary_cache/domains/WORKING-VM
cp --reflink=always mac_hdd_ng.img mac_hdd_ng_$(date +%Y_%m_%d)img.