5

I've got an AWS instance running Jupyter that I use for general mucking around, and tend to shut it down when not in use. Shutting it down changes the IP and the DNS name. On the Mac, I have a simple script that uses the AWS CLI to grab the current IP of the instance and use that to open the Jupyter notebook in Chrome.

I'm trying to replicate the same functionality on a ChromeBook. I've been able to get the shell running, get the AWS CLI running, but can't figure out how to do the last bit, which is to open the URL in Chrome. (In other words, do the equivalent of the OSX Bash command open -a "/Applications/Google Chrome.app" http://1.2.3.4:8888 on the ChromeBook shell.

So basically I want to know how to open an arbitrary URL in Chrome from the ChromeBook shell.

Gort the Robot
  • 2,222
  • 14
  • 21
  • Ah, sorry, that was an unfortunate typo. I'm running a shell on the Chromebook itself, in developer mode. (Ctrl-Alt-T to get crosh and then `shell`) – Gort the Robot Jul 11 '17 at 20:46
  • 1
    There are several free dynamic dns providers such as [noip.com](https://www.noip.com/free), where you have your server run a single line curl command on startup, and it updates a DNS record. This way, you can have something like `stevenburnap.noip.com` always point to your host, no matter how often it changes IP. – that other guy Jul 12 '17 at 16:55
  • Yeah, I was trying to avoid that, but I guess I may have to. (Partly because the server will typically be started right when I want to use it, and I was worried about DNS propagation delays.) – Gort the Robot Jul 12 '17 at 20:36
  • The TTL is typically set to 60 seconds or so, so it shouldn't be *too* bad, especially with Chrome's auto-retry. – that other guy Jul 12 '17 at 21:15
  • 1
    What do you get when you run ```which google-chrome``` in the terminal? Any results from ```ls /usr/bin/ | grep 'google'```? You mentioned /opt/google/chrome/chrome core-dumped. That may be the wrong executable. – DavidBittner Jul 17 '17 at 02:29
  • `google-chrome` gives "Command not found". Nothing in `/usr/bin/` that looks remotely like Chrome. I am sure you are right, but I can't find the correct executable. `/opt/google/chrome/chrome` is what appears in the process list. I assume there's a launcher somewhere... – Gort the Robot Jul 22 '17 at 07:08

1 Answers1

4

My Chromium OS machine has xdg-open. If your version has that, it'll be the easiest thing.

xdg-open http://1.2.3.4:8888

If not, you can always just call the full path of Chrome with the url as a parameter, (e.g. chrome http://...) or consider the many options provided here.

James K.
  • 366
  • 1
  • 15