Installer Gearman sur OSX

installer gearman sur OSX

Prérequis: libevent

S'assurer que la libevent est présente

$ ls -l /usr/local/lib/libevent*

Le cas échéant, l'installer

$ curl -L -O http://www.monkey.org/~provos/libevent-1.4.12-stable.tar.gz
$ tar -xvzf libevent-1.4.12-stable.tar.gz
$ cd libevent-1.4.12-stable
$ ./configure
$ make
$ sudo make install

Installer libgearman

$ curl -L -O http://launchpad.net/gearmand/trunk/0.9/+download/gearmand-0.9.tar.gz
$ tar -xvzf gearmand-0.9.tar.gz
$ cd gearmand-0.9
$ ./configure
$ make
$ sudo make install

Il installera aussi les 2 applications qui nous intéressent :

/usr/local/bin/gearman
/usr/local/sbin/gearmand

Assurez vous que tous les paths sont accessibles via PATH

$ echo $PATH

si /usr/local/bin ou /usr/local/sbin ne sont pas présent, les rajouter dans le path de l'utilisateur, ou mieux le path général (le fichier /etc/paths)

Commandes utiles

  • lancer gearmand pour la 1re fois

    $ gearmand -vv
     INFO Starting up
     INFO Listening on :::4730 (4)
     INFO Listening on 0.0.0.0:4730 (5)
     INFO Creating wakeup pipe
     INFO Creating IO thread wakeup pipe
     INFO Adding event for listening socket (4)
     INFO Adding event for listening socket (5)
     INFO Adding event for wakeup pipe
     INFO Entering main event loop
    
  • S'assurer que gearmand est entrain de tourner

    $ ps auxw | grep [g]earmand
    xavierbarbosa 21315   0.0  0,0    75664    452 s007  S+    4:57     0:00.00 gearmand -vv
    
  • Vérifier que gearman écoute le port 4730 pour les jobs en TCP

    $ sudo lsof -i tcp:4730
    COMMAND    PID          USER   FD   TYPE    DEVICE SIZE/OFF NODE NAME
    gearmand 21315 xavierbarbosa    4u  IPv6 0x6e29258      0t0  TCP *:4730 (LISTEN)
    gearmand 21315 xavierbarbosa    5u  IPv4 0xa243a68      0t0  TCP *:4730 (LISTEN)
    
  • Lancer gearman en mode détaché !

    $ gearmand &
    

Installer Drizzle sur OSX

Marqué :
$ sudo port install bzr protobuf-c pcre
$ cd src
$ bzr branch lp:libdrizzle
$ cd libdrizzle
$ ./config/autorun.sh
$ ./configure --prefix=/opt/local && make && sudo make install
$ cd ..
$ bzr branch lp:drizzle
$ cd drizzle
$ ./config/autorun.sh
$ ./configure --with-lib-prefix=/opt/local --prefix=/opt/local &&  make && sudo make install

Un bon tuto: http://pjkix.com/journal/2009/04/28/installing-drizzle-db-on-os-x/

grep recursively through a svn checkout

Marqué :

For files not named on the command line, only the basename is compared to the exclude pattern.

Try one of these:

find * -name '.svn' -prune -o -type f -exec grep -- "MY_PATTERN" /dev/null \{\} +

find * -type f -exec grep --exclude='*.svn/*' -- "MY_PATTERN" /dev/null \{\} +

Substitution de mots clefs dans Subversion

Subversion peut remplacer des mots clefs donnés dans un ou plusieurs fichiers lors du commit. C'est très pratique pour insérer dans les fichiers certaines informations. Les mots clefs suivants sont disponibles:

  • $Date$ : La date du commit.
  • $Revision$ : Le numéro de la révision où le fichier a été modifié pour la dernière fois.
  • $Author$ : Le nom de l'auteur de la modification.
  • $HeadURL$ : L'URL de la dernière version du fichier dans le dépôt Subversion.
  • $Id$ : Un résumé des mots-clefs ci-dessus.

Ajouter ces mots clefs à vos fichiers ne suffit pas. Il faut activer explicitement ce réglage. Pour un fichier donné cela se fait grâce à la ligne de commande:

svn propset svn:keywords "Date Author" mon-fichier.txt

Si vous souhaitez que certains mots clefs soient substituées dans tous les fichiers que vous ajoutez au dépôt, cela peut se configurer dans le fichier ${HOME}/subversion/config. Pour ce faire, votre fichier de configuration doit ressembler à :

[miscellany]
enable-auto-props = yes

[auto-props]
*.php = svn:keywords="Id Author Date"

Subversion Global Ignores

Marqué :

If you’re a Mac OS X user running Subversion on the command line and mounting remote disks you may have run into instances where you want to globally ignore ._*, .AppleDouble, and *:2e_* files. To do this simply open your Terminal and edit your ~/.subversion/config file and look for the line below.

#global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store

Uncomment it by removing the # and add the necessary additional exclusions and it will now look like this.

global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store ._* .AppleDouble *:2e_*

Save it and you’re all set. Now you won’t need to edit your svn:ignore property for every project!