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

October 25, 2021 · 1 min · ulysses

aws suspend auto scaling group

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.

October 20, 2021 · 1 min · ulysses

check certificate expiration

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

October 20, 2021 · 1 min · ulysses

run telnet on git bash

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.

October 20, 2021 · 1 min · ulysses

copy s3 to gcs

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. ...

October 13, 2021 · 1 min · ulysses

git undo add

To undo a git add, run git reset file or get reset. git reset filename git reset Run git status to check. git status

October 13, 2021 · 1 min · ulysses

aws cli search iam userid

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" } ]

October 11, 2021 · 1 min · ulysses

gcp display roles on service account

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

October 6, 2021 · 1 min · ulysses

gcp list service accounts in project

How to display a list service accounts in a GCP project. gcloud iam service-accounts list --project your-project

October 6, 2021 · 1 min · ulysses

where in windows

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.

October 6, 2021 · 1 min · ulysses