lundi 25 février 2013

Reusing SSH Connection

SOURCE : http://sshmenu.sourceforge.net/articles/transparent-mulithop.html

"The transparent multi-hop connections can be very useful but you may find that it takes a second or two to establish each connection. This delay can become annoying if it happens a lot (e.g.: every time you save a file from the text editor).
The good news is that if you can configure SSH to reuse an existing connection. This means that for example if you have an SSH shell session running then a new connection for SCP can skip the connection setup phase. Two steps are required:
First, you must create a directory (or 'folder') which SSH will use to keep track of established connections:
mkdir ~/.ssh/tmp
Next, add these two lines at the start of your ~/.ssh/config (make sure to use your username in place of 'YOUR-NAME'):


ControlMaster auto
ControlPath   /home/YOUR-NAME/.ssh/tmp/%h_%p_%r

As you can see, a small investment in time setting up your SSH configuration can pay back dividends in convenience."



vendredi 8 février 2013

SVN backup repository with history

Copier toutes l'historique d'un repository SVN auquel vous avez accès (en lecture), 
mais pas les droits d'administration :
 
 
  svnadmin create localrepos
  emacs localrepos/hooks/pre-revprop-change # make it 'exit 0' 
  chmod +x localrepos/hooks/pre-revprop-change
  svnsync init --username USERNAME file:///path/to/localrepos https://myproject.googlecode.com/svn
  Copied properties for revision 0.
  svnsync sync --username USERNAME file:///path/to/localrepos
 
Source : http://code.google.com/p/support/wiki/SubversionFAQ#How_do_I_download_my_Subversion_history? 
 
 
 
Donc :
$ svnadmin creat localrepos
$ cat > localrepos/hooks/pre-revprop-change
#! /bin/bash
exit 0

$ chmod a+x localrepos/hooks/pre-revprop-change
$ svnsync init --username USERNAME file:///NEWREPO https://OLDREPO
   Copied properties for revision 0.
$ svnsync sync --username USERNAME file:///NEWREPO 
[...copie de toutes les révisions...] 
 
 
 
Sur la machine où j'ai copié l'historique, j'ai du utiliser une feinte :
$ svnadmin setuuid UUID-OLDREPO
 
 
Puis, pour changer les "checkouts" de source, svn switch :
$ svn switch --relocate https://OLDREPO svn+ssh://NEWREPO 

Et voilà !


PS : si vous avez les accès svnadmin sur les deux machines, il y a plus simple comme solution.
http://particul.es/blog/index.php?post/Reprendre-un-projet-%3A-svn-tips-pour-changer-l-url-du-d%C3%A9pot


lundi 4 février 2013

Ext4 (non crypté) macosx

 sudo fuse-ext2 /dev/disk2s1 /Volumes/elem/ -o force



Avec :
http://osxfuse.github.com/