Re: [opensuse] Can I lock a DHCP ip adress?

2007-10-15 Thread Ted Harding
On 15-Oct-07 08:27:01, Aniruddha wrote:
 On Sun, 2007-10-14 at 17:22 -0600, John Meyer wrote:
 I must have gotten into this thread a little too late.  Why, exactly,
 would you want a static ip in a dhcp environment?  Sorry for the new
 question, but it's better than asking people if they prefer top or
 bottom (not in that way, of course) ;-)
 
 
 Lol! I agree 100% ;) The reason I would like a static ip is simple,
 I use ssh to troubleshoot his system. Therefor it would be handy if
 his ip didn't change all the time.
 -- 
 Regards,
 
 Aniruddha

Ahh! Then get him to email you whenever he starts a new session
(this could even be set up as a task for when his system starts
up). You should be able to find out the IP address he is mailing
from, from the headers in the email.

(For example, your localhost is 192.168.2.167, and you are
connected to wanadoo.nl as 85.144.207.123).

Best wishes,
Ted.


E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861
Date: 15-Oct-07   Time: 10:14:23
-- XFMail --
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Can I lock a DHCP ip adress?

2007-10-14 Thread Ted Harding
On 14-Oct-07 21:42:59, Aniruddha wrote:
 On Sun, 2007-10-14 at 14:34 -0700, joe wrote:
 
 Aniruddha wrote:
  My brother get his ip adres through DHCP from a large
  college lan, his ip changes with regular intervals.
  I wonder is it possible reserve one particular ip for
  his machine and if so how do I do this?
 
 Sure - are you the admin of the dhcp server?
 
 Joe
 
 
 Errr, I am afraid not. He just receives his ip adress through dhcp.

There is one thing he could try, which may or may not work often
enough to to be useful.

Say he gets a particular IP address one time. Let him note that,
and configure his own machine to have that IP address statically
configured in his machine (this may involve setting up a static
DNS and gateway too, so it might not be trivial).

Then, if when he next connects, that particular IP address is
free the remote server should simply recognise that he is
using it, and not try to give it to anyone else. Since it's
static on his mkachine, it would not change so long as he
remained connected.

(This is exactly what I do on my home LAN, by the way: The ADSL
router gives out dynamic IPs by DHCP to any connected machine
that asks for one, but does not interfere with any machines
that have static IPs configured in them; and whenever I connect
some other machine -- e.g. I'm trying out different Linux distros
in virtual machines and off live CDs at the moment, and they all
ask for DHCP in the first instance -- the router aloways gives
them an IP different from the statitically configured ones.
Of course, if one or more of the statically configured machines
was switched off, then presumably the router could use one of
their IP addresses, since it's not in use).

Whether this suggestion is useful would depend on the demand
for IP addresses on that campus. If an idle IP address gets
snapped up quickly, then it would be no use at all!

On the other hand, if his disconnections are brief, then
there may be a good chance that this trick could work well
enough.

If it failed at any time, of course, then he'd just have to
revert to DHCP for that connection.

Best wishes,
Ted.


E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861
Date: 14-Oct-07   Time: 23:51:47
-- XFMail --
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [opensuse] How to insert lines into text file ?

2007-08-16 Thread Ted Harding
On 16-Aug-07 08:15:04, Alexey Eremenko wrote:
 Hi all !
 
 I would like to insert a new line on each second line, like that:
 
 
 pre.txt:
 line1
 line2
 line3
 
 After.txt:
 line1
 
 line2
 
 line3
 
 I have found the echo -e \n  command to actually insert a new
 line, but how to automate the process so every second line will get a
 new line?

Your pre.txr and aAfter.txt example suggests that you are not inserting
a new line at each second line of the original, which would give

pre.txt
line1
line2
line3
line4
line5
...

After.txt
line1
line2

line3
line4

line5
...

but instead inserting an extra newline after each line of pre.txt

Either way, though, you could use 'awk':

cat pre.txt | awk '{print $0 \n}'

will do the insert of the extra newline after each line of pre.txt;

cat pre.txt | awk 'BEGIN{R=0}{if(R==0) {print $0} else 
{print $0 \n}}{R = 1-R}'

will do it after each second line of the original. Example:

$ cat pre.txt
line1
line2
line3
line4
line5
line6
line7
line8


]$ cat pre.txt | awk '{print $0 \n}'
line1

line2

line3

line4

line5

line6

line7

line8


$ cat pre.txt | awk 'BEGIN{R=0}{if(R==0) {print $0} else 
{print $0 \n}}{R = 1-R}'
line1
line2

line3
line4

line5
line6

line7
line8


This is based on testing the value of R which switches
between 0 and 1. Clearly it is straightforward to compute
more complicated conditions involving the line-number of
the original file.

Best wishes,
Ted.


E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861
Date: 16-Aug-07   Time: 09:53:12
-- XFMail --
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [opensuse] alt-F1?

2007-05-23 Thread Ted Harding
On 23-May-07 16:52:24, John E. Perry wrote:
 I've seen several statements lately that one gets to the black
 console screens via alt-F1.  When I do this, I get the KDE menu.
 I have to do ctrl-alt-Fx to get to the consoles.
 
 As far as I know, my system is a simple standard opensuse 10.2
 with the basic suse updates through opensuseupdater.  No hacks,
 no obscure window manager additions.  Why is my X different?
 Should I be concerned?
 
 John Perry

The behaviour you describe is standard, and has been, on Linux,
since X came in (early-mid 90s).

The Alt-Fn statements you have seen refer to swapping between
black consoles. So, from one black cosole, say Console 1,
you can swap to any other, say Console 5, with Alt-F5.

Of course, Alt-F7 will take you to the console which is running X.

From an X console, however, to get to any other console you must
use Ctrl-Alt-Fn. So Ctrl-Alt-F1 will take you to black console 1,
for instance.

The reason X is different is that, depending on the window
manager, Alt-Fn will have some other function in X. This again
is standard.

Overall, nothing whatever to be concerned about!

Hoping this helps,
Ted.


E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861
Date: 23-May-07   Time: 18:53:05
-- XFMail --
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [opensuse] Re: alt-F1?

2007-05-23 Thread Ted Harding
On 23-May-07 18:54:52, Jonathan Arnold wrote:
 (Ted Harding) wrote:
 On 23-May-07 16:52:24, John E. Perry wrote:
 I've seen several statements lately that one gets to the black
 console screens via alt-F1.  When I do this, I get the KDE menu.
 I have to do ctrl-alt-Fx to get to the consoles.

 As far as I know, my system is a simple standard opensuse 10.2
 with the basic suse updates through opensuseupdater.  No hacks,
 no obscure window manager additions.  Why is my X different?
 Should I be concerned?

 John Perry
 
 The behaviour you describe is standard, and has been, on Linux,
 since X came in (early-mid 90s).
 
 The Alt-Fn statements you have seen refer to swapping between
 black consoles. So, from one black cosole, say Console 1,
 you can swap to any other, say Console 5, with Alt-F5.
 
 Of course, Alt-F7 will take you to the console which is running X.
 
 From an X console, however, to get to any other console you must
 use Ctrl-Alt-Fn. So Ctrl-Alt-F1 will take you to black console 1,
 for instance.
 
 The reason X is different is that, depending on the window
 manager, Alt-Fn will have some other function in X. This again
 is standard.
 
 And that's why it's easier to just get in the Ctrl-Alt-Fn mode,
 because that works from either a virtual terminal or X.
 
 I recently wrote a short bit about this:
 
 http://freebsd.amazingdev.com/blog/archives/000872.html

Which is fair anough -- though once you get used to it, it's no
trouble to use Alt-Fn from a console. (Mind you, I got used to
Alt-Fn back in 1992, before X came in, and all you had was black
consoles and Alt-Fn. So for me, Ctrl-Alt-Fn is an add-on)!

Of course, the point of all these posts on this thread is to
clarify what was puzzling John Perry in the firstplace. I hope
we've done that!

Best wishes to all,
Ted.


E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861
Date: 23-May-07   Time: 21:15:50
-- XFMail --
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [opensuse] postscript question.

2007-04-23 Thread Ted Harding
On 23-Apr-07 01:49:14, Carlos E. R. wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 
 Hi,
 
 Is there a way to add page numbers to the pages of a postscript
. file, so that they print in the paper?
 
 I have done this in the past with a2ps or similar, but this time
 the original is a ps file.
 
 I can, for instance, use psnup -2 infile.ps outfile.ps to
 rearrange it two pages per sheet, and I can print odd pages first,
 then even on the other side, and thus get 4 pages per sheet and
 save trees. But unless I number them with pencil I can easily get
 lost when ordering them.
 
 So the question is, how can I add the page numbers automatically?

In principle yes, but whether it is straightforward in practice
depends on the contents of the PostScript file (PS is such a
generalised language that there are many many ways in which the
same printed content can be represented in PsotScript).

The most favourable case is a PS file which is entirely plain
ASCII text with no hex-encoded content, and which contains DCS
(Document Structuring Convention) comments.

Such a comment always begins with %% at the start of a line,
such as

%%Pages: 4
%%PageOrder: Ascend
%%Orientation: Portrait

etc.

In that case, you will probably find DSC comments like

%%Page: 1 1
%%BeginPageSetup
PostScript Code
%%EndPageSetup
More PostScript Code

This is the best place for an automated page-numbering
system to start from. The following assumes that you
want the page number to be 1 inch (72 points) up from the
bottom of the page, and 1 inch in from the left, and that
the standard coordinate system is in operation (some
software may, for instance, invert the vertical so that
distance is measures from the top rather than the default
bottom of the page -- in which case the numbers will not
only be at the top left, but also upside down!).

%%Page: requires two arguments: the first is a page label
(which may be anything), and the second is a sequential
page number, starting from 1 at the first page of the
document. E.g.
%%Page: Title 1
%%Page: i 2
%%Page: ii 3
%%Page: 1 4
etc.

DSC Comments are not printed, but are there to assist
display software in displaying the document (e.g. jumping
to a particular page, and displaying page number and/or
label in a status box).

In that case, you can feed your PS file through an 'awk'
script in order to plant PS commands to print the (sequential)
page number. Example:

#! /bin/bash
awk '
{print $0}
/^%%Page:/{Pno = $3}
/^%%EndPageSetup/{
  print( gsave )
  print( /Times-Roman findfont 12 scalefont setfont )
  print( 72 72 moveto )
  print( ( Pno ) show )
  print( grestore )
}'


Store the above as a file, say numps.awk, and make it
executable:

  chmod 755 numps.awk

and then:

  cat myfile.ps | ./numps.awk  mynewfile.ps

Check it with:

  gv mynewfile.ps

and if it's OK then you can print it!

As I say, whether the above will work as intended depends
on how the PS file was created. If it has non-standard
features which interfere (e.g. inverted coordinates as
above) then the 'awk' script would need to be amended
accordingly. But at least this illustrates the principle.

Also, a PS file need not contain DSC comments at all, in
which case the above will not work, and a different
approach would have to be worked out.

Hoping this helps!
Ted.


E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861
Date: 23-Apr-07   Time: 14:54:27
-- XFMail --
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Double Linked List patented in 2006

2007-03-19 Thread Ted Harding
On 19-Mar-07 21:00:37, Tom Horsley wrote:
 On Mon, 19 Mar 2007 20:37:58 - (GMT)
 (Ted Harding) [EMAIL PROTECTED] wrote:
 
 For example, does it occur in standard textboooks on computer
 programming and data structures? Is there long-standing open
 source software in which it may be found?
 
 Well, it is essentially the way all relational databases work, so
 they should clearly sue Oracle for a million billion zillion dollars.

Can you expand and clarify that?

I can see that storage in a relational databse table (i.e. relation)
is facilitated by using a double-linked list (in the *traditional*
sense I described at [1] in my previous mail), where each record
is associated with two pointers, one to its successor in some desired
order (e.g. alphabetical sort) and the other to its predecessor.

But is the *other* double-linked list as I described at [2] of
my previous mail generally used -- i.e. is each record associated
with two or more sets of pointers, where, in one set, one pointer
points to the successor in one ordering and the other pointer to
its predecessor in the same ordering; and in another set one
pointer points to the successor in a different ordering and the
other points to its predecessor in this different ordering, and
so on?

You say it is essentially the way all relational databases work,
which -- if we are talking about the same interpretation -- means
that in all relational databases each record in a relation is
associated with multiple forward pointers and a matched set of
multiple backward pointers. Is that the case (speaking from
ignorance here)?

It is the second interpretation of double linked list which is
the subject of the patent, not the first!

With thanks,
Ted.


E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861
Date: 19-Mar-07   Time: 22:12:46
-- XFMail --
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Double Linked List patented in 2006

2007-03-19 Thread Ted Harding
On 19-Mar-07 21:29:52, Anders Johansson wrote:
 On Monday 19 March 2007 21:37, Ted Harding wrote:
 Now, while the standard doubl{e|y} linked list described
 at [1] above has been around since the year dot (or shortly
 thereafter), and is found everywhere, the second kind described
 at [2] above (though it has undoubtedly been implemented many
 times) could conceivably be considered sufficiently novel to
 provoke a patent application!
 
 It certainly fails the obvious to one skilled in the field test
 
 So my question, for clarification, is: Can anyone supply any
 reference of sufficiently long standing to demonstrate that
 the second kind of double linked list at [2] above is well
 established prior art?
 
 They are sorting the list in various ways, and storing the previous
 results so they don't have to do them all over again when they need
 them again. If
 
 struct foo *next, *prev
 
 is old hat, why would
 
 struct foo *next[100], *prev[100]
 
 be a patentable invention.
 
 They are storing various paths in traversing a tree or graph. There is 
 absolutely nothing about that that isn't patently (if you'll pardon the
 pun) obvious to one skilled in the field

I absolutely agree that it's an obvious generalisation, and I'm
pretty sure that it's been used many times. But the trick when
making a claim for novelty is to isolate, abstract and identify the
concept as adapted to a class of purposes, and give it a name.
So what I was after is whether there exists such an identification of
this technique that has been around long enough to well-established
prior art.

That has certainly been the case for

  struct foo *next *prev

(see good books on C programming from 20 years ago) but what about
the other?

And, just to make it clear, I oppose the whole concept of patentability
of programming techniques, since in principle -- given the abstract
definition of any given programming language -- all constructs
stateable in the laguage are implicit in its definition; and
therefore to anyone skilled in the field they should be available
as an inspirational mental perception that this is how to solve this
problem. To inhibit this by patent is to inhibit thought itself.

On the other hand, I think the concept of copyright in a publication
of a programming technique can be defended. What is then prohibited
is the unauthorised deliberate copying from the publication. But
then what has to be proved is the act of copying, not the fact that
it is the same technique. The same technique could arise by mental
inspiration, but then while the program's structures could be
identifiably the same, the precise details would differ (perhaps
in order and detail of definitions, or variable names, etc.).
However, if the copier's code were character-by-character identical
to the original, then this would justifiably be viewed is totally
improbable as an independent creation.

Thanks Anders!
Ted.


E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861
Date: 19-Mar-07   Time: 22:37:32
-- XFMail --
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [opensuse] possibility to use standard keyboard single-hande

2007-03-08 Thread Ted Harding

On 08-Mar-07 Zhang Weiwu wrote:
 The doctor suggested me to use left arm as less as possible.
 I think this is only possible if I can type single-handed.
 
 After I read this article I decide to start to practice single
 hand typing on standard keyboard:
 http://edgarmatias.com/papers/hci96/
 
 Problem being I don't know if this is possible on Linux. Using
 this typing technology, it require OS to make Space Bar work
 in the way like Shift. E.g. press Shift and a you get A,
 press space bar and a you get ;, the symmetrical opposite
 key of a on keyboard.
 
 I tried to google around, it seems so far not so much Linux
 software take this issue seriously yet (or at least simple google
 search is not sufficient). I guess there might be a keyboard
 layout that can help me do that: checking gnome keycode map list,
 there is no keyboard layout for single-handed QWERTY.
 
 Maybe this is simple? Maybe all I need is to tweak some configuration
 file for X or Gnome? I don't know.
 
 A lot of google search showed that alternative method is to use
 Dvorak single-handed layout keyboard. That's not an easy option
 to me because I type Chinese a lot and I already remembered key
 position. Switching from QWERTY to an alternative layout is a big
 trouble for me, too much to re-learn and re-practice. And, my arm
 is not permanently injured, I wish to get back to dual-hand typing
 after several months. Holiday is not an option for me too, I am
 running a company and under business pressure.

One simple suggestion -- if it is medically acceptable -- is to
use your injured arm/hand only for the keys Shift, Ctrl, Alt, and
use your good hand for all other keys. That would minimise the
strain on your injured arm.

Another approach would be to re-program say the SPACE bar to act
as Shift, and some other key otherwise rarely used (e.g. F12)
to act as SPACE.

Indications of how to do this sort of thing can be found in

  man xmodmap

Hoping this helps, sympathy with your problems, and wishing
you a good solution and outcome!
Ted.



E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861
Date: 08-Mar-07   Time: 10:29:31
-- XFMail --
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] Can spam be defeated?

2006-12-21 Thread Ted Harding
On 21-Dec-06 Daniel Bauer wrote:
 [...]
 I am not at all an expert, but I dislike the option of
 rejecting emails due to a blacklist. I prefer to have
 spam in my spam-folder (after it has been marked by
 Spam-Assassin), where I can quickly overview the subject
 lines.
 [...]
 Using blacklists for warning/marking purposes seems ok
 to me, but letting a blacklist make decisions can be
 dangerous. Just my opinion.
 
 Daniel

I've been reading this discussion--technicalities and conflicts
of automated spam-filtering--and welcome Daniel's common-sense
approach.

I was going to write, anyway, that the very best filter for
unwanted mail is yourself. The real issue is how you implement
that filter.

In my case, I have mail delivered to a different machine (call
it mailhost) to the one I actually handle mail on (call it
mailagent).

Logged in to mailhost, I open my inbox with good old fast and
compact 'elm'. This displays a text window with 1 line per mail,
showing sender and subject for each mail.

Then, with one finger on D (delete) and one on J (skip
down one line), I can work through the bunch of delivered mail
very quickly indeed--the decision to D (get rid of it) and J
(keep it) is made in a fraction of a second, and I can work
through 100 mails in perhaps a minute. Then quit 'elm', confirming
deletions and keep-in-inbox in the process. Any slips of the fingers
can be rectified with Shift-K (move up 1 regardless of status)
and U (undelete), though I don't often need that.

Having done that, I then use POP3 retrieval to bring the
remainder over to mailagent, where can deal with it normally
using a mail client (XFMail).

The advantage of this approach is that not only spam (which one
can almost always easily recognise from Sender and Subject) but
also mails from mailing-lists on topics one doesn't want to read
about, etc., are handled all in one go. if there's any doubt,
then pressing the spacebar in 'elm' shows you the body, so you
can then definitively decide. Being eing 'elm', it's very fast.
And, being you, it's as fast as you can be and also flexible,
discriminating and accurate.

Doing this in the MUA (XFMail) would be more tedious, because
it's GUI-based, so you waste ages moving and clocking the mouse!

I get on average about 500 mails a day, of which about 2/3 is
spam, and most of the rest is not interesting, so I only retrieve
some 5-15% for further consideration.

False negatives (retrieving mail I don't really want) are unusual,
and false positives (deleting mail I do want) are very rare.

I reckon that, with the 500 or so per day, dealing with spam and
unwanted mail in this way probably takes 5-10 minutes in total.

By the way, you don't need to use two machines for the above
(depending on your MUA). XFMail stores mail in MH folders,
one of which is inbox, so doesn't directly deal with the
user's system mailbox /var/spool/mail/user except when pulling
mail. So with an MUA which works that way, you could use 'elm'
on the inbox as above. But if your MUA's inbox is the user's
system mailbox, you may find that the MUA puts a lock on it.

Best wishes, and Season's Greetings to all!
Ted.


E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861
Date: 21-Dec-06   Time: 11:36:42
-- XFMail --
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]