Tuesday, December 20, 2005

Firefox

Speeding up Firefox seems to be a meme going around the blogsphere lately. Most of the tips I’ve seen, though, are only for broadband connections with the latest hardware and only include some of the settings that would affect performance.

The Firefox Tweak Guide has the full details on how to speed up Firefox regardless of your connection or hardware, reprinted in part below. Don’t forget that the easiest way to tweak user files is with chromEdit extension.

Common to all configurations

These are the settings that seem to be common to all configuration files regardless of connection speed or computer speed with a couple of additions - plugin paths can be found with about:plugins and the bookmark menu delay is turned off.

user_pref("network.http.pipelining", true);
user_pref("network.http.proxy.pipelining", true);
user_pref("network.http.pipelining.maxrequests", 8);
user_pref("content.notify.backoffcount", 5);
user_pref("plugin.expose_full_path", true);
user_pref("ui.submenuDelay", 0);

Fast Computer Fast Connection

user_pref("content.interrupt.parsing", true);
user_pref("content.max.tokenizing.time", 2250000);
user_pref("content.notify.interval", 750000);
user_pref("content.notify.ontimer", true);
user_pref("content.switch.threshold", 750000);
user_pref("nglayout.initialpaint.delay", 0);
user_pref("network.http.max-connections", 48);
user_pref("network.http.max-connections-per-server", 16);
user_pref("network.http.max-persistent-connections-per-proxy", 16);
user_pref("network.http.max-persistent-connections-per-server", 8);
user_pref("browser.cache.memory.capacity", 65536);

A couple settings of note - Firefox is allocated 4096 KB of memory by default and in this configuration we give it roughly 65MB as denoted by the last line. This can be changed according to what is used.

Fast Computer, Slower Connection

This configuration is more suited to people without ultra fast connections. We are not talking about dial up connections but slower DSL / Cable connections.

user_pref("content.max.tokenizing.time", 2250000);
user_pref("content.notify.interval", 750000);
user_pref("content.notify.ontimer", true);
user_pref("content.switch.threshold", 750000);
user_pref("network.http.max-connections", 48);
user_pref("network.http.max-connections-per-server", 16);
user_pref("network.http.max-persistent-connections-per-proxy", 16);
user_pref("network.http.max-persistent-connections-per-server", 8);
user_pref("nglayout.initialpaint.delay", 0);
user_pref("browser.cache.memory.capacity", 65536);

Fast Computer, Slow Connection

user_pref("browser.xul.error_pages.enabled", true);
user_pref("content.interrupt.parsing", true);
user_pref("content.max.tokenizing.time", 3000000);
user_pref("content.maxtextrun", 8191);
user_pref("content.notify.interval", 750000);
user_pref("content.notify.ontimer", true);
user_pref("content.switch.threshold", 750000);
user_pref("network.http.max-connections", 32);
user_pref("network.http.max-connections-per-server", 8);
user_pref("network.http.max-persistent-connections-per-proxy", 8);
user_pref("network.http.max-persistent-connections-per-server", 4);
user_pref("nglayout.initialpaint.delay", 0);
user_pref("browser.cache.memory.capacity", 65536);

Slow Computer, Fast Connection

user_pref("content.max.tokenizing.time", 3000000);
user_pref("content.notify.backoffcount", 5);
user_pref("content.notify.interval", 1000000);
user_pref("content.notify.ontimer", true);
user_pref("content.switch.threshold", 1000000);
user_pref("content.maxtextrun", 4095);
user_pref("nglayout.initialpaint.delay", 1000);
user_pref("network.http.max-connections", 48);
user_pref("network.http.max-connections-per-server", 16);
user_pref("network.http.max-persistent-connections-per-proxy", 16);
user_pref("network.http.max-persistent-connections-per-server", 8);
user_pref("dom.disable_window_status_change", true);

One of the changes made for this particular configuration is the final line where the status bar is disabled for changing web pages to save processor time.

Slow Computer, Slow Connection

We have entered the doldrums of the dial-up user

user_pref("content.max.tokenizing.time", 2250000);
user_pref("content.notify.interval", 750000);
user_pref("content.notify.ontimer", true);
user_pref("content.switch.threshold", 750000);
user_pref("nglayout.initialpaint.delay", 750);
user_pref("network.http.max-connections", 32);
user_pref("network.http.max-connections-per-server", 8);
user_pref("network.http.max-persistent-connections-per-proxy", 8);
user_pref("network.http.max-persistent-connections-per-server", 4);
user_pref("dom.disable_window_status_change", true);



user_pref("network.dns.disableIPv6", true);

Monday, December 19, 2005

samba 3 - getlocalsid

  1. Change the name of your server back to what it was in the smb.conf file and restart Samba.
  2. Use the new net getlocalsid [NAME] and net setlocalsid S-1-5-21-x-y-z commands to change the SID of your Samba server back to what it used to be.

    For example, if samba1 is the old NetBIOS name of your PDC, you can retrieve its SID with the following command, as the SID is still available:

         net getlocalsid samba1
    SID for domain samba1 is: S-1-5-21-3349071909-1695333706-3939217754

    Then you can set your SID correctly with:

         net setlocalsid S-1-5-21-3349071909-1695333706-3939217754

    Of course, a quick way to achieve all that is:

         net setlocalsid ‘net getlocalsid samba1 | cut -f2 -d:‘

    These commands are only available in Samba-3.0alpha20 and beyond.

  3. When Samba 2.2.8 ships, you should also be able to recover your previous SID and replace the existing one with the old one. You do this with the commands smbpasswd -X and smbpasswd -W
  4. Change the name of your server back to what it was in the smb.conf file and restart Samba.
  5. Use the new net getlocalsid [NAME] and net setlocalsid S-1-5-21-x-y-z commands to change the SID of your Samba server back to what it used to be.

    For example, if samba1 is the old NetBIOS name of your PDC, you can retrieve its SID with the following command, as the SID is still available:

         net getlocalsid samba1
    SID for domain samba1 is: S-1-5-21-3349071909-1695333706-3939217754

    Then you can set your SID correctly with:

         net setlocalsid S-1-5-21-3349071909-1695333706-3939217754

    Of course, a quick way to achieve all that is:

         net setlocalsid ‘net getlocalsid samba1 | cut -f2 -d:‘

    These commands are only available in Samba-3.0alpha20 and beyond.

  6. When Samba 2.2.8 ships, you should also be able to recover your previous SID and replace the existing one with the old one. You do this with the commands smbpasswd -X and smbpasswd -W

    For example, if samba1 is the old NetBIOS name of your Samba 2.2.8 server, you can retrieve its SID with:

          smbpasswd -X samba1
    SID for domain samba1 is: S-1-5-21-3349071909-1695333706-3939217754

    And you can change the SID of your server with:

          smbpasswd -W S-1-5-21-3349071909-1695333706-3939217754

It turns out that Samba still has the SID in its secrets.tdb file. If you can't remember your server's old name, you can most likely figure it out with the aid of tdbdump.

Firstly, you will need to build tdbdump. You can do this from the Samba source tree:

     cd tdb
make tdbdump

Then you simply dump your secrets file with tdbdump. The following shows an example.

   ./tdb/tdbdump /usr/local/samba/private/secrets.tdb
{
key = "SECRETS/SID/CRAPTESTER"
data = "\01\04\00\00\00\00\00\05\15\00\00\00\0D\949?\A6Z\8A\7F\C88\B2\88
\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00
\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
}
{
key = "SECRETS/SID/INTRESTING"
data = "\01\04\00\00\00\00\00\05\15\00\00\00|\0Ex\04v\E8\F5\19\0Ag,\FF\00
\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00
\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
}

You might find your data formatted a little differently to that above.

In anycase, you can see the server names that are likely to have been used. They are the last component of the keys starting with SECRETS.

You should note that there will be one entry in your secrets.tdb file of the form SECRETS/SID/ for your domain SID, and one entry of the form SECRETS/SID/ for your server SID. They should be the same.



Friday, December 16, 2005

diff smb.conf working & not

[root@linux samba]# diff smb.conf ../samba.3/smb.conf
9a10
> netbios aliases = AMBITER2006
11,12c12
< #auth methods = guest, sam, winbind
< passdb backend = tdbsam
---
> auth methods = guest, sam, winbind
16d15
< log level = 2
18c17
< socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=8192 SO_SNDBUF=8192
---
> socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
25,26c24,25
< # add machine script = /usr/sbin/adduser -n -g machines -c Machine -d /dev/null -s /bin/false %u$
< # logon script = netlogon.bat
---
> add machine script = /usr/sbin/adduser -n -g machines -c Machine -d /dev/null -s /bin/false %u$
> logon script = netlogon.bat
29,33c28
< security = user
< encrypt passwords = yes
< domain logons = yes
< os level = 7
< hosts allow = 127.0.0.1 10.0.0.0/255.255.255.0
---
> os level = 64
35c30
< domain master = No
---
> domain master = Yes

Samba PDC

Migration

Chapter 7. Adding Domain Member Servers and Clients


[global]
workgroup = AMBITER2005
realm = LINUX.AMBITER2005.LOCALE
netbios name = AMBITER2005
server string = Samba Version %v
#auth methods = guest, sam, winbind
passwd program = /usr/bin/passwd %u
unix password sync = Yes
log file = /var/log/samba/%m.log
log level = 2
max log size = 50
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=8192 SO_SNDBUF=8192
printcap name = /etc/printcap
add user script = /usr/sbin/useradd -m %u
delete user script = /usr/sbin/userdel -r %u
add group script = /usr/sbin/groupadd %g
delete group script = /usr/sbin/groupdel %g
add user to group script = /usr/sbin/usermod -G %g %u
# add machine script = /usr/sbin/adduser -n -g machines -c Machine -d /dev/null -s /bin/false %u$
# logon script = netlogon.bat
logon drive = h:
logon home = \\%N\%U\.profile
security = user
encrypr passwords = yes
domain logons = yes
os level = 64
host allow = 127.0.0.1 10.0.0.0/255.255.255.0
preferred master = Yes
domain master = Yes
wins support = Yes
ldap ssl = no
idmap uid = 16777216-33554431
idmap gid = 16777216-33554431
cups options = raw

Tuesday, December 13, 2005

Samba 3

http://openskills.info/infobox.php?IDbox=552