-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add READMEs for ffmcut, flatten-json, qunpak, random-line, tailsleep
- Loading branch information
1 parent
834c95a
commit 18daf80
Showing
5 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |