67 lines
1.9 KiB
Markdown
67 lines
1.9 KiB
Markdown
## 7digital.rb
|
|
|
|
7digital sells digital music but they can't handle files with non-English names.
|
|
|
|
`bin/7digital.rb` takes 2 arguments, a zip archive with audio files and a target
|
|
directory. It extracts the archive into the directory and renames its contents
|
|
according to the meta information saved in the audio files. The audio files are
|
|
expected to be in 2 directories, the artist and album directories. These
|
|
directories are also renamed.
|
|
|
|
## mock\_server.rb
|
|
|
|
`bin/mock\_server.rb` takes some JSON on its STDIN and starts a simple HTTP server
|
|
that slowly (in chunks) answers all requests with the given input.
|
|
|
|
For example:
|
|
|
|
```sh
|
|
echo '{"var": "stuff"}' | ./bin/mock_server.rb
|
|
```
|
|
|
|
and in another session:
|
|
|
|
```
|
|
curl localhost:8082
|
|
```
|
|
|
|
## read\_logs.rb
|
|
|
|
`bin/read\_logs.rb` looks in the `log/` directory for files ending with `.log`,
|
|
`.log.1`, `.log.2.gz`, `.log.3.gz` and so forth. It filters out lines starting
|
|
with a timestamp, `yyyy-mm-ddThh:mm:ss`, followed by random characters and a
|
|
custom string provided as the only command line parameter. Finally
|
|
it outputs all matched content after the provided string along with the date.
|
|
|
|
The log files are read in the order based on the number in the filename.
|
|
|
|
For example calling the script as
|
|
|
|
```sh
|
|
./bin/read_logs.rb 'doctrine.INFO:'
|
|
```
|
|
|
|
on a log file containing
|
|
`[2025-02-04T19:51:49.356093+01:00] doctrine.INFO: Disconnecting [] []`
|
|
|
|
will print:
|
|
|
|
```
|
|
2025-02-04 (Disconnecting [])
|
|
```
|
|
|
|
## cross\_toolchain.rb
|
|
|
|
`bin/cross_toolchain.rb` builds a cross toolchain for 32-bit RISC-V (G). The
|
|
script should work on Mac OS with preinstalled GNU tools and case-sensitive file
|
|
system and Linux. The resulting GCC is to be found in
|
|
`./tmp/rootfs/bin/riscv32-unknown-linux-gnu-*`.
|
|
|
|
## rename.rb
|
|
|
|
Changes the extension of all files matching a pattern in the given directory.
|
|
Call the `rename.rb` without arguments to see the usage information and an
|
|
example.
|
|
|
|
## tea-cleaner
|