<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss1frenchfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns="http://purl.org/rss/1.0/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">

<channel rdf:about="http://b.twidi.com/index.php/">
  <title>Le TwiBlog</title>
  <description><![CDATA[The one with Titi]]></description>
  <link>http://b.twidi.com/index.php/</link>
  <dc:language>fr</dc:language>
  <dc:creator />
  <dc:rights />
  <dc:date>2011-10-18T15:22:47+02:00</dc:date>
  <admin:generatorAgent rdf:resource="http://www.dotclear.net/" />
  
  <sy:updatePeriod>daily</sy:updatePeriod>
  <sy:updateFrequency>1</sy:updateFrequency>
  <sy:updateBase>2011-10-18T15:22:47+02:00</sy:updateBase>
  
  <items>
  <rdf:Seq>
    <rdf:li rdf:resource="http://b.twidi.com/index.php/2011/10/18/113-django-13-et-postgresql-probleme-lie-a-pysocopg-sous-ubuntu-oneiric" />
  <rdf:li rdf:resource="http://b.twidi.com/index.php/2011/10/18/112-vim-effectuer-une-action-a-l-enregistrement-sauf-dans-un-repertoire" />
  <rdf:li rdf:resource="http://b.twidi.com/index.php/2011/06/21/111-lire-une-video-flash-en-plein-ecran-sous-linux-bloque-l-ecran-la-solution" />
  <rdf:li rdf:resource="http://b.twidi.com/index.php/2011/05/16/110-dotcloud-django-and-auth_basic-exclude-a-file-or-a-path-from-authentication" />
  <rdf:li rdf:resource="http://b.twidi.com/index.php/2010/12/30/109-recuperer-une-session-firefox-perdue-par-erreur" />
  <rdf:li rdf:resource="http://b.twidi.com/index.php/2010/12/11/108-transform-a-linear-git-repository-into-a-one-adapted-to-a-workflow-named-git-flow" />
  <rdf:li rdf:resource="http://b.twidi.com/index.php/2010/12/11/107-duplicate-a-git-repository" />
  <rdf:li rdf:resource="http://b.twidi.com/index.php/2010/08/31/106-flux-rss-de-votre-timeline-facebook" />
  <rdf:li rdf:resource="http://b.twidi.com/index.php/2010/06/03/105-trier-les-entrees-par-titre-dans-google-reader" />
  <rdf:li rdf:resource="http://b.twidi.com/index.php/2010/02/16/104-meego-osfr-nouveau-blog-sur-meego-le-nouvel-os-de-nokia-et-intel" />
  </rdf:Seq>
  </items>
<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rdf+xml" href="http://feeds.feedburner.com/Twiblog" /><feedburner:info uri="twiblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FTwiblog" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/Twiblog" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FTwiblog" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FTwiblog" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FTwiblog" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://add.my.yahoo.com/content?lg=fr&amp;url=http%3A%2F%2Ffeeds.feedburner.com%2FTwiblog" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/bn/intatm_fr_1.gif">Subscribe with Mon Yahoo!</feedburner:feedFlare></channel>

<item rdf:about="http://b.twidi.com/index.php/2011/10/18/113-django-13-et-postgresql-probleme-lie-a-pysocopg-sous-ubuntu-oneiric">
  <title>Django 1.3 et postgresql (problème lié à pysocopg sous ubuntu oneiric)</title>
  <link>http://feedproxy.google.com/~r/Twiblog/~3/woWcXj72-ZE/113-django-13-et-postgresql-probleme-lie-a-pysocopg-sous-ubuntu-oneiric</link>
  <dc:date>2011-10-18T15:22:47+02:00</dc:date>
  <dc:language>fr</dc:language>
  <dc:creator>Twidi</dc:creator>
  <dc:subject>Développement</dc:subject>
  <description>Vous utilisez django ? En version &lt;= 1.3.1 ?


Vous utilisez postgresql ? (qui utiliserait encore mysql...)


Vous venez de mettre à jour votre (k)unbutu en oneiric ?


Jusque là, tout va bien.


mais d'un coup soudain votre navigateur vous affichera un méchant message au lieu...</description>
  <content:encoded><![CDATA[ <p>Vous utilisez django&nbsp;? En version &lt;= 1.3.1&nbsp;?</p>


<p>Vous utilisez postgresql&nbsp;? (qui utiliserait encore mysql...)</p>


<p>Vous venez de mettre à jour votre (k)unbutu en oneiric&nbsp;?</p>


<p>Jusque là, tout va bien.</p>


<p>mais d'un coup soudain votre navigateur vous affichera un méchant message au lieu de votre belle page&nbsp;:</p>


<pre> Exception Value: current transaction is aborted, commands ignored until end of transaction block</pre>


<p>Ou alors (car ce n'est pas systématique) un jour vous allez lancer un test de votre application django.</p>


<p>Et là c'est le drame&nbsp;:</p>


<pre> psycopg2.ProgrammingError: autocommit cannot be used inside a transaction</pre>


<p>MAIS !!??</p>


<p>Le coupable est identifié&nbsp;: <strong>psycopg2</strong> qui, en version 2.4.2, casse plus ou moins django.</p>


<p>Le bug est référencé sur le tracker django&nbsp;: <a href="https://code.djangoproject.com/ticket/16250" hreflang="fr">https://code.djangoproject.com/ticket/16250</a></p>


<p>Il est "fixé" mais comme indiqué dans le dernier commentaire, le fix n'est pas dans django 1.3.1 et ne sera donc disponible qu'à partir de django 1.4.</p>


<p>Comment faire&nbsp;?</p>


<p>Simple.</p>


<p>Il faut donc utiliser psycopg 2.4.1 au lieu de psycopg 2.4.2 fourni avec la dernière ubuntu. Malheureusement le paquet n'est pas disponible.</p>


<p>Pas grave, nous allons le faire à la main&nbsp;!</p>


<p>Avant tout cela vous voudrez peut-être supprimer la version 2.4.2 de psycopg de votre système, dans ce cas&nbsp;:</p>


<pre> sudo apt-get --purge remove python-psycopg2</pre>


<p>Puis on commence par installer dans le système les paquets nécessaires à la compilation (n'ayez pas peur) de psycopg2&nbsp;:</p>


<pre> sudo apt-get build-dep python-psycopg2</pre>


<p>Et enfin on va installer la version voulue via pip (mettez sudo si vous n'êtes pas dans un virtualenv)&nbsp;:</p>


<pre> pip install psycopg2==2.4.1</pre>


<p>Et voilà tout remarche comme avant&nbsp;!</p><img src="http://feeds.feedburner.com/~r/Twiblog/~4/woWcXj72-ZE" height="1" width="1"/>]]></content:encoded>
<feedburner:origLink>http://b.twidi.com/index.php/2011/10/18/113-django-13-et-postgresql-probleme-lie-a-pysocopg-sous-ubuntu-oneiric</feedburner:origLink></item>
<item rdf:about="http://b.twidi.com/index.php/2011/10/18/112-vim-effectuer-une-action-a-l-enregistrement-sauf-dans-un-repertoire">
  <title>VIM : effectuer une action à l'enregistrement SAUF dans un répertoire</title>
  <link>http://feedproxy.google.com/~r/Twiblog/~3/LHDGe_PKbnY/112-vim-effectuer-une-action-a-l-enregistrement-sauf-dans-un-repertoire</link>
  <dc:date>2011-10-18T11:36:25+02:00</dc:date>
  <dc:language>fr</dc:language>
  <dc:creator>Twidi</dc:creator>
  <dc:subject>Développement</dc:subject>
  <description>J'utilise vim pour coder, ce depuis des années.


Comme je n'aime pas les espaces inutiles, j'ai une petite ligne de configuration dans mon .vimrc qui supprime les espaces (ou caractères équivalents) en fin de ligne :


autocmd BufWritePre * %s/\s\+$//e


Sur un projet où je travaille, on m'a...</description>
  <content:encoded><![CDATA[ <p>J'utilise vim pour coder, ce depuis des années.</p>


<p>Comme je n'aime pas les espaces inutiles, j'ai une petite ligne de configuration dans mon .vimrc qui supprime les espaces (ou caractères équivalents) en fin de ligne&nbsp;:</p>


<pre>autocmd BufWritePre * %s/\s\+$//e</pre>


<p>Sur un projet où je travaille, on m'a demandé explicitement de ne pas le faire. J'ai donc cherché comment ignorer les fichiers dans le répertoire du projet (et sous-répertoires) et après maintes recherches, j'ai fini par trouver&nbsp;:</p>


<pre> autocmd BufWritePre * if expand("%:p") !~ "rep_a_ignorer" | %s/\s\+$//e | endif</pre>


<p>Je commence par récupérer le chemin complet du fichier courant, que je compare à une expression rationnelle, et si ça ne correspond pas, je fais mon remplacement.</p><img src="http://feeds.feedburner.com/~r/Twiblog/~4/LHDGe_PKbnY" height="1" width="1"/>]]></content:encoded>
<feedburner:origLink>http://b.twidi.com/index.php/2011/10/18/112-vim-effectuer-une-action-a-l-enregistrement-sauf-dans-un-repertoire</feedburner:origLink></item>
<item rdf:about="http://b.twidi.com/index.php/2011/06/21/111-lire-une-video-flash-en-plein-ecran-sous-linux-bloque-l-ecran-la-solution">
  <title>Lire une vidéo flash en plein écran sous linux bloque l'écran : la solution</title>
  <link>http://feedproxy.google.com/~r/Twiblog/~3/9Cnq7lL3hds/111-lire-une-video-flash-en-plein-ecran-sous-linux-bloque-l-ecran-la-solution</link>
  <dc:date>2011-06-21T10:53:37+02:00</dc:date>
  <dc:language>fr</dc:language>
  <dc:creator>Twidi</dc:creator>
  <dc:subject>Le grand Ternet</dc:subject>
  <description>Petite mésaventure classique avec Adobe Flash, que personne n'aime mais qui est pourtant aujourd'hui indispensable (si tant qu'on ne tient pas trop à sa batterie, sauf à installer l'excellente extension FlashBlock pour Firefox) : vouloir lire une vidéo, par exemple Youtube, en plein écran,...</description>
  <content:encoded><![CDATA[ <p>Petite mésaventure classique avec Adobe Flash, que personne n'aime mais qui est pourtant aujourd'hui indispensable (si tant qu'on ne tient pas trop à sa batterie, sauf à installer l'excellente <a href="https://addons.mozilla.org/en-US/firefox/addon/flashblock/">extension FlashBlock pour Firefox</a>)&nbsp;: vouloir lire une vidéo, par exemple Youtube, en plein écran, entendre la vidéo se jouer (oui j'ai bien dit entendre, pas voir), mais voir son écran figé sur un aperçu de la vidéo, et plus rien dans X ne répond.</p>


<p>Aucune solution à part redémarrer l'ordinateur ou du moins X.</p>


<p>En 30 secondes de recherche sur le grand ternet, j'ai trouvé <a href="http://ubuntuforums.org/showpost.php?p=9958308&amp;postcount=11" hreflang="en">la solution pour que cela ne se produise plus</a>&nbsp;:</p>


<pre>sudo mkdir /etc/adobe
echo "OverrideGPUValidation=true" &gt;~/mms.cfg
sudo mv ~/mms.cfg /etc/adobe/</pre>

<p>A nous les joies de la HD en plein écran sur Youtube&nbsp;!</p>


<p>PS&nbsp;: ce "freeze" ne se produisait pas forcément tout le temps, et dépend à priori du matériel (carte graphique)</p><img src="http://feeds.feedburner.com/~r/Twiblog/~4/9Cnq7lL3hds" height="1" width="1"/>]]></content:encoded>
<feedburner:origLink>http://b.twidi.com/index.php/2011/06/21/111-lire-une-video-flash-en-plein-ecran-sous-linux-bloque-l-ecran-la-solution</feedburner:origLink></item>
<item rdf:about="http://b.twidi.com/index.php/2011/05/16/110-dotcloud-django-and-auth_basic-exclude-a-file-or-a-path-from-authentication">
  <title>Dotcloud, django and auth_basic : exclude a file or a path from authentication</title>
  <link>http://feedproxy.google.com/~r/Twiblog/~3/eWsYyFTqNfQ/110-dotcloud-django-and-auth_basic-exclude-a-file-or-a-path-from-authentication</link>
  <dc:date>2011-05-16T20:53:43+02:00</dc:date>
  <dc:language>fr</dc:language>
  <dc:creator>Twidi</dc:creator>
  <dc:subject>Logiciel libre</dc:subject>
  <description>I'm currently developing a website in django (more precisely with satchmo) which is hosted on dotcloud for the development version.


To protect this site, i easily set a "basic authentication" by creating a nginx.conf (documented here and more specifically here) site with these lines :...</description>
  <content:encoded><![CDATA[ <p>I'm currently developing a website in <a href="http://www.djangoproject.com/" hreflang="en">django</a> (more precisely with <a href="http://www.satchmoproject.com/" hreflang="en">satchmo</a>) which is hosted on <a href="http;//www.dotcloud.com">dotcloud</a> for the development version.</p>


<p>To protect this site, i easily set a "basic authentication" by creating a <strong>nginx.conf</strong> (documented <a href="http://docs.dotcloud.com/components/python/#customize-the-web-server-configuration" hreflang="en">here</a> and more specifically <a href="http://support.dotcloud.com/entries/20016523-how-to-password-protect-a-django-website" hreflang="en">here</a>) site with these lines&nbsp;:</p>


<pre>   auth_basic "Dev version : restricted access";
   auth_basic_user_file /home/dotcloud/current/.htpasswd;</pre>


<p>But later i encountered a problem with <a href="https://www.paypal.com/ipn/">Paypal and it's "Instant payment notifications" system</a>... because the site is protected and always returned a <strong>401 http error</strong> to Paypal.</p>


<p>When i figured out this mess (not as quickly as i hoped...), i decided to remove the authentication for the "ipn" page in my site, while keeping it on the rest of the site.</p>


<p>So i laughed "ah ah easy to do !" and tried this&nbsp;:</p>


<pre>   location / {
       auth_basic "Dev version : restricted access";
       auth_basic_user_file /home/dotcloud/current/.htpasswd;
   }
   
   location ^~ /shop/checkout/paypal {
       auth_basic off;
   }</pre>


<p>But then, at the end of the "<strong>dotcloud push myapp.dev .</strong>" command, a little error message came to me</p>


<pre>   Reloading nginx configuration: [emerg]: duplicate location "/" in /home/dotcloud/current/nginx.conf:1</pre>


<p>So i checked the main <strong>nginx.conf</strong> file in my dotcloud serveur ("<strong>/etc/nginx/nginx.conf</strong>" and "<strong>/etc/nginx/sites-available/default</strong>", after a "<strong>dotcloud ssh myapp.dev</strong>") and, of course, i saw an existing "<strong>location /</strong>" block.</p>


<p>But... the dotcloud team gave us a chance to arrange this problem, by letting us having a <strong>uwsgi.conf</strong> in our project, which will be included into the existing "<strong>location /</strong>" block.</p>


<p>So, now i have two files&nbsp;:</p>


<p><strong>nginx.conf</strong>&nbsp;:</p>


<pre>   auth_basic_user_file /home/dotcloud/current/.htpasswd;
   
   location = /shop/checkout/paypal/ipn/ {
       auth_basic off;
   }</pre>


<p><strong>uwsgi.conf</strong>&nbsp;:</p>


<pre>  auth_basic "Dev version : restricted access";</pre>


<p>But this is not working. I now have a <strong>404 http error</strong> on the "ipn" page. I don't know how nginx works but i think that it's because <strong>wsgi</strong> is not configured for this page. So, by duplicating the <strong>wsgi</strong> part of the "<strong>location /</strong>" block into mine, it seems ok (no need to touch <strong>uwsgi.conf</strong>, it's ok with only the <strong>auth_basic</strong> line):</p>


<p><strong>nginx.conf</strong>:</p>


<pre>   auth_basic_user_file /home/dotcloud/current/.htpasswd;
   
   location = /shop/checkout/paypal/ipn/ {
       auth_basic off;
       uwsgi_pass   unix:///var/dotcloud/uwsgi.sock;
       uwsgi_param SCRIPT_NAME /;
       uwsgi_param UWSGI_SCRIPT wsgi;
       include        uwsgi_params;
   }</pre>


<p>And NOW, it works :)</p>


<p>I really found this to "hard" for a so simple thing... maybe i do not understand well how to do this. There is a way to avoid the duplicate configuration between the two location blocks&nbsp;? If youi have the answer, and/or a better way to do this, comments are opened&nbsp;!</p>


<p>PS&nbsp;: Be reading the main <strong>nginx.conf</strong> i noticed that it's not just our own <strong>nginx.conf</strong> and <strong>uwsgi.conf</strong> which are included, but <strong>*nginx.conf</strong> and <strong>*uwsgi.conf</strong>.</p>


<p>PPS&nbsp;: thanks to django, satchmo and dotcloud teams. Great tools&nbsp;!</p><img src="http://feeds.feedburner.com/~r/Twiblog/~4/eWsYyFTqNfQ" height="1" width="1"/>]]></content:encoded>
<feedburner:origLink>http://b.twidi.com/index.php/2011/05/16/110-dotcloud-django-and-auth_basic-exclude-a-file-or-a-path-from-authentication</feedburner:origLink></item>
<item rdf:about="http://b.twidi.com/index.php/2010/12/30/109-recuperer-une-session-firefox-perdue-par-erreur">
  <title>Récupérer une session Firefox perdue par erreur</title>
  <link>http://feedproxy.google.com/~r/Twiblog/~3/Ui-zXhb9hY4/109-recuperer-une-session-firefox-perdue-par-erreur</link>
  <dc:date>2010-12-30T10:59:34+01:00</dc:date>
  <dc:language>fr</dc:language>
  <dc:creator>Twidi</dc:creator>
  <dc:subject>Le grand Ternet</dc:subject>
  <description>Il arrive que Firefox crash. Surtout par exemple la version 4, en beta.


Mais Firefox est malin, s'il crash, au retour il vous propose deux options :


Commencer une nouvelle session
Restaurer les onglets de la session précédente (en permettant de supprimer des onglets)


(Depuis Firefox 3.5...</description>
  <content:encoded><![CDATA[ <p>Il arrive que Firefox crash. Surtout par exemple la version 4, en beta.</p>


<p>Mais Firefox est malin, s'il crash, au retour il vous propose deux options&nbsp;:</p>

<ul>
<li>Commencer une nouvelle session</li>
<li>Restaurer les onglets de la session précédente (en permettant de supprimer des onglets)</li>
</ul>

<p>(Depuis Firefox 3.5 il ne propose cette page qu'au second crash consécutif, il charge en effet la session si un seul crash survient, ce qui peut entrainer un autre crash, d'où cet écran permettant de choisir de supprimer certaines pages de la session)</p>


<p>Si comme moi vous vous servez des onglets comme bookmarks, vous pouvez en avoir des dizaines d'ouverts. C'est encore plus pratique avec Firefox 4 et sa gestion de groupes d'onglets (seuls les onglets d'un groupe sont visibles à un moment donnés)</p>


<p>Mais voilà, au lieu de cliquer sur "Restaurer", vous avez cliqué sur "Commencer une nouvelle session". Et là, c'est le drame (oui il fallait que je place cette phrase).</p>


<p>Pas de panique, Firefox a pensé à vous. Il a gardé dans le dossier de votre profil la session précédente dans un fichier de sauvegarde, <strong>sessionstore.bak</strong> Il ne reste qu'à remettre ce fichier à la place du fichier de la vraie session, <strong>sessionstore.js</strong></p>


<p>Il existe deux solutions pour restaurer ce fichier&nbsp;:</p>

<ol>
<li>À la main, en copiant le fichier <strong>sessionstore.bak</strong> à la place de <strong>sessionstore.js</strong>, dans votre fichier profil, une fois Firefox fermé [connaître l'existence de ces fichiers vous permet de faire une sauvegarde de <strong>sessionstore.bak</strong> ou <strong>sessionstore.js</strong> pour une utilisation future)</li>
<li>En tapant <strong>about:sessionrestore</strong> dans la barre d'adresse, ce qui fera de nouveau apparaître la page de choix dont je parlais au début de ce post</li>
</ol>

<p>Et voilà vous pouvez respirer à nouveau.</p>


<p><a href="http://kb.mozillazine.org/Session_Restore" hreflang="en">Plus d'infos sur la resturation des sessions dans Firefox, voir "Session Restore" chez MozillaZine</a> (en anglais)</p><img src="http://feeds.feedburner.com/~r/Twiblog/~4/Ui-zXhb9hY4" height="1" width="1"/>]]></content:encoded>
<feedburner:origLink>http://b.twidi.com/index.php/2010/12/30/109-recuperer-une-session-firefox-perdue-par-erreur</feedburner:origLink></item>
<item rdf:about="http://b.twidi.com/index.php/2010/12/11/108-transform-a-linear-git-repository-into-a-one-adapted-to-a-workflow-named-git-flow">
  <title>Transform a linear git repository into a one adapted to a workflow named git-flow</title>
  <link>http://feedproxy.google.com/~r/Twiblog/~3/SHwS-5KO5sI/108-transform-a-linear-git-repository-into-a-one-adapted-to-a-workflow-named-git-flow</link>
  <dc:date>2010-12-11T20:24:54+01:00</dc:date>
  <dc:language>fr</dc:language>
  <dc:creator>Twidi</dc:creator>
  <dc:subject>Développement</dc:subject>
  <description>For a few months now, i develop "GRead", a Google Reader client written in python + Qt, for use on the Nokia n900, but with the help of PyQt, works also on any desktop.


It's my first complete project, open-source, and managed by Git, on GitHub.


But i come from Subversion and although i...</description>
  <content:encoded><![CDATA[ <p>For a few months now, i develop "GRead", a Google Reader client written in python + Qt, for use on the Nokia n900, but with the help of PyQt, works also on any desktop.</p>


<p>It's my first complete project, open-source, and managed by Git, on GitHub.</p>


<p>But i come from Subversion and although i know that git is really powerful and that i can easily manage branches with it, i used to have the same workflow than with Subversion&nbsp;: a linear one.</p>


<p>I mainly work in the master branch, with some developments done in a specific branch but finally merged in the master without nothing in the master during this time.</p>


<p>It was a "subversion applied to git" way of doing things.</p>


<p>And then i saw a <a href="http://presentation-git.heroku.com/" hreflang="fr">git presentation</a> in Paris and the orator spoked about "<a href="http://nvie.com/posts/a-successful-git-branching-model/" hreflang="en">git-flow</a>".</p>


<p><img src="http://nvie.com/img/2009/12/Screen-shot-2009-12-24-at-11.32.03.png" alt="" /></p>


<p>I was interested in this and i read some stuff about git-flow and decided to apply it to all of my future projects. And on my current main one, GRead</p>


<p>I won't tell you why and how git-flow is great. Just how to transform an linear flow to a git-flow one.</p>


<p>Here is the graph of my repository before&nbsp;:</p>


<p><a href="/images/git-flow/gread-old-flow.png" target="_blank"><img src="/images/git-flow/gread-old-flow.png" alt="" /></a></p>


<p>And after&nbsp;:</p>


<p><a href="/images/git-flow/gread-flow.png" target="_blank"><img src="/images/git-flow/gread-flow.png" alt="" /></a></p>


<p>For transform my graph i wrote a bash script (it took me lot of hours, i just started too learn git !) which will do everything. It will create master and develop branches, and a branch for each feature or hotfix you specify in the script, and for each tag you want, a release branch.</p>

<p>Launch the script it locally, in the directory of a clone of your repository, and all the magic will apply. It can takes a long time to finish. For me it was <a></a>150 commits. The more branches and the more commits you have, the longer it will take to run.</p>

<p>Be careful, some times the script will ask your attention, in several cases&nbsp;:</p>

<ul>
<li>a cherry-pick cannot be applied. Simply ignore it if it's from a merge (read the message just above the alert)</li>
<li>an existing branch will be duplicated, you should answer "Y" to continue for this branch (else the branch is ignored)</li>
</ul>

<p>You can find the <a href="https://gist.github.com/737492" hreflang="en">script "linear-git-to-git-flow.sh"</a>, on GitHub, heavily commented. Just read comments in the first part to know how to use it.</p>

<p>PS : i know that this script can surely be better. But notice that i just started to really use Git... i you have any suggestion i will be happy to enhance this script with your help<img src="http://feeds.feedburner.com/~r/Twiblog/~4/SHwS-5KO5sI" height="1" width="1"/>]]></content:encoded>
<feedburner:origLink>http://b.twidi.com/index.php/2010/12/11/108-transform-a-linear-git-repository-into-a-one-adapted-to-a-workflow-named-git-flow</feedburner:origLink></item>
<item rdf:about="http://b.twidi.com/index.php/2010/12/11/107-duplicate-a-git-repository">
  <title>Duplicate a Git repository</title>
  <link>http://feedproxy.google.com/~r/Twiblog/~3/4ivXTo2p_SY/107-duplicate-a-git-repository</link>
  <dc:date>2010-12-11T18:13:50+01:00</dc:date>
  <dc:language>fr</dc:language>
  <dc:creator>Twidi</dc:creator>
  <dc:subject>Développement</dc:subject>
  <description>Imagine you have a repository on GitHub. And you want to play with objects in the Git internal key value store. For example to create a branch for past commits, rearrange branches, etc, etc.


But it can be preferable to have a test repository to do this if you do not want to lost things...


For me...</description>
  <content:encoded><![CDATA[ <p>Imagine you have a repository on GitHub. And you want to play with objects in the Git internal key value store. For example to create a branch for past commits, rearrange branches, etc, etc.</p>


<p>But it can be preferable to have a test repository to do this if you do not want to lost things...</p>


<p>For me it was to adapt the linear development of an application (<a href="http://github.com/twidi/GRead" hreflang="en">GRead</a>) to a workflow i discovered at a <a href="http://presentation-git.heroku.com/" hreflang="fr">Git presentation</a>&nbsp;: <a href="http://nvie.com/posts/a-successful-git-branching-model/" hreflang="en">Git-flow</a>. I'll explain this in the next post on this blog.</p>


<p>The first thing to do for me was to find a way of duplicate my repository on GitHub on which i can work as it was the original one, with same data.</p>


<p>The solution is easy if you know a little of the Git internal, but for me it was not the case (i just did some pull/commit/push by this time)</p>


<p>So thanks to <a href="http://blog.thomasmango.com/post/731804559/transferring-a-private-repository-on-github" hreflang="en">Thomas Mango</a> for giving me the solution&nbsp;:</p>


<p>0. Some variables</p>

<ul>
<li>$myproject is your project name on github and the name of the directory in which the project was cloned.</li>
<li>$myotherproject is the name of the duplicate.</li>
<li>$meandmyself if your username on GitHub</li>
</ul>

<p>1. Create a new repository on GitHub, but don't follow steps after that. Just create it.</p>


<p>You now have https://github.com/$meandmyself/$myotherproject</p>


<p>Duplicate your local copy of the repository&nbsp;:</p>


<pre> cp -a $myproject $myotherproject</pre>


<p>Change the origin of the copy&nbsp;:</p>


<pre> cd $myotherproject
 git remote rm origin
 git remote add origin git@github.com:$meandmyself/$myotherproject.git</pre>


<p>And then push your copy online&nbsp;:</p>


<pre> git push origin master</pre>


<p>It's done&nbsp;!</p>


<p>If you want to copy branch too, note that they are already in your local copy.
You just have to do this&nbsp;: (work for each local branch)&nbsp;:</p>


<pre> for branch in $(git branch | sed -e s/\*//g); do if <a href="&quot;$branch&quot; != &quot;master&quot;"> "$branch" != "master" </a>; then
   git checkout $branch
   git push origin $branch
   git checkout master
   git branch -f $branch origin/$branch
 fi; done</pre><img src="http://feeds.feedburner.com/~r/Twiblog/~4/4ivXTo2p_SY" height="1" width="1"/>]]></content:encoded>
<feedburner:origLink>http://b.twidi.com/index.php/2010/12/11/107-duplicate-a-git-repository</feedburner:origLink></item>
<item rdf:about="http://b.twidi.com/index.php/2010/08/31/106-flux-rss-de-votre-timeline-facebook">
  <title>Flux RSS de votre timeline Facebook</title>
  <link>http://feedproxy.google.com/~r/Twiblog/~3/bMPhvCGbaHo/106-flux-rss-de-votre-timeline-facebook</link>
  <dc:date>2010-08-31T11:29:23+02:00</dc:date>
  <dc:language>fr</dc:language>
  <dc:creator>Twidi</dc:creator>
  <dc:subject>Le grand Ternet</dc:subject>
  <description>Étant un utilisateur inconditionnel des flux rss (via Google Reader), je les utilise pour tout ou presque. Excepté Twitter que j'ai pluggé sur mon gtalk via tweet.im (donc je reçois les tweets via ma messagerie sur mon Nokia n900).
Il me restait Facebook. Si je dois lancer une application pour...</description>
  <content:encoded><![CDATA[ <p>Étant un utilisateur inconditionnel des flux rss (via Google Reader), je les utilise pour tout ou presque. Excepté Twitter que j'ai pluggé sur mon gtalk via <a href="https://www.tweet.im/" hreflang="en">tweet.im</a> (donc je reçois les tweets via ma messagerie sur mon <a href="http://www.nokia-n900.fr" hreflang="fr">Nokia n900</a>).
Il me restait Facebook. Si je dois lancer une application pour suivre le flux... je ne suivrai pas les mises à jour du status de mes amis.</p>


<p>Alors j'ai cherché comment obtenir le flux rss de ma timeline facebook.</p>


<p>Voici les quelques étapes à suivre&nbsp;:</p>

<ol>
<li>Connectez-vous sur votre Facebook (si si :D)</li>
<li>Allez sur <a href="http://www.facebook.com/notes.php?friends">http://www.facebook.com/notes.php?friends</a> (page des articles de vos amis)</li>
<li>Cliquez sur "Articles de mes amis" dans la partie "Abonnement" dans la colonne de gauche</li>
<li>dans l'url obtenu, remplacez "friends_notes" par "friends_status"</li>
<li>et voilà vous avez le flux RSS de votre timeline Facebook</li>
</ol>

<p>Attention cette URL est privée (elle contient une clé) donc ne la partagez pas, n'importe qui pourrait alors lire le contenu de votre timeline&nbsp;!</p><img src="http://feeds.feedburner.com/~r/Twiblog/~4/bMPhvCGbaHo" height="1" width="1"/>]]></content:encoded>
<feedburner:origLink>http://b.twidi.com/index.php/2010/08/31/106-flux-rss-de-votre-timeline-facebook</feedburner:origLink></item>
<item rdf:about="http://b.twidi.com/index.php/2010/06/03/105-trier-les-entrees-par-titre-dans-google-reader">
  <title>Trier les entrées par titre dans Google Reader</title>
  <link>http://feedproxy.google.com/~r/Twiblog/~3/jo3m8vvW0so/105-trier-les-entrees-par-titre-dans-google-reader</link>
  <dc:date>2010-06-03T13:44:45+02:00</dc:date>
  <dc:language>fr</dc:language>
  <dc:creator>Twidi</dc:creator>
  <dc:subject>Le grand Ternet</dc:subject>
  <description>Il peut parfois être utile de trier par titre la liste des entrées de Google Reader.


Rien de très compliqué avec un peu de jQuery.


Tout d'abord, il faut faire tourner jQuery sur la page de Google Reader.


Par exemple avec le bookmarklet jQueryfy


Lancé sur Google Reader, ce...</description>
  <content:encoded><![CDATA[ <p>Il peut parfois être utile de trier par titre la liste des entrées de Google Reader.</p>


<p>Rien de très compliqué avec un peu de jQuery.</p>


<p>Tout d'abord, il faut faire tourner jQuery sur la page de Google Reader.</p>


<p>Par exemple avec le <a href="http://www.learningjquery.com/2009/04/better-stronger-safer-jquerify-bookmarklet" hreflang="en">bookmarklet jQueryfy</a></p>


<p>Lancé sur Google Reader, ce bookmarklet nous dit d'utiliser $jq à la place de $ dans jQuery.</p>


<p>Ensuite plus qu'à récupérer la liste des entrées, trier par titre et ranger les éléments ainsi triées</p>


<p>La liste des entrées affichées (en effet, l'opération sera à refaire dès que le contenu de la liste changera) est dans "div#entries", qui contient autant de "div.entry" que d'entrées affichées, pour chacun desquels on trouve un "h2" avec notre titre.</p>


<p>La structure est donc simple, et notre code est aisé&nbsp;:</p>



<pre>$jq('#entries div.entry').sort(
    function(a, b){
        x = $jq(a).find('h2').text().
        y = $jq(b).find('h2').text();
        return x.localeCompare(y);
    }
).each(
    function(index, element){
        element.parentNode.appendChild(element);
    }
)</pre>

<p>ce qui, raccourci, donne&nbsp;:</p>


<pre> $jq('#entries .entry').sort(function(a,b){ return $jq(a).find('h2').text().localeCompare($jq(b).find('h2').text())}).each(function(i,e){e.parentNode.appendChild(e)})</pre>


<p>Et voici donc le bookmarklet <a href="javascript:(function(){$jq('#entries%20.entry').sort(function(a,b){ return $jq(a).find('h2').text().localeCompare($jq(b).find('h2').text())}).each(function(i,e){e.parentNode.appendChild(e)})})()">GReader Title Sort</a> (testé uniquement sous Firefox) à lancer bien sûr après celui de jQuery, et avec une liste d'articles affichée dans Google Reader (et à relancer à chaque fois que vous voudrez trier)</p><img src="http://feeds.feedburner.com/~r/Twiblog/~4/jo3m8vvW0so" height="1" width="1"/>]]></content:encoded>
<feedburner:origLink>http://b.twidi.com/index.php/2010/06/03/105-trier-les-entrees-par-titre-dans-google-reader</feedburner:origLink></item>
<item rdf:about="http://b.twidi.com/index.php/2010/02/16/104-meego-osfr-nouveau-blog-sur-meego-le-nouvel-os-de-nokia-et-intel">
  <title>http://meego-os.fr : nouveau blog sur MeeGo, le nouvel OS de Nokia et Intel</title>
  <link>http://feedproxy.google.com/~r/Twiblog/~3/8tOOH0NrQF0/104-meego-osfr-nouveau-blog-sur-meego-le-nouvel-os-de-nokia-et-intel</link>
  <dc:date>2010-02-16T10:20:04+01:00</dc:date>
  <dc:language>fr</dc:language>
  <dc:creator>Twidi</dc:creator>
  <dc:subject>Projets</dc:subject>
  <description>J'ai lancé hier, quelques heures après l'annonce de la naissance de MeeGo, OS résultant de la fusion des OS de Nokia (Maemo) et Intel (Moblin), un nouveau blog sur le sujet, en français.


Retrouvez-le à l'adresse suivante : http://www.meego-os.fr


Vous pouvez aussi suivre les actualités de ce...</description>
  <content:encoded><![CDATA[ <p>J'ai lancé hier, quelques heures après l'annonce de la naissance de MeeGo, OS résultant de la fusion des OS de Nokia (Maemo) et Intel (Moblin), un nouveau blog sur le sujet, en français.</p>


<p>Retrouvez-le à l'adresse suivante&nbsp;: <a href="http://www.meego-os.fr" hreflang="fr">http://www.meego-os.fr</a></p>


<p>Vous pouvez aussi suivre les actualités de ce blog sur&nbsp;:</p>

<pre>- <a href="http://www.twitter.com/Meego_FR" hreflang="fr">le compte Twitter associé</a>
- <a href="http://www.facebook.com/pages/Meego-FR/308528516036" hreflang="fr">la page Facebook dédiée</a></pre><img src="http://feeds.feedburner.com/~r/Twiblog/~4/8tOOH0NrQF0" height="1" width="1"/>]]></content:encoded>
<feedburner:origLink>http://b.twidi.com/index.php/2010/02/16/104-meego-osfr-nouveau-blog-sur-meego-le-nouvel-os-de-nokia-et-intel</feedburner:origLink></item>

</rdf:RDF>

