• Skip to main content

Uly.me

cloud engineer

  • Home
  • Archives
  • Search

configuration

GCP Instance Scheduler

May 28, 2021 by Ulysses

GCP recently added Instance Schedule to its console.

To configure, perform the following.

– Create an instance schedule.
– Add instance(s) to a schedule.
– If no errors, the service account has the correct permissions.

The service account used by Instance Schedule is owned by GCP and is not visible in the GCP console.

If service account has no permissions, the you must perform the following.

– Create a custom role with compute.instances.start and compute.instances.stop permissions.
– Add custom role to the service account.

Finally, validate instances are starting and stopping based on schedule.

Filed Under: Cloud Tagged With: configuration, gcp, instance schedule, service account

Setup Log Rotation

January 16, 2021 by Ulysses

Logrotation is available in most Linux distros. If they are missing, you can easily install them. The logrotation main configuration file is located in /etc/logrotate.conf which is the default setting. The config file contains an include statement that pulls in other log configurations located in the /etc/logrotate.d/ directory. When setting up a log rotation, it’s best to add your log rotation configuration in this directory.

Here’s a simple configuration in a file called webmon.

/home/ubuntu/webmon.log {
        daily
        create 0640 ubuntu ubuntu
        dateext
        rotate 7
	nocompress
}

/home/ubuntu/webmon.log { daily create 0640 ubuntu ubuntu dateext rotate 7 nocompress }

The options above does the following:

  • The logs are rotated daily.
  • The logs are rotated 7 times with no compression.
  • The rotate log files will have dates appended to them.
  • The log files are owned user ubuntu with permission of 0640.

There are more options from the logrotate man pages which can be added.

Filed Under: Linux Tagged With: configuration, log, rotation

Matrox Monarch Configuration

July 4, 2019 by Ulysses

You can import the Matrox Monarch HD configuration on boot up from a web page. Go to:

Command Center > Automatic Configuration.
Type in URL Address starting with https.
Check "Load settings on device reboot."
You can either power off the device or hit reset.
Holding reset for more than 5 seconds does a factory reset.
On next bootup, device will have configuration contained from the remote file.

Command Center > Automatic Configuration. Type in URL Address starting with https. Check "Load settings on device reboot." You can either power off the device or hit reset. Holding reset for more than 5 seconds does a factory reset. On next bootup, device will have configuration contained from the remote file.

Filed Under: Misc Tagged With: configuration, file, live streaming, matrox, monarch, remote, web

AWS CLI Bucket Lifecycle Configuration

December 14, 2018 by Ulysses

I was banging my head against the wall (not quite literally, but it was close) trying to come up with a S3 lifecycle configuration from scratch. I needed a JSON file that I can run in a bash script, so I can apply the lifecycle rules to a few dozen S3 buckets. Obviously, trying to create one from scratch wasn’t the wisest choice in my part. As it turns out, you can setup a temporary bucket and use the console to recreate the lifecycle, then export the lifecycle JSON file. Duh! Genius! Here’s the command to export the lifecycle configuration.

aws s3api get-bucket-lifecycle-configuration \
--bucket bucket-name

aws s3api get-bucket-lifecycle-configuration \ --bucket bucket-name

The output would be in a JSON format similar to this:

{
    "Rules": [
        {
            "Status": "Enabled",
            "NoncurrentVersionExpiration": {
                "NoncurrentDays": 90
            },
            "NoncurrentVersionTransitions": [
                {
                    "NoncurrentDays": 7,
                    "StorageClass": "INTELLIGENT_TIERING"
                }
            ],
            "Filter": {
                "Prefix": ""
            },
            "Expiration": {
                "ExpiredObjectDeleteMarker": true
            },
            "AbortIncompleteMultipartUpload": {
                "DaysAfterInitiation": 7
            },
            "ID": "EFS S3 Backup Lifecycle Rules"
        }
    ]
}

{ "Rules": [ { "Status": "Enabled", "NoncurrentVersionExpiration": { "NoncurrentDays": 90 }, "NoncurrentVersionTransitions": [ { "NoncurrentDays": 7, "StorageClass": "INTELLIGENT_TIERING" } ], "Filter": { "Prefix": "" }, "Expiration": { "ExpiredObjectDeleteMarker": true }, "AbortIncompleteMultipartUpload": { "DaysAfterInitiation": 7 }, "ID": "EFS S3 Backup Lifecycle Rules" } ] }

Filed Under: Cloud Tagged With: aws cli, configuration, json, lifecycle, s3

  • Home
  • About
  • Contact

Copyright © 2022