This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| """ | |
| The game Sky Force Reloaded on Android stores how many in-game stars you've | |
| collected in an obfuscated config file. This program was made by | |
| reverse-engineering that obfuscation using a bunch of sample values. | |
| Given the number of stars you want, it will generate a line to add to the | |
| game's config file. Note that the game will treat invalid values as 0 so make a | |
| backup of your config before modifying it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ####### | |
| # Setup | |
| ####### | |
| ### Enable IPv4/6 forwarding: | |
| # # In /etc/sysctl.d/30-ipforward.conf : | |
| # net.ipv4.ip_forward=1 | |
| # net.ipv6.conf.default.forwarding=1 | |
| # net.ipv6.conf.all.forwarding=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Goals: | |
| # - Allow access without having to deal with Plex accounts | |
| # - Only allow read-only access (no changing tags, fixing matches, etc) | |
| # - Don't leak information between users (what has been watched, play progress, etc) | |
| # - Prevent users from claiming the server, changing settings, or acessing internal information | |
| # - Allow administration of the server for people with SSH access to it | |
| # Basic setup instructions: | |
| # - Install Nginx on the same server as Plex and load this config file (usually just a matter of | |
| # dropping it into `/etc/nginx/conf.d`) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Requires: audiowaveform (https://github.com/bbc/audiowaveform), metaflac, sox | |
| zoom_start=60 | |
| zoom_duration=4 | |
| zoom_end=$((zoom_start + zoom_duration)) | |
| if [ $# -lt 1 ] || [ "$1" == "--help" ] || [ "$1" == "-h" ]; then | |
| echo "Generates spectrogram and waveform images from flac files" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # The save files for The Messenger and Sea of Stars on the Nintendo Switch are | |
| # just JSON files with a prefix checksum and (only for The Messenger) some | |
| # padding at the end. The checksum is just the length of the data encoded using | |
| # ULEB128 (https://en.wikipedia.org/wiki/LEB128) | |
| # | |
| # This script takes a save file and adds/updates the checksum. This makes | |
| # editing save files extremely easy. Just open the file in any text editor, | |
| # make the desired changes, save it, then run this script on it to make sure |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -eou pipefail | |
| # This script takes/generates a Wireguard private/public key pair, registers it with CloudFlare's WARP | |
| # service, and outputs a Wireguard config file. | |
| # Adapted from @saurik's script here: https://twitter.com/saurik/status/1176893448445558784 | |
| if [ "$#" -gt 0 ] && [ "$1" = "--help" ]; then | |
| echo "Creates a Wireguard config file for CloudFlare's WARP service." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| """ | |
| Shows a binary diff of files. Handles cases where data was inserted/removed | |
| instead of just modified in place to avoid showing that the rest of a file | |
| after a modification was changed. | |
| WARNING: The algorithm used to generate the diff is quadratic in the expected | |
| case and cubic in the worst case. Do not run this on large files unless you | |
| want to wait for a *very* long time. Additionally, because it was only meant to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # See https://www.3dbrew.org/wiki/NCSD for details on the file format | |
| import io | |
| import os | |
| import logging | |
| MEDIA_UNIT = 0x200 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| #################################### | |
| # Update a UniFi Controller installation on Alpine Linux | |
| # | |
| # Assumes that the unifi service can be manipulated with "rc-service unifi <start/stop>" | |
| # | |
| # For initial installation see https://wiki.alpinelinux.org/wiki/UniFi_Controller | |
| # Additional steps: | |
| # - apk add --no-cache libc6-compat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import zipfile | |
| import io | |
| import logging | |
| def zip_paths(paths): | |
| """ | |
| Compresses directories and files to a single zip file. | |
| Returns the zip file as a data stream, None if error. |
NewerOlder