Ranger Cheatsheet

ranger is a console file manager with vim key bindings

Most Used Keyboard Shortcuts

ttag toggle
g nnew tab
TABnext tab
qquit tab
d Ddelete
d dcut
y yyank / copy
p ppaste
p opaste overwrite
g hgo home
Sopen shell
ropen with …
d ccount the size
[move up in the parent directory
]move down in the parent directory
``last directory bookmark
z htoggle show hidden files
o rsort reverse
o msort by mtime
o nsort natural / by name
Rreload this directory
SPACEselect under cursor
vinvert selection / select all

Organize your Photos by Date Using Exiftool

Find all photos without date information

$ exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

Set last created and modified to a specific date

$ find . -name "*.jpg" | while read filename;
exiftool "-AllDates=1986:11:05 12:00:00" "$filename";

Copy of the originals will be created. Remove *.jpg_original if everything went fine or add -overwrite_original parameter.


by one year

$ exiftool "-AllDates+=1:0:0 00:00:00" .

Rename your files to contain the date and time

they will be suffixed with -N if they have the same date and time

$ exiftool '-FileName<DateTimeOriginal' -d "%Y%m%d_%H%M%S%%-c.%%e" *.jpg
$ exiftool '-FileName<DateTimeOriginal' -d "%Y-%m-%d %H.%M.%S%%-c.%%e" *.jpg

Copy your photos in a folder structure organised by datetime

exiftool '-Directory<CreateDate' -d ~/Dropbox/Photos/%Y/%y%m -r .

Git Sheet


### Delete remote branch
git push origin --delete refs/heads/BRANCH_NAME


### List remote tags
git ls-remote --tags
### Checkout specific tag
git checkout refs/tags/TAG_NAME
### Delete remote tag
git push origin --delete refs/tags/TAG_NAME


Add remote origin

### Add remote origin
git remote add origin gogs@rdd.ro:liv/dotFiles.git
### set the upstream branch to master
git push -u origin master
### To change it remove current origin and add a new one as above
git remote remove origin


### Log graph
git log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short

See commit log and changes before merging into working copy

### Fetch
git fetch origin
### Check the log and/or the changes
git log -p master..origin/master git log origin/master
### Merge
git merge origin/master


Meaning: get the last version without the .git folder.

git archive --remote gogs@rdd.ro:liv/dotFiles.git HEAD | tar xvf - 
### OR only a sub-directory
git archive --remote gogs@rdd.ro:liv/dotFiles.git HEAD sub-directory | tar xvf -

My .gitconfig

name = liv
email = liviu@rdd.ro
autocrlf = input
safecrlf = true
whitespace = trailing-space,space-before-tab
co = checkout
ci = commit
st = status --short --branch
br = branch
hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short
type = cat-file -t
dump = cat-file -p
info = remote show origin
please = push --force-with-lease
default = simple
prune = true