Commit 18daf800 authored by hydrargyrum's avatar hydrargyrum

add READMEs for ffmcut, flatten-json, qunpak, random-line, tailsleep

parent 834c95ae
# ffmcut
Use ffmpeg to cut a video
# Synopsis
ffmcut INPUT START END OUTPUT
# Desciption
Cut INPUT video file from START timestamp to END timestamp and write OUTPUT file.
START and END arguments are in seconds but minutes and hours are also supported. Examples:
30
10:30
1:20:00
# flatten-json
Flatten a deep JSON structure in a flat object with path-like keys
# Synopsis
flatten-json [--expand [--no-lists]] [--separator CHAR]
# Example
Given the following JSON:
```json
{
"my_object": [
{
"id": "foo",
"name": "Foo!",
"description": "blah blah"
},
{
"id": "bar",
"name": "Bar..."
}
],
"something": "whatever"
}
```
`flatten-json` will output this:
```json
{
"my_object/0/id": "foo",
"my_object/0/name": "Foo!",
"my_object/0/description": "blah blah",
"my_object/1/id": "bar",
"my_object/1/name": "Bar...",
"something": "whatever"
}
```
A flat JSON with only one level of depth and path-like keys.
# Options
--expand
Do the reverse operation, take a flat JSON with path-like keys and transform in tree JSON
--no-lists
(Only applicable if `--expand` is given), when faced with numeric elements in path, do not try to build a list/array, build an object with numeric keys.
--separator CHAR
Use CHAR instead of `/` as path separator. Applicable for both `--expand` and `--flatten`.
# qunpak
Extract and list Quake .pak archive files.
```
qunpak PAK0.PAK
```
will extract PAK0.PAK.
It's also possible to simply list its content:
```
qunpak -l PAK0.PAK
```
Only some files can be extracted by specifying a glob-pattern ("*" will match slashes and dots):
```
qunpak PAK0.PAK "*.wav"
```
will extract all .wav files from the root content in PAK0.PAK.
By default, files are extracted in current directory, but another directory can be used:
```
qunpak -O /other/dir/where/to/extract PAK0.PAK
```
# random-line
Returns a random line from stdin
# Example
% seq 10 | random-line
6
# tailsleep #
tailsleep is a command-line program that reads a file and prints its content to stdout, and if the file is modified externally by appending data, the new data is written to stdout. However, if the file is not modified within a few seconds (5 seconds by default), tailsleep exits.
It is a bit like the "`tail -f`" command (hence the name) but it writes the full content of the file (not the 10 last lines), and exits when the file is not modified for some time.
# Sample uses #
Extract a file that is being downloaded by a web browser:
```
tailsleep file-being-downloaded.tar.gz.part | tar -xzf -
```
As an extension, download Flash videos loading/loaded in your web browser (doesn't need to be playing them, they can be paused):
```
find /proc/*/fd -lname "*FlashXX*" | while read vid
do
tailsleep $vid > "video-`basename $vid`.flv"
done
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment