and you want a simple information from it, you just want to execute one line of code in command line and get the return? Well if you have, you know that in order to do so there should be a port forwarding enabled in your router, an ssh server running in your Linux computer and an ssh client (ex. putty.exe) installed in the computer you are temporarly at. With "Gmail Commander" you don't have to go through all that trouble, you simple send a mail in your gmail acount with the code you want to be executed and in a few moments you get another mail with the return of that command. How cool is that.
"Gmail commander" is a simple bash shell script that can run in every machine that has Linux and a network connection. Unfortunately in order for the script to run correctly you should set up your computer to be able to send mails from the command line, but don't worry i'll post another script that does exactly this.
"Gmail commander" monitors your mail inbox using this web page "https://mail.google.com/mail/feed/atom"
(This is a web page that shows only your unread mails. It shows only the subject, author and time of a mail)
When "Gmail commander" spots that there is mail in which the subject begins with "remote_command", then checks if the author of that mail is your self (this is done for security reasons), after all that, executes the command that is in the subject and mails back the reurn.
The mails subject should be in the form "remote_command:actual command" (without the quotes)
For example if you want to view the files in your Desktop you simply send a mail with a subject :
remote_command:ls /home/user/Desktop/
You can download the install_ssmtp.sh and gmail_commander.sh from here
untar in a folder and execute install_ssmtp.sh, then execute gmail_commander.sh
Enjoy and allways remember "Coding can be fun when you do it your own"
Δεν υπάρχουν σχόλια:
Δημοσίευση σχολίου