Hideya OHASHI avatar Hideya OHASHI committed 3c589aa


Comments (0)

Files changed (3)

+= Setup Two Computers (A and B)
+$ sudo apt-get install aria2 mercurial mktorrent
+$ cat >~/.hgrc
+username = My Name
+hgext.zeroconf = 
+$ mkdir -p ~/.aria2
+$ cat >~/.aria2/aria2.conf
+$ hg clone http://example.com/hakoburn
+$ cd hakoburn
+$ hg serve -d
+= Computer A
+$ bin/updater
+= Computer B
+$ mkdir MyBox
+$ cp /bin/ls MyBox
+$ bin/update MyBox
+if ! [ -z $1 ]; then
+  mktorrent -a '' $1
+  mv -f MagnetLinks .MagnetLinks.old
+  grep -v $1 .MagnetLinks.old >MagnetLinks
+  aria2c -S $1.torrent | grep -o 'magnet:.*' >>MagnetLinks
+  INFOHASH=`aria2c -S $1.torrent | grep '^Info Hash:' | cut -d ' ' -f 3`
+  mv -f $1.torrent $INFOHASH.torrent
+  hg ci -m update
+rm -f AllTorrents
+touch AllTorrents
+for FILENAME in *.torrent; do
+  INFOHASH=`echo "$FILENAME" | cut -d '.' -f 1`
+  grep -i -q $INFOHASH MagnetLinks
+  if [ $? -eq 0 ]; then
+    echo $FILENAME >>AllTorrents
+  else
+    mv -f $FILENAME .$FILENAME.old
+  fi
+cat MagnetLinks >>AllTorrents
+aria2c -V -i AllTorrents
+while true; do
+  hg pull -u
+  bin/update
+  sleep 1
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.