Skip to content

Instantly share code, notes, and snippets.

View einsteinx2's full-sized avatar

Ben Baron einsteinx2

View GitHub Profile
@einsteinx2
einsteinx2 / fix_old_xcode.sh
Created December 23, 2022 18:54
Fix old Xcode to run on new macOS
#!/bin/sh
# https://stackoverflow.com/a/74500488/299262
set -euo pipefail
# Set the paths to your Old/New Xcodes
OLD_XCODE="/Applications/Xcode-13.4.1.app"
NEW_XCODE="/Applications/Xcode.app" # To get build number
# Get New Xcode build number
@einsteinx2
einsteinx2 / sign-fluid-app
Last active June 17, 2022 20:31
Script to properly code sign Fluid web apps to prevent various issues due to macOS security checks (requires Apple developer account)
#!/bin/bash
# View xattrs: `xattr -lr SomeApp.app`
# Confirm signature: `spctl -a -v SomeApp.app`
# Print signature information (Fluid apps have a signature but it's invalid): `codesign -dv --verbose=4 SomeApp.app`
# NOTE: I seem to get this error, but it doesn't affect usage in any way:
# "SomeApp.app: invalid resource directory (directory or signature have been modified)"
# Information used to create this script:
# https://stackoverflow.com/questions/18441268/codesign-app-file-in-command-line
#!/usr/bin/env python3
# Requires: Python 3.7 (might work on 3.6, but I haven't tested)
# Purpose: Rename files such as "Some Game (USA) (En, Fr).gbx" to "Some Game.gbx"
# File Names: This script will operate on any file with the gb, gbc, and gba extension
# Note: Supports both copy and move
import os
import glob
import collections
@einsteinx2
einsteinx2 / organize_nkit_gc_for_wii.py
Last active June 26, 2023 19:39
Small python script to convert a folder full of *.nkit.iso files into the folder structure needed for use on a modded Wii
#!/usr/bin/env python3
# Requires: Python 3.7 (might work on 3.6, but I haven't tested)
# Purpose: Convert a folder full of *.nkit.iso (uncompressed) files into the folder structure needed for use on a modded Wii
# File names: Games must be named like "Game Name [GAMEID].nkit.iso"
# Multi-disc: Multi-disc games must be named like "Game Name (Disc 1) [GAMEID].nkit.iso" and "Game Name (Disc 2) [GAMEID].nkit.iso"
# Notes: Supports both copy and move, if you name your games differently you'll need to modify the script as it was made for my personal use
# TODO:
# - Better documentation
@einsteinx2
einsteinx2 / hangfix-intel-e1000e
Last active February 13, 2020 20:26
ProxMox if-up.d script to fix hanging Intel e1000e Gigabit NIC when a VM has a lot of network usage
#!/bin/sh -e
# Instructions:
# Change HANGING_IFACE to match the interface name of your interface (this can
# be found by running `ifconfig -a` or `cat /etc/network/interfaces`.
#
# Place this file in `/etc/network/if-up.d` and make sure to make it executable
# by running `chmod a+x /etc/network/if-up.d/hangfix-intel-e1000e` then reboot.
#
# After reboot, confirm it worked by running `ethtool -k eno1 | grep segmentation`
@einsteinx2
einsteinx2 / monitorio - Bash function to monitor the size of a file on disk
Last active April 16, 2023 11:07
monitorio - Bash function to monitor the size of a file on disk
# Show write speed for file or directory
# Optional second parameter to set the check interval in seconds, defaults to 20
monitorio () {
target="$1"
interval=${2:-"20"}
echo -e "Checking every ${interval} seconds"
size=$(du -ks "$target" | awk '{print $1}')
firstrun="1"
echo ""
while [ 1 ]; do
@einsteinx2
einsteinx2 / iSubCLA.txt
Created November 16, 2017 23:25
iSub CLA
Contributor License Agreement
By contributing your code to iSub you grant Benjamin Baron a non-exclusive, irrevocable, worldwide, royalty-free, sublicenseable, transferable license under all of Your relevant intellectual property rights (including copyright, patent, and any other rights), to use, copy, prepare derivative works of, distribute and publicly perform and display the Contributions on any licensing terms, including without limitation: (a) open source licenses like the GPL license; and (b) binary, proprietary, or commercial licenses. Except for the licenses granted herein, You reserve all right, title, and interest in and to the Contribution.
You confirm that you are able to grant us these rights. You represent that You are legally entitled to grant the above license. If Your employer has rights to intellectual property that You create, You represent that You have received permission to make the Contributions on behalf of that employer, or that Your employer has waived such rights for the Contribut
@einsteinx2
einsteinx2 / BalanceCLA.txt
Created October 23, 2017 16:03
Balance Contributor License Agreement
Contributor License Agreement
By contributing your code to Balance you grant Balanced Software, Inc. a non-exclusive, irrevocable, worldwide, royalty-free, sublicenseable, transferable license under all of Your relevant intellectual property rights (including copyright, patent, and any other rights), to use, copy, prepare derivative works of, distribute and publicly perform and display the Contributions on any licensing terms, including without limitation: (a) open source licenses like the GPL license; and (b) binary, proprietary, or commercial licenses. Except for the licenses granted herein, You reserve all right, title, and interest in and to the Contribution.
You confirm that you are able to grant us these rights. You represent that You are legally entitled to grant the above license. If Your employer has rights to intellectual property that You create, You represent that You have received permission to make the Contributions on behalf of that employer, or that Your employer has waived such rights for t
iSub 4 Missing Functionality:
Play Queue:
- Drag and drop various minor issues
- UX improvement, when mini player in play queue is not at the top, fade in a copy. When scrolling back go the top, make it slightly sticky so if falls back into place easily.
Playback:
DONE - Videos (Video player and play queue incrementing)
DONE - Support self signed SSL in AVPlayer/AVPlayerController
- Shuffle mode

Keybase proof

I hereby claim:

  • I am einsteinx2 on github.
  • I am benbaron (https://keybase.io/benbaron) on keybase.
  • I have a public key ASCi0o7AxR8SyDgF0HSFUsGCPogrkc082VNZ2U_iufyegQo

To claim this, I am signing this object: