Skip to content

Instantly share code, notes, and snippets.

View olliefr's full-sized avatar
🍊

Oliver Frolovs olliefr

🍊
View GitHub Profile
@olliefr
olliefr / README.txt
Created April 22, 2025 16:50
Databricks: configure verbose Audit Logs with Terraform
The configuration uses default credentials as set up by:
databricks auth login --host https://9999487995419999.1.gcp.databricks.com/
@olliefr
olliefr / main.tf
Created April 22, 2025 01:10
Databricks: assign external location to multiple workspaces
terraform {
required_providers {
databricks = {
source = "databricks/databricks"
version = "1.74.0"
}
google = {
source = "hashicorp/google"
version = "6.30.0"
}
@olliefr
olliefr / gist:fca737274b0ccf52847a98f830cf2bf0
Last active January 15, 2025 14:40
Migrating multi-architecture images across Docker Repositories

Use reglient:

src="ghcr.io/iximiuz/labs/nginx:alpine"

dst="us-central1-docker.pkg.dev/dml-sandbox-firebass-21/demorepo/nginx:alpine"

curl -LO https://github.com/regclient/regclient/releases/download/v0.8.0/regctl-linux-amd64

chmod +x regctl-linux-amd64
@olliefr
olliefr / README.md
Created November 4, 2023 08:15
Country flags emoji in Windows fonts

National flags in Windows fonts

Context

This gist contains a copy of my comment to a Medium article named Designing in the Open(Source) published by Microsoft Design (official account).

The article is about Fluent Emoji -- a collection of emoji from Microsoft. They are kind of a big deal because they are included with every copy of Windows operating system as a Segoe UI Emoji font.

@olliefr
olliefr / dataflow.md
Last active November 12, 2022 18:29
Dataflow data generator
@olliefr
olliefr / datastore.md
Last active November 18, 2022 02:46
Datastore (Google Cloud)

Datastore is weird!

It is a legacy service tied to App Engine. Once enabled, App Engine API cannot be disabled on a Cloud project.

Cloud projects can use either Datastore or Firestore but not both. Once set, it cannot be changed. Since all legacy App Engine apps use Datastore, a different project must be used for Firestore usage.

This Codelab gives some historical context on App Engine, Datastore, and Firestore.

For Python client for Datastore API there are at least two options:

@olliefr
olliefr / gist:f2cf97267a813dab82c1baa011bbd5bb
Last active July 11, 2022 16:19
Create a new isolated environment for Python
mkdir sandpit-one && cd $_
conda create --prefix ./conda --yes python=3.8 ipython
conda activate ./conda
python -m pip install --upgrade pip
@olliefr
olliefr / awesome-cli.txt
Last active August 22, 2022 20:30
Awesome command line one-liners
# Generate a random password
openssl rand -base64 18
# Display total size of a single directory in human-readable format
du -csh /home/oliver/
# Display size of everything in a directory in human-readable format
du -csh /home/oliver/*
# Compare the output of two programs without having to save it into files first.
@olliefr
olliefr / main.tf
Created April 1, 2022 00:23
Making sense of Terraform Google provider's google_organization_policy and compute.vmExternalIpAccess constraint.
terraform {
required_version = "~> 1.1.7"
required_providers {
google = "~>4.12.0"
}
experiments = [module_variable_optional_attrs]
}
variable "gcp_organisation" {
@olliefr
olliefr / fix_cp1251_filenames.py
Created August 1, 2020 14:47
Recode file names in the current directory from CP-1251 to file system's native encoding using Python
# -*- coding: utf-8 -*-
"""
This script was written to solve a specific problem:
A large directory of video files had file names encoded in Windows-1251.
These file names would not display correctly in Windows 10 or OS X.
I wanted to recode them to the native encoding for the current file system.
Python is smart enough to apply the correct encoding when writing out
the file names to the file system.