aws cloudwatch alarms
How to enable and disable CloudWatch alarms $ aws cloudwatch disable-alarm-actions --alarm-names myalarm --region us-east-1 $ aws cloudwatch enable-alarm-actions --alarm-names myalarm --region us-east-1
How to enable and disable CloudWatch alarms $ aws cloudwatch disable-alarm-actions --alarm-names myalarm --region us-east-1 $ aws cloudwatch enable-alarm-actions --alarm-names myalarm --region us-east-1
You can administratively suspend a process in AWS Auto Scaling group for troubleshooting purposes. Here are the available processes. Terminate Launch AddToLoadBalancer AlarmNotification AZRebalance HealthCheck ReplaceUnhealthy ScheduledActions If you have difficulty launching a VM, check if any of these processes are suspended. Removed them if applicable.
Here’s the openssl command to find out if a cert is expired. $ openssl s_client -connect yourdomain.com:443 -servername yourdomain.com 2> /dev/null | openssl x509 -noout -dates Result notBefore=Apr 9 00:00:00 2020 GMT notAfter=Apr 9 23:59:59 2022 GMT
Although telnet is not used regularly since insecure, it’s a handy tool for testing ports. For example, to check if a port 80 is open, you run this command. $ telnet servername 80 Git Bash does not come with telnet, but you can use the Windows version by using winpty. $ winpty telnet servername 457 Connecting To servername...Could not open connection to the host, on port 457: Connect failed If port is open, you get an empty reply, just like in Windows.
You can use gsutil to copy directly from a S3 bucket to a GCS bucket. gsutil can read/write to a S3 bucket as long as it has access to your AWS credentials. The -R option is recursive and -m is for multi-threaded or multi-processing. gsutil -m cp -R s3://bucket/ gs://bucket You can also use rsync instead of cp. Just be aware that rsync does not copy empty directory trees gsutil -m rsync -r s3://bucket/ gs://bucket If you plan to use -d, Use it with caution since it deletes content. ...
To undo a git add, run git reset file or get reset. git reset filename git reset Run git status to check. git status
Here’s how to search for an IAM user in AWS by filtering their access key. aws iam list-users --query 'Users[?UserId==`AIDAxxxxxxxxxxxxxxxxx`]' \ --profile your-profile The results only returns one user with that UserID. [ { "Path": "/", "UserName": "your-username", "UserId": "AIDAxxxxxxxxxxxxxxxxx", "Arn": "arn:aws:iam::xxxxxxxxxxxx:user/sa-lucidchart", "CreateDate": "2019-04-15T15:53:18+00:00" } ]
How to display roles assigned to a GCP service account. gcloud projects get-iam-policy your-project-id \ --flatten="bindings[].members" \ --format='table(bindings.role)' \ --filter="bindings.members:your-service-account@your-project.iam.gserviceaccount.com" Result ROLE organizations/xxxxxxxxxxxxx/roles/role-name roles/compute.instanceAdmin.v1 roles/compute.networkViewer roles/logging.logWriter roles/monitoring.metricWriter
How to display a list service accounts in a GCP project. gcloud iam service-accounts list --project your-project
How to find where the executable is located in Windows? Use the where command in CMD. where gcloud C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\gcloud C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\gcloud.cmd It will list multiple locations if you have several versions installed on your system.