<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>MGautier</title><link href="http://mgautier.fr" rel="alternate"></link><link href="http://mgautier.fr/feeds/firefox.atom.xml" rel="self"></link><id>http://mgautier.fr</id><updated>2010-03-04T20:20:00Z</updated><entry><title>Firefox, one user, several computers, one profile per computer</title><link href="http://mgautier.fr/2010/03/astuce/firefox-profiles-computers-en.html" rel="alternate"></link><updated>2010-03-04T20:20:00Z</updated><author><name>Matthieu Gautier</name></author><id>tag:mgautier.fr,2010-03-04:/2010/03/astuce/firefox-profiles-computers-en.html/</id><summary type="html">&lt;p&gt;This tip is for people like me who works on several computers with a simple user account.&lt;/p&gt;
&lt;p&gt;I use to make several ssh to several computers with the same user. As my /home dir is shared and that all Firefox
profiles are in ~/.mozilla/firefox, if you try to launch Firefox on both computers ... you can't&lt;/p&gt;
&lt;p&gt;Here a simple example to better understand what I'm speaking about:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;In two consoles, I launch two ssh with same user, but to different computers.&lt;/li&gt;
&lt;li&gt;On the A computer, I launch the following command&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="gp"&gt;user@machineA$&lt;/span&gt; firefox /my/local/pageA.html
&lt;/pre&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;I've got a Firefox window on pageA.html.
* On the B Computer, I do the same without closing the computer A Firefox instance:&lt;/p&gt;
&lt;blockquote&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="gp"&gt;user@machineB$&lt;/span&gt; firefox /my/local/pageB.html
&lt;/pre&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;And now .. Firefox try to open localB.html with the Firefox instance of .. computer A&lt;/p&gt;
&lt;p&gt;I don't care if I've got both pages on the same window, but pageB.html is on computer B not on computer A.
Conclusion: Firefox doesn't find pageB.html (normal)&lt;/p&gt;
&lt;p&gt;The solution is in the Firefox profile management. You just need to have a profile per computer.&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;First, let's creating our two profiles:&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="gp"&gt;$&lt;/span&gt; firefox -CreateProfile profileA --no-remote
&lt;span class="gp"&gt;$&lt;/span&gt; firefox -CreateProfile profileB --no-remote
&lt;/pre&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Secondly, launch Firefox using the profile corresponding to the computer:&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="gp"&gt;user@machineA$&lt;/span&gt; firefox -P profileA --no-remote /my/local/pageA.html
&lt;span class="gp"&gt;user@machineB$&lt;/span&gt; firefox -P profileB --no-remote /my/local/pageB.html
&lt;/pre&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;Now, you've got two Firefox instance launched and you can open both pages.&lt;/p&gt;
&lt;p&gt;To automate all this, just add the following lines to your .bashrc:&lt;/p&gt;
&lt;blockquote&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="c"&gt;#If the profile doesn&amp;#39;t existe create it.&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="k"&gt;$(&lt;/span&gt;ls ~/.mozilla/firefox | grep profile&lt;span class="k"&gt;$(&lt;/span&gt;hostname&lt;span class="k"&gt;)&lt;/span&gt; | wc -l &lt;span class="k"&gt;)&lt;/span&gt; -eq 0 &lt;span class="o"&gt;]]&lt;/span&gt;
&lt;span class="k"&gt;then&lt;/span&gt;
&lt;span class="k"&gt;    &lt;/span&gt;firefox -CreateProfile profile&lt;span class="k"&gt;$(&lt;/span&gt;hostname&lt;span class="k"&gt;)&lt;/span&gt; --no-remote
&lt;span class="k"&gt;fi&lt;/span&gt;

&lt;span class="c"&gt;#create an alias to launch firefox with the good profile&lt;/span&gt;
&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;firefox&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;firefox -P profile$(hostname) --no-remote&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;Enjoy !!&lt;/p&gt;
</summary><category term="bash"></category><category term="firefox"></category><category term="linux"></category></entry><entry><title>Firefox, un utilisateur, plusieurs machines, un profil par machines</title><link href="http://mgautier.fr/2009/11/astuce/firefox-profiles-computers.html" rel="alternate"></link><updated>2009-11-16T14:39:00Z</updated><author><name>Matthieu Gautier</name></author><id>tag:mgautier.fr,2009-11-16:/2009/11/astuce/firefox-profiles-computers.html/</id><summary type="html">&lt;p&gt;Cette astuce s'adresse au gens qui, comme moi, travaillent sur plusieurs machines avec un seul compte partagé.&lt;/p&gt;
&lt;p&gt;Il m'arrive souvent de faire plusieurs ssh vers des machines réseaux avec le même utilisateur.
Étant donné que le /home est partagé, et que les profiles Firefox sont stockés dans ~/.mozilla/firefox, si vous
lancez Firefox sur les deux machines et bien... vous pouvez pas.&lt;/p&gt;
&lt;p&gt;Un exemple simple pour comprendre de quoi je parle :&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Dans deux terminaux différents je lance deux ssh avec le même utilisateur sur deux machines différentes&lt;/li&gt;
&lt;li&gt;Sur la machine A, je lance la commande:&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="gp"&gt;user@machineA$&lt;/span&gt; firefox /ma/page/localA.html
&lt;/pre&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;J'ai bien une fenêtre Firefox qui s'ouvre avec la page localA.html.&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Sur la machine B, je fait la même chose sans fermer l'instance de Firefox sur la machine A :&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="gp"&gt;user@machineB$&lt;/span&gt; firefox /ma/page/localB.html
&lt;/pre&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;Firefox tente d'afficher localB.html sur l'instance de la machine A (Ha.. la joie des pipes, des locks et compagnie)&lt;/p&gt;
&lt;p&gt;Ça me dérange pas en d'avoir les deux pages dans la même fenêtre, mais le problème c'est que localB.html ...
est sur la machine B pas la A. Conclusion : Firefox ne trouve pas localB.html (normal)&lt;/p&gt;
&lt;p&gt;La solution se trouve dans la gestion des profiles. Il suffit d'utiliser un profile distinct pour chaque machine.&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Premièrement, créons nos deux profiles :&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="gp"&gt;$&lt;/span&gt; firefox -CreateProfile profileA --no-remote
&lt;span class="gp"&gt;$&lt;/span&gt; firefox -CreateProfile profileB --no-remote
&lt;/pre&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Ensuite il suffit de lancer Firefox en utilisant le profile associé à la machine :&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="gp"&gt;user@machineA$&lt;/span&gt; firefox -P profileA --no-remote /ma/page/localA.html
&lt;span class="gp"&gt;user@machineB$&lt;/span&gt; firefox -P profileB --no-remote /ma/page/localB.html
&lt;/pre&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;Ainsi j'ai deux instances de Firefox qui sont lancées.&lt;/p&gt;
&lt;p&gt;Pour automatiser tout ça, il suffit de rajouter ces quelques lignes à votre .bashrc :&lt;/p&gt;
&lt;blockquote&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="c"&gt;#si le profile de la machine n&amp;#39;existe pas, on le crée.&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="k"&gt;$(&lt;/span&gt;ls ~/.mozilla/firefox | grep profile&lt;span class="k"&gt;$(&lt;/span&gt;hostname&lt;span class="k"&gt;)&lt;/span&gt; | wc -l &lt;span class="k"&gt;)&lt;/span&gt; -eq 0 &lt;span class="o"&gt;]]&lt;/span&gt;
&lt;span class="k"&gt;then&lt;/span&gt;
&lt;span class="k"&gt;    &lt;/span&gt;firefox -CreateProfile profile&lt;span class="k"&gt;$(&lt;/span&gt;hostname&lt;span class="k"&gt;)&lt;/span&gt; --no-remote
&lt;span class="k"&gt;fi&lt;/span&gt;

&lt;span class="c"&gt;#un alias pour automatiquement utiliser le profile de la machine&lt;/span&gt;
&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;firefox&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;firefox -P profile$(hostname) --no-remote&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;À nous les joies du surf profilé :)&lt;/p&gt;
</summary><category term="bash"></category><category term="firefox"></category><category term="linux"></category></entry></feed>
