Skip to content

Instantly share code, notes, and snippets.

@joshenders
joshenders / usbloadergx_hdd.md
Last active February 5, 2023 04:16
How to format a USB drive for storing GameCube games

Why do we change the cluster size when formatting USB drives for storing GameCube games?

For loading GC Games with USBLoaderGX via DiosMios/Nintendont, format your usb drive's primary partition as FAT32 with 32KB clusters (also known as blocks). This increases performance by reducing the NUMBER of transactions required to perform a read/write operation at the expense of the (very negligible) LENGTH of time to complete a transaction; since it's reading more data per transaction.

I'm not certain, since I can't find a GameCube disk specification, but I don't think the 32KB cluster size is an attempt to imitate the on-disk storage format of retail GameCube discs; which may or may not be 32KB. Retail Wii discs however, actually DO use 32KB clusters. As far as I can tell, 32KB is simply the highest density of bytes per cluster that is supported by FAT32 and of course, by extension, Wii homebrew storage libraries.

If you're concerned about storage efficiency

@joshenders
joshenders / gist:5074637
Last active January 23, 2016 12:51
Fixing Audio Sync issues with mencoder
# Delay audio by 300ms
mencoder -ovc copy -oac copy -audio-delay -0.3 <infile> -o <outfile>
@joshenders
joshenders / Bucket Garden List.md
Last active December 17, 2015 16:49
List of items for Bucket Garden
@joshenders
joshenders / pizza.sh
Created May 31, 2013 07:14
$QUERY_STRING parser
#!/bin/bash
if [[ -z "$QUERY_STRING" ]]; then
# default if $QUERY_STRING is empty
QUERY_STRING="crust=thin&name=jenders&topping=cheese"
fi
crust="$(tr '&' '\n' <<< $QUERY_STRING | awk -F= '/crust/ { print $2 }')"
name="$(tr '&' '\n' <<< $QUERY_STRING | awk -F= '/name/ { print $2 }')"
topping="$(tr '&' '\n' <<< $QUERY_STRING | awk -F= '/topping/ { print $2 }')"
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Basic string exercises
# Fill in the code for the functions below. main() is already set up
#include <stdio.h>
#include <stdlib.h>
void fill(unsigned char* addr, size_t amount) {
unsigned long i;
for (i = 0; i < amount; i++) {
*(addr + i) = 42;
}
}
#include <stdio.h>
#include <stdlib.h>
#define PADDING 255
void fill(unsigned char* addr, size_t buffer) {
unsigned long i;
for (i = 0; i < buffer; i++) {
*(addr + i) = PADDING;
# enable emacs line editing mode for programs with support
set editing-mode emacs
# enable word jumping with alt + arrow
# mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
# - https://code.google.com/p/iterm2/wiki/Keybindings
"\e\e[C": forward-word
"\e\e[D": backward-word
@joshenders
joshenders / gist:7613039
Last active December 29, 2015 04:09
TP-LINK TL-WR307N
RED | BLACK | BLACK | WHITE
_______
|o o o o|
-------
| | | |
| | | `- TP_OUT
| | `- TP_IN
| `- GND
`- VCC
@joshenders
joshenders / gist:7761879
Created December 3, 2013 00:38
Fix a couple of syntax errors that prevent the documentation from building with Texinfo-5.1:
# GNU long options
sed \
--in-place \
--expression 's/@colophon/@@colophon/' \
--expression 's/doc@cygnus.com/doc@@cygnus.com/' bfd/doc/bfd.texinfo
# short options
sed -i -e 's/@colophon/@@colophon/' -e 's/doc@cygnus.com/doc@@cygnus.com/' bfd/doc/bfd.texinfo