Google Material Design Components on Ubuntu Server on Google Cloud - google-cloud-platform

I cannot get Material Design Components to run on my virtual server. I have tried following their "quick start" page and their Material basics (Web 101) course to no avail. I am able to execute most of the steps in either tutorial, but I cannot see the JavaScript apply to the page. What am I doing wrong? I will detail my process below so that someone can hopefully spot my mistake.
First I create a VM instance on the Google Cloud Platform. It is a Ubuntu 18.04 LTS image with 1 CPU, 3.75 GB memory, and HTTP/HTTPS traffic allowed on the firewall.
Then I install Node.js and NPM on the machine.
sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm
Then I clone the codelab from GitHub. (following Web 101 in this example)
git clone https://github.com/material-components/material-components-web-codelabs
...and navigate to the pertinent directory.
cd material-components-web-codelabs/mdc-101/starter
In that directory, I install NPM.
npm install
The install works just fine, save for one optional dependency called "/chokidar/fsevents" which is apparently for Mac OS X anyways.
From the same directory, I start NPM.
npm start
At this point, the tutorial says I should be able to reach the site. It says to navigate to http://localhost:8080/. Since I am installing this on a remote, cloud server, I replace "localhost" with the server's external IP. I invariably get a timeout error from the browser.

Ensure that the port 8080 is open and listening inside the VM instance by running telnet, nmap, or netstat commands.
$ telnet localhost 8080
$ nmap <external-ip-vm-instance>
$ netstat -plant
If it is not listening, then this means that the application was not installed correctly.
Look at the Firewall Rule in the GCP to make sure that the VM instance allows ingress traffic to the port 8080.
Since you are running Ubuntu, make sure that the default Ubuntu firewall did not block the port 8080. If so, you have to allow access to the port 8080 by running the following command:
$ sudo ufw allow 8080/tcp

Related

Code server on AWS EC2 return error and doesn't start

I follow the guide to install code-server on EC2, but it doesn't works.
When I access to my instance from browser, I have this error:
Error connecting to your code-server instance
Ensure code-server is running and was properly started with the --link command line flag.
I've tried to install code-server on EC2 manually, but it doesn't start.
At the end I've found code-server on aws marketplace (aws.amazon.com/marketplace/pp/prodview-bw5rwv7u435ey)
and follow the instruction, but at the command:
systemctl status code-server
I've got:
code-server.service
Loaded: bad-setting (Reason: Unit code-server.service has a bad unit file setting.)
Active: inactive (dead)
How can I run code-server on AWS EC2?
Thank you
Install code-server only by install script.
curl -fsSL https://code-server.dev/install.sh | sh
Install Caddy.
It works
Don't follow the guide on gitHub, don't run launch-code-server.sh
When you will access by browser it will ask you the password. You find the password on ~/.config/code-server/config.yaml

Official Lightsail SSL with Really Simple SSL Plugin Wrong for Debian Instances

Followed the steps to setup an SSL for Lightsail AWS (new instance running Debian) in the official docs here:
https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-using-lets-encrypt-certificates-with-wordpress
Everything is absolutely fine until I reach section 8.
In section 8.1 is says:
Enter the following command to set your wp-config.php and htaccess.conf files to be writeable. The Really Simple SSL plugin will write to the wp-config.php file to configure your certificates.
sudo chmod 666 /opt/bitnami/apps/wordpress/htdocs/wp-config.php && sudo chmod 666 /opt/bitnami/apps/wordpress/conf/htaccess.conf
However these paths don't exist in the Debian instance (used to work for Ubuntu instances).
The Really Simple SSL certificate says:
"No SSL detected"
How to install this properly on the newer Debian instances?
Bitnami Engineer here,
The Bitnami WordPress directory structure changed a bit some months ago but it seems that the Lightsail documentation was not updated (please note that we do not maintain those guides). The WordPress files are now inside the /opt/bitnami/wordpress directory.
https://docs.bitnami.com/aws/faq/get-started/understand-directory-structure/
Apart from that, I do now know why they are modifying the permissions of the htaccess.conf file so running these commands should be enough
sudo chmod 666 /opt/bitnami/wp-config.php
sudo chmod 666 /bitnami/wp-config.php
However, as I mentioned before, we do not maintain those guides. If you want to generate a SSL certificate, I suggest you take a look at this guide in the Bitnami documentation to generate a Let's Encrypt SSL certificate and redirect the requests to https if required.
https://docs.bitnami.com/aws/faq/administration/generate-configure-certificate-letsencrypt/
sudo /opt/bitnami/bncert-tool

Local DC/OS is unreachable

I have a DC/OS local installation using vagrant. I have restarted my Mac machine and power up the virtual machines on which dc/os is installed. Still I not not able to open the GUI. When I give docs service command on CLI, I get the following error
URL [http://m1.dcos/mesos/master/state.json] is unreachable.
The response I got from mesosphere:
It would be good if you can login to your master node with:
vagrant
ssh m1
And run the following command:
sudo
systemctl status dcos-adminrouter.service
I have cleaned up the vagrant environment and set up again. I am not facing the problem yet.

How does one configure shared folders to automount for arch/manjaro linux VM in virtualbox?

I have a manjaro/arch virtual machine running in virtualbox with a windows 10 host. I have configured the shared folder I want to share in virtualbox as c:\tfs with the name tfs but it doesn't show up in the linux vm anywhere. I am able to mount it manually, but it won't auto-mount. I created the /media and /media/tfs folder in the VM, since it did not exist, and now the following command successfully manually mounts my folder sudo mount -t vboxsf tfs /media/tfs. How do I get the automount to work as intended without resorting to editing /etc/fstab?
It turns out that a few more steps are needed to configure the automount for shared folders of virtualbox. This tiny forum post was the key. You need to enable and start the virtualbox service vboxservice.service installed with the guest utils.
First ensure you have a folder /media, this is where it will try to mount your shared folders
Ensure that the guest utils are installed with sudo pacman -Q virtualbox-guest-utils
Enable service with sudo systemctl enable vboxservice.service
Start service with sudo systemctl start vboxservice.service
Reboot, I tried just logging out but reboot was necessary for me to start the service
Verify that your folder is now automounted in /media with sf_ prefix, mine is /media/sf_tfs
p.s. I also ran this command based on another post to add my username to the vboxsf group, although I'm not sure whether this one was necessary or not. sudo usermod -aG vboxsf brandon

Launching anaconda spyder gui in cygwin

I am connecting my windows 7 computer to a linux based cluster using cygwin. Within a specific node in the cluster I want to launch the anaconda spyder gui.
to launch spyder you simply type:
spyder into cygwin
but that returns:
QXcbConnection: Could not connect to display
Aborted (core dumped)
I also tried:
QTA_QPA_PLATFORM=offscreen spyder
but that returns:
QFontDatabase: Cannot find font directory /home/spotter/anaconda2/lib/fonts - is Qt installed correctly?
I installed qt4 dev-tools but it didn't change anything
EDIT:
I installed xinit and xorg and now I try this:
before logging in with ssh i run:
export DISPLAY=localhost:0.0
then I login using ssh:
ssh -Y -X usrname#machine
and now when I try to use spyder I get:
connect localhost port 6000: Connection refused
QXcbConnection: Could not connect to display localhost:11.0
So it sounds like you are running Cygwin on your local Windows machine, logging into a remote server with ssh, and running spyder from that machine with the intent of having it show up on your local screen. Now that you have startx working, you are close to a solution.
Between steps 5 and 6, you need to run the export DISPLAY command on the remote machine and set it to the name of your local computer. You will need to know your hostname for this. The steps will look like this:
startx
ssh -Y -X username#machine
export DISPLAY=win-machine-name:0.0
spyder
The last two commands are executed on the remote machine. I just made up the win-machine-name. In its place, you will put the IP address or machine name of your windows machine. That is how you tell set the DISPLAY environment variable on the remote machine, so X clients know where to send the graphics commands.
Hope this helps!
For me what I did was:
Install packages associated with startx
Change the sshd_config file to allow X11 forwarding
export DISPLAY=localhost:0.0
startx
login with ssh -Y -X username#machine
spyder