Skip to content

Commit

Permalink
Docs & demos for v0.0.8 (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
thushan authored Jan 28, 2024
1 parent 42530b7 commit e97a512
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 6 deletions.
Binary file added docs/artefacts/smash-v0.0.8-demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/artefacts/smash-v0.0.8-hdd-photos-demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/demos.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
Pre-recorded demos of `smash` in action.

# Examples
* [v0.0.8-hdd-photos](https://vhs.charm.sh/vhs-6tlEMMcnwSWSXQtHzD2fEU.gif) - `smash`ing an old portable USB HDD of photos & removing duplicates.
* [v0.0.7-hdd-photos](https://vhs.charm.sh/vhs-4OwN0BJfb3F3CTzGJCFHcs.gif) - `smash`ing an old portable USB HDD of photos & removing duplicates.
* [v0.0.5-hdd-photos](https://vhs.charm.sh/vhs-7B6XHxXq8VPvZ6AY9FpGIc.gif) - `smash`ing an old portable USB HDD of photos with excluded directories.

# Versions
* [v0.0.8](https://vhs.charm.sh/vhs-7BJdHGJLipNTwKQjJjDhXV.gif) - powered by [VHS](https://vhs.charm.sh)
* [v0.0.7](https://vhs.charm.sh/vhs-5uZbZAvk8Y6eq4dihLppbk.gif) - powered by [VHS](https://vhs.charm.sh)
* [v0.0.5](https://vhs.charm.sh/vhs-1zSMi9vYpmh0DivoB4E6g4.gif) - powered by [VHS](https://vhs.charm.sh)
* [v0.0.4](https://vhs.charm.sh/vhs-tgMXNRqo7UovLRd5iSlgF.gif) - powered by [VHS](https://vhs.charm.sh)
Expand Down
20 changes: 19 additions & 1 deletion docs/vhs/demo-photos-hdd.tape
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,39 @@ Set WindowBar Colorful
Set Theme "TokyoNight"

# smash Linux/drivers
Type "# In this demo, we're using a slow USB SATA 2.5inch disk with photos"
Enter
Type "# but we want to ignore sort, tmp & events folders in the collection"
Enter
Sleep 1s
Type "./smash /media/thushan/smash/photos/ --exclude-dir=sort,tmp,events -o report.json"
Sleep 500ms
Enter
Sleep 30s
Type "clear"
Sleep 500ms
Enter
Type "# So let's see the main files that were duplicated:"
Enter
Sleep 1s
Type `jq '.analysis.dupes[]|[.location,.path,.filename]|join("/")' report.json`
Sleep 500ms
Enter
Sleep 2s
Type "# and now the duplicates:"
Enter
Sleep 1s
Type `jq '.analysis.dupes[].duplicates[]|[.location,.path,.filename]|join("/")' report.json`
Sleep 500ms
Enter
Sleep 5s
Type "clear"
Sleep 500ms
Enter
Type `jq '.analysis.dupes[]|[.location,.path,.filename]|join("/")' report.json | xargs ls -lh`
Type "# You could now remove the files but let's just list the filesizes for now:"
Enter
Sleep 1s
Type `jq '.analysis.dupes[].duplicates[]|[.location,.path,.filename]|join("/")' report.json | xargs exa -lh --no-user --no-permissions`
Sleep 500ms
Enter
Sleep 5s
Expand Down
23 changes: 20 additions & 3 deletions docs/vhs/demo.tape
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,46 @@ Set WindowBar Colorful
Set Theme "JetBrains Darcula"

# smash Linux/drivers
Type "# Let's start by de-duping the linux source tree,"
Enter
Type "# exlude the git dir and saving to report.json!"
Enter
Sleep 1s
Type "./smash ~/linux/drivers --exclude-dir=git -o report.json"
Sleep 500ms
Enter
Sleep 10s
Type "clear"
Sleep 500ms
Enter
Type `jq '.analysis.dupes[]|[.location,.path,.filename]|join("/")' report.json | xargs wc -l`
Type "# Now let's look at only the duplicate files"
Enter
Sleep 1s
Type `jq '.analysis.dupes[].duplicates[]|[.location,.path,.filename]|join("/")' report.json | xargs wc -l`
Sleep 500ms
Enter
Sleep 5s
Type `jq '.analysis.dupes[]|[.location,.path,.filename]|join("/")' report.json | xargs rm`
Type "# *gulp* let's remove them duplicates, shall well?"
Enter
Sleep 1s
Type `jq '.analysis.dupes[].duplicates[]|[.location,.path,.filename]|join("/")' report.json | xargs rm`
Sleep 500ms
Enter
Sleep 5s
Type "# Okay, let's just double check they got removed"
Enter
Sleep 1s
Type "cd ~/linux/drivers"
Sleep 500ms
Enter
Sleep 2s
Sleep 1s
Type "git status -s"
Sleep 500ms
Enter
Sleep 3s
Type "# Alright, let's reset this for gits & giggles..."
Enter
Sleep 1s
Type "git reset --hard"
Sleep 500ms
Enter
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ Amongst the highlights of `smash`:
* Supports a variety of non-cryptographic algorithms (see [algorithms supported](./docs/algorithms.md)).
* Read-only view of the underlying filesystem when analysing
* Reports on duplicate files & empty (0 byte) files
* Outputs a report in json, you can use tools like [jq](https://github.com/jqlang/jq) to operate on (see [examples](#examples) below or [this vhs tape](https://vhs.charm.sh/vhs-4OwN0BJfb3F3CTzGJCFHcs.gif))
* Outputs a report in json, you can use tools like [jq](https://github.com/jqlang/jq) to operate on (see [examples](#examples) below or [the vhs tapes](./docs/demos.md))
* Used to dedupe multi-TB of astrophysics datasets, images and video content & run regularly to report duplicates

`smash` does not support pruning of duplicates or empty files natively and it's encouraged you vet the output report before pruning via automated tools.

<p align="center">
<img src="https://vhs.charm.sh/vhs-5uZbZAvk8Y6eq4dihLppbk.gif" alt="Made with VHS"><br/>
<img src="https://vhs.charm.sh/vhs-7BJdHGJLipNTwKQjJjDhXV.gif" alt="Made with VHS"><br/>
<sub>
<sup>Find duplicates in the <a href="https://github.com/torvalds/linux">linux/drivers</a> source tree with <code>smash</code> (see our <a href="docs/demos.md">🍿 other demos</a>). Made with <a href="https://vhs.charm.sh" target="_blank">vhs</a>!</sup>
</sub>
Expand Down

0 comments on commit e97a512

Please sign in to comment.