Editing a Google Apps Engine file via SSH - google-compute-engine

I'm dealing with a deprecated Google Apps Engine project where I want to make a small change to an HTML file. Since I don't have the dev environment set up, I've edited the file by SSHing into the server and using sudo nano [file].I'm aware that this is probably bad practice, but this is a one-time issue that needs to be fixed quickly.
My changes don't seem to be propagating to the live webapp. Is there some additional step to complete changes to files on the App Engine Compute Engine VM instance to get them to go live? (maybe it is a CDN or cache issue?)
As some context, I know almost nothing about this environment. Thanks!

Related

How do you change the public key of a Oracle Cloud Instance?

I accidentally deleted my public and private key and had to generate new SSH keys due to not being able to restore the keys (and not having a backup anywhere). How do I change the public SSH key then of my Oracle Cloud instance?
Terminating the instance and remaking it isn't an option, and I've tried looking online but wasn't able to find much. Any help would be appreciated.
Thanks
Some background
Found a solution! Just so people are aware, there are methods online that involve connecting to the machine via VNC, but for me personally it felt very trial-an-error, when pressing buttons at the wrong time, and it ended up not working properly (VNC didn't display recovery mode for me, just a blank screen after selecting it).
Summary
This guide involves: Creating another machine (as incl. in free tier anyway), detaching the boot volume drive from the machine and attaching it to the machine just created, to do editing to change the keys over, then attaching the drive back up.
Create another VPS (Oracle have them incl. > free tier)
I deleted one of my other VPS' in the Oracle panel (that was a free machine - as I didn't need it and wasn't using it) and created it again anew (I made sure to delete the old boot volumes before continuing).
(This solution is assuming your using Ubuntu 20.04, but this will probably work for other OS's as well)
Basically from there,
I powered off the machine I wanted to change my SSH key of.
After fully being powered off, just detach the boot volume from the VPS, and attached it as a block volume to the machine just created.
Login to the machine via SSH, and run the connection commands by hitting the three dots (image below) and viewing the connection commands, to connect the drive up.
Editing files on the drive & mounting process
Then by running blkid (or sudo fdisk -l for a more friendly view)
you're able to see what drives are available for mounting. So then you just make a folder and simply type:
sudo mount [drive path e.g. /dev/sdb] [folder path e.g. ./drive]
Edit the file at /home/ubuntu/.ssh/authorized_keys, or however your machine is configured (Oracle by default disallows root, but if you've edited your configuration it's up to your end).
Then, simply go to the relevant path to be able to unmount the drive, umount [folder path e.g. ./drive]
Run the disconnect commands for the drive from the panel.
Then, simply detach the drive from your other machine and reattach it back to the original machine. Wait till it's fully attached and then start the machine again.
You can create a console connection, connection to it, then reboot the instance (through OCI console), and get to GRUB in the console connection... a few more steps and you can upload a new ssh key: https://docs.oracle.com/en-us/iaas/Content/Compute/References/serialconsole.htm

Legacy GCE and GKE metadata requests from google_daemon/manage_addresses.py

I have an old Debian Compute Engine instance (created and running since December 2013) and got an email warning about the turndown of Legacy GCE and GKE metadata server endpoints (more details at https://cloud.google.com/compute/docs/migrating-to-v1-metadata-server).
I followed the directions for locating the process and found that the requests were coming from /usr/share/google/google_daemon/manage_addresses.py. The script seems to be the same as what's at https://github.com/gtt116/gce/blob/master/google_daemon/manage_addresses.py (also with what's in that directory).
I don't recall installing this, so I'm imaging it came with the provided Debian image I used in 2013.
Does anyone know what this manage_addresses.py script is, what it does, and what I should do with it now that the legacy metadata server endpoints are turning down? Is it safe to just stop running it? Or is there a new script I should replace it with? Or should I just try to update it myself to use the new endpoint?
I dug around and was able to trace /usr/share/google/google_daemon/manage_addresses.py as being installed by a package called google-compute-daemon. A search for that brought me to https://github.com/GoogleCloudPlatform/compute-image-packages#troubleshooting which explains that google-compute-daemon has been replaced with python-google-compute-engine. That led me to https://cloud.google.com/compute/docs/images/install-guest-environment . I followed the instructions there and manually installed the guest environment.
I noticed during installation that it said it was removing the google-compute-daemon package (and a packaged called google-startup-scripts), so this seems like the right thing. And I'm no longer seeing any requests to the legacy endpoints. So it seems like at some point the old guest environment failed to update.
TLDR; If you have this problem, follow the instructions at https://cloud.google.com/compute/docs/images/install-guest-environment#installing_guest_environment to manually update the guest environment.

How do I force Azure Apps to use latest html file?

I have a web application hosted on azure apps that I publish using visual studio. It is a flask app. One of the templates is called searchresult.html. I am making changes to this file that are made when I run locally. When I run it on the server though the changes are absent.
Using the azure console I can see that the changes are present in the file that is stored on the server, but the application continues to deliver the old html.
How can I force azure to see my updated file?
Things I have tried:
Deleting the file directly on the server and re-publishing it
Committing changes to git, even though I knew that would do nothing
Testing it locally (it works)
Restarting the application
Since you said you already check the file has been changed on the Kudu, so it supposed not an issue of deployment. You could disable caching in your browser.
such as in chrome browser, navigate to F11 window and select the Disable cache blanket.
or please try to access your website via incognito model.
In addition, I crashed into similar issue with you in other web app. My previous solution is that enable always on option on the portal and restart my app, it worked.
Just for your reference.Hope it helps you.

Where is the link to phpmyadmin in Google Compute Engine?

I set up a LAMP instance in Google Compute Engine approx 45 days ago, and it came with phpMyAdmin already set up and accessible via a button in the console (in Compute Engine -> VM instances -> instance-name -> phpMyAdmin).
The button is now gone, and I can't find any documentation regarding the change. I can still access it via the browser at my-ip/phpmyadmin.
Just wondering if there was some recent change I was unaware of. I can update phpmyadmin manually but it appears that GCE no longer "officially" supports it.
I am assuming you deployed your LAMP stack via deployment manager. https://console.cloud.google.com/deployments/
If so, you should be able to access your deployment and all the relative details over there including login link for phpmyadmin.
As far as support from Google is concerned, since you have already deployed your instance, even if they remove it from their deployments, it will never affect what you have deployed. Moreover I just deployed a new instance and I can see that phpmyadmin is as an option (not sure if it always was). But even after adding it to my deployment, no extra instance for phpmyadmin was created. It is in the same instance as my rest of stack.
Since you are able to access it via your URL, there's nothing be worried about, and there are no changes on GCP side either. If anything, phpmyadmin is now optional.

How to prevent Google from changing your /etc/hosts file when you restart the network service?

Whenever I change the /etc/hosts file and restart the network service, Google overwrites the file.
So, it is impossible to do. Your server does not directly contain a public IP address. Yes, this screws things up with certain pieces of software, such as ISPConfig. There literally is no way to run ISPConfig on Google currently. Thankfully several other web hosting control panels (cPanel and InerWorx) work with a little bit of hacky configuration. If you want to know how to configure them, reply below.