Serve an ISO image in a HTTP server. Designed for use with TeX Live, but should work for any ISO image.
Very suitable for offline and non-root environments, especially if you cannot mount -o loop the image.
- curl, perl, python3, pycdlib
| #!/usr/bin/env python3 | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from math import radians, degrees, pi, sin, asin, cos, atan2, sqrt, acos | |
| EARTH_RADIUS = 6371 | |
| def wingman_coord(latitude, longitude, altitude, heading, wingman_angle, wingman_distance): |
| /* | |
| * Compile: | |
| *. apt-get install -y libsctp-dev | |
| * gcc sctptest.c -o server -lsctp -Wall | |
| * ln -s server client | |
| * | |
| * Invoke: | |
| * | |
| * ./server | |
| * ./client |
| // ultra fast dump function (output like hexdump -C) | |
| void hexdump(const void *data, size_t size) | |
| { | |
| static const char digits[] = "0123456789abcdef"; | |
| char line[80]; // we use 79 chars at most | |
| size_t i; | |
| int j; | |
| for (i = 0; i < size; i += 16) | |
| { |
| #!/usr/bin/env python3 | |
| """ | |
| Very simple HTTP server in python for logging requests | |
| Usage:: | |
| ./server.py [<port>] | |
| """ | |
| from http.server import BaseHTTPRequestHandler, HTTPServer | |
| import logging | |
| class S(BaseHTTPRequestHandler): |
| FROM alpine:edge AS toilet-builder | |
| RUN apk update && apk add gcc musl-dev make curl unzip findutils fdupes | |
| WORKDIR /build | |
| # figlet | |
| RUN curl -skL -o figlet-master.zip https://github.com/cmatsuoka/figlet/archive/refs/heads/master.zip && \ | |
| unzip -q -o figlet-master.zip && \ |
| [package] | |
| name = "hello" | |
| version = "0.1.0" | |
| edition = "2021" | |
| [dependencies] | |
| [[bin]] | |
| name = "hello" | |
| path = "hello.rs" |
| #!/bin/echo must be source: | |
| # bash debugger | |
| # Rene Devichi. https://unlicense.org | |
| # Usage: `source bashdb.db` at the beginning of your script | |
| # Inline version: | |
| # curl -sL -o /tmp/bashdb.sh https://gist.github.com/rene-d/fd2d2c37dfc1371255818d73f7b5f1db/raw/bashdb.sh | |
| # trap "rm -f /tmp/bashdb.sh" EXIT | |
| # . /tmp/bashdb.sh |
| alias eject="diskutil list | sed -nr '/external, physical/s,^/dev/disk([0-9]+) .*,\1,p' | xargs -I+ diskutil eject /dev/rdisk+" |
| #!/usr/bin/env bash | |
| # https://en.wikipedia.org/wiki/ANSI_escape_code | |
| print_colors() | |
| { | |
| # Print column headers. | |
| printf "%-4s " '' ${bgs[@]} | |
| echo |