[gameprogrammer] Re: Not game dev related but need some urgent help

  • From: Alan Wolfe <alan.wolfe@xxxxxxxxx>
  • To: gameprogrammer@xxxxxxxxxxxxx
  • Date: Thu, 6 May 2010 19:49:59 -0700

you can run a process (an exe along with command line arguments) invisibly

You can use that to run putty and make it do the command(s) you want.

You can also make putty spit out the results of it's operations into a file
which your application can then read in and you could display that to the
user (one of your initial requirements!)

So yeah, we are getting you, and what you want to do is totally possible.

2010/5/6 ®£$ǖ"v@M$Ħ ¢© $. <theamericansushi@xxxxxxxxx>

> I don't think you guys are getting me. Lemme break it down a bit:
>
> On my application (on VB) i'm gong to have a few buttons. One of them to
> establish connection and run a file. When this button is pressed it gets
> into the code. It should automatically connect to the linux box, auto login,
> and automatically execute that file. While all this is happening the user
> should not see the linux box or the putty command line. It should all happen
> in the background.
>
>
> On Fri, May 7, 2010 at 7:33 AM, Jake Briggs <jakbri@xxxxxxxxxxxxxx> wrote:
>
>> The same way you were going to access putty or plink I guess. A google
>> gives me many results, but I cannot evaluate them since I am not a 
>> vb.netexpert :
>>
>> http://www.devx.com/dotnet/Article/7914
>> http://www.thescarms.com/dotnet/Process.aspx
>> http://www.msfn.org/board/topic/8712-vbnet-how-to-execute-a-program-from/
>>
>> There is probably even a way to have stdout redirected back into 
>> vb.netinstead or doing a "command > out"
>>
>> Or you can use a library directly like in this article :
>>
>> http://www.codeproject.com/KB/IP/sharpssh.aspx
>>
>> which looks quite good.
>>
>> Jake
>>
>>
>> On 07/05/10 13:50, ®£$ǖ"v@M$Ħ ¢© $. wrote:
>>
>>> But how would i access it directly from my VB code? What you've given is
>>> the commands for the command line.
>>> Yea, i've tried putty but then that open the linux box and shows that to
>>> the user, which is not the requirement for the project unfortunately.
>>> Maybe if there was a way i could hard code the IP address and the
>>> username and password into PuTTy so would auto connect and login on
>>> launch?
>>>
>>> On Fri, May 7, 2010 at 4:18 AM, Jake Briggs <jakbri@xxxxxxxxxxxxxx
>>> <mailto:jakbri@xxxxxxxxxxxxxx>> wrote:
>>>
>>>    Instead of a username and password, you should use keys for
>>>    passwordless logins. You could use
>>>    http://sshwindows.sourceforge.net/ and do something like :
>>>
>>>    ssh user@hostname "scriptName.sh -a argument -b argument2" >
>>> output.txt
>>>
>>>    The  2nd argument to ssh is the command to run on the machine, and
>>>    the ">" redirects the output to the file output.txt.
>>>
>>>    Here is how to generate keys :
>>>    http://nosheep.net/story/password-less-ssh-login/
>>>
>>>    Here is an example. My work machine is called osama, my home
>>>    machine's URL is obscured (its name is beastie), but there are keys
>>>    on each :
>>>
>>>    jakbri@osama:/data1/48hrs$ ssh jake@xxxxxxxxxxxxxx
>>>    <mailto:jake@xxxxxxxxxxxxxx> "ls"
>>>
>>>    beastie-bttv.txt
>>>    debian-multimedia-keyring_2008.10.16_all.deb
>>>    Desktop
>>>    linux-wbfs-manager
>>>    Mail
>>>    Music
>>>    osama-bttv.txt
>>>    Pictures
>>>    play.sql
>>>    plucker
>>>    Projects
>>>    sdl
>>>    sync-from-ipod.sh
>>>    sync-ipod.sh
>>>    temp
>>>    Videos
>>>    jakbri@osama:/data1/48hrs$
>>>
>>>    This example ssh's to the machine at urlto.jake.com
>>>    <http://urlto.jake.com>, using the username jake, no password since
>>>
>>>    the keys take care of that. It runs the command "ls" which lists the
>>>    contents of a directory and the results go to the terminal on osama
>>>    where I ran the command.
>>>
>>>    Another example, the command ls -ls *.txt lists the contents of the
>>>    directory with filenames that end in .txt and the -l means in a list
>>>    and the h in -lh means human readable file sizes :
>>>
>>>    jakbri@osama:/data1/48hrs$ ssh jake@xxxxxxxxxxxxxx
>>>    <mailto:jake@xxxxxxxxxxxxxx> "ls -lh *.txt"
>>>
>>>    -rw-r--r-- 1 jake jake  814 2009-07-26 13:15 beastie-bttv.txt
>>>    -rw-r--r-- 1 jake jake 1.1K 2009-07-26 13:07 osama-bttv.txt
>>>    jakbri@osama:/data1/48hrs$
>>>
>>>    and another, where I redirect the stdout to a file, then show the
>>>    file  :
>>>
>>>    jakbri@osama:/data1/48hrs$ ssh jake@xxxxxxxxxxxxxx
>>>    <mailto:jake@xxxxxxxxxxxxxx> "ls -lh *.txt" > list.txt
>>>
>>>    jakbri@osama:/data1/48hrs$ cat list.txt
>>>    -rw-r--r-- 1 jake jake  814 2009-07-26 13:15 beastie-bttv.txt
>>>    -rw-r--r-- 1 jake jake 1.1K 2009-07-26 13:07 osama-bttv.txt
>>>    jakbri@osama:/data1/48hrs$
>>>
>>>    I think you could do something similar with plink - the putty
>>>    command line.
>>>
>>>    Jake
>>>
>>>
>>>
>>>
>>>    On 07/05/10 04:54, ®£$ǖ"v@M$Ħ ¢© $. wrote:
>>>
>>>        Glad to hear it's on topic  :).
>>>
>>>        I need to connect to the linux box to execute a program from a
>>>        specific
>>>        directory, with a known username and password. Also, i need to
>>>        gather
>>>        data from the application and display it back in my original
>>>        program(located on my windows machine)
>>>
>>>        Thanks for your time :)
>>>
>>>        On Thu, May 6, 2010 at 10:16 PM, Alan Wolfe
>>>        <alan.wolfe@xxxxxxxxx <mailto:alan.wolfe@xxxxxxxxx>
>>>        <mailto:alan.wolfe@xxxxxxxxx <mailto:alan.wolfe@xxxxxxxxx>>>
>>> wrote:
>>>
>>>            This is somewhat on topic since networked games sometimes
>>>        run linux
>>>            servers and we all dev on windows (pretty much).
>>>
>>>            What do you need to connect for?  IE what task are you trying
>>> to
>>>            preform?
>>>
>>>            Depending on the answer to that question, I have a couple
>>>        different
>>>            ways you could achieve your goal (:
>>>
>>>            2010/5/6 ®£$ǖ"v@M$Ħ ¢© $. <theamericansushi@xxxxxxxxx
>>>        <mailto:theamericansushi@xxxxxxxxx>
>>>        <mailto:theamericansushi@xxxxxxxxx
>>>
>>>        <mailto:theamericansushi@xxxxxxxxx>>>
>>>
>>>
>>>                Sorry guys this isn't game development but i've already
>>>                exhausted all my resources (google :P ).
>>>                Okay, so here's a overview. I need remotely connect to a
>>>        linux
>>>                based machine from my windows machine via vb.net
>>>        <http://vb.net> <http://vb.net>
>>>
>>>
>>>                I've already tried PuTTy but that requires me to enter the
>>>                username and password after establishing the connection.
>>>        Maybe
>>>                if there's a way i can hardcode the username and password
>>> so
>>>                that it auto logins on opening?
>>>                I really need help doing this so any form of help is
>>> really
>>>                appreciated.
>>>                BTW pls don't get angry im on the wrong list, you guys
>>>        were the
>>>                best help i got before for something else so i thought
>>>        i'd give
>>>                this a shot
>>>
>>>                Thanks,
>>>                Suvamsh
>>>
>>>
>>>
>>>
>>>    --
>>>
>>>    Jacob Briggs
>>>    Systems Engineer
>>>
>>>    Core Technology Limited
>>>    Level 1, NZX Centre
>>>    11 Cable Street
>>>    Wellington
>>>    Phone +64 4 801 2250
>>>
>>>    --
>>>
>>>    Private Object doAnythingConceivable(String whatToDo, Object
>>>    whatToDoItWith) { .....
>>>
>>>
>>>    ---------------------
>>>    To unsubscribe go to http://gameprogrammer.com/mailinglist.html
>>>
>>>
>>>
>>>
>> --
>>
>> Jacob Briggs
>> Systems Engineer
>>
>> Core Technology Limited
>> Level 1, NZX Centre
>> 11 Cable Street
>> Wellington
>> Phone +64 4 801 2250
>>
>> --
>>
>> Private Object doAnythingConceivable(String whatToDo, Object
>> whatToDoItWith) { .....
>>
>>
>> ---------------------
>> To unsubscribe go to http://gameprogrammer.com/mailinglist.html
>>
>>
>>
>

Other related posts: