Send Command to Linux via Windows Mobile? - General Topics

Hi, Anybody knows any software compatible with WM to remotely send command to Linux system?
Under Windows we have plink which is pretty good to send any command to linux.
Basically I need to have a simple user interface (just a few buttons), I load this interface, it will auto log into the linux server. Once I click one of the button, it will send a few command lines to Linux.
I tried with Visual Studio 2008 without success as Sendkeys is not available for WM platform.
Anybody has any idea?
thanks a lot in advance
johnny

Personally the few times i need to connect to a Linux box from my PPC i use Pocket Putty. OK it's command line only but it's good enough for my needs.

vnc would also work well of cause one would take over the linux but that would mean one could send commands by typing them into a console or clicking on the button which perfomred that command

thanks a lot Rudegar and Deedee,
I have tried pocket putty using VB 2008, however I couldn't access to the linux server with below commands:
Private Sub btn_sd1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_sd1.Click
Dim m_Process As New ProcessStartInfo()
m_Process.FileName = "putty.exe"
m_Process.UseShellExecute = False
m_Process.Arguments = "[email protected]_Server " & "/etc/asterisk/intercom/203.sh"
Process.Start(m_Process)
End Sub
"Linux_Server" is the saved putty session I saved with the pocket putty. /etc/asterisk/intercom/203.sh is the directory of the linux bash file I need to execute.
Basically I just need to login into the Linux Server and execute the bash file once the button is clicked.
Deedee you have any ideas?
thanks a lot.
johnny

Unfortunately none.
My VB is limited to not much more than text file processing, i used to parse a lot of various log files by hand and decided to learn VB6 so i could automate the process. the VB is slowly extending in function but tends to be snaffling someone elses code and hacking it to work the way i want it.
My Linux is equally restriced in scope, actually probably more so.
Wish i could have been more help.

yidiyuehan said:
thanks a lot Rudegar and Deedee,
I have tried pocket putty using VB 2008, however I couldn't access to the linux server with below commands:
Private Sub btn_sd1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_sd1.Click
Dim m_Process As New ProcessStartInfo()
m_Process.FileName = "putty.exe"
m_Process.UseShellExecute = False
m_Process.Arguments = "[email protected]_Server " & "/etc/asterisk/intercom/203.sh"
Process.Start(m_Process)
End Sub
"Linux_Server" is the saved putty session I saved with the pocket putty. /etc/asterisk/intercom/203.sh is the directory of the linux bash file I need to execute.
Basically I just need to login into the Linux Server and execute the bash file once the button is clicked.
Deedee you have any ideas?
thanks a lot.
johnny
Click to expand...
Click to collapse
This may be possible using MortScript. Why don't you post your request in the Development & Hacking forum as there is an active Mortscript thread there.
Here is its direct link
Cheers

I will learn what is MortScript if pocket putty isn't really workable.
If there is a pocket plink it will become much easier as I can do this using Plink with VB.net.

Related

Developing a Portal application in C#

I am wanting to develop a portal application in C# for Windows Mobile 6.0. I have installed the .net Compact Framework 3.5 on my device and have the necessary tools on the PC to develop for Windows Mobile. I am using Visual Studio 2005 to develop this application.
I am not a programmer, I have little experience with .net technologies but have for past assignments used VB.net to create small applications for assignments at uni.
I am now in my third and final year at uni and I decided to take on a project that is titled Human Computer Interaction of Mobile Devices. As part of my project I am required to produce an application, though designing various menu systems in itself will be quite a job, not to mention the documentation of it all.
The application I want to create now, is not necessarily part of my project, though it may influence me later on and should go some way to helping me. I have had the intentions of creating an application in Flash up to now.
Anyway, this application, its what I would call a portal. It has 4 tabs, Websites, Television, Radio and Programs. The Programs tab page has been designed much like the iPhone interface with either same or somewhat similar buttons. These buttons do not do anything at the moment.
I started the other week in designing an application in vb.net and run the debug exe as standalone on PC and linking to application that are on the PC will actually run when clicking on the picturebox as that is what I am using rather than buttons.
I put a Try Catch in and the error message comes up on the Mobile. If I take the Try Catch away then FileExceptionNotFound error message comes up and forces the program to close.
In C#, I have created much the same application, it does nothing whatsoever at the moment other than allowing me to flick from one tab to another. I am wanting to link pictureboxes in the programs tab to programs stored on the phone such as \Windows\Opera9.exe and \Windows\tmail.exe and so on.
I would like Radio Stations and Television channels to load up in a program specified in code if a default one does not start so I realise that I would need to call the link of the radio station (same with television channels) and then tell it to load up in specified program.
The other thing I am not sure about it how I would tell the phone to connect to the internet.
I didn't really want to be asking for help on here with this, as its probably not too difficult to create something like this, seeing as what some people (geniuses) on here have been able to develop. If nobody is able to help, then maybe pointing me in the right direction of some good reliable resources would be an idea. I have done much searching on Google etc for help with this and MSDN but my programming skills have never been up to much if I'm honest.
Any help would be much appreciated.
A few things then
For Visual Studio download and isntall the Windows Mobile SDK's (Version 6, standard and Pro).
Then when you create a new Mobile Device application you have everything you need. There should be a Toolbar in Visual Studio that allows you to select where your device will be run in Debug Mode (either the Emulator or on your device). This is the easiest way to debug your apps; also using MyMoblier will help.
Starting an App in C# is as easy as System.Diagnostics.Process.Start() method.
Connecting to the net is a little harder, I have written my own based on what I found using google. Basically it centers around 3 API calls:
Code:
[DllImport("CellCore.dll")]
static extern int ConnMgrEstablishConnectionSync(ConnMgrConnectionInfo connectionInfo, ref IntPtr connectionHandle, uint dwTimeout, ref ConnMgrStatus dwStatus);
[DllImport("CellCore.dll")]
static extern int ConnMgrMapURL(string url, ref Guid networkGuid, int passZero);
[DllImport("CellCore.dll")]
static extern int ConnMgrReleaseConnection(IntPtr connectionHandle, int cache);
Hope this helps
EDIT:
Also moved to Q&A to avoid upsetting them
Ta
Dave
Thanks for the advice. I have already downloaded Windows Mobile 6 SDK but I for some reason don't seem to be able to access the ROMS from WM6 inside of Visual Studio. I might be able work that issue out though. I will see how I get on with it and post back if I have any further problems.
Connecting to the internet.
I have found that the .net object WebRequest will open the connection if is not already open.
Stream ResponseStream = WebRequest.Create("yourURLgoesinhere").GetResponse().GetResponseStream() will return a stream to read to get the object.
If there is an active WiFi connection the phone will use it, or it will use an active GPRS connection, or fire up the default GPRS connection as a last resort.
The bottom line is - let the machine do all the hard work.

WM Programming-Pascal and C console programs

Hi everyone!
I'm studying Turbo Pascal and C programming languages at school,I write console programs from "add 2 numbers and print the result" to something more complex.
I was wondering...is there any way to get these simple console programs to work on my HTC Touch PRO 2 (WM 6.1)?
Hope you can help me...
Thanks!
I 2nd this, I'd like to know too.
Or otherwise I'm also interested in writing a basic app for WM just to try it.
Jason
easy to do with c using embedded visual c++ which you can google and it's free and c++ is always backward compatible with ansi c
doubt you will have much luck with pascal because the best bet would have been borlans options and they quit the whole market with their delphi pascal options
nailing the last nail in the coffin of pascal
For Pascal, use FreePascal/Lazarus combo. It's a ***** to set up, though.
Rudegar said:
easy to do with c using embedded visual c++ which you can google and it's free and c++ is always backward compatible with ansi c
doubt you will have much luck with pascal because the best bet would have been borlans options and they quit the whole market with their delphi pascal options
nailing the last nail in the coffin of pascal
Click to expand...
Click to collapse
Can I write console applications with it,or they have to have a GUI?
Chainfire said:
For Pascal, use FreePascal/Lazarus combo. It's a ***** to set up, though.
Click to expand...
Click to collapse
Yeah,i tried that,but i can't make it work...I followed the guide but i can't do anything that works on WM
"Can I write console applications with it,or they have to have a GUI?"
both a lot easier to make console apps though
Thank you,I'll give it a try
The problem you will encounter with console applications is the fact that there is no console as such.
printf() will not work as there is no output window on which to write anything. There is also no way of reading user input direct from the 'keyboard' or keypad.
When the exe is run it starts as a windowless application, the WinMain() function is called and when this ends it is terminated. You can open and close files, read and write to and from them, anything you like, as long as it requires no user input, and does not display anything. Pretty restrictive! The only thing the user will see is the hourglass/busy icon, until the app finishes.
Even C# console applications are subject to the same restrictions.
To do anything 'smart' it will have to be a PPC (GUI) application.
there are plenty of free console apps one can download for free
stephj said:
The problem you will encounter with console applications is the fact that there is no console as such.
printf() will not work as there is no output window on which to write anything. There is also no way of reading user input direct from the 'keyboard' or keypad.
When the exe is run it starts as a windowless application, the WinMain() function is called and when this ends it is terminated. You can open and close files, read and write to and from them, anything you like, as long as it requires no user input, and does not display anything. Pretty restrictive! The only thing the user will see is the hourglass/busy icon, until the app finishes.
Even C# console applications are subject to the same restrictions.
To do anything 'smart' it will have to be a PPC (GUI) application.
Click to expand...
Click to collapse
What if I use Pocket Console,or something like that? Would they run correctly?
Can't really say, as I haven't used them. The console stuff I have written, drags objects from over the net, then writes the data out in a format I can use to a file on the device. No user input required.
All I can suggest is to try the classic
printf("Hello World!\n")
and see what happens. Good Luck!
C programing
Hello,
yes, you can. Just use pocketdos. An emulator for DOS and you can use your simple compilers
Search for Pocketdos.com
xdawis said:
Hello,
yes, you can. Just use pocketdos. An emulator for DOS and you can use your simple compilers
Search for Pocketdos.com
Click to expand...
Click to collapse
Thank you! They work now! PocketDos is great!

SQL database editor?

Hey everyone,
So I was just thinking over what I would love to do with my Transformer/Dock combo and one thing came to mind.
I can connect to my office via VPN, access our company intranet and use various web based tools but there's one thing I'm missing: SQL access.
I use GUI tool that lets me have several DB connections open and run SQL in a window along with seeing the results of the query. I can drop or truncate tables, etc also.
So my question is: Does anything like that exist for Android and more specifically, Honeycomb so there's a bigger screen?
Thanks,
-Bob
How about phpMyAdmin or similar installed on one of the SQL servers. Or using remote desktop/VNC to remote control a PC with the MS SQL tools on it.

[Q] SL4A: Accessing Linux Shell from javascript

Hi everybody!
I recently bumped into SL4A.
For automating some things (wake up and send to sleep my NAS, mount it as local drive) from my android tv box its perfect.
The things i want to automate can be done via Linux shell commands and i would like to implement these functions with a nice GUI in HTML and Javascript.
In Python you do it with os.system i believe, but the problem is, that i am a very experienced VB.net, HML and Javascript programmer, but have no clue about Python.
So is there a way to acces the Linux shell directly from javascript or do i have to write a kind of python interface to connect from javascript to the shell?
Greetz
Olli

[kinda resolved]SSH Client with support for password protected ppk

Hey,
I'm searching for an SSH client that supports the use of password protected private keys (.ppk file). I'm not really a fan of having them inside the app or even on my phone in plain text. Can you guys recommend one? Termius seems to need them as plain text for example.
I found some solution. Not the most ideal but at least it's doing what I want: a combination of Termiux and a rudimentary Linux distribution installed with AnLinux.
So you basically just install Debian or whatever you prefer on your phone, add all necessary packages and you are good to go.
You have to give it access to storage and it seems it needs to be started with su rights through the Termiux package tsu, but then you can import a ppk key via the putty-tools package like on a standard Linux distribution and the private key can be converted to a password protected OpenSSH key.
Not the most intuitive way but it's working.

Categories

Resources