gcp login service account
Here’s the command to authenticate as a service account. gcloud auth activate-service-account --key-file=key.json To log out. gcloud auth revoke
Here’s the command to authenticate as a service account. gcloud auth activate-service-account --key-file=key.json To log out. gcloud auth revoke
Here’s how to modify a line in a file using sed. sed -i 's/replace me.*/with this text/' /path/to/a/file.txt
AWS has machine types that require ENA Support. You can run AWS CLI to find out if instance is ENA enabled. aws ec2 describe-instances \ --instance-id i-xxxxxxxxxxxxxxxxx \ --profile default \ --region us-east-1 \ --query 'Reservations[].Instances[].EnaSupport' Login to the instance and verify. sudo lspci | grep -i Amazon List driver details. modinfo nvme Verify modules loaded at startup. lsmod | grep nvme lsmod | grep ena If ENA drivers are missing, install them. yum install pciutils
Keep your disks when a VM is deleted. gcloud compute instances set-disk-auto-delete server --no-auto-delete --disk=server-disk-1 gcloud compute instances set-disk-auto-delete server --no-auto-delete --disk=server-disk-2 To delete. gcloud compute instances set-disk-auto-delete server --auto-delete --disk=server-disk-1 gcloud compute instances set-disk-auto-delete server --auto-delete --disk=server-disk-2
s3fs allows Linux to mount S3 buckets as a file system. Install s3fs. sudo apt install s3fs Setup credentials. echo ACCESS_KEY_ID:SECRET_ACCESS_KEY > /etc/.passwd-s3fs chmod 400 ${HOME}/.passwd-s3fs Setup mount directory. mkdir -p /mountpoint chown username:username /mountpoint Mount it. s3fs bucketname /mountpoint -o passwd_file=/etc/.passwd-s3fs Mount it automatically. bucketname /mountpoint fuse.s3fs _netdev,allow_other,passwd_file=/etc/.passwd-s3fs,rw,uid=1000,gid=1000,umask=022 0 0 Alternative. s3fs#bucketname /mountpoint fuse _netdev,allow_other,use_cache=/root/cache,uid=1000,gid=1000,umask=022 0 0
Generate a map of your live streaming viewers by placing of your viewer’s IP into a file and then using IPInfo’s map tool. vim ipList 54.0.0.1 54.0.0.2 54.0.0.3 To plot the IPs on a map, pipe them to IPinfo.io. cat ipList | curl -XPOST --data-binary @- "ipinfo.io/map?cli=1" The result is a URL of the map.
Install Speedtest CLI. sudo apt-get install gnupg1 apt-transport-https dirmngr export INSTALL_KEY=379CE192D401AB61 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $INSTALL_KEY echo "deb https://ookla.bintray.com/debian generic main" | sudo tee /etc/apt/sources.list.d/speedtest.list sudo apt-get update sudo apt-get install speedtest To run. speedtest Result. $ speedtest Speedtest by Ookla Server: City of Columbus - Columbus, OH (id = 40410) ISP: Spectrum Latency: 9.39 ms (0.63 ms jitter) Download: 117.74 Mbps (data used: 60.3 MB) Upload: 11.81 Mbps (data used: 5.6 MB) Packet Loss: 0.0% Result URL: https://www.speedtest.net/result/c/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx (redacted)
If you’re trying to access GCS (Google Cloud Storage) and you’re getting “Your credentials are invalid. Please run gcloud auth login”, you most likely have a previous key stored in the ~/.boto file. This happens if you previously configured gsutil with your own credentials, then switched over to Google SDK mode. To fix the invalid credentials, edit the ~/.boto file and comment out the auth key. vim ~/.boto Comment out. #gs_oauth2_refresh_token = <token redacted=""> </token> Rerun the gsutil ls command. It should work.
Install yum install sos Run sosreport sosreport Case number will be part of exported report located in /var/tmp. cd /var/tmp
If you get a WordPress “There has been a critical error on your website” error, you probably have an issue with a theme or plugin. The quickest way to troubleshoot is to rename the plugins directory since there’s no way to login. This technically disables all plugins. Rename it back to plugins and enable each plugin one by one. Disable all plugins. mv plugins plugins-backup Login and restore the plugins directory. ...