Ohad Levy | 1 Sep 09:27 2008
Picon

Re: [Telux] Next OSDClub Tel Aviv Meeting: "Puppet" on 7-September

I would recommend anyone who needs to manage UNIX based machines (Apple, Linux, Solaris, FreeBSD, HP-UX etc) and don't have enough time/have too many machines or just want to optimize the way they work , to come for this meeting.
 
Puppet in my eyes is the evolution of infrastructure management, improving the good work that was started with other tools like cfengine.

I myself is at the end of a big rollout project which is mostly based on Puppet infrastructure for approx 2500 servers, so if anyone is interested in a large scale deployments I'll be happy to talk about this as well.
 
Looking forward to seeing you,
Ohad
On Sun, Aug 31, 2008 at 12:46 PM, Shlomi Fish <shlomif-ik1l9ssToec+JF/nGntIXQ@public.gmane.org> wrote:
Hi all!

The Tel Aviv OSDClub (Open Source Developers
Club - a merger of the Tel Aviv Linux club and Perl-Israel meetings), will
hold the following meeting:

http://wiki.osdc.org.il/index.php/Tel_Aviv_Meeting_on_07_September_2008 - "Puppet" -
a tool for central management of many computers.

{{{{
The Tel Aviv Linux Club (also now known as OSDClub Tel Aviv - Open Source
Developers' Club) will hold a presentation by Ohad Levy on Sunday,
07-September-2008 about "Puppet - the Central Management Tool".

The meeting will take place at Tel Aviv University, at the Schreiber Maths&CS
building, room 008 on 18:30. So mark your calendars. See
http://www.cs.tau.ac.il/telux/advanced.html for "how-to-get-there"
instructions.
}}}}

The club's homepage is:

http://www.cs.tau.ac.il/telux/

More information can be found on the links. If you need rides or can give
them, then add your information to the wiki pages. In any other problems,
feel free to contact me:

http://www.shlomifish.org/me/contact-me/

Upcoming meetings:

* http://wiki.osdc.org.il/index.php/Tel_Aviv_Meeting_on_21_September_2008

Regards,

       Shlomi Fish

-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Stop Using MSIE - http://www.shlomifish.org/no-ie/

I met a guy in the bar, talked to her and she gave me her phone number.

=================================================================
To unsubscribe, send mail to linux-il-request-NSemkxREmS1YZAO8hgG6+w@public.gmane.org with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request-NSemkxREmS1YZAO8hgG6+w@public.gmane.org


Shlomi Fish | 1 Sep 10:42 2008
Picon

Curses Problem in Detecting Backspace

Hi all!

I'm trying to detect Backspace input using Curses/Ncurses. So I have the 
following Perl script that isolates the problem I'm having:

{{{{{{{{{{
#!/usr/bin/perl

use strict;
use warnings;

use Curses;

my $main_win = Curses->new();
initscr();
noecho();
$main_win->keypad(1);

my $char = $main_win->getch();

my $ok = ($char eq KEY_BACKSPACE());

endwin();

print sprintf("%s\nGot %s\n", 
    ($ok ? "Got backspace" : "Did not get backspace"),
    $char
);

}}}}}}}}}}

On a konsole or xterm, after I press Backspace, I'm getting:

{{{
Did not get backspace
Got
}}}

On a Linux virtual console, it seems to work, and I'm getting "Got backspace".

Now, I implemented this program as a C program:

{{{{{{{{
/*
 * test-bs.c
 *
 * Compile with:
 *
 * gcc -Wall -o test-bs test-bs.c -lncurses
 *
 * */
#include <curses.h>
#include <stdio.h>

int main(int argc, char * argv[])
{
    WINDOW * main_win;
    int ch;
    int ok;
    int expected;

    initscr();
    noecho();

    main_win = newwin(24, 80, 0, 0);

    keypad(main_win, 1);

    ch = wgetch(main_win);
    expected = KEY_BACKSPACE;

    ok = (ch == expected);

    endwin();

    printf(
        "%s\nGot: %i\nExpected: %i\n", 
        (ok ? "Got backspace" : "Did not get backspace"),
        ch,
        expected
    );

    return !ok;
}
}}}}}}}}

And on the xterm/konsole, I'm getting:

{{{
shlomi:$module$ ./test-bs
Did not get backspace
Got: 127
Expected: 263
}}}

Again - it works on a virtual console.

The funny thing is that I can recall it working correctly on konsole/xterm a 
few days ago, and then it stopped.

What should I do to get it working?

I'm using Mandriva Cooker on a Pentium 4 machine.

Regards,

	Shlomi Fish

-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
The Case for File Swapping - http://xrl.us/bjn7i

Shlomi, so what are you working on? Working on a new wiki about unit testing 
fortunes in freecell? -- Ran Eilam

=================================================================
To unsubscribe, send mail to linux-il-request@... with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@...

Valery Reznic | 1 Sep 11:13 2008
Picon

Re: Curses Problem in Detecting Backspace

It's looks like your BACKSPACE mapped to delete.

Valery

--- On Mon, 9/1/08, Shlomi Fish <shlomif@...> wrote:

> From: Shlomi Fish <shlomif@...>
> Subject: Curses Problem in Detecting Backspace
> To: "Linux-IL" <linux-il@...>, "Perl in Israel" <perl@...>
> Cc: module-authors@...
> Date: Monday, September 1, 2008, 11:42 AM
> Hi all!
> 
> I'm trying to detect Backspace input using
> Curses/Ncurses. So I have the 
> following Perl script that isolates the problem I'm
> having:
> 
> {{{{{{{{{{
> #!/usr/bin/perl
> 
> use strict;
> use warnings;
> 
> use Curses;
> 
> my $main_win = Curses->new();
> initscr();
> noecho();
> $main_win->keypad(1);
> 
> my $char = $main_win->getch();
> 
> my $ok = ($char eq KEY_BACKSPACE());
> 
> endwin();
> 
> print sprintf("%s\nGot %s\n", 
>     ($ok ? "Got backspace" : "Did not get
> backspace"),
>     $char
> );
> 
> }}}}}}}}}}
> 
> On a konsole or xterm, after I press Backspace, I'm
> getting:
> 
> {{{
> Did not get backspace
> Got
> }}}
> 
> On a Linux virtual console, it seems to work, and I'm
> getting "Got backspace".
> 
> Now, I implemented this program as a C program:
> 
> {{{{{{{{
> /*
>  * test-bs.c
>  *
>  * Compile with:
>  *
>  * gcc -Wall -o test-bs test-bs.c -lncurses
>  *
>  * */
> #include <curses.h>
> #include <stdio.h>
> 
> int main(int argc, char * argv[])
> {
>     WINDOW * main_win;
>     int ch;
>     int ok;
>     int expected;
> 
>     initscr();
>     noecho();
> 
>     main_win = newwin(24, 80, 0, 0);
>     
>     keypad(main_win, 1);
> 
>     ch = wgetch(main_win);
>     expected = KEY_BACKSPACE;
> 
>     ok = (ch == expected);
> 
>     endwin();
> 
>     printf(
>         "%s\nGot: %i\nExpected:
> %i\n", 
>         (ok ? "Got backspace" : "Did not get
> backspace"),
>         ch,
>         expected
>     );
> 
>     return !ok;
> }
> }}}}}}}}
> 
> And on the xterm/konsole, I'm getting:
> 
> {{{
> shlomi:$module$ ./test-bs
> Did not get backspace
> Got: 127
> Expected: 263
> }}}
> 
> Again - it works on a virtual console.
> 
> The funny thing is that I can recall it working correctly
> on konsole/xterm a 
> few days ago, and then it stopped.
> 
> What should I do to get it working?
> 
> I'm using Mandriva Cooker on a Pentium 4 machine.
> 
> Regards,
> 
> 	Shlomi Fish
> 
> -----------------------------------------------------------------
> Shlomi Fish       http://www.shlomifish.org/
> The Case for File Swapping - http://xrl.us/bjn7i
> 
> Shlomi, so what are you working on? Working on a new wiki
> about unit testing 
> fortunes in freecell? -- Ran Eilam
> 
> =================================================================
> To unsubscribe, send mail to linux-il-request@...
> with
> the word "unsubscribe" in the message body, e.g.,
> run the command
> echo unsubscribe | mail linux-il-request@...

=================================================================
To unsubscribe, send mail to linux-il-request@... with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@...

Shlomi Fish | 1 Sep 11:45 2008
Picon

Re: Curses Problem in Detecting Backspace

On Monday 01 September 2008, Valery Reznic wrote:
> It's looks like your BACKSPACE mapped to delete.
>

OK, but what should I do about it?

Regards,

	Shlomi Fish

> Valery
>
> --- On Mon, 9/1/08, Shlomi Fish <shlomif@...> wrote:
> > From: Shlomi Fish <shlomif@...>
> > Subject: Curses Problem in Detecting Backspace
> > To: "Linux-IL" <linux-il@...>, "Perl in Israel"
> > <perl@...> Cc: module-authors@...
> > Date: Monday, September 1, 2008, 11:42 AM
> > Hi all!
> >
> > I'm trying to detect Backspace input using
> > Curses/Ncurses. So I have the
> > following Perl script that isolates the problem I'm
> > having:

[ Snipped ]

-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
First stop for Perl beginners - http://perl-begin.org/

Shlomi, so what are you working on? Working on a new wiki about unit testing 
fortunes in freecell? -- Ran Eilam

=================================================================
To unsubscribe, send mail to linux-il-request@... with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@...

Valery Reznic | 1 Sep 11:49 2008
Picon

Re: Curses Problem in Detecting Backspace


--- On Mon, 9/1/08, Shlomi Fish <shlomif@...> wrote:

> From: Shlomi Fish <shlomif@...>
> Subject: Re: Curses Problem in Detecting Backspace
> To: valery_reznic@...
> Cc: "Linux-IL" <linux-il@...>, "Perl in Israel" <perl@...>
> Date: Monday, September 1, 2008, 12:45 PM
> On Monday 01 September 2008, Valery Reznic wrote:
> > It's looks like your BACKSPACE mapped to delete.
Keys mapping in the X never was my strong point, so I am at no help here. But I think this mapping BASKSPACE ->
delete is very common so you nay want to support both cases in your code.

Valery

> >
> 
> OK, but what should I do about it?
> 
> Regards,
> 
> 	Shlomi Fish
> 
> > Valery
> >
> > --- On Mon, 9/1/08, Shlomi Fish
> <shlomif@...> wrote:
> > > From: Shlomi Fish <shlomif@...>
> > > Subject: Curses Problem in Detecting Backspace
> > > To: "Linux-IL"
> <linux-il@...>, "Perl in Israel"
> > > <perl@...> Cc:
> module-authors@...
> > > Date: Monday, September 1, 2008, 11:42 AM
> > > Hi all!
> > >
> > > I'm trying to detect Backspace input using
> > > Curses/Ncurses. So I have the
> > > following Perl script that isolates the problem
> I'm
> > > having:
> 
> [ Snipped ]
> 
> -----------------------------------------------------------------
> Shlomi Fish       http://www.shlomifish.org/
> First stop for Perl beginners - http://perl-begin.org/
> 
> Shlomi, so what are you working on? Working on a new wiki
> about unit testing 
> fortunes in freecell? -- Ran Eilam

=================================================================
To unsubscribe, send mail to linux-il-request@... with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@...

Yedidyah Bar-David | 1 Sep 11:57 2008

Re: Curses Problem in Detecting Backspace

On Mon, Sep 01, 2008 at 12:45:50PM +0300, Shlomi Fish wrote:
> On Monday 01 September 2008, Valery Reznic wrote:
> > It's looks like your BACKSPACE mapped to delete.
> >
> 
> OK, but what should I do about it?

There are many resources about this on the net. I thought
backspace/delete problems are a thing of the past, apparently they are
not.

http://en.wikipedia.org/wiki/Backspace
http://tldp.org/HOWTO/BackspaceDelete/index.html
http://www.debian.org/doc/debian-policy/ch-opersys.html#s9.8
--

-- 
Didi

=================================================================
To unsubscribe, send mail to linux-il-request@... with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@...

Shlomi Fish | 1 Sep 12:26 2008
Picon

Re: Curses Problem in Detecting Backspace

On Monday 01 September 2008, Yedidyah Bar-David wrote:
> On Mon, Sep 01, 2008 at 12:45:50PM +0300, Shlomi Fish wrote:
> > On Monday 01 September 2008, Valery Reznic wrote:
> > > It's looks like your BACKSPACE mapped to delete.
> >
> > OK, but what should I do about it?
>
> There are many resources about this on the net. I thought
> backspace/delete problems are a thing of the past, apparently they are
> not.
>
> http://en.wikipedia.org/wiki/Backspace
> http://tldp.org/HOWTO/BackspaceDelete/index.html
> http://www.debian.org/doc/debian-policy/ch-opersys.html#s9.8

Hi!

I found a workaround for this problem in the code for Curses::UI::Common. 
There they have:

{{{{{{{{{
    $key = KEY_BACKSPACE if (
	ord($key) == 127 or 
	$key eq "\cH"
    );
}}}}}}}}}

Having placed that in my code, it seems to work.

Regards,

	Shlomi Fish

-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Original Riddles - http://www.shlomifish.org/puzzles/

Shlomi, so what are you working on? Working on a new wiki about unit testing 
fortunes in freecell? -- Ran Eilam

=================================================================
To unsubscribe, send mail to linux-il-request@... with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@...

Ghiora Drori | 2 Sep 06:20 2008
Picon

Re: Memory manipulator

Hi,
I assume this is relevant:
:H. Peter Anvin writes:
Mikael Pettersson wrote:
On Wed, 19 Sep 2007 14:35:29 +0100, James Pearson wrote:
/proc/PID/environ currently truncates at 4096 characters, patch based on
the /proc/PID/mem code.

Does /proc/PID/mem even work? If I do `strace cat /proc/PID/mem > /dev/null'
for a known good PID, the first read() from /proc/PID/mem fails with ESRCH,

Of course it does. Address zero isn't typically mapped.

I would also look here:
http://www.comptechdoc.org/os/linux/howlinuxworks/linux_hlproc.html
and use item 6 maps plus  /dev/mem

(Warning I am not a kernel programmer, so this is just my 2 cents after goggling)




Indeed. My bad :-(
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo <at> xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/





On Sun, Aug 31, 2008 at 12:18 PM, Shachar Shemesh <shachar-bG81FZYBAlipwFb5G8XvHQ@public.gmane.org> wrote:
Gilad Ben-Yossef wrote:


Shachar Shemesh wrote:

You can only use /proc/PID/mem if you are already attached to that process as a debugger.
How interesting. Where is that documented?
Google. I spent almost half an hour trying to figure that one out. It is, indeed, not documented anywhere I could find.

neither the proc man page or the relevant kernel documentation file does not mention this.

Don't use no double negatives! Sorry, couldn't resist.



I'm going to send a patch...
Go for it.

Shachar

=================================================================
To unsubscribe, send mail to linux-il-request-NSemkxREmS1YZAO8hgG6+w@public.gmane.org with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request-NSemkxREmS1YZAO8hgG6+w@public.gmane.org




--
Constant change is here to stay!

President John F. Kennedy once said that "the hottest places in Hell
are reserved for those who in a period of moral crisis maintain their
neutrality."

Nadav Har'El | 2 Sep 07:59 2008
Picon

Re: Curses Problem in Detecting Backspace

On Mon, Sep 01, 2008, Shlomi Fish wrote about "Re: Curses Problem in Detecting Backspace":
> On Monday 01 September 2008, Valery Reznic wrote:
> > It's looks like your BACKSPACE mapped to delete.
> >
> 
> OK, but what should I do about it?

This problem has always driven me crazy - not the actual problem, but why
it still exists. After all, look at any keyboard manufactured in the last
two decades - each and every one has separate "backspace" and "delete" keys,
not to mention that most people prefer to use ^C as their delete (SIGINTR)
anyway. Who in their right mind would possibly want their backspace key to
do something strange (like send a weird escape sequence, or interrupt the
current process) while to erase a character they need to press control-H?

But annoyingly, every once in a while I do come across this idiotic (sorry)
problem on actual systems I use.

The first thing you need to check is whether your terminal emulator (xterm,
or whatever you use) sends a backspace (^H, or ASCII 8) when you press the
backspace key. From your post it appears it doesn't, and you need to check
why. Xterm, for example, has the "backarrowKey" property which defaults to
true (backspace), but perhaps your Linux distribution tryed to "improve"
this default and uses something else - try control-left-mouse-button to
see your current settings. Or, if you're using some other terminal emulator
(you probably are, unfortunately xterm has grown out of fashion and replaced
by MS-Windows-lookalikes :( ), look into it's documentation.

Another thing you should check is your tty settings. Run "stty" and see that
your erase = ^H. If erase = ^? then you are actually expecting the backspace
key to send a ^? (delete), so don't be surprised if it does (maybe your
terminal emulator sees this stty setting and generates the character it
expects).

The least likely problem is that somehow your underlying X-Window system is
sending a "delete" character when you're pressing the backspace key - you
can check this with the "xev" tool (X event viewer).

--

-- 
Nadav Har'El                        |        Tuesday, Sep  2 2008, 2 Elul 5768
nyh@...             |-----------------------------------------
Phone +972-523-790466, ICQ 13349191 |If marriage was illegal, only outlaws
http://nadav.harel.org.il           |would have in-laws.

=================================================================
To unsubscribe, send mail to linux-il-request@... with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@...

Nadav Har'El | 2 Sep 08:17 2008
Picon

Re: Curses Problem in Detecting Backspace

On Mon, Sep 01, 2008, Shlomi Fish wrote about "Re: Curses Problem in Detecting Backspace":
> > > > It's looks like your BACKSPACE mapped to delete.
> I found a workaround for this problem in the code for Curses::UI::Common. 
> There they have:
> 
> {{{{{{{{{
>     $key = KEY_BACKSPACE if (
> 	ord($key) == 127 or 
> 	$key eq "\cH"
>     );
> }}}}}}}}}
> 
> Having placed that in my code, it seems to work.

I found why your backspace is generating a delete (ASCII 127) character.
It appears that Debian, for example, have this policy

	http://www.debian.org/doc/debian-policy/ch-opersys.html#s9.8

which contains the following dictate which to me looks nothing less than
stupid (sorry if this offends anyone):

	"X translations are set up to make KB_Backspace generate ASCII DEL"
	"Terminals should have stty erase ^?"

This does nothing but complicate everything! You first try very hard for
backspace to generate some character which is not backspace, and then
try very hard to get all applications to recognize this character as the
backspace. All this nonsense makes some sort of historic (or perhaps I
better call it pre-historic) sense, but like I said, it is completely uncalled
for in modern (read, last 20 years) systems.

P.S. As I write this, I notice that also on my system (Fedora 9), if I go
to the console (outside X), the backspace key generates ^?, and stty is set
for ^? to be the erase key. The horror! What an abomination :( And apparently,
it is not only in Debian :(

--

-- 
Nadav Har'El                        |        Tuesday, Sep  2 2008, 2 Elul 5768
nyh@...             |-----------------------------------------
Phone +972-523-790466, ICQ 13349191 |Entropy: Not just a fad, it's the future!
http://nadav.harel.org.il           |

=================================================================
To unsubscribe, send mail to linux-il-request@... with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@...


Gmane