Linux-Misc Digest #776, Volume #26               Wed, 10 Jan 01 22:13:02 EST

Contents:
  Re: L2-Cache of Pentium2 with Linux (John-Paul Stewart)
  Re: Converting filesysetem (reiserfs,ext2,ext3). (Steve Lamb)
  Finally, a cure for bad web characters (Christopher Wong)
  Re: How to obtain info on "GNOME vs KDE" ? (MH)
  How to I set ipchains live with ICQ? (Carfield Yim)
  Swap Partition Size (Bob Simon)
  Re: Backup software for Linux? ("dom")
  Re: L2-Cache of Pentium2 with Linux (Jean-David Beyer)
  Re: Help! Printer doesn't stop printing!!! (Jean-David Beyer)
  Re: CD-RW (Donald Arseneau)
  Tax Software?? (Christopher W. Aiken)
  Re: Enter escape charcter in vi or another editor ([EMAIL PROTECTED])

----------------------------------------------------------------------------

From: John-Paul Stewart <[EMAIL PROTECTED]>
Subject: Re: L2-Cache of Pentium2 with Linux
Date: Thu, 11 Jan 2001 02:23:48 GMT

[posted and mailed]

"Peter T. Breuer" wrote:
> 
> John-Paul Stewart <[EMAIL PROTECTED]> wrote:
> > "Peter T. Breuer" wrote:
> > <C source snipped>
> 
> > Cool.  Is there any information on interpreting these
> 
> OK .. I'll relent. Look at the sequence. You should see that the
> speeds against blocksize go something like this:
> 
> Peter

Ahhhh...I see.  The sequence you describe makes sense.  My
results don't.  I get a big speed drop going from 128KB to
256KB and another fairly significant one from 256KB to
512KB.  That's why I was confused.  (Its a pentium pro with
256KB L2 cache.)  The comparison results you offered won't
be necessary though.

BTW, I (J-P Stewart) am NOT the one who said my cache wasn't
working.  That was somebody else.  I saw your reply to him,
and was interested by the code you posted.  (Just curious
about memory speed, that's all.)

Thanks, and next time I promise I'll think some more before
asking!

J-P

------------------------------

From: [EMAIL PROTECTED] (Steve Lamb)
Crossposted-To: alt.os.linux.mandrake
Subject: Re: Converting filesysetem (reiserfs,ext2,ext3).
Date: Thu, 11 Jan 2001 02:22:51 -0000
Reply-To: [EMAIL PROTECTED]

On Tue, 09 Jan 2001 14:31:41 GMT, Thaddeus L Olczyk <[EMAIL PROTECTED]>
wrote:
>Well, let's experience shows that it takes at least 20 minutes to find
>something by search engines, many are slow in response and they often
>have advertisors come up first or something toally unrelated. 

    Just as an aside, Google.  It is what finally got me off my Yahoo! kick.
I dislike all the others because they provide entirely too many hits.  Google
is normally pretty good with having what I want up top.  They also aren't
trying to be anything other than a search engine.  


-- 
         Steve C. Lamb         | I'm your priest, I'm your shrink, I'm your
         ICQ: 5107343          | main connection to the switchboard of souls.
===============================+=============================================

------------------------------

From: [EMAIL PROTECTED] (Christopher Wong)
Crossposted-To: comp.os.linux.networking
Subject: Finally, a cure for bad web characters
Reply-To: [EMAIL PROTECTED]
Date: Thu, 11 Jan 2001 02:28:08 GMT

If you browse the web with Linux on a regular basis, you may frequently
find web pages that have funny characters in them. They would show up in
your browser as block characters, question marks or just
blanks. Typically, they are punctuation characters such as smart
quotes. The reason for these annoying characters is explained at:

http://www.fourmilab.ch/webtools/demoroniser/

In short, they happen when Microsoft apps generate HTML with
Windows-specific characters. For some time, I have been patiently
emailing webmasters to explain the problem, but results have been
mediocre. Finally, I gave up and hacked the Internet Junkbuster proxy to
fix up these characters on the fly. While the "demoroniser" in the link
above is more complete, I wanted something that fixes up the web page
before the junk appears on my web browser. I offer the patch below. It
patches version 2.0.2-10 of the Junkbuster at:

http://www.waldherr.org/junkbuster

(I submitted the patch to those developers on Sourceforge, but since
this is an unasked-for feature I do not know if they will accept it)

I hope this is useful to somebody.

Chris

============================== begin patch ==============================
--- jcc.c.orig  Sun Sep 17 13:01:48 2000
+++ jcc.c       Wed Jan 10 00:11:25 2001
@@ -231,6 +231,10 @@
 #endif
 }
 
+#if !defined(_WIN32)
+static int write_filtered_socket(int fd, char* buf, int size);
+#endif
+
 void
 chat(struct client_state *csp)
 {
@@ -601,12 +605,18 @@
 
                        if(server_body || http->ssl) {
                                /* just write */
+#if defined(_WIN32)
                                if(write_socket(csp->cfd, buf, n) != n) {
                                        fprintf(logfp, "%s: write to client failed: ",
                                                        prog);
                                        fperror(logfp, "");
                                        return;
                                }
+#else
+                               if (write_filtered_socket(csp->cfd, buf, n)
+                                   != 0)
+                                  return;
+#endif                         
                                continue;
                        } else {
                                /* we're still looking for the end of the
@@ -1243,3 +1253,111 @@
        }
        freez(eno);
 }
+
+#if !defined(_WIN32)
+static char* replchars[] = {
+   ",",   /* 130 slightly shortened comma */
+   "<em>f</em>",   /* 131 florin */
+   "\"",  /* 132 right double quote */
+   "...", /* 133 ellipses */
+   "+",   /* 134 dagger */
+   " ",   /* 135 double dagger, vertical */
+   "^",   /* 136 circumflex */
+   "<sup>0</sup>/<sub>00</sub>", /* 137 permil */
+   "_",   /* 138 (?? uncertain) */
+   "<",   /* 139 less than sign */
+   "OE",  /* 140 capital OE ligature */
+   "",
+   "",
+   "",
+   "",
+   "`",   /* 145 left single quote */
+   "\'",  /* 146 right single quote */
+   "\"",  /* 147 left double quote */
+   "\"",  /* 148 right double quote */
+   "*",   /* 149 bullet */
+   "-",   /* 150 en dash */
+   "--",  /* 151 em dash */
+   "<sup>~</sup>",   /* 152 tilde */
+   "<sup>TM</sup>", /* 153 trademark */
+   "_",   /* 154 ?? */
+   ">",   /* 155 greater than sign */
+   "oe",  /* 156 small oe ligature */
+   "",
+   "",
+   "Y",   /* 159 capital Y, umlaut */
+};
+
+
+static int flushBuffer(int fd, char* outBuf, int size)
+{
+   int ret = write_socket(fd, outBuf, size);
+   if (ret != size) {
+      /* error: write error msg and return nonzero */
+      fprintf(logfp, "%s: write to client failed: ", prog);
+      fperror(logfp, "");
+      return errno;
+   } 
+   return 0;
+}
+
+static int write_filtered_socket(int fd, char* buf, int size)
+{
+   char sendBuf[BUFSIZ];
+   int i, n, loc, bufLoc, unprintables;
+   unsigned char ch;
+   
+   /* first check if this is text (no nulls) */
+   unprintables = 0;
+   n = size > 50 ? 49 : size-1;
+   for (i=0; i<n; i++) {
+      ch = (unsigned char) buf[i];
+      if (ch == 0)
+        return flushBuffer(fd, buf, size);
+      if (ch < 9 || (13 < ch && ch < 32) || 159 < ch)
+        unprintables++;
+   }
+   if (unprintables*5 > n)
+      return flushBuffer(fd, buf, size);
+
+   bufLoc = loc = 0;
+   while (loc < size) {
+      ch = (unsigned char) buf[loc];
+      if (130 <= ch && ch <= 159) {
+        /* single funny character. Substitute correct string */
+        strcpy(&sendBuf[bufLoc], replchars[ch - 130]);
+        bufLoc += strlen(replchars[ch - 130]);
+        loc++;
+      } else if (ch == '&') {
+        /* might be a nonstandard numeric entity. Test. */
+        n = 0;
+        sscanf(&buf[loc], "&#%d;", &n);
+        if (130 <= n && n <= 159) {
+           strcpy(&sendBuf[bufLoc], replchars[n - 130]);
+           bufLoc += strlen(replchars[n - 130]);
+           while (buf[loc] != ';') loc++;
+           loc++;
+        } else {
+           /* ordinary character. Copy it over */
+           sendBuf[bufLoc++] = ch;
+           loc++;
+        }
+      } else {
+        /* ordinary character. Copy it over */
+        sendBuf[bufLoc++] = ch;
+        loc++;
+      }
+
+      /* flush our output buffer if it comes within 32char fullness threshold */
+      if (bufLoc > sizeof(sendBuf)-32) {
+        if (flushBuffer(fd, sendBuf, bufLoc) != 0)
+           return -1;
+        bufLoc = 0;
+      }
+   }
+
+   /* empty remaining stuff */
+   if (bufLoc > 0)
+      return flushBuffer(fd, sendBuf, bufLoc);
+}
+#endif

------------------------------

From: MH <[EMAIL PROTECTED]>
Subject: Re: How to obtain info on "GNOME vs KDE" ?
Date: Wed, 10 Jan 2001 18:35:09 -0800

Roberto Alsina wrote:

> In article <[EMAIL PROTECTED]>,
>   MH <[EMAIL PROTECTED]> wrote:
> > Roberto Alsina wrote:
> >
> > > In article <[EMAIL PROTECTED]>,
> > >   MH <[EMAIL PROTECTED]> wrote:
> > > > Arctic Storm wrote:
> > > >
> > > > > > The biggest difference [between GNOME & KDE] is the
> > > > > > browser.  Konqueror is an  excellent browser in its own right,
> > > > > > and GNOME doesn't even have one.
> > > > > > Therefore, KDE wins.
> > > > >
> > > > > I have GNOME, and it originally came with Netscape 4.x, and I
> > > > > recently
> > > > > installed Netscape 6.  What do you mean by, "GNOME doesn't even
> > > > > have one
> > > > > [browser]"?
> > > >
> > > > Netscape?  Need I say more?
> > >
> > > Yes. You need, for example, say what is the connection between
> > > Netscape and GNOME?
> > >
> > > I mean, other than using GTK+ (not GNOME) as a low-level toolkit
> > > (less than 20K of the 5M LOCs of Mozilla!, a whole toolkit built over
> > > it), I know of none.
> > >
> >
> > You really should try to FOLLOW the thread.  Had you done so, you
> > would have known that I was in fact making YOUR point.
> 
> Actually, I did follow it. It's just that your irony passed completely
> undetected.
> 

Sorry.  First time I've ever been accused of being subtle!  ;-)

------------------------------

Date: Thu, 11 Jan 2001 10:39:07 +0800
From: Carfield Yim <[EMAIL PROTECTED]>
Subject: How to I set ipchains live with ICQ?

After I setup my ipchains rule, everything fine except ICQ client.
I find that every Linux icq client can't connect to ICQ server, even I 
allow all request from the server ip, but icq still can't connect.
How can I set it??

------------------------------

From: Bob Simon <[EMAIL PROTECTED]>
Subject: Swap Partition Size
Date: Thu, 11 Jan 2001 02:39:09 GMT

When I originally installed RH7, I had 16MB RAM and allocated 32MB to
the swap partition.  I've just installed another 32MB RAM for a total
of 48MB.

I've read that the swap partition should be at least as large as the
total amount of memory.  Why?  What are the consequences of not having
as much swap space as real memory?

After DOS, /boot, and Linux swap, the root partition is allocated the
balance of my drive space.  If I need to increase my swap partition, how
do I do so at the expense of the root partition?

--
Please address private email replies to bsimon at ATT dot Net.


Sent via Deja.com
http://www.deja.com/

------------------------------

From: "dom" <[EMAIL PROTECTED]>
Subject: Re: Backup software for Linux?
Date: Wed, 10 Jan 2001 21:58:44 -0500

kbackup is simple to set up and use, and works great



In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
wrote: 
>>>>>> "mst" == mst  <[EMAIL PROTECTED]> writes:
> 
>     mst> Chris MacTavish wrote: 
>     >>  Hello all, Does anyone know of a good backup program for 
>     >> Redhat 6.2? I have tried "taper" but i get a memory fault error 
>     >> halfway through when running it from the command line. I have a
>     >> Seagate 20/40 Dat backup drive and im trying to back up 30 GB of
>     >> data. I need a backup program that does compression. Maybe taper
>     >> will work if i can figure out why it memory faults. If anyone has
>     >> any ideas as to why taper memory faults or of another way to back
>     >> up my data then please help me....i can't be the only one trying
>     >> to back up large amounts of data!
>     >> 
>     >> Thanks Chris 
> 
> what's wrong with the traditional unix tape & backup utilities?  you 
> can use mt to set the compression mode on the drive (generally a bad
> idea).  for backups, there's tar, cpio, and dump.  it's pretty easy to
> run any of these as regular cron jobs.  i'm using dump here.  in fact, i
> just restored my whole fs (don't ask why...)  dump and restore saved the
> day.
> 
> ciao, 
> 
> g.m. 
> 


------------------------------

From: Jean-David Beyer <[EMAIL PROTECTED]>
Subject: Re: L2-Cache of Pentium2 with Linux
Date: Wed, 10 Jan 2001 21:55:38 -0500

"Peter T. Breuer" wrote (in part):

> Kernels know nothing about L2 caches, in principle.
> 
> Here is some code (not mine) to test your cache.
> 
> Peter
> 
> /*
>  *  Compilation:
>  *
>  *    gcc -O3 -fomit-frame-pointer MemSpeed.c -o MemSpeed
>  */
> 
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> #include <sys/times.h>
> #include <time.h>
> #include <sys/types.h>
> 
> #define KB              (1024)
> #define MB              (KB*KB)
> 
> #define TESTSIZE        (8*MB)
> #define LOOPSIZE        (256*MB)
> 
> int main(int argc, char *argv[])
> {
>     u_long mb = TESTSIZE;
>     u_long size, passes, d, i, j;
>     volatile u_long *mem;
>     struct tms tms;
>     time_t start, stop;
> 
>     switch (argc) {
>         case 2:
>             mb = atol(argv[1])*MB;
>         case 1:
>             break;
> 
>         default:
>             fprintf(stderr, "Usage: %s megabytes\n", argv[0]);
>             exit(1);
>             break;
>     }
> 
>     mem = malloc(mb);
> 
>     fprintf(stderr, "*** MEMORY WRITE PERFORMANCE (%d MB LOOP) ***\n",
>             LOOPSIZE/MB);
>     for (size = 64; size <= mb; size <<= 1) {
>         passes = LOOPSIZE/size;
>         fprintf(stderr, "size = %9ld bytes: ", size);
>         times(&tms);
>         start = tms.tms_utime;
>         for (i = 0; i < passes; i++)
>             for (j = 0; j < size/sizeof(u_long); j += 16) {
>                 mem[j] = 0; mem[j+1] = 0; mem[j+2] = 0; mem[j+3] = 0;
>                 mem[j+4] = 0; mem[j+5] = 0; mem[j+6] = 0; mem[j+7] = 0;
>                 mem[j+8] = 0; mem[j+9] = 0; mem[j+10] = 0; mem[j+11] = 0;
>                 mem[j+12] = 0; mem[j+13] = 0; mem[j+14] = 0; mem[j+15] = 0;
>             }
>         times(&tms);
>         stop = tms.tms_utime;
>         fprintf(stderr, "%5.3f MB/s\n",
>                 (double)(LOOPSIZE/MB)/(double)(stop-start)*(double)CLK_TCK);
>     }
>     fprintf(stderr, "*** MEMORY READ PERFORMANCE (%d MB LOOP) ***\n",
>             LOOPSIZE/MB);
>     for (size = 64; size <= mb; size <<= 1) {
>         passes = LOOPSIZE/size;
>         fprintf(stderr, "size = %9ld bytes: ", size);
>         times(&tms);
>         start = tms.tms_utime;
>         for (i = 0; i < passes; i++)
>             for (j = 0; j < size/sizeof(u_long); j += 16) {
>                 d = mem[j]; d = mem[j+1]; d = mem[j+2]; d = mem[j+3];
>                 d = mem[j+4]; d = mem[j+5]; d = mem[j+6]; d = mem[j+7];
>                 d = mem[j+8]; d = mem[j+9]; d = mem[j+10]; d = mem[j+11];
>                 d = mem[j+12]; d = mem[j+13]; d = mem[j+14]; d = mem[j+15];
>             }
>         times(&tms);
>         stop = tms.tms_utime;
>         fprintf(stderr, "%5.3f MB/s\n",
>                 (double)(LOOPSIZE/MB)/(double)(stop-start)*(double)CLK_TCK);
>     }
>     exit(0);
> }

I just tried that program and it is very interesting. Not quite what I
expected. This machine has 2 Pentium III chips in it, the 550 MHz kind
with 512K cache.

valinux:jdbeyer[~]$ ./MemSpeed 
*** MEMORY WRITE PERFORMANCE (256 MB LOOP) ***
size =        64 bytes: 1422.222 MB/s
size =       128 bytes: 1706.667 MB/s
size =       256 bytes: 1600.000 MB/s
size =       512 bytes: 1600.000 MB/s
size =      1024 bytes: 1706.667 MB/s
size =      2048 bytes: 1706.667 MB/s
size =      4096 bytes: 1706.667 MB/s
size =      8192 bytes: 1828.571 MB/s
size =     16384 bytes: 1706.667 MB/s
size =     32768 bytes: 387.879 MB/s
size =     65536 bytes: 393.846 MB/s
size =    131072 bytes: 382.090 MB/s
size =    262144 bytes: 341.333 MB/s
size =    524288 bytes: 258.586 MB/s
size =   1048576 bytes: 192.481 MB/s
size =   2097152 bytes: 153.293 MB/s
size =   4194304 bytes: 188.235 MB/s
size =   8388608 bytes: 158.025 MB/s
*** MEMORY READ PERFORMANCE (256 MB LOOP) ***
size =        64 bytes: 1828.571 MB/s
size =       128 bytes: 1828.571 MB/s
size =       256 bytes: 1969.231 MB/s
size =       512 bytes: 1706.667 MB/s
size =      1024 bytes: 1828.571 MB/s
size =      2048 bytes: 1969.231 MB/s
size =      4096 bytes: 1969.231 MB/s
size =      8192 bytes: 1969.231 MB/s
size =     16384 bytes: 1828.571 MB/s
size =     32768 bytes: 882.759 MB/s
size =     65536 bytes: 853.333 MB/s
size =    131072 bytes: 882.759 MB/s
size =    262144 bytes: 624.390 MB/s
size =    524288 bytes: 345.946 MB/s
size =   1048576 bytes: 248.544 MB/s
size =   2097152 bytes: 253.465 MB/s
size =   4194304 bytes: 241.509 MB/s
size =   8388608 bytes: 261.224 MB/s
valinux:jdbeyer[~]$ 

I guess from this I can tell that the L1 cache is 16384 bytes and the L2
cache is 524288 bytes (I knew the second of these). What I find curious
is that the write performance slowly increases up to 8192 bytes, and
moves back before falling off the L1 cliff. For read performance, it
seems to peak at 256 bytes. I will have to think more about this. The
machine was running other stuff (mainly SETI@home at nice 19), so this
may have interfered a little. Perhaps these anomalies are just
statistical artifacts of no significance.
-- 
 .~.  Jean-David Beyer           Registered Linux User 85642.
 /V\                             Registered Machine    73926.
/( )\ Shrewsbury, New Jersey
^^-^^ 9:50pm up 1 day, 23:00, 4 users, load average: 2.09, 2.17, 2.01

------------------------------

From: Jean-David Beyer <[EMAIL PROTECTED]>
Subject: Re: Help! Printer doesn't stop printing!!!
Date: Wed, 10 Jan 2001 21:57:39 -0500

Andr� wrote:
> 
> Hi
> 
> I have a printer and I tried to print a lot of things, but with no
> success.
> 
> Well, now the printer decided to work. But it is printing everything I
> sent to it in the last day (perhaps hundreds of pages). How do I stop
> it? I tried lpq but is just says no entries. I tried lpc too, but no
> success.
> 
> Please help
> 
> TIA
> 
> Andr�
man lprm ?
-- 
 .~.  Jean-David Beyer           Registered Linux User 85642.
 /V\                             Registered Machine    73926.
/( )\ Shrewsbury, New Jersey
^^-^^ 9:55pm up 1 day, 23:05, 4 users, load average: 2.14, 2.15, 2.03

------------------------------

From: Donald Arseneau <[EMAIL PROTECTED]>
Subject: Re: CD-RW
Date: 10 Jan 2001 19:07:54 -0800

[EMAIL PROTECTED] (Dances With Crows) writes:

> On Wed, 10 Jan 2001 07:27:21 GMT, E J staggered into the Black Sun and said:
> ># mount /mnt/ls120 /dev/scd0 -t vfat 
> 
> Nope.  I think you want /dev/sda here, as /dev/scd0 is the first SCSI
> CD-ROM, while /dev/sda is the first SCSI disk.  

Thanks a lot.  
mount -t vfat /dev/sda /mnt/ls120 
works, and it works in the fstab.  I guess I will leave it as a 
fake scsi device.

Donald Arseneau                          [EMAIL PROTECTED]

------------------------------

From: [EMAIL PROTECTED] (Christopher W. Aiken)
Subject: Tax Software??
Date: Thu, 11 Jan 2001 03:03:47 -0000
Reply-To: [EMAIL PROTECTED]

Is there any tax software like Kiplinger TAXCUT from
H&R Block for FreeBSD or Linux?

--
Christopher W. Aiken, Scenery Hill, Pa, USA
chris at cwaiken dot com,   www.cwaiken.com
Current O/S: Debian GNU/Linux 2.2_r2

------------------------------

From: [EMAIL PROTECTED]
Subject: Re: Enter escape charcter in vi or another editor
Date: 10 Jan 2001 22:07:46 -0500

Bill M Leagans <[EMAIL PROTECTED]> wrote:

> How do you enter special charactes in vi or another editor such as ASCII
> code 27 (escape).

It depends on the editor ... in vi (at least what I am using) (mine is 
linked to elvis) (but this works in vim too) try pressing (after being in 
input mode) CTRL-V and then the key you want, such as CTRL-B (NOT just B, 
but CTRL-B) or CTRL-V and then the ESCape key, etc.

------------------------------


** FOR YOUR REFERENCE **

The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:

    Internet: [EMAIL PROTECTED]

You can send mail to the entire list by posting to comp.os.linux.misc.

Linux may be obtained via one of these FTP sites:
    ftp.funet.fi                                pub/Linux
    tsx-11.mit.edu                              pub/linux
    sunsite.unc.edu                             pub/Linux

End of Linux-Misc Digest
******************************

Reply via email to