Just think how awesome it'd be if you come to your home and see your laptop or any other resource up and working the way you want it to be.
Well that'd be pretty sweet if I get home and see my Spotify playlist playing on my speaker, my laptop up and working and loaded with the ongoing projects with all its virtual environments already loaded.
....all at the end of running a single script.
So get this, I live in a hostel right with a public shared wifi which clearly does not allow me fiddling around with its router settings. Of course, why would they :/
My only solution to get my little thing done is to expose my local web server to the internet.
One word answer: ngrok :)
Connect bot for android : download here
openssh for your laptop :
sudo apt-get install openssh-server
Firewall people please remember that since we're going to be using port 22 for our little automation. We're gonna need to keep port 22 open. Please use
ufw or uncomplicated firewall to open the port with
sudo ufw allow 22
Now hop on the train once again when you're done,
Follow along and setup your ubuntu or whatever os you are using. I am personally writing this article on zorin os which again is an ubuntu derivative.
- Install ngrok from here
- Follow along every step till authenticating your token.
- FIRE IT UP!! with,
$ ./ngrok tcp 22 # now look for the line Forwarding tcp://0.tcp.ngrok.io:XXXXX -> localhost:22 # the only thing useful to you is 0.tcp.ngrok.io:XXXXX # where XXXXX is your port number
alias ng="./ngrok tcp 22"
Now open connect bot and make a host
email@example.com:XXXXXin the very first line.
you can keep post login automation commands but I would not recommend those for then just again a personal preference of mine of if I ever need to do something before running the automated command.
you should get connected now.
Yes, sadly. So does the have to be your laptop and the ssh service.
No, you may not. Since that would stop the ssh service and of course other services. You may make it go to sleep put it charge and hit your way to life.
Yes. Just change port number on the connect bot.