Using Google Cloud Endpoints API over local HTTP - google-chrome

I am using OSX. I have set up my endpoints in my development server. When I visit localhost:8080/_ah/api/explorer, I receive this error message:
The API you are exploring is hosted over HTTP, which can cause
problems. Learn how to use Explorer with a local HTTP API.
The link instructs me to start a Chrome session with special flags as follows:
[path-to-Chrome] --user-data-dir=test --unsafely-treat-insecure-origin-as-secure=http://localhost:port
I am confused about where to input this line? I assumed that it should be entered into the CLI, so I tried it on the terminal:
$ /Applications/GoogleChrome.app --user-data-dir=test --unsafely-treat-insecure-origin-as-secure=http://localhost:8080
Of course, the response is this:
$ -bash: GoogleChrome.app: command not found
After some research, I found that I can launch a Chrome session using the $ google-chrome command, but this also failed with -bash: google-chrome: command not found.
I also tried to locate Chrome using $ whereis google-chrome, but this returns no response.

Try this: open /Applications/Google\ Chrome.app --args --user-data-dir=test --unsafely-treat-insecure-origin-as-secure=http://localhost:8080

Related

Trying to connect google drive to paperspace gradient notebook

I'm trying to mount google drive to paperspace notebook using google-drive-ocamlfuse with the following code
sudo add-apt-repository ppa:alessandro-strada/ppa
sudo apt update && sudo apt install google-drive-ocamlfuse
but when launching with
google-drive-ocamlfuse
there's an error:
/bin/sh: 1: firefox: not found
/bin/sh: 1: google-chrome: not found
/bin/sh: 1: chromium-browser: not found
/bin/sh: 1: open: not found
Cannot retrieve auth tokens.
Failure("Error opening URL:https://accounts.google.com/o/oauth2/auth?client_id=..........
ocamlfuse's github page has instructions on "Headless Usage & Authorization" but it's for local machine not for something like paperspace.
is there any way i can use google-drive-ocamlfuse to mount the drive?
is there any other better/simpler method to mount google drive on paperspace gradient?
Short answer:
There is no way to mount Google Drive as filesystem on paperspace gradient.
Long answer:
Your error message says cannot open browser. You are correct, should use headless mode [https://github.com/astrada/google-drive-ocamlfuse/wiki/Headless-Usage-&-Authorization]. Basically create an OAuth App, note down the client-id and client-secret, then authenticate using google-drive-ocamlfuse -headless -id client-id -secret client-secret.
But even if the authentication step success, you will still encounter error like fuse: device not found, try 'modprobe fuse' first. It is because Paperspace gradient notebook is running as container. A container cannot perform fuse operation unless it has SYS_ADMIN capability. (See FUSE inside Docker). In this case, we have no control on how paperspace running their container. So we are unable to mount filesystem on paperspace gradient.
However, you can use something like https://github.com/iterative/PyDrive2 to access Google Drive file.

google cloud console - phpmyadmin 404 not found

Trying to create a new instance for running a php web app. But never installed a new server before. So I have followed all the instructions from the link below but when I go to http://[my ip addess]/phpmyadmin
I get a 404 error.
https://cloud.google.com/community/tutorials/setting-up-lamp?_ga=2.212307860.-1468980495.1579877933
As per the Ubuntu Help Community, if you're getting a 404 error upon visiting http://localhost/phpmyadmin, you will need to configure apache2.conf to work with Phpmyadmin.
Try the following command:
$ gksudo gedit /etc/apache2/apache2.conf
Include the following line at the bottom of the file, save and quit.
$ Include /etc/phpmyadmin/apache.conf
Greetings!

enabled/disabled google chrome extension with command line

There is a way to enable/disable google chrome extension with a command line ?
I would like enabled un extension already installed by terminal.
Launch Chrome with extension parameter may help you.
Example:
launch chrome with cmd
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -no-first-run --load-extension="extension path"
Here's an architecture example for what wOxxOm proposed in comments:
An extension can enable/disable other extensions with chrome.management API and "management" permission.
An extension can spawn a companion daemon process that communicates with the rest of OS using Native Messaging's chrome.runtime.connectNative().
Said daemon can create a named pipe that you can write to from the command line, and pass whatever commands are sent to the pipe to the extension using the Native Messaging protocol.
Note that Chrome cannot be contacted from "outside" directly: it must spawn a process on its own, and then you can communicate with the process.
Alternatively (if you don't want to use the Native Messaging protocol, or want the daemon to exist independent of Chrome), your daemon can open a local WebSockets server and your extension can communicate through that. However, it would be possible to impersonate your extension in that case.

How to load-and-launch a Google Chrome App from the command line?

At this link, it says:
These command line options to Chrome may help you iterate:
--load-and-launch-app=/path/to/app/ installs the unpacked application from the given path, and launches it.
What is the entire command line statement?
For example, is it:
$ chrome --load-and-launch-app=/path/to/app/
or maybe:
$ cca --load-and-launch-app=/path/to/app/
What, specifically, is the entire command?
The basic command you have correct
/Path/to/Chrome --load-and-launch-app=/Path/to/App
Assuming you are using Mac, OSX(from your comments) and you installed Google Chrome the normal way, (into your Applications directory), your /Path/to/Chrome will be
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
But to make sure you can your Google Chrome Application directly into your terminal (assuming standard MacOSX terminal or iTerm)
For the /Path/To/App part of the command, use the directory which contains the manifest.json file.
For instance, if your path to the manifest.json file is
/Users/[Your Username]/Downloads/basic/manifest.json
which you can get from going to this link
Your command to load and launch the "Basic" google chrome app is
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --load-and-launch-app=/Users/[Your Username]/Downloads/basic
One additional detail that may be helpful: the path to your app must be an absolute path, beginning at the root directory (/).
You have to do --load-and-launch-app=/Users/YourUsername/Documents/my_chrome_app
Alternately, if you don't want to type the whole path, you could use $PWD, which evaluates to your current directory (must execute the command from the same directory as your manifest.json):
--load-and-launch-app=$PWD
You cannot do --load-and-launch-app=.
You cannot do --load-and-launch-app=~/Documents/my_chrome_app

How to load cesium globe in firefox

I just started testing Cesium after I read all the documentation for getting started with it, but I have a problem:
I downloaded the files (Cesium 1.6 zip)
But when I am open file HelloWorld.html in Firefox (but also in Chrome) it appears an error:
An error occurred while rendering. Rendering has stopped.
SecurityError: The operation is insecure.
p#file:///E:/3D/Cesium-1.11/Build/Cesium/Cesium.js:433:19771
et.prototype.createTexture2D#file:///E:/3D/Cesium-1.11/Build/Cesium/Cesium.js:449:19216
H.prototype.update#file:///E:/3D/Cesium-1.11/Build/Cesium/Cesium.js:434:9598
S.prototype.update#file:///E:/3D/Cesium-1.11/Build/Cesium/Cesium.js:452:1283
m.prototype.update#file:///E:/3D/Cesium-1.11/Build/Cesium/Cesium.js:455:27826
vt#file:///E:/3D/Cesium-1.11/Build/Cesium/Cesium.js:458:15315
Ct#file:///E:/3D/Cesium-1.11/Build/Cesium/Cesium.js:458:18817
bt.prototype.render#file:///E:/3D/Cesium-1.11/Build/Cesium/Cesium.js:458:25057
P.prototype.render#file:///E:/3D/Cesium-1.11/Build/Cesium/Cesium.js:464:4096
t#file:///E:/3D/Cesium-1.11/Build/Cesium/Cesium.js:463:23110
Please solve this problem.
Try to launch it from a local server. Many browsers have different security policies if they load files from file:// or http://
An easy way to launch a local server is use python (on linux or cygwin):
$ cd /path/to/HelloWorld.html
$ python -m SimpleHTTPServer