Re: [gentoo-user] Separate instances of Firefox require separate profiles

2014-06-23 Thread Dale
Walter Dnes wrote:
   I vaguely remember a while ago, somebody on this list asked about
 running separate instances of Firefox.  I finally figured out how to run
 separate instances of Firefox, as ***COMPLETELY SEPARATE PROCESSES***.
 Namely, that you need ***A SEPARATE PROFILE FOR EACH INSTANCE***.  Let's
 start with 2 profiles trusted and default.  From the command line,
 execute the following commands...

 firefox -new-instance -P trusted 
 firefox -new-instance -P default 
 ps -ef | grep firefox

   You won't need the  if you launch from a desktop or window-manager
 launcher.  In the above example, I launched 2 instances of Firefox, and
 verified their existance by running ps -ef | grep firefox.

   So if you have some sites that you visit regularly, you can have a
 separate profile for each one.  This has some advantages...

 1) You can have totally different customized setups (including different
 add-ons) for each site.

 2) Profiles, including cookies, are stored in separate directories.
 Therefore third-party cookies left by trackers when you're on site A
 using profile A, will not be readable by the same third-party when
 you're on site B, using profile B, making tracking you more difficult
 and less reliable... one... two... three... awww.

 3) If you have a whole bunch of websites open, and one of them crashes
 Firefox, or hangs it so you need to kill it, you don't end up taking
 down all your browsers.


That I think was me.  Also, if you close one and it doesn't die
correctly, you can use this little trick, as a script in my case, to
find the process for each one that is running.

ls -al /home/user name here/.mozilla/firefox/*/lock 

For example, on mine it returns this, name somewhat edited:

root@fireball / # /root/firefox
ls -al /home/dale/.mozilla/firefox/*/lock
 
lrwxrwxrwx 1 dale users 16 Jun 22 22:57
/home/dale/.mozilla/firefox/4p9tgzd5.MOD/lock - 127.0.0.1:+28060
lrwxrwxrwx 1 dale users 16 Jun 22 22:53
/home/dale/.mozilla/firefox/ar78vn2c.default/lock - 127.0.0.1:+27753
lrwxrwxrwx 1 dale users 16 Jun 22 23:58
/home/dale/.mozilla/firefox/hmnj07pv.Greet staff/lock - 127.0.0.1:+31137
root@fireball / #  

Notice the process number on the end?  If say I close the default but it
doesn't die as it should, I can do this:

kill 27753

The other processes are still running.  Also, if it is dead but it
didn't remove the lock file, just use rm instead of ls and remove the
options of course. 

Hope that helps you as much as it did me.  ;-) 

Dale

:-)  :-) 

-- 
I am only responsible for what I said ... Not for what you understood or how 
you interpreted my words!




Re: [gentoo-user] Separate instances of Firefox require separate profiles

2014-06-23 Thread Mick
On Monday 23 Jun 2014 06:33:12 Walter Dnes wrote:
   I vaguely remember a while ago, somebody on this list asked about
 running separate instances of Firefox.  I finally figured out how to run
 separate instances of Firefox, as ***COMPLETELY SEPARATE PROCESSES***.
 Namely, that you need ***A SEPARATE PROFILE FOR EACH INSTANCE***.  Let's
 start with 2 profiles trusted and default.  From the command line,
 execute the following commands...
 
 firefox -new-instance -P trusted 
 firefox -new-instance -P default 
 ps -ef | grep firefox
 
   You won't need the  if you launch from a desktop or window-manager
 launcher.  In the above example, I launched 2 instances of Firefox, and
 verified their existance by running ps -ef | grep firefox.
 
   So if you have some sites that you visit regularly, you can have a
 separate profile for each one.  This has some advantages...
 
 1) You can have totally different customized setups (including different
 add-ons) for each site.
 
 2) Profiles, including cookies, are stored in separate directories.
 Therefore third-party cookies left by trackers when you're on site A
 using profile A, will not be readable by the same third-party when
 you're on site B, using profile B, making tracking you more difficult
 and less reliable... one... two... three... awww.
 
 3) If you have a whole bunch of websites open, and one of them crashes
 Firefox, or hangs it so you need to kill it, you don't end up taking
 down all your browsers.

Taking this a step further I create additional one-off profile directories in 
/tmp, which are deleted when I reboot (this is a laptop), which ensures that 
tracing between sites does not happen.

Note, you will also need to remove any flash cookies (LSOs) which sit in your 
~/ and are not deleted, unless you have installed the Better Privacy addon.  
For a more pedestrian approach:

 rm -Rf .macromedia/Flash_Player/*

-- 
Regards,
Mick


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Separate instances of Firefox require separate profiles

2014-06-23 Thread Walter Dnes
On Mon, Jun 23, 2014 at 06:02:02PM +0100, Mick wrote

 Taking this a step further I create additional one-off profile
 directories in /tmp, which are deleted when I reboot (this is a
 laptop), which ensures that tracing between sites does not happen.

  Here is more detail on my approach...

1) Generate a random 8-letter name for a directory with the command

head /dev/urandom | tr -d -c a-z | tail -c 8

   Let's say you got cjyqsiqd (without the quotes).

2) mkdir ~/.mozilla/firefox/cjyqsiqd
   (or whatever 8-character string you got)

3) Create directories for a template profile, plus the profiles you want
to use.  I'll call them profile1, profile2, etc, but in real life,
you'll want more descriptive names.

mkdir ~/.mozilla/firefox/cjyqsiqd/template
mkdir ~/.mozilla/firefox/cjyqsiqd/profile1
mkdir ~/.mozilla/firefox/cjyqsiqd/profile2
mkdir ~/.mozilla/firefox/cjyqsiqd/profile3
...
mkdir ~/.mozilla/firefox/cjyqsiqd/profilen

4) Create the profiles starting with the template profile.  Note that
there is a good reason for navigating into the profile dirs.  It will
become obvious later.  The command is...

firefox -new-instance -ProfileManager

Create Profile
Next
Enter new profile name: (more intuitive if it matches the directory name)
Choose Folder (Navigate into the corresponding folder before clicking Open)
Open
Exit

Rinse lather repeat for all the other profiles you'll want.

5) For the next step do not delete the template dir, but delete all the
other profile dirs you've just created.  No, this is not a joke.

cd ~/.mozilla/firefox/cjyqsiqd/
rm -rf profile1 profile2 profile3 ... profilen

6) Launch firefox with the template profile...

firefox -new-instance -P template

...and tweak it to your heart's content, keeping in mind what options
your profiles will need.  Install extensions, set font sizes, your
favourite behaviours, tweak the menu bars, set cookie options, etc.  And
make sure to set the browser to open to a home page (more on that
later).  When you're finished, exit Firefox.

7) Copy your template directory to replace the profile directories you
deleted in step 5.  This is a lot easier than doing the same changes in
several directories.  The names will be different depending on what did
in step 3.

cd ~/.mozilla/firefox/cjyqsiqd/
cp -r template profile1
cp -r template profile2
cp -r template profile3
...
cp -r template profilen

8) Open the profiles and do the final customizations for each profile
separately.  The command is

firefox -new-instance -P profilename

The customizing includes stuff like which cookie domain(s) to accept and
which page(s) to open on startup.  And yes, you can get Firefox to open
multiple tabs on startup.  When entering the homepage to open, separate
the pages with pipe signs  | , e.g...

http://foo.com | http://bar.com | ftp://bad.example.com/data.txt

 Note, you will also need to remove any flash cookies (LSOs) which
 sit in your ~/ and are not deleted, unless you have installed the
 Better Privacy addon.  For a more pedestrian approach:
 
  rm -Rf .macromedia/Flash_Player/*

  There also seems to be ~/.adobe directory.  What I do is to create
*FILES* (yes) like so...

touch ~/.adobe
touch ~/.macromedia

  This blocks the creation of directories by that name.  Some idiot sites
will refuse to play videos in that situation.  I click on the Flash
button, and the video displays something like Error #2046.  I have a
workaround for that, namely a script ~/bin/killflash like so...

#!/bin/bash
rm -rf ~/.adobe
rm -rf ~/.macromedia
sleep 20
rm -rf ~/.adobe
touch ~/.adobe
rm -rf ~/.macromedia
touch ~/.macromedia

  I launch killflash in an xterm, and then click on the video to play.
Note that the video only has to start within the 20-second window.  The
way that linux works, you can delete a file, but any app that has it
open will continue to see it, even though no other apps can.  As soon as
the last filehandle to the file is closed, its space is finally released.

-- 
Walter Dnes waltd...@waltdnes.org
I don't run desktop environments; I run useful applications