Skip to content

Instantly share code, notes, and snippets.

View Erotemic's full-sized avatar
An eroteme is a question mark

Jon Crall Erotemic

An eroteme is a question mark
View GitHub Profile
@Erotemic
Erotemic / lightning_cli_save_hyperaparams_error_on_link_args.py
Created October 5, 2024 16:56
lightning_cli_save_hyperaparams_error_on_link_args.py
@Erotemic
Erotemic / SuperUser-Question-1851016.md
Created September 10, 2024 14:44
A minimal example of sharing data with BitTorrent - SuperUser Question 1851016

I want to write a minimal, reproducible, and configurable minimal example that demonstrates how to create, seed, and download a torrent.

Issue & Question

This is much harder than I anticipated. The command line tooling is weaker than I would have guessed, but it exists, and it should be possible. There are a lot of edge-cases to consider when writing a networking example, and perhaps my difficulty is because I'm hitting one of those. I'm looking for help with writing up this example in a way that helps document what some of the issue

@Erotemic
Erotemic / proxy-debug-v3.sh
Created May 7, 2024 21:58
proxy-debug-v3.sh
# The following documents steps I took when following instructions from:
# https://askubuntu.com/a/1512388/426149
#===========================================#
# PART 1 - Test Manual SOCKS5 Configuration #
#===========================================#
# Note that all following steps, are done on the local client, the remote
# just needs to be accessible vis SSH.
@Erotemic
Erotemic / pac-file-reproduce.sh
Created May 7, 2024 01:34
pac-file-reproduce.sh
exact_steps_taken(){
DOMAIN=mlb.com
echo "DOMAIN = $DOMAIN"
nslookup "$DOMAIN"
DOMAIN_ADDRESS=34.102.169.19
echo "DOMAIN_ADDRESS = $DOMAIN_ADDRESS"
echo '
@Erotemic
Erotemic / pac-file-notes.sh
Created May 6, 2024 04:11
Attempt to log in a PAC file (not working)
# https://stackoverflow.com/questions/66514500/how-do-i-configure-a-python-server-for-post
# Run a test server on port 8000
python -c 'if 1:
from http.server import BaseHTTPRequestHandler, HTTPServer
class handler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header("Content-type", "text/html")
self.end_headers()
@Erotemic
Erotemic / cpkt_error_mwe.py
Created March 10, 2023 02:42
cpkt_error_mwe.py
import torch
import torch.nn
from torch import nn
from torch.utils.data import Dataset
import numpy as np
import pytorch_lightning as pl
from pytorch_lightning.cli import LightningCLI
from typing import List, Dict
@Erotemic
Erotemic / jsonargparse_scriptconfig_poc.py
Last active February 19, 2023 02:09
jsonargparse_scriptconfig_poc.py
import jsonargparse
import inspect
from jsonargparse.parameter_resolvers import ParamData
from jsonargparse.signatures import get_signature_parameters
from jsonargparse.signatures import get_doc_short_description
from typing import List, Set, Union, Optional, Tuple, Type, Any
from jsonargparse.util import get_import_path, iter_to_set_str
from argparse import SUPPRESS
from jsonargparse.typing import is_final_class
@Erotemic
Erotemic / transfer_assets.py
Created November 28, 2022 16:34
transfer_assets - POC non-copyrighted SM64 generated randomized assets.
"""
make VERSION=us -j16
build/us_pc/sm64.us
SeeAlso:
https://github.com/TechieAndroid/sm64redrawn
"""
import ubelt as ub
import aifc
import kwimage
@Erotemic
Erotemic / pyenv.Dockerfile
Created October 31, 2022 15:28
pyenv.Dockerfile
# syntax=docker/dockerfile:1.3.0-labs
# This dockerfile uses new-ish buildkit syntax.
# Details on how to run are on the bottom of the file.
# (docker devs: todo unconsequential heredocs)
FROM nvidia/cuda:11.4.3-cudnn8-devel-ubuntu20.04
ARG PYTHON_VERSION=3.10.5
ARG PYENV_VERSION=v2.3.3
@Erotemic
Erotemic / install_python_pyenv.rst
Created October 31, 2022 15:26
install_python_pyenv.rst

An fully FOSS alternative to a conda environment is pyenv. The only real drawback to pyenv is that you must be able to compile Python itself.

On ubuntu this can be setup as follows:

### Based on code in https://github.com/Erotemic/local/blob/main/tools/pyenv_ext/pyenv_ext_commands.sh