LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Silly Question (https://www.linuxquestions.org/questions/linux-general-1/silly-question-52948/)

Crashed_Again 04-01-2003 07:41 PM

Silly Question
 
I'm currently logged into my machine using ssh from a remote location. My girlfriend is browsing the internet now on my server. I like to have fun with her and print stuff out and make Linux do all crazy things.

Is there a command I can issue that will display a 'pop-up' message. I know when you do a shutdown command it will pop up occasionaly and say 'The system is going down in 30 minutes' or whatever. Any commands like that?

Tinkster 04-01-2003 07:54 PM

I'm not sure how RH implements this, but
I'd think it's possibly some demon that listens
to wall :)

To be able to pop-up stuff on her screen as
a different user she'd need xhost +localhost
enabled ;) ... then, of course, you could
pester her with anything x-related you want
by setting your DISPLAY=localhost:0.0

Cheers,
Tink

macewan 04-01-2003 07:57 PM

just ssh to the box then
$mozilla
or gaim or whatever

this should start that program on that box.

Crashed_Again 04-01-2003 08:01 PM

I know I can run any X application I want on the server but the question is WHAT application will 'pop-up' with a message of my choosing. I imagine it would be something like:

popup 'Hey what are you doing?' <enter>

but of course it is not that. I guess I could just create a text file with the message I wanted and then open up that text file in an editor. I just thought there might be an application that is specific for this situation.

Tinkster 04-01-2003 08:03 PM

Did you try a
wall?

Cheers,
Tink

MasterC 04-01-2003 08:07 PM

ytalk (?) or just talk are sometimes mentioned, I don't know how well that'd work though since I've never used em ;)

Cool

Crashed_Again 04-01-2003 08:16 PM

Quote:

Originally posted by Tinkster
Did you try a
wall?

Cheers,
Tink

Whats "wall"? Did you mean it like 'I'm going A-WALL!' ?

MasterC I don't have talk installed because I heard it is a very insecure feature to use. Not sure about ytalk but I imagine it is part of the talk package.

hmmm....

Tinkster 04-01-2003 08:26 PM

Quote:

Originally posted by Crashed_Again
Whats "wall"? Did you mean it like 'I'm going A-WALL!' ?
man wall
Code:

WALL(1)                System General Commands Manual                WALL(1)

NAME
    wall - write a message to users

SYNOPSIS
    wall [file]

DESCRIPTION
    Wall displays the contents of file or, by default, its standard input, on
    the terminals of all currently logged in users.

    Only the super-user can write on the terminals of users who have chosen
    to deny messages or are using a program which automatically denies mes-
    sages.

    Reading from a file is refused when the invoker is not superuser and the
    program is suid or sgid.

SEE ALSO
    mesg(1), talk(1), write(1), shutdown(8)



Cheers,
Tink

macewan 04-01-2003 08:28 PM

http://www.deadmule.com/macewan/scre...p/helloworld.c

then

gcc -Wall -g helloworld.c -o hello_world `gtk-config --cflags` \
`gtk-config --libs`

Dave Skywatcher 04-01-2003 10:50 PM

Just write a script in PerlTk, PythonTk, etc. that pops up a box with a string, which comes from an argument you pass to it on the command line. Should be really, really easy if you've used Tk before (I haven't, or I would write it for you).

Crashed_Again 04-04-2003 06:46 AM

OH yeah Tinkster! wall is what I wanted. Something like:

wall "Hey! What are you doing on my computer?"

works great. Thats exactly what I was after. Thanks buddy.

I wonder why it is called 'wall'?

Tinkster 04-04-2003 03:29 PM

Since it's normally just used for administrative
tasks (notice the reference to shutdown in man?)
I assume its short for "warn all" - as in "warn
all users that the box is going down soon!" ;)

Cheers,
Tink

cuckoopint 04-05-2003 01:41 AM

I could've sworn it stood for 'write all', since it displays it to all users.
; )

As for the message, the problem I think is...wall is a console thing. But you were asking for a pup up? In that case you would need to start an xterm (or similar) and then run wall, right?

How about look into xmessage ('man xmessage') which will actually popup a window with a message/program output/etc in it.

Crashed_Again 04-05-2003 02:15 AM

Quote:

Originally posted by cuckoopint
How about look into xmessage ('man xmessage') which will actually popup a window with a message/program output/etc in it.
Oh! I was satisfied with 'wall' but xmessage has a bit more options. Thanks cuckoopint! Its always great to learn new commands.

Tinkster 04-06-2003 12:55 AM

The problem (actually it's a feature, I'd consider
the other behaviour a security hole) that I
(Slackware?) have with xmessage is that it
doesn't work if the user didn't explicitly enable
xdisplays from other than his own actual display
(eg xhost +localhost, xhost + ).

But since both RH and MDK have that little
demon listening for wall per user by default
I thought it'd be a good idea ;)

Cheers,
Tink

J_Szucs 04-06-2003 04:40 PM

I got interested and tried wall and xmessage:
For me:
- wall only worked once, and the subsequent messages were ignored.
- xmessage, when invoked from the konsole, died with an error: 'Error, can not open display'.
I have, however, other ideas for you:
If you have a proxy server and it happens to be squid, then, when you are logged-in as root, you can re-configure squid to catch her requests for her favourite pages and show her your 'customised' error messages, instead.
I think you could even redirect her to some other pages - but I am not sure, as I never tried this.
However, she can anytime avoid these tricks by re-configuring the browser to not to use the proxy...

Tinkster 04-06-2003 07:22 PM

/me pokes crashed_again in the ribs with a pointy stick ... "How about you mate?" ;}

Cheers,
Tink

Crashed_Again 04-06-2003 07:26 PM

How about me what buddy?

linuxlastslonge 04-06-2003 07:41 PM

lol ..... kill her login process or kill her browser's process.

that's always fun.

you can also issue beep commands. if speakers are on and soundcard is working, you can run mpg123 to play an mp3. you can run different programs and make them display on her Xterm.

that sounds like fun. i think i'll have to do that to my folks next time i catch them using my system.... lol. :-D

great times!

Crashed_Again 04-06-2003 07:49 PM

That was the first thing I did was kill her browser. She is online chatting with dudes and it really pisses me off.

I like your mp3 idea. I may have to record myself saying something like "I am root. Step away from the computer now!" and play it when she is on.

Tinkster 04-06-2003 11:34 PM

Quote:

Originally posted by Crashed_Again
How about me what buddy?
I was wondering what wall/xmessage are
actually doing on your machine :}

/me is always curious

Cheers,
Tink

P.S.: Thx for the affero-feedback, btw! :}

J_Szucs 04-07-2003 05:08 AM

Quote:

lol ..... kill her login process or kill her browser's process.
Well, that is actually funny, and also OK if you do not have time to figure out something more sophisticated, or you want to teach her how cruel life can be...

However, I would still prefer to replace some neat pictures on her favourite page with less neat ones.
Until she suspects there must be something wrong with that page...


All times are GMT -5. The time now is 09:54 PM.