yum check update
To check which packages are available for an update. yum check-update
To check which packages are available for an update. yum check-update
JQ is a json processor. It’s for slicing and dicing data. Download To install on GitBash, unzip the file and copy the executable to /usr/bin. mv jq-win64.exe to /usr/bin/jq.exe Create an alias. Edit ~/.bashrc. alias jq='/usr/bin/jq.exe' Using JQ. jq --version jq '.selfLink' vm.json
If you create scripts in Windows, editors sometimes add a carriage return in addition to the line feed. You can use dos2unix to remove the extra characters. Or you can use sed. sed -i -e 's/\r$//' script.sh
You are probably wondering how the sudoers file works. Here’s a simple explanation. Command username host=(user:group) tag:commands Explanation username – the specified user allowed to run commands. host – the specified host the command is allowed to run. user – specifies which users can use the command. group – specifies which groups can run the command. tag – the option allowed. NOPASSWD command – the command allowed to run. Examples root ALL=(ALL) ALL username ALL=(ALL) ALL john test=(ALL) NOPASSWD: /bin/useradd jane ALL=(sales) NOPASSWD: /bin/sh %sudo ALL=(ALL) ALL %adgroup ALL=(ALL) ALL
Buckets are regional. Your source and destination buckets should be in different regions. aws s3 sync s3://DOC-EXAMPLE-BUCKET-SOURCE s3://DOC-EXAMPLE-BUCKET-TARGET Use the sync command. It will copy new or modified files.
gcloud compute ssl-certificates create certificate-name \ --description="ssl cert for domain-name.com" \ --domains=domain-name.com \ --certificate=certificate-file \ --private-key=private-key \ --region=us-central1-c \ --global
Make an IP alias reservation. gcloud compute instances network-interfaces update instance-name \ --zone us-central1-c \ --aliases default:/32 \ --project project-id
How to update an instance metadata in GCP. gcloud compute instances add-metadata instance-name \ --metadata key-name=value \ --project your-project-id \ --zone us-central1-a In this example, we are adding enable-oslogin=TRUE. gcloud compute instances add-metadata instance-name \ --metadata enable-oslogin=TRUE \ --project your-project-id \ --zone us-central1-a
There are multiple ways to change URL in WordPress. Here’s one via wp-config.php. define( 'WP_HOME', 'http://example.com' ); define( 'WP_SITEURL', 'http://example.com' ); If you have a redirect in Apache, comment it out. #Redirect permanent / https://yourdomain.com/ This is by far the easiest way to change URL in WordPress.
How to create GCP firewall via Terraform. Ingress provider "google" { project = "project-id" } resource "google_compute_firewall" "default" { name = "test-firewall" description = "this is a test firewall" priority = "1000" direction = "INGRESS" network = "projects/project-id/regions/us-east1/subnetworks/default" target_service_accounts = ["service-account-compute@developer.gserviceaccount.com"] source_ranges = ["10.128.0.0/20"] allow { protocol = "tcp" ports = ["80", "8080", "1000-2000"] } } Egress provider "google" { project = "project-id" } resource "google_compute_firewall" "default" { name = "test-firewall" description = "this is a test firewall" priority = "1000" direction = "EGRESS" network = "projects/project-id/regions/us-east1/subnetworks/default" target_service_accounts = ["service-account-compute@developer.gserviceaccount.com"] destination_ranges = ["10.128.0.0/20"] allow { protocol = "tcp" ports = ["80", "8080", "1000-2000"] } } Service account to Service account. ...