Skip to content

Instantly share code, notes, and snippets.

@jakebrinkmann
Last active December 12, 2024 00:53
Show Gist options
  • Save jakebrinkmann/577dfbb8a63f382cd5ed87f50a662b31 to your computer and use it in GitHub Desktop.
Save jakebrinkmann/577dfbb8a63f382cd5ed87f50a662b31 to your computer and use it in GitHub Desktop.

Revisions

  1. jakebrinkmann revised this gist Dec 12, 2024. 1 changed file with 12 additions and 5 deletions.
    17 changes: 12 additions & 5 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -29,11 +29,18 @@ curl -fSLo /tmp/BIOS.zip \
    https://github.com/Abdess/retroarch_system/releases/download/v20220308/Batocera_V34-dev.zip \
    && unzip -n /tmp/BIOS.zip -d /userdata/

    rsync -av --progress \
    /media/TOSHIBA_3TB_EXT/downloads/1G1R\ -\ No-Intro\ -\ Nintendo\ -\ N64/*Mario*.zip \
    "/userdata/roms/n64/roms/"
    ln -sf \
    "/media/TOSHIBA_3TB_EXT/downloads/Nintendo - N64/" \
    /userdata/roms/n64/

    rsync -av --progress \
    /media/TOSHIBA_3TB_EXT/downloads/1G1R\ -\ Redump\ -\ Nintendo\ -\ GameCube/*Mario*.rvz \
    ln -sf \
    "/media/TOSHIBA_3TB_EXT/downloads/Nintendo - GameCube/" \
    /userdata/roms/gamecube/

    ln -sf \
    "/media/TOSHIBA_3TB_EXT/downloads/Nintendo - Game Boy Advance/" \
    /userdata/roms/gba/

    # > it is recommended to use direct downloads with a download manager instead of torrents...
    # - https://r-roms.github.io/megathread/popular/
    ```
  2. jakebrinkmann revised this gist Dec 10, 2024. 2 changed files with 21 additions and 13 deletions.
    24 changes: 21 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,13 @@
    # ${PROJECT}

    > "A good game is like a good book or a good movie, it transports you to another world." -- Shigeru Miyamoto, game designer
    > "A good game is like a good book or a good movie, it transports you to another world."
    > -- Shigeru Miyamoto, game designer
    [Batocera.linux](https://batocera.org/download) is a popular choice for retro gaming enthusiasts due to its ease of use, extensive compatibility, and seamless user experience. An open-source and completely free retro-gaming distribution, it can be copied to a USB stick or SD card, turning any computer/nano computer into a gaming console. It supports many emulators and game engines out of the box.

    > [!WARNING]
    > Seems like batocera conflicts with Plex/\*arr server setup
    ![](https://picsum.photos/900/300)

    ## Hardware
    @@ -14,8 +18,22 @@
    ## Misc Setup

    ```bash
    cat >> ~/.ssh/config <<EOF
    Host batocera.local
    StrictHostKeyChecking no
    UserKnownHostsFile=/dev/null
    EOF
    ssh [email protected]

    unzip "/mnt/media/downloads/1G1R - No-Intro - Nintendo - N64/Mario Kart 64 \(USA\).zip" \
    -d "/mnt/media/roms/n64/roms"
    curl -fSLo /tmp/BIOS.zip \
    https://github.com/Abdess/retroarch_system/releases/download/v20220308/Batocera_V34-dev.zip \
    && unzip -n /tmp/BIOS.zip -d /userdata/

    rsync -av --progress \
    /media/TOSHIBA_3TB_EXT/downloads/1G1R\ -\ No-Intro\ -\ Nintendo\ -\ N64/*Mario*.zip \
    "/userdata/roms/n64/roms/"

    rsync -av --progress \
    /media/TOSHIBA_3TB_EXT/downloads/1G1R\ -\ Redump\ -\ Nintendo\ -\ GameCube/*Mario*.rvz \
    /userdata/roms/gamecube/
    ```
    10 changes: 0 additions & 10 deletions batocera-usb.sh
    Original file line number Diff line number Diff line change
    @@ -61,13 +61,7 @@ echo " vi /boot/batocera-boot.conf"

    # Audio Setup
    echo "To configure audio settings:"
    echo "1. Run the following commands to list devices:"
    echo " aplay -L"
    echo " batocera-audio list"
    echo " batocera-audio list-profiles"
    echo "2. Adjust settings in the Batocera menu or KODI:"
    echo " - Navigate to System Settings > Hardware Audio Output."
    echo " - Ensure the audio profile matches your device."

    # Example: Checking KODI audio passthrough settings
    echo "To verify KODI settings:"
    @@ -78,10 +72,6 @@ echo "To update to a new version:"
    echo " batocera-check-updates butterfly"
    echo " batocera-upgrade https://updates.batocera.org/x86_64/butterfly/last"

    # Change ROM location:
    echo "To add external drive for ROMs:"
    echo " - Navigate to System Settings > Storage Device"

    echo "#================================================================================"
    echo "All tasks completed. Enjoy your Batocera setup!"
    echo "#================================================================================"
  3. jakebrinkmann revised this gist Dec 10, 2024. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions batocera-usb.sh
    Original file line number Diff line number Diff line change
    @@ -80,9 +80,7 @@ echo " batocera-upgrade https://updates.batocera.org/x86_64/butterfly/last"

    # Change ROM location:
    echo "To add external drive for ROMs:"
    echo " blkid | grep SHARE"
    echo " echo 'sharedevice=DEVICES' >> /media/BATOCERA/batocera-boot.conf"
    echo " echo 'sharedevice_part1=SHARE@12e46ca9-xxxx-xxxx-xxxx-xxxxxxxxxx:/media/roms' >> /media/BATOCERA/batocera-boot.conf"
    echo " - Navigate to System Settings > Storage Device"

    echo "#================================================================================"
    echo "All tasks completed. Enjoy your Batocera setup!"
  4. jakebrinkmann revised this gist Dec 10, 2024. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions batocera-usb.sh
    Original file line number Diff line number Diff line change
    @@ -73,6 +73,17 @@ echo " - Ensure the audio profile matches your device."
    echo "To verify KODI settings:"
    echo " grep -RI hdmi .kodi/userdata/"

    # Check for updates
    echo "To update to a new version:"
    echo " batocera-check-updates butterfly"
    echo " batocera-upgrade https://updates.batocera.org/x86_64/butterfly/last"

    # Change ROM location:
    echo "To add external drive for ROMs:"
    echo " blkid | grep SHARE"
    echo " echo 'sharedevice=DEVICES' >> /media/BATOCERA/batocera-boot.conf"
    echo " echo 'sharedevice_part1=SHARE@12e46ca9-xxxx-xxxx-xxxx-xxxxxxxxxx:/media/roms' >> /media/BATOCERA/batocera-boot.conf"

    echo "#================================================================================"
    echo "All tasks completed. Enjoy your Batocera setup!"
    echo "#================================================================================"
  5. jakebrinkmann revised this gist Dec 10, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,7 @@
    ## Misc Setup

    ```bash
    git clone https://github.com/Abdess/retroarch_system.git /userdata/bios/
    ssh [email protected]

    unzip "/mnt/media/downloads/1G1R - No-Intro - Nintendo - N64/Mario Kart 64 \(USA\).zip" \
    -d "/mnt/media/roms/n64/roms"
  6. jakebrinkmann revised this gist Dec 10, 2024. 2 changed files with 89 additions and 2 deletions.
    13 changes: 11 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,21 @@
    # ${PROJECT}

    > QUOTE
    > "A good game is like a good book or a good movie, it transports you to another world." -- Shigeru Miyamoto, game designer
    Description...
    [Batocera.linux](https://batocera.org/download) is a popular choice for retro gaming enthusiasts due to its ease of use, extensive compatibility, and seamless user experience. An open-source and completely free retro-gaming distribution, it can be copied to a USB stick or SD card, turning any computer/nano computer into a gaming console. It supports many emulators and game engines out of the box.

    ![](https://picsum.photos/900/300)

    ## Hardware

    - I use a used [Dell Optiplex 7040 Micro Tower, Intel Core i5-6500T, 8 GB Memory, 256 GB SSD](https://www.amazon.com/Dell-Optiplex-i5-6500T-Certified-Refurbished/dp/B01NA98UZX) purchased for $50
    - I set it up after flashing a [batocera-usb](./batocera-usb.sh)

    ## Misc Setup

    ```bash
    git clone https://github.com/Abdess/retroarch_system.git /userdata/bios/

    unzip "/mnt/media/downloads/1G1R - No-Intro - Nintendo - N64/Mario Kart 64 \(USA\).zip" \
    -d "/mnt/media/roms/n64/roms"
    ```
    78 changes: 78 additions & 0 deletions batocera-usb.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,78 @@
    #!/bin/bash
    # Batocera Update Script - Version 40
    # Date: 2024-12-10

    # Set the Batocera image URL and download directory
    FILE_URL="https://updates.batocera.org/x86_64/stable/last/batocera-x86_64-40-20240801.img.gz"
    DOWNLOAD_DIR="/tmp"

    # Step 1: Download the specified Batocera image to /tmp
    echo "Downloading the Batocera image from $FILE_URL to $DOWNLOAD_DIR..."
    IMAGE_FILE="$DOWNLOAD_DIR/$(basename $FILE_URL)"
    curl -fSLo $IMAGE_FILE $FILE_URL

    # Step 2: Prompt the user to choose the target USB device
    echo "Identifying available USB drives..."
    echo "Available drives and descriptions:"
    lsblk -o NAME,SIZE,MODEL,TYPE | grep disk

    echo ""
    echo "WARNING: Be careful to select the correct drive. Writing to the wrong drive will erase all data on it."
    read -p "Enter the target drive name (e.g., sda, sdb, etc.): " TARGET_DRIVE

    if [ -z "$TARGET_DRIVE" ]; then
    echo "No drive selected. Exiting."
    exit 1
    fi

    TARGET_PATH="/dev/$TARGET_DRIVE"

    # Confirm the user's choice
    echo "You selected $TARGET_PATH. Are you sure you want to proceed? (yes/no)"
    read -r CONFIRM

    if [ "$CONFIRM" != "yes" ]; then
    echo "Operation canceled by user."
    exit 1
    fi

    # Step 3: Extract and write the image to the target drive
    IMAGE_FILE="$DOWNLOAD_DIR/$(basename $FILE_URL)"
    echo "Flashing Batocera image to $TARGET_PATH..."
    gunzip -c $IMAGE_FILE | sudo dd status=progress of=$TARGET_PATH conv=fsync
    sync
    sudo eject $TARGET_PATH
    echo "#================================================================================"
    echo "Image flashed and drive ejected."
    echo "#================================================================================"

    #================================================================================

    # SSH Access
    # Access Batocera via SSH using one of the following:
    # Default username: root
    # Default password: linux
    echo "Access Batocera via SSH:"
    echo " ssh [email protected] or ssh root@<Batocera_IP>"

    # Editing Boot Configuration
    echo "To edit the boot configuration:"
    echo " vi /boot/batocera-boot.conf"

    # Audio Setup
    echo "To configure audio settings:"
    echo "1. Run the following commands to list devices:"
    echo " aplay -L"
    echo " batocera-audio list"
    echo " batocera-audio list-profiles"
    echo "2. Adjust settings in the Batocera menu or KODI:"
    echo " - Navigate to System Settings > Hardware Audio Output."
    echo " - Ensure the audio profile matches your device."

    # Example: Checking KODI audio passthrough settings
    echo "To verify KODI settings:"
    echo " grep -RI hdmi .kodi/userdata/"

    echo "#================================================================================"
    echo "All tasks completed. Enjoy your Batocera setup!"
    echo "#================================================================================"
  7. jakebrinkmann revised this gist Dec 10, 2024. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -14,6 +14,18 @@ services:
    - PGID=${PGID}
    - TZ=${TIMEZONE}
    restart: unless-stopped

    watchtower:
    image: containrrr/watchtower
    container_name: watchtower
    environment:
    - TZ=${TIMEZONE}
    - WATCHTOWER_CLEANUP=true
    - WATCHTOWER_INCLUDE_STOPPED=true
    - WATCHTOWER_SCHEDULE=0 0 3 * * *
    restart: unless-stopped
    volumes:
    - /var/run/docker.sock:/var/run/docker.sock
    # romm:
    # image: rommapp/romm:latest
    # container_name: romm
  8. jakebrinkmann revised this gist Dec 10, 2024. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -3,10 +3,12 @@ services:
    image: lscr.io/linuxserver/emulatorjs
    container_name: emulatorjs
    ports:
    - 3000:3000
    - 3000:3000 # configuration backend
    - 80:3080 # WebApp
    # - 4001:4001 # IPFS peering (for artwork)
    volumes:
    - ${ROMS_PATH}:/data
    - ${CONFIG_PATH}/emulatorjs:/config
    - ${CONFIG_PATH}/emulatorjs:/config # store user profiles
    environment:
    - PUID=${PUID}
    - PGID=${PGID}
  9. jakebrinkmann revised this gist Dec 10, 2024. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -5,3 +5,8 @@
    Description...

    ![](https://picsum.photos/900/300)

    ```bash
    unzip "/mnt/media/downloads/1G1R - No-Intro - Nintendo - N64/Mario Kart 64 \(USA\).zip" \
    -d "/mnt/media/roms/n64/roms"
    ```
  10. jakebrinkmann revised this gist Dec 10, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ services:
    ports:
    - 3000:3000
    volumes:
    - ${ROMS_PATH}/roms:/data
    - ${ROMS_PATH}:/data
    - ${CONFIG_PATH}/emulatorjs:/config
    environment:
    - PUID=${PUID}
  11. jakebrinkmann revised this gist Dec 10, 2024. 1 changed file with 45 additions and 0 deletions.
    45 changes: 45 additions & 0 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -12,3 +12,48 @@ services:
    - PGID=${PGID}
    - TZ=${TIMEZONE}
    restart: unless-stopped
    # romm:
    # image: rommapp/romm:latest
    # container_name: romm
    # restart: unless-stopped
    # environment:
    # - DB_HOST=romm-db
    # - DB_NAME=romm # Should match MARIADB_DATABASE in mariadb
    # - DB_USER=romm-user # Should match MARIADB_USER in mariadb
    # - DB_PASSWD=${MARIADB_PASSWORD} # Should match MARIADB_PASSWORD in mariadb
    # volumes:
    # - romm_resources:/romm/resources # Resources fetched from IGDB (covers, screenshots, etc.)
    # - romm_redis_data:/redis-data # Cached data for background tasks
    # - /path/to/library:/romm/library # Your game library. Check https://github.com/rommapp/romm?tab=readme-ov-file#folder-structure for more details.
    # - /path/to/assets:/romm/assets # Uploaded saves, states, etc.
    # - /path/to/config:/romm/config # Path where config.yml is stored
    # ports:
    # - 80:8080
    # depends_on:
    # romm-db:
    # condition: service_healthy
    # restart: true
    #
    # romm-db:
    # image: mariadb:latest
    # container_name: romm-db
    # restart: unless-stopped
    # environment:
    # - MARIADB_ROOT_PASSWORD= # Use a unique, secure password
    # - MARIADB_DATABASE=romm
    # - MARIADB_USER=romm-user
    # - MARIADB_PASSWORD=${MARIADB_PASSWORD}
    # volumes:
    # - mysql_data:/var/lib/mysql
    # healthcheck:
    # test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
    # start_period: 30s
    # start_interval: 10s
    # interval: 10s
    # timeout: 5s
    # retries: 5
    #
    # volumes:
    # mysql_data:
    # romm_resources:
    # romm_redis_data:
  12. jakebrinkmann revised this gist Dec 10, 2024. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions .env
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    TIMEZONE=America/Chicago
    PUID=1001
    PGID=1001
    CONFIG_PATH=/configs
    MEDIA_PATH=/mnt/media
    ROMS_PATH=${MEDIA_PATH}/roms
  13. jakebrinkmann revised this gist Dec 10, 2024. 2 changed files with 15 additions and 36 deletions.
    37 changes: 1 addition & 36 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,42 +1,7 @@
    # ${PROJECT}

    > QUOTE
    Description...

    ![](https://picsum.photos/900/300)

    #### Contents

    * [About](#about-)
    * [Dependencies](#dependencies-)
    * [Usage](#usage-)
    * [Development](#development-)
    * [Contributing](#contributing-)
    * [Meta](#meta-)

    ## About [&#x219F;](#contents)


    ## Dependencies [&#x219F;](#contents)


    ## Usage [&#x219F;](#contents)


    ## Development [&#x219F;](#contents)


    ## Contributing [&#x219F;](#contents)

    - No contribution is too small!
    - Please submit as many fixes for typos and grammar bloopers as you can!
    - Try to limit each pull request to one change only.

    ## Meta [&#x219F;](#contents)

    See `LICENSE.txt` for more information.

    ---
    ---

    [&#x219F; Back to Top &#x219F;](#readme)
    14 changes: 14 additions & 0 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    services:
    emulatorjs:
    image: lscr.io/linuxserver/emulatorjs
    container_name: emulatorjs
    ports:
    - 3000:3000
    volumes:
    - ${ROMS_PATH}/roms:/data
    - ${CONFIG_PATH}/emulatorjs:/config
    environment:
    - PUID=${PUID}
    - PGID=${PGID}
    - TZ=${TIMEZONE}
    restart: unless-stopped
  14. jakebrinkmann created this gist Dec 10, 2024.
    42 changes: 42 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,42 @@
    # ${PROJECT}
    > QUOTE
    Description...

    ![](https://picsum.photos/900/300)

    #### Contents

    * [About](#about-)
    * [Dependencies](#dependencies-)
    * [Usage](#usage-)
    * [Development](#development-)
    * [Contributing](#contributing-)
    * [Meta](#meta-)

    ## About [&#x219F;](#contents)


    ## Dependencies [&#x219F;](#contents)


    ## Usage [&#x219F;](#contents)


    ## Development [&#x219F;](#contents)


    ## Contributing [&#x219F;](#contents)

    - No contribution is too small!
    - Please submit as many fixes for typos and grammar bloopers as you can!
    - Try to limit each pull request to one change only.

    ## Meta [&#x219F;](#contents)

    See `LICENSE.txt` for more information.

    ---
    ---

    [&#x219F; Back to Top &#x219F;](#readme)