Skip to content

Commit

Permalink
add READMEs for ffmcut, flatten-json, qunpak, random-line, tailsleep
Browse files Browse the repository at this point in the history
  • Loading branch information
hydrargyrum committed Oct 11, 2020
1 parent 834c95a commit 18daf80
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 0 deletions.
17 changes: 17 additions & 0 deletions ffmcut/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 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
57 changes: 57 additions & 0 deletions flatten-json/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# 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`.
29 changes: 29 additions & 0 deletions qunpak/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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
```
9 changes: 9 additions & 0 deletions random-line/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# random-line

Returns a random line from stdin

# Example

% seq 10 | random-line
6

22 changes: 22 additions & 0 deletions tailsleep/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 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
```

0 comments on commit 18daf80

Please sign in to comment.