How to add Terminal Object in your Website? - shell

Website like koding , codeschool ,cloud9 and many others have the ability to access their server via terminal.
Is it really terminal application in sandbox?
How did they do that?

Read this
The terminal access can be provided by having a client server mechanism.
Here a server is running at the linux machine and client is browser.
server executes command on behalf of client.
Take a look at ajaxterm

Related

Sent Email process not working

I have a question about my application built in Oracle APEX 4.2. This application has a process to send emails (when a user changes his password or requests a password reset).
When I run this application online on my "apex.oracle.com" account, it runs fine. But when I run it on my home computer (running Windows 7), the email process doesn't work. Probably it is because my home server is not an email server.
Can someone please help me so that my home computer is able to send emails via my above mentioned application?
Thanks in advance.
you have several options:
Configure a local SMTP server so it can be use by APEX and send emails.
Connect to a remote server - like Google - and sends emails that way (you have to open a new account and connect with that and also there's some certificate problems, https://arkatec.wordpress.com/2011/08/15/sending-email-using-oracle-database-and-google-mail-service/)
Use htmldb_mail package (I haven't tried this one)
In the first options you need to construct a procedure that does all the work for you.
You can use one of this:
http://www.orafaq.com/wiki/Send_mail_from_PL/SQL
Important: keep in my that you're going to encounter permission issues with the UTL packages (grant execute on UTL_XXX to USER) and algo, if you're are working on 11g you need to create an ACL

Does anyone know how to issue a SUBMIT command to OpenVMS over an FTP session?

I am currently using windows telnet to submit files to the OpenVMS queue via a series of sendkeys/application waits through VBA. It works, up until the end-user shifts focus away from the telnet window. I would prefer to issue the SUBMITs using an FTP session, where I can script the commands into a batch file and shoot it across FTP. I was able to do something similar with IBM mainframes - through the quote site FTP command - setting the filetype=jes, followed by a JCL file that would be dropped into the work queue for immediate execution. I can't seem to find anything on the internet related to FTP, openVMS, and submit. I have tried using Quote submit/que=... but it does not recognize the command. (Submit works fine under telnet).
Maybe you can use Remote Shell Protocol (RSH) to execute a command in a remote node
You would need a rsh client on windows:
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/rsh.mspx?mfr=true
And also enable RSH service on VMS via TCPIP$CONFIG
(See OpenVMS documentation http://h71000.www7.hp.com/doc/index.html)
This works best with a VMS username dedicated to processing inbound FTP files. If you put in the LOGIN.COM for that username to detect it's a network connection and submit a batch job to look for the expected file, get exclusive access to it with retries (the FTP is done), and then process the file - That has worked for me.
The other option is to put a security ACL on the directory and make an audit listener - it will get file creates via a mailbox message. Then it can do similar: get exclusive access to the file being created and then process it.

Running .exe on a XAMPP Server

I am wondering if it is possible to run a program on a xampp server? I am making a game and need to run the controller program on the server to receive info from the client programs. Is this possible? I do know that you can start a program on a server remotely, but it opens the program on the server pc, not what I am wanting.
Also, I would like to know if it is possible to click and link on a index.php page and that opens the client.exe on your pc. So far, it only launches it on the server pc. I am using the echo exec('') command to launch the program.
Thanks,
DogLover
On server side you can try either PHP/CGI and stores the data in a file or a MySQL database.
On client side you can try either JAVA/Flash or you can force the download of file on user computer using content disposition in header.

windows cmd connection to remote mysql dbf

is there a way of how to connect to mysql dbf on a remote server and run sql queries using windows command line?
Yes, you can connect to a different host by running mysql -h 123.45.67.89.
Please note that there are a few security implications:
You will have to grant yourself access. You will need to run something like GRANT ALL on db_name.table TO user#your_ip IDENTIFIED BY 'password'. db_name, table and your_ip can be * but beware of opening your server to hackers.
You will have to open your server's firewall if you are not on the same LAN. Again, ymmv and you should be aware not to open the door to exploits.
You may want to use SSL and use secure-auth in order to protect your traffic and credentials.
Hope that helps.
MySQL has a command-line client, where you can run queries. If you don't want to allow remote connections to the database on the server, you can still script things into a batch. There are command-line telnet/ssh clients, that either accept external file as a list of commands to run remotely, or you can pass it with the input stream redirection (less then symbol) to them.
When opening a connection to server - most clients are programmed so that the only way to specify the login password is by typing it in from keyboard (yeah, they don't use default input stream). Things like that make it hard to script it. However, it may be possible to set up a certificate based login on SSH - you'd actually have to research that.
If the server that's hosting the MySQL database is also a web server - you could also think about putting some script (PHP, Perl, Python, Ruby - whatever you like) on the password protected area, that would allow you to execute queries by simply making a HTTP(S) queries on that script. Although, Windows doesn't have a command-line HTTP(S) client, you can always get something like wget.exe and perform queries with it. Note, that if you choose this approach - I strongly advice to put that script under HTTPS - if discovered by malicious user, it could be lethal to your data.
You could use telnet, or SSH if you want to be more secure.
If the MySQL is running on Linux or BSD, you need a Telnet or SSH connection through something like putty
This will open a command line on the remote server. The command is mysql. There will be issues around authentication of remote users (as you would expect).
If the remote server is running Windows, you have a whole different set of issues.
I'm not sure you can connect to a remote Windows server and control it this way.
I should say I'm not sure HOW you could connect to a remote Windows server and use it this way. But no doubt it's possible.

Restarting windows service from website

I've a website that puts info into a mySQL database and a windows service (written in VB.Net) that polls the db and actions what's in there.
However, occasionally it stalls and rather than having to RDP into the server, I want superusers to click on a button to restart the service.
I can get the button to say, do a directory listing of c:\ output to a test file so the whole 'getting a command to execute on a remote server' issue works. However, I can't restart services.
I assume this is a security thing (although it has full rights to c:\ I thought I'd sussed that already).
The website runs under the normal IUSR_user so am I doing something really stupid or can someone explain how to get the service to be restarted ?
Many thanks
Adrian
I think a significantly bigger problem is that you have a service that's stalling. Do you have any logs or errors that the service outputs to that you could use to diagnose why it's stalling?
I'd write a service that restarts selected services and call that from my website, just for fun!
It seems that you need to give the user permissions on the specific service. The simplest way to do this (in my view) is to use subinacl.exe from the Windows Resource Kit.
subinacl.exe /service MySQL /Grant=IUSR_user
I'm would be very careful when doing this on a public-facing web server. Have both authentication and rate limiting on the restarting code.
Use the ServiceController class:
http://msdn.microsoft.com/en-us/library/system.serviceprocess.servicecontroller.aspx
This should allow you to connect to the named service and stop/start it.
EDIT:
In addition, you probably need to have your web app impersonate a user with rights to restart the service. This can be accomplished via an identity impersonate in the web.config, or running the web app in a configured application pool in IIS. Keep in mind that the web app will have to run on the same box as the service is running on.

Resources