Recent comments posted to this site:

comment 23 70dcb7e7ffdd14351adaf4c40ee7fdd0
[[!comment Error: unsupported page format hs]]
Fri Aug 26 23:26:00 2016

I'm using pipsi to install packages without polluting the system, Michael's fork from magthe's fork from TobiasTheViking repo (I don't know if the other branches are better or worse, but this is working).

Instructions

First thing: go to https://www.flickr.com/services/apps/create/noncommercial/? and create an app (if you use the keys provided in the flickrannex repository you'll be giving access to your flickr to everybody).

Now follow the steps:

wget https://github.com/mikemccracken/flickrannex/archive/master.zip unzip master.zip cd flickrannex-master/ edit setup.py # replace 'flickrapi' with 'flickrapi==1.4.5' # otherwise it will install a wrong version of the dependency. edit flickrannex # on lines 46 and 47, replace the api_key and api_secret # with the values from the application you created in the # first step. pipsi install ./ cd flickrannex # go through the oauth setup, will open a window in the browser # some commands will appear after you're successful. ignore them. cd ~/annex # your git-annex folder git config annex.flickr-hook $HOME/.local/bin/flickrannex git annex initremote flickr type=hook hooktype=flickr encryption=none

Comment by fiatjaf Sat Aug 6 23:51:48 2016

Following the instructions above, when issuing:

git annex initremote googledrive type=external externaltype=googledrive encryption=shared folder=gitannex

googleannexdrive fails and I get:

initremote googledrive (encryption setup) (encryption key stored in git repository) No handlers could be found for logger "oauth2client.util"
git-annex: You need to set OAUTH environment variables and folder and encryption parameters when running initremote.

Am I making some obvious mistake?

If not, I'd like to share my positive experience with git-annex-remote-rclone (https://github.com/DanielDent/git-annex-remote-rclone), which wraps rclone (https://rclone.org) that supports Google Drive: it worked for me.

Comment by emanuele.olivetti Thu Jul 14 14:58:29 2016

Hello

it took me some time to figure out how to exclude directories matching a specific structure within the .gitattributes file:

**/some_dir/**/below_this_dir_is_everything_in_plane_text/**/* annex.largefiles=nothing

Maybe it helps someone else. (In case this way is the intended way)

Comment by christophfischer Tue Jun 21 11:42:37 2016

I want to use a recent git-annex version, and I prefer a Docker solution to a binary. There wasn't much documentation on how to do that, so here are the steps I took, just in case anybody finds this information useful. This is not a complete guide, just more than I was able to find so far.

  • Install Docker so that you can access it (eg, docker info) without sudo. (Beyond the scope in here.)

  • Create a git-annex image as follows:

Dockerfile:

FROM debian:unstable
RUN apt-get update && apt-get install -y ssh git man git-annex=6.20160511-1
# maybe install gpg2, other remotes, etc
#RUN apt-get install -y gnupg2 && ln -s /usr/bin/gpg2 /usr/local/bin/gpg
#RUN apt-get install -y golang-go && GOPATH=/usr/local go get github.com/encryptio/git-annex-remote-b2
VOLUME /data
WORKDIR /data

Build image and run basic test:

docker build -t git-annex-6.20160511-1 .
docker run -it --rm git-annex-6.20160511-1 git-annex version
  • You still need to:

    • On host: Replace git-annex by a script that invokes the Dockerized version.
    • In container:
      • Use non-root uids, otherwise you end up creating files with uid 0.
      • Access ssh and gpg credentials on host.
      • Access ~/.gitconfig on host.
      • Mount git repository root as a volume, not just the current dir.
      • Access AWS/B2 credentials, if applicable.

Here is a sample script that achieves these. Name it git-annex, and place it in your PATH before the host git-annex (or just uninstall the latter).

#!/bin/bash
CONT_NAME=${CONT_NAME:-git-annex-6.20160511-1}
# if in git repo, mount root as /data, and cd into relative subdir
# if not, mount cwd as /data
abs_dir=$(readlink -e .)
root_dir=$(git rev-parse --show-toplevel 2>/dev/null || true)
root_dir=${root_dir:-$abs_dir}
rel_dir=${abs_dir#$root_dir}
# if run by git, assume command is git-annex
# otherwise, don't assume, to allow other uses
cmd=
! [ "$(basename "$(readlink -e /proc/$PPID/exe)")" = "git" ] || cmd=git-annex
exec docker run -it --rm \
    -u $(id -u):$(id -g) \
    -v /etc/passwd:/etc/passwd:ro \
    -v $HOME/.ssh:$HOME/.ssh \
    -v $HOME/.gnupg:$HOME/.gnupg \
    -v $HOME/.gitconfig:$HOME/.gitconfig \
    -v "$root_dir":/data \
    ${AWS_ACCESS_KEY_ID:+-e AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID"} \
    ${AWS_SECRET_ACCESS_KEY:+-e AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY"} \
    ${B2_ACCOUNT_ID:+-e B2_ACCOUNT_ID="$B2_ACCOUNT_ID"} \
    ${B2_APP_KEY:+-e B2_APP_KEY="$B2_APP_KEY"} \
    -w /data"$rel_dir" \
    $CONT_NAME $cmd "$@"
Comment by matei.david Fri Jun 3 18:48:11 2016

Actually you do want to exclude "cover.jpg" from being annexed because it will allow you to view the covers of all your books without getting them. Keeping metadata.opf out of annex is not that important because you cannot safely edit the metadata without getting the books first.

It would be great to teach Calibre to see broken symlinks as normal zero length files and work with them accordingly. And we do need a Calibre plugin with buttons "annex get" and "annex unlock".

Comment by Dilyin Thu Jun 2 18:10:33 2016

Looks like it's not possible to set the annex cost of the "web" and "bittorrent" special remotes annex cost.

This doesn't seem to work:

[remote "web"] annex-cost = 500

Perhaps, because these remotes don't actually exist.

Setting annex cost for a webdav remote works but is incremented by 50 for some reason.

Comment by Dilyin Wed Jun 1 18:44:15 2016

Hmm, guyz? Are you serious with these scripts?

  1. git rm -r --cached large_files

    files are indexed as both removed and untracked and are still in place

  2. commit the changes

    files are seen as untracked

  3. git annex add large_files

    files are replaced with symlinks and are in the index

  4. commit changes again

Make sure that you don't have annex.largefiles settings that would prevent annexing the files.

Comment by Dilyin Wed Jun 1 18:36:40 2016

The hash directories for a key can be looked up by passing the key to git annex examinekey --format '${hashdirlower}\n'

Comment by joey Tue May 31 16:18:45 2016

Format appears to be /BASE_DIR/xxx/yyy/FILEKEY/FILEKEY

How can I get the xxx/yyy or the complete storage path of an annexed file in a fast way?

Background:
I have to "chmod" the xxx/yyy within an '.git/hooks/pre-commit' action (shared used NFS location).
Following way using 'find' needs too much time in case of a big remote:

$ git annex info --fast inputbinaries | grep 'directory:' | awk '{print $2}'
/gitworkspace/inputbinaries/DWDM1830-all_playground

$ git annex info vendor-libs/x86/libsnmpdm.a | grep 'key:' | awk '{print $2}'
SHA256E-s3992448--82604383354b28f8efcdf8d83bb63607a8d5967551ded055e782ac342bb7f8e0.a

$ find /gitworkspace/inputbinaries/DWDM1830-all_playground -type f -name SHA256E-s3992448--82604383354b28f8efcdf8d83bb63607a8d5967551ded055e782ac342bb7f8e0.a
/gitworkspace/inputbinaries/DWDM1830-all_playground/28e/785/SHA256E-s3992448--82604383354b28f8efcdf8d83bb63607a8d5967551ded055e782ac342bb7f8e0.a/SHA256E-s3992448--82604383354b28f8efcdf8d83bb63607a8d5967551ded055e782ac342bb7f8e0.a
Comment by uwe.nagler Tue May 31 11:51:56 2016