Skip to content

Instantly share code, notes, and snippets.

View XertroV's full-sized avatar

Max Kaye XertroV

View GitHub Profile
@GreepTheSheep
GreepTheSheep / _TM_Collisions_tutorial.md
Last active April 7, 2023 16:38
Collisions on a TM dedicated server

Create a file on UserData/Scripts/Modes/Trackmania/collisions.Script.txt , with the content on file linked with this gist

Then you need to edit your matchsettings file like this :

<playlist>
    <gameinfos>
        <script_name>Trackmania/collisions.Script.txt</script_name>
    </gameinfos>

 
@dneuman
dneuman / WrappedText.py
Last active February 7, 2024 06:10
Text Wrapping in Matplotlib
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Wrapping arbitrary text to a defined box is not supported at least up to
Matplotlib 3.1. This is because the wrap width is hardwired to the Figure box.
A way around this is to override the _get_wrap_line_width method, either with
a new function, or by subclassing the matplotlib.text.Text class. Both
methods are shown below.
@pmarreck
pmarreck / encrypt_decrypt.sh
Last active September 23, 2021 20:18
Some easy bash scripts to encrypt/decrypt data, for anyone who wants to go all cloak&dagger. (bitcoin private keys, etc.)
# Encryption functions. Requires the GNUpg "gpg" commandline tool. On OS X, "brew install gnupg"
# Explanation of options here:
# --symmetric - Don't public-key encrypt, just symmetrically encrypt in-place with a passphrase.
# -z 9 - Compression level
# --require-secmem - Require use of secured memory for operations. Bails otherwise.
# cipher-algo, s2k-cipher-algo - The algorithm used for the secret key
# digest-algo - The algorithm used to mangle the secret key
# s2k-mode 3 - Enables multiple rounds of mangling to thwart brute-force attacks
# s2k-count 65000000 - Mangles the passphrase this number of times. Takes over a second on modern hardware.
# compress-algo BZIP2- Uses a high quality compression algorithm before encryption. BZIP2 is good but not compatible with PGP proper, FYI.