<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4362521529694319627</id><updated>2011-11-28T00:35:18.287+01:00</updated><title type='text'>lucy in the sky with ruby</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jney.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4362521529694319627/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://jney.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>jean-sébastien</name><uri>http://www.blogger.com/profile/17460049140621353804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4362521529694319627.post-5756515131152015628</id><published>2010-02-25T16:47:00.004+01:00</published><updated>2010-02-25T17:04:41.172+01:00</updated><title type='text'>Inserer HTML page into another HTML page</title><content type='html'>&lt;h2&gt;...Ou comment se débarasser des iframes en xhtml strict?&lt;/h2&gt;&lt;br /&gt;Aleksandar Vacić dans son &lt;a href="http://aplus.rs/web-dev/insert-html-page-into-another-html-page/" target="_blank"&gt;post&lt;/a&gt; explique comment utiliser l'élément &lt;span style="font-style:italic;"&gt;&amp;lt;object&amp;gt;&lt;/span&gt; pour inclure du html dans une autre page.&lt;br /&gt;&lt;br /&gt;Voici le code :&lt;br/&gt;&lt;br /&gt;&lt;script src="http://gist.github.com/314653.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4362521529694319627-5756515131152015628?l=jney.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jney.blogspot.com/feeds/5756515131152015628/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4362521529694319627&amp;postID=5756515131152015628' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4362521529694319627/posts/default/5756515131152015628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4362521529694319627/posts/default/5756515131152015628'/><link rel='alternate' type='text/html' href='http://jney.blogspot.com/2010/02/inserer-html-page-into-another-html.html' title='Inserer HTML page into another HTML page'/><author><name>jean-sébastien</name><uri>http://www.blogger.com/profile/17460049140621353804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4362521529694319627.post-7534342502983432312</id><published>2008-09-06T14:36:00.000+02:00</published><updated>2008-09-06T14:47:56.300+02:00</updated><title type='text'>Regex Named group</title><content type='html'>En lisant la &lt;a href="http://codefluency.com/articles/2008/04/13/migrating-to-ruby-1-9/"&gt;présentation&lt;/a&gt; de &lt;a href="http://codefluency.com/"&gt;Bruce Williams&lt;/a&gt;, je tombe sur une fonctionnalité très intéressante des expressions régulières sous ruby 1.9, les named group.&lt;br /&gt;En particulier "?&lt;&gt;" qui permet d'extraire des expressions sous forme de hash. exemple :&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&gt;&gt; "His name is Joe".match(/name is (?&lt;name&gt;\S+)/)[:name]&lt;br /&gt;=&gt; "Joe"&lt;br /&gt;&lt;/name&gt;&lt;/code&gt;&lt;/pre&gt;J'adore ça.&lt;br /&gt;&lt;br /&gt;Fait étonnant, cette fonctionnalité est déjà présente dans la dernière version de JRuby : 1.1.4 (je n'ai pas tester les précédentes).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4362521529694319627-7534342502983432312?l=jney.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jney.blogspot.com/feeds/7534342502983432312/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4362521529694319627&amp;postID=7534342502983432312' title='1 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4362521529694319627/posts/default/7534342502983432312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4362521529694319627/posts/default/7534342502983432312'/><link rel='alternate' type='text/html' href='http://jney.blogspot.com/2008/09/regex-named-group.html' title='Regex Named group'/><author><name>jean-sébastien</name><uri>http://www.blogger.com/profile/17460049140621353804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4362521529694319627.post-2316711727406467065</id><published>2008-04-08T23:51:00.000+02:00</published><updated>2008-04-09T00:35:48.717+02:00</updated><title type='text'>Installer le gem memcached sous freebsd</title><content type='html'>&lt;a href="http://blog.evanweaver.com/files/doc/fauna/memcached/files/README.html"&gt;memcached&lt;/a&gt; est un plugin memcache de &lt;a href="http://blog.evanweaver.com/"&gt;Evan Weaver&lt;/a&gt; qui a des &lt;a href="http://blog.evanweaver.com/files/doc/fauna/memcached/files/BENCHMARKS.html"&gt;benchmarks impressionants&lt;/a&gt;, en effet memcached est jusqu'à 150x plus rapide que &lt;a href="http://seattlerb.rubyforge.org/memcache-client/"&gt;memcache-client&lt;/a&gt;, et jusqu'à 15x plus rapide que &lt;a href="http://blog.methodmissing.com/2007/6/4/get-your-caffeine-on/"&gt;caffeine&lt;/a&gt;. Il s'appuie sur la librairie &lt;a href="http://tangent.org/552/libmemcached.html"&gt;libmemcached&lt;/a&gt;.&lt;h2&gt;Installation de libmemcached&lt;/h2&gt;le plugin nécessite la version 0.16.&lt;br /&gt;avec portdowngrade selectionner la version 0.16.&lt;br /&gt;&lt;code&gt;cd /usr/ports/databases/libmemcached/ &amp;amp;&amp;amp; make install clean&lt;/code&gt;&lt;br /&gt;si durant l'installation le port libmemcached-0.16.tar.gz est introuvable le télécharger &lt;a href="http://www.box.net/shared/ksqcl3688g"&gt;ici&lt;/a&gt; et le placer dans le répertoire /usr/ports/distfiles, puis relancer l'installation&lt;br /&gt;&lt;h2&gt;Installation du gem&lt;/h2&gt;&lt;code&gt;gem install --no-ri --no-rdoc memcached -- --with-opt-include=/usr/local/include&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4362521529694319627-2316711727406467065?l=jney.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jney.blogspot.com/feeds/2316711727406467065/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4362521529694319627&amp;postID=2316711727406467065' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4362521529694319627/posts/default/2316711727406467065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4362521529694319627/posts/default/2316711727406467065'/><link rel='alternate' type='text/html' href='http://jney.blogspot.com/2008/04/installer-le-gem-memcached-sous-freebsd.html' title='Installer le gem memcached sous freebsd'/><author><name>jean-sébastien</name><uri>http://www.blogger.com/profile/17460049140621353804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4362521529694319627.post-7984337338872105405</id><published>2008-04-06T19:21:00.000+02:00</published><updated>2008-04-06T21:56:29.609+02:00</updated><title type='text'>Configuration de base d'un serveur freebsd</title><content type='html'>&lt;h2&gt;Services à proscrire&lt;/h2&gt;Ne surtout pas activer telnetd et ftpd.&lt;br /&gt;&lt;h2&gt;Configuration du réseau&lt;/h2&gt;1. /etc/rc.conf&lt;br /&gt;&lt;code&gt;hostname="nom_de_la_machine"&lt;br /&gt;ifconfig_ed0="inet xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx"&lt;br /&gt;defaultrouter="xxx.xxx.xxx.xxx"&lt;/code&gt;&lt;br /&gt;2. /etc/resolv.conf&lt;br /&gt;&lt;code&gt;domain mon_domaine&lt;br /&gt;nameserver adresse.du.dns&lt;/code&gt;&lt;br /&gt;&lt;h2&gt;Ports&lt;/h2&gt;1. /etc/make.conf&lt;br /&gt;Fichier utilisé par make et important car les ports sont compilés avec cet outil pour la plupart d'entre eux. Ajouter la ligne suivante:&lt;br /&gt;&lt;code&gt;CFLAGS= -O -pipe&lt;/code&gt;&lt;div&gt;&lt;code&gt;&lt;/code&gt;&lt;span class="Apple-style-span"   style=" ;font-family:-webkit-monospace;font-size:13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;2. /usr/local/etc/pkgtools.conf&lt;br /&gt;Fichier utilisé par portupgrade et autres portinstall. Compléter MAKE_ARGS de la façon suivante:&lt;br /&gt;&lt;code&gt;MAKE_ARGS = {&lt;br /&gt;'java/jdk*' =&gt; 'WITHOUT_WEB=yes',&lt;br /&gt;'editors/vim' =&gt; 'NO_GUI=yes',&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style=" ;font-family:-webkit-monospace;font-size:13px;"&gt;&lt;br /&gt;&lt;/span&gt;3. recupération des ports&lt;br /&gt;&lt;code&gt;portsnap fetch &amp;amp;&amp;amp; portsnap extract&lt;/code&gt;&lt;br /&gt;&lt;h2&gt;Programmes de base&lt;/h2&gt;&lt;h3&gt;vim&lt;/h3&gt;&lt;code&gt;cd /usr/ports/editors/vim &amp;amp;&amp;amp; make install NO_GUI=yes clean&lt;/code&gt;&lt;br /&gt;&lt;h3&gt;sudo&lt;/h3&gt;&lt;code&gt;cd /usr/ports/security/sudo &amp;amp;&amp;amp; make install clean&lt;/code&gt;&lt;br /&gt;éditer le fichier /usr/local/etc/sudoers et ajouter la ligne:&lt;br /&gt;&lt;code&gt;%wheel  ALL=(ALL)       ALL&lt;/code&gt;&lt;br /&gt;ici le groupe "wheel" aura le droit de faire des sudo&lt;br /&gt;&lt;h3&gt;portupgrade&lt;/h3&gt;Installation:&lt;br /&gt;&lt;code&gt;cd /usr/ports/ports-mgmt/portupgrade; make install clean&lt;/code&gt;&lt;br /&gt;Met à jour les applications installés via le système des ports (interactif et toutes les applications) :&lt;br /&gt;&lt;code&gt;portupgrade -Rria&lt;/code&gt;&lt;br /&gt;&lt;h3&gt;pkg_cutleaves&lt;/h3&gt;Installation :&lt;br /&gt;&lt;code&gt;cd /usr/ports/ports-mgmt/pkg_cutleaves; make install clean&lt;/code&gt;&lt;br /&gt;&lt;h2&gt;date et heure du serveur&lt;/h2&gt; On ne précise pas le drift, qui est par défaut dans /var/db/ntpd.drift et qu'il faut créer pour éviter les problèmes non évalués pour le moment avec un :&lt;br /&gt;sudo touch /var/db/ntpd.drift&lt;br /&gt;Le contenu de /etc/ntp.conf est le suivant :&lt;div&gt;&lt;br /&gt;&lt;code&gt;# les trois pools français fournissant l'heure&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;server 0.fr.pool.ntp.org&lt;br /&gt;server 1.fr.pool.ntp.org&lt;br /&gt;server 2.fr.pool.ntp.org&lt;br /&gt;# pour éviter que ce serveur soit également un serveur de temps&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;restrict default ignore&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style=" ;font-family:-webkit-monospace;font-size:13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Dans le fichier /etc/rc.conf pour le rendre disponible au démarrage:&lt;br /&gt;&lt;code&gt;# Date&lt;br /&gt;ntpdate_enable="YES"&lt;br /&gt;ntpdate_program="/usr/sbin/ntpdate"&lt;br /&gt;ntpdate_flags="-b"&lt;br /&gt;ntpd_enable="YES"&lt;br /&gt;ntpd_program="/usr/sbin/ntpd"&lt;/code&gt;&lt;br /&gt;&lt;h2&gt;sécurisation&lt;/h2&gt;&lt;h3&gt;ttys&lt;/h3&gt;Mettre insecure à la place de tous les secure pour empêcher de se logguer en root (via telnet et cie)&lt;br /&gt;En single-user, le password sera demandé parce que si console reste secure, le password n'est pas demandé.&lt;br /&gt;&lt;code&gt;vi /etc/ttys&lt;br /&gt;:%s/secure/insecure/g&lt;/code&gt;&lt;br /&gt;&lt;h3&gt;configuration de ssh&lt;/h3&gt;1. Activer dans le fichier de config /etc/rc.conf&lt;br /&gt;&lt;code&gt;sshd_enable="YES"&lt;/code&gt; &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2. Dans /etc/ssh/sshd_config, décommenter :&lt;br /&gt;&lt;code&gt;# interdiction du login root en ssh&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;PermitRootLogin no&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;# utile en cas de mis en place de jails&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;ListenAddress adresse.du.serveur &lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3. Générer une clé publique et privée avec openssh du côté des machines clients se connectant au serveur FreeBSD :&lt;br /&gt;&lt;code&gt;ssh-keygen -t dsa&lt;/code&gt; (avec tous les choix par défaut).&lt;br /&gt;Placer ensuite la clé publique (~/.ssh/id_dsa.pub) dans le fichier authorized_keys du répertoire .ssh de votre compte côté serveur.&lt;/div&gt;&lt;div&gt;&lt;h3&gt;firewall&lt;/h3&gt;1. à activer dans /etc/rc.conf via:&lt;br /&gt;firewall_enable="YES"&lt;br /&gt;firewall_logging="YES"&lt;br /&gt;firewall_script="/etc/ipfw.rules"&lt;br /&gt;&lt;br /&gt;2. Définir le verbose du logging dans /etc/sysctl.conf via:&lt;br /&gt;net.inet.ip.fw.verbose_limit=5&lt;br /&gt;&lt;br /&gt;3. Créer le fichier /etc/ipfw.rules avec les règles voulues&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4362521529694319627-7984337338872105405?l=jney.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jney.blogspot.com/feeds/7984337338872105405/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4362521529694319627&amp;postID=7984337338872105405' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4362521529694319627/posts/default/7984337338872105405'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4362521529694319627/posts/default/7984337338872105405'/><link rel='alternate' type='text/html' href='http://jney.blogspot.com/2008/04/configuration-de-base-dun-serveur.html' title='Configuration de base d&apos;un serveur freebsd'/><author><name>jean-sébastien</name><uri>http://www.blogger.com/profile/17460049140621353804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4362521529694319627.post-384907347323252336</id><published>2008-04-03T23:51:00.000+02:00</published><updated>2008-04-04T00:05:07.675+02:00</updated><title type='text'>installation de mysql sous freebsd7</title><content type='html'>&lt;h2&gt;Installation du package&lt;/h2&gt;&lt;code&gt; cd /usr/ports/databases/mysql51-server&lt;br /&gt;&lt;br /&gt;make install BUILD_STATIC=yes BUILD_OPTIMIZED=yes WITH_CHARSET=utf8 WITH_COLLATION=utf8_general_ci clean &lt;/code&gt;&lt;br /&gt;Possibilité d'ajouter l'option WITH_LINUXTHREADS=yes mais je ne sais pas si ça change quelque chose sur freebsd7 contenu des perfs de mysql&lt;br /&gt;&lt;h2&gt;initialisation&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;initialisation de db: &lt;code&gt;mysql_install_db&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;code&gt;chown -R mysql /var/db/mysql/&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;code&gt;chgrp -R mysql /var/db/mysql/&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;code&gt;/usr/local/bin/mysqld_safe –user=mysql &amp;amp;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;renseignement du password root : &lt;code&gt;/usr/local/bin/mysqladmin -u root password 'newpassword'&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;editer /etc/rc.conf et ajouter:&lt;br /&gt;&lt;code&gt;mysql_enable="YES"&lt;/code&gt;&lt;br /&gt;ajouter les règles suivantes au firewall pour mysql si vous souhaitez l'administer à distance&lt;br /&gt;&lt;code&gt; # Allow in/out MySQL&lt;br /&gt;&lt;br /&gt;$cmd 00190 allow tcp from me to any 3306 out via $pif setup keep-state&lt;br /&gt;$cmd 00191 allow tcp from any to me 3306 in via $pif setup keep-state &lt;/code&gt;&lt;br /&gt;&lt;br /&gt;autorisé le root à distance (pas secure, seulement pour les configurations de test)&lt;br /&gt;&lt;code&gt;mysql -u root -p&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;GRANT ALL ON *.* TO root@'192.168.1.10' IDENTIFIED BY 'password';&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4362521529694319627-384907347323252336?l=jney.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jney.blogspot.com/feeds/384907347323252336/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4362521529694319627&amp;postID=384907347323252336' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4362521529694319627/posts/default/384907347323252336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4362521529694319627/posts/default/384907347323252336'/><link rel='alternate' type='text/html' href='http://jney.blogspot.com/2008/04/installation-de-mysql-sous-freebsd7.html' title='installation de mysql sous freebsd7'/><author><name>jean-sébastien</name><uri>http://www.blogger.com/profile/17460049140621353804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4362521529694319627.post-7450857283812866134</id><published>2008-04-03T21:28:00.000+02:00</published><updated>2008-04-03T21:50:47.243+02:00</updated><title type='text'>installation ebb sous freebsd7</title><content type='html'>&lt;a href="http://ebb.rubyforge.org/"&gt;ebb&lt;/a&gt; est LE serveur web pour les applications ruby le plus rapide du moment.&lt;br /&gt;&lt;h2&gt;installer glib2&lt;/h2&gt;&lt;code&gt;cd /usr/ports/devel/glib20/ &amp;amp;&amp;amp; make install clean&lt;/code&gt;&lt;br /&gt;&lt;h2&gt;installer libev&lt;/h2&gt;&lt;code&gt;cd /usr/ports/devel/libev/ &amp;amp;&amp;amp; make install clean&lt;/code&gt;&lt;br /&gt;&lt;h2&gt;installer le gem&lt;/h2&gt;installer ruby-gems si ce n'est pas déjà fait:&lt;br /&gt;&lt;code&gt;cd /usr/ports/devel/ruby-gems/ &amp;amp;&amp;amp; make install clean&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;puis &lt;br /&gt;&lt;code&gt;gem install --no-ri --no-rdoc ebb&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;utiliser en suite ebb avec rails :&lt;br /&gt;ebb_rails&lt;br /&gt;ou avec merb :&lt;br /&gt;merb -a ebb&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4362521529694319627-7450857283812866134?l=jney.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jney.blogspot.com/feeds/7450857283812866134/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4362521529694319627&amp;postID=7450857283812866134' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4362521529694319627/posts/default/7450857283812866134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4362521529694319627/posts/default/7450857283812866134'/><link rel='alternate' type='text/html' href='http://jney.blogspot.com/2008/04/installation-ebb-sous-freebsd7.html' title='installation ebb sous freebsd7'/><author><name>jean-sébastien</name><uri>http://www.blogger.com/profile/17460049140621353804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4362521529694319627.post-1037652848652012122</id><published>2008-03-15T02:07:00.000+01:00</published><updated>2008-03-15T02:20:44.846+01:00</updated><title type='text'>fonzz.com</title><content type='html'>Un message uniquement pour dire à quel point je suis content d'avoir des retour bons et moins sur un service que nous (7theories) avons lancé.&lt;br /&gt;C'est le cas pour &lt;a href="http://www.fonzz.com"&gt;fonZz&lt;/a&gt; qui a été le sujet de 3 posts cette semaine:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://blog.accessoweb.info/fonZz-un-nouveau-comparatif-de-prix-social_a2984.html"&gt;access web&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.capitaine-commerce.com/index.php/2008/03/10/550-en-bref-visitoyscom-saysayfr-et-fonzzcom"&gt;capitaine-commerce&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.geekomatik.com/fonzz-un-nouveau-comparatif-de-prix-social"&gt;geekomatik&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;Et nous allons faire en sorte que ce ne soit que le début.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4362521529694319627-1037652848652012122?l=jney.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jney.blogspot.com/feeds/1037652848652012122/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4362521529694319627&amp;postID=1037652848652012122' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4362521529694319627/posts/default/1037652848652012122'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4362521529694319627/posts/default/1037652848652012122'/><link rel='alternate' type='text/html' href='http://jney.blogspot.com/2008/03/fonzzcom.html' title='fonzz.com'/><author><name>jean-sébastien</name><uri>http://www.blogger.com/profile/17460049140621353804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4362521529694319627.post-52007899559241346</id><published>2008-03-11T01:01:00.000+01:00</published><updated>2008-03-11T01:34:04.865+01:00</updated><title type='text'>jquery et protect_from_forgery</title><content type='html'>protect_from_forgery est parfait pour protéger des attaques CSRF, mais il n'est pas possible d'utiliser les verbes POST, PUT, DELETE sans donner la clé au serveur.&lt;br /&gt;Dans une implémentation rails classique c'est à dire avec prototype, c'est plutôt facile de faire des actions Ajax, car link_to_remote n'est autre qu'un formulaire avec la clé inclue.&lt;br /&gt;&lt;br /&gt;Voici la solution que j'utilise avec jquery:&lt;br /&gt;J'utilise des classes css sur mes liens pour dire quel verbe http utiliser. par exemple:&lt;br /&gt;&lt;code&gt;link_to 'toto', post_path(@post), :class =&gt; 'delete remote'&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Mon code jquery pour géré le lien est les suivant:&lt;br /&gt;&lt;code&gt;$('a.remote.delete').bind('click',function(){&lt;br /&gt;       var _href = this.getAttribute('href')&lt;br /&gt;       $.ajax({&lt;br /&gt;         url: _href, data: {_method: "delete"},&lt;br /&gt;         beforeSend: function(xhr) {&lt;br /&gt;           xhr.setRequestHeader("Accept", "text/javascript")},&lt;br /&gt;         dataType: 'script',&lt;br /&gt;         type: 'DELETE'})&lt;br /&gt;       return false })&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Jusqu'ici tout va bien... Malheureusement quand on essaie de cliquer sur le lien on aura une erreur, la clé n'est pas présente.&lt;br /&gt;Donc je soumet la clé (form_authenticity_token) directement dans le lien. voici le petit helper qui m'aide à faire ça :&lt;br /&gt;&lt;code&gt;def secure_link_to(name, options = {}, html_options = nil, *parameters_for_method_reference)&lt;br /&gt; options += (options.include?('?') ? '&amp;amp;' : '?') +&lt;br /&gt;   "#{request_forgery_protection_token.to_s}=#{form_authenticity_token}"&lt;br /&gt; link_to(name, options, html_options)&lt;br /&gt;end&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Il suffit maintenant d'appeler:&lt;br /&gt;&lt;code&gt;secure_link_to 'toto', post_path(@post), :class =&gt; 'delete remote'&lt;/code&gt;&lt;br /&gt;et le tour est joué.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4362521529694319627-52007899559241346?l=jney.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jney.blogspot.com/feeds/52007899559241346/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4362521529694319627&amp;postID=52007899559241346' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4362521529694319627/posts/default/52007899559241346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4362521529694319627/posts/default/52007899559241346'/><link rel='alternate' type='text/html' href='http://jney.blogspot.com/2008/03/jquery-et-protectfromforgery.html' title='jquery et protect_from_forgery'/><author><name>jean-sébastien</name><uri>http://www.blogger.com/profile/17460049140621353804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4362521529694319627.post-4402434192322907593</id><published>2008-03-10T04:46:00.000+01:00</published><updated>2008-03-10T04:51:02.535+01:00</updated><title type='text'>4 beta invites pour github</title><content type='html'>S'il y en a que ça intéresse j'ai 4 invitations pour github, ça vous évitera d'attendre le délai de quelques jours. mailez moi à cette adresse:&lt;br /&gt;&lt;code&gt;ruby&gt;&gt; "jney@%s.com" % "7theories"&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4362521529694319627-4402434192322907593?l=jney.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jney.blogspot.com/feeds/4402434192322907593/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4362521529694319627&amp;postID=4402434192322907593' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4362521529694319627/posts/default/4402434192322907593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4362521529694319627/posts/default/4402434192322907593'/><link rel='alternate' type='text/html' href='http://jney.blogspot.com/2008/03/4-beta-invites-pour-github.html' title='4 beta invites pour github'/><author><name>jean-sébastien</name><uri>http://www.blogger.com/profile/17460049140621353804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4362521529694319627.post-5116682587818102953</id><published>2008-03-09T18:06:00.000+01:00</published><updated>2008-03-09T18:23:42.663+01:00</updated><title type='text'>Des contraintes jusqu'à 127 caractères sous postgresql</title><content type='html'>Si vous voulez des noms de contraintes (et autres dont colonnes, fonctions,...) sous postgresql qui soient limités à 127 caractères au lieu de 63, il faut:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Télécharger les sources de postgresql:&lt;br /&gt;&lt;code&gt;wget http://wwwmaster.postgresql.org/download/mirrors-ftp?file=%2Fsource%2Fv8.2.6%2Fpostgresql-8.2.6.tar.gz&lt;/code&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Décompresser les sources:&lt;br /&gt;&lt;code&gt;tar xzvf postgresql-8.2.6.tar.gz&lt;/code&gt;&lt;br /&gt;&lt;code&gt;cd postgresql-8.2.6&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Modifier la valeur &lt;code&gt;NAMEDATALEN&lt;/code&gt; dans le fichier src/include/postgres_ext.h, la passer à 128 à la place de 64&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Ensuite compiler postgresql:&lt;br /&gt;&lt;code&gt;./configure --prefix=/usr/local &amp;&amp; make &amp;&amp; make install&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Voila, vous n'avez plus qu'à configurer normalement votre base de données préférée et vous pourrez utiliser des noms beaucoup parlant!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4362521529694319627-5116682587818102953?l=jney.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jney.blogspot.com/feeds/5116682587818102953/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4362521529694319627&amp;postID=5116682587818102953' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4362521529694319627/posts/default/5116682587818102953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4362521529694319627/posts/default/5116682587818102953'/><link rel='alternate' type='text/html' href='http://jney.blogspot.com/2008/03/des-contraintes-jusqu-127-caractres.html' title='Des contraintes jusqu&apos;à 127 caractères sous postgresql'/><author><name>jean-sébastien</name><uri>http://www.blogger.com/profile/17460049140621353804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4362521529694319627.post-7124864196809967882</id><published>2008-03-08T17:46:00.000+01:00</published><updated>2008-03-08T18:04:16.718+01:00</updated><title type='text'>namespacing avec jquery</title><content type='html'>A un moment donné j'avais besoin de "namespacé" mes fonctions et plugins avec jquery donc j'avais posé la &lt;a href="http://groups.google.com/group/jquery-en/browse_thread/thread/c9bf7bfc46522353"&gt;question&lt;/a&gt; sur le groupe jquery.&lt;br /&gt;&lt;br /&gt;Voici le code permettant d'avoir la fonction namespace:&lt;code&gt;&lt;br /&gt;$.namespace = function(ns, functions){&lt;br /&gt;  $.fn[ns] = function() {return this.extend(functions)}&lt;br /&gt;}&lt;br /&gt;$.namespace('$', $.fn) // the default namespace&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Une fois, cette fonction déclarée vous pouvez déclarer les namespaces que vous desirez.&lt;br /&gt;&lt;br /&gt;exemple:&lt;code&gt;&lt;br /&gt;$.namespace('mon_namespace', {&lt;br /&gt;  ma_fonction: function(){&lt;br /&gt;    $(this).each(function(){alert($(this).attr('id'))})&lt;br /&gt;  }&lt;br /&gt;})&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;que vous appelerez comme ceci:&lt;br /&gt;&lt;code&gt;$('#mon_div').mon_namespace().ma_fonction()&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4362521529694319627-7124864196809967882?l=jney.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jney.blogspot.com/feeds/7124864196809967882/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4362521529694319627&amp;postID=7124864196809967882' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4362521529694319627/posts/default/7124864196809967882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4362521529694319627/posts/default/7124864196809967882'/><link rel='alternate' type='text/html' href='http://jney.blogspot.com/2008/03/namespacing-avec-jquery.html' title='namespacing avec jquery'/><author><name>jean-sébastien</name><uri>http://www.blogger.com/profile/17460049140621353804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4362521529694319627.post-7903931891665820877</id><published>2008-03-08T01:46:00.000+01:00</published><updated>2008-03-08T02:20:28.336+01:00</updated><title type='text'>importer les contacts avec ruby on rails</title><content type='html'>Il est toujours intéressant de proposer à l'utilisateur d'importer les contacts de ces différents réseaux, aussi bien pour lui que pour agrandir votre propre réseau.&lt;br /&gt;&lt;br /&gt;Importer les contacts avec rails n'a pas été si facile la seule librairie disponible été &lt;a href="http://rubyforge.org/projects/contacts/"&gt;contacts&lt;/a&gt;. Très facile d'utilisation mais les seuls comptes fonctionnant était les comptes gmail. Ceci étant dis cette librairie a été remise à jour récemment. Donc j'imagine qu'elle doit marcher normalement maintenant.&lt;br /&gt;&lt;br /&gt;Il y a quelques mois de ça, est sortie la librairie &lt;a href="http://rubyforge.org/projects/contentfree/"&gt;Blackbook&lt;/a&gt;, simple et fiable. Pour importer les contacts pas besoin de selectionner le réseau (hotmail, gmail, yahoo etc...), simplement login et le mot de passe et la Blackbook se débrouille :&lt;br /&gt;&lt;code&gt;@contacts = Blackbook.get :username =&gt; params[:email], :password =&gt; params[:password]&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Ceci retournera un Array de Hash. Le soucis c'est que selon le reseau les Hash renvoyés n'auront pas les mêmes clés.&lt;br /&gt;sous gmail:&lt;br /&gt;&lt;code&gt;{:name=&gt;"johnny", :email=&gt; "johnny.h@fakemail.fr"}&lt;/code&gt;&lt;br /&gt;sous hotmail/live:&lt;br /&gt;&lt;code&gt;{:name=&gt;"johnny", :email=&gt;"", :"Windows Live ID"=&gt;"johnny.h@fakemail.fr"}&lt;/code&gt;&lt;br /&gt;sous yahoo:&lt;br /&gt;&lt;code&gt;{:name=&gt;"mail: johnny.h@fakemail.fr ", :email=&gt;"@yahoo.com"}&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Donc le seul moyen est de parser l'Array et d'en extraire nom et email:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;@contacts = @contacts.collect do |contact|&lt;br /&gt;  email = nil # doit être initialiser&lt;br /&gt;  # initialalisation du nom du contact&lt;br /&gt;  name  = contact[:name] if !contact[:name].include?('@')&lt;br /&gt;  # recherche de l'email dans toutes clés du hash&lt;br /&gt;  contact.each_value do |e|&lt;br /&gt;    # on regarde avec une expression regulière &lt;br /&gt;    # si on trouve qqchose qui ressemble a un email&lt;br /&gt;    # si on trouve on passe à l'élément suivant&lt;br /&gt;    (email = e.match(/([_\w\d-]+(\.[_\w\d-]+)*@[\w\d-]+(\.[\w\d-]{2,})+)|(^$)/i)[0] rescue nil) &amp;&amp; break&lt;br /&gt;  end&lt;br /&gt;  {:name =&gt; name, :email =&gt; email} if !email.blank? &amp;&amp; !current_user.email?(email)&lt;br /&gt;end.compact&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Voilà, le tour est joué on se retrouve avec un array de hash bien organisé, du style:&lt;br /&gt;&lt;code&gt;{:name=&gt;"johnny", :email=&gt; "johnny.h@fakemail.fr"}&lt;/code&gt;&lt;br /&gt;quelque soit le compte sur lequel on se connecte.&lt;br /&gt;&lt;br /&gt;à noter que les noms ne seront pas obligatoirement bon mais le principal est d'avoir les emails pour envoyer les invitations.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4362521529694319627-7903931891665820877?l=jney.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jney.blogspot.com/feeds/7903931891665820877/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4362521529694319627&amp;postID=7903931891665820877' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4362521529694319627/posts/default/7903931891665820877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4362521529694319627/posts/default/7903931891665820877'/><link rel='alternate' type='text/html' href='http://jney.blogspot.com/2008/03/importer-les-contacts-avec-ruby-on.html' title='importer les contacts avec ruby on rails'/><author><name>jean-sébastien</name><uri>http://www.blogger.com/profile/17460049140621353804</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
