2019-04-09 13:14:24 +00:00
|
|
|
# utils
|
2014-07-02 19:02:56 +00:00
|
|
|
|
|
|
|
Random utilities of vbatts' being cleaned up, and published
|
|
|
|
|
|
|
|
# Commands
|
|
|
|
|
2015-05-21 15:14:05 +00:00
|
|
|
## dups
|
|
|
|
|
|
|
|
building a document of file checksum info, for a directory tree. Optionally
|
|
|
|
deduplicate the tree using hardlinks.
|
|
|
|
|
|
|
|
### Install
|
|
|
|
|
2019-04-09 13:14:24 +00:00
|
|
|
go get github.com/vbatts/utils/cmd/dups
|
2015-05-21 15:14:05 +00:00
|
|
|
|
|
|
|
### Usage
|
|
|
|
|
|
|
|
$ dups -h
|
|
|
|
Usage of dups:
|
|
|
|
-H=false: hardlink the duplicate files
|
|
|
|
-l="": load existing map from file
|
|
|
|
-q=false: less output
|
|
|
|
-s="hash-map.json": file to save map of file hashes to
|
|
|
|
|
|
|
|
By default it scans the paths provided, and creates a JSON document of the file paths and their checksum:
|
|
|
|
|
|
|
|
$ dups .
|
2019-04-09 13:14:24 +00:00
|
|
|
"/home/vbatts/src/vb/utils/.git/logs/refs/heads/master" is the same content as "/home/vbatts/src/vb/utils/.git/logs/HEAD"
|
|
|
|
"/home/vbatts/src/vb/utils/.git/refs/remotes/origin/master" is the same content as "/home/vbatts/src/vb/utils/.git/refs/heads/master"
|
|
|
|
"/home/vbatts/src/vb/utils/cmd/find-todos/main.go~" is the same content as "/home/vbatts/src/vb/utils/cmd/find-todos/main.go"
|
|
|
|
"/home/vbatts/src/vb/utils/cmd/slackware-sync/README.md~" is the same content as "/home/vbatts/src/vb/utils/cmd/slackware-sync/README.md"
|
|
|
|
"/home/vbatts/src/vb/utils/cmd/slackware-sync/main.go" is the same content as "/home/vbatts/src/vb/utils/cmd/slackware-sync/main.go~"
|
2015-05-21 15:14:05 +00:00
|
|
|
Savings of 0.005681mb
|
|
|
|
wrote "hash-map.json"
|
|
|
|
|
|
|
|
With the `-H` flag, as duplicate files are found (files with matching checksum)
|
|
|
|
are encountered, hardlink it to the duplicate file.
|
|
|
|
|
|
|
|
|
2014-07-02 19:02:56 +00:00
|
|
|
## next-note
|
|
|
|
|
|
|
|
Simple date formating for notes
|
|
|
|
|
|
|
|
### Install
|
|
|
|
|
2019-04-09 13:14:24 +00:00
|
|
|
go get github.com/vbatts/utils/cmd/next-note
|
2014-07-02 19:02:56 +00:00
|
|
|
|
2014-07-02 19:16:16 +00:00
|
|
|
### Usage
|
|
|
|
|
|
|
|
next-note -h
|
|
|
|
Usage of next-note:
|
|
|
|
-c=false: print current week's filename
|
|
|
|
-d=false: print current date
|
|
|
|
-dir="": Base directory for tasks
|
|
|
|
-p=false: print previous week's filename
|
|
|
|
|
|
|
|
### vim
|
|
|
|
|
|
|
|
Copy ./cmd/next-note/next-note.vim to ~/.vim/plugin/
|
|
|
|
|
|
|
|
This provides commands, like:
|
|
|
|
|
|
|
|
* `:Nd` - append the date to the current buffer
|
|
|
|
* `:Nc` - to open a tabe for current week's notes file
|
|
|
|
* `:Np` - to open a tabe for previous week's notes file
|
|
|
|
* `:Nn` - to open a tabe for next week's notes file
|
|
|
|
|
2014-07-02 19:02:56 +00:00
|
|
|
## find-todos
|
|
|
|
|
|
|
|
Look through your notes directory for TODO items.
|
|
|
|
|
|
|
|
### Install
|
|
|
|
|
2019-04-09 13:14:24 +00:00
|
|
|
go get github.com/vbatts/utils/cmd/find-todos
|
2014-07-02 19:02:56 +00:00
|
|
|
|