Skip to content

Instantly share code, notes, and snippets.

View viatcheslavmogilevsky's full-sized avatar

Vyatcheslav Mogilevsky viatcheslavmogilevsky

View GitHub Profile
#!/bin/bash -e
TF_PLUGIN_CACHE_DIR="$HOME/.terraform.d/plugin-cache"
declare -a iaac_repos=("$HOME/acme-corp/iaac-repo-01"
"$HOME/acme-corp/iaac-repo-02"
)
LOCKED_PROVIDER_VERSIONS="{}"

Gmail filters

Filter calendar invites/updates

  • Query: from:(-me) {filename:vcs filename:ics} has:attachment
  • Do this: Skip Inbox, Apply label "Calendar", Never send it to Spam, Never mark it as important, Categorize as Primary
  • XML entry (from export):
@viatcheslavmogilevsky
viatcheslavmogilevsky / aws-config-example
Last active March 20, 2025 14:20
aws-vault and aws-config
[profile central]
region=us-east-1
output=json
mfa_serial=arn:aws:iam::123456789012:mfa/mydeviceid
mfa_process=op item get qwertyuiopasdfghjklzxcvbnm --otp
[profile production]
source_profile=central
role_arn=arn:aws:iam::123456789013:role/admin
role_session_name=j.doe
@viatcheslavmogilevsky
viatcheslavmogilevsky / BootstrapDay.scpt
Last active May 5, 2025 14:53
macOS automation: bootstrap day
-- Launch iTerm
tell application "iTerm"
activate
end tell
-- comment example:
-- A man could lose himself in London, lose himself in London!
-- Legend:
-- meta-dir is special dir where notes (long-file.md/short-file.txt) are located

Terminal tips

Frequent commands/bash-snippets

git tips

Stash

Stash show diff

Opensearch tips

Regex filter example

{
  "regexp": {
    "request_ip": {
      "case_insensitive": true,
 "flags": "ALL",
#!/bin/bash
target_namespaces=( default )
target_cluster_context=$(kubectl config current-context | awk -F'/' '{print $NF}')
KNOWN_REGISTRY="123456789012.dkr.ecr.us-west-1.amazonaws.com"
inspect_container () {
echo -n '{{printf "%s,%s,%s,%d,%s,%s,%s," $element.metadata.namespace $podOwnerType $element.metadata.name $count $containerType $container.name $container.image }}
{{- range $envFromItem := $container.envFrom -}}
@viatcheslavmogilevsky
viatcheslavmogilevsky / .tool-versions
Created September 18, 2024 14:35
Ruby AWS client example
ruby 3.3.0
.obsidian/plugins/**/*.js
.obsidian/plugins/**/*.css
.obsidian/workspace.json
@viatcheslavmogilevsky
viatcheslavmogilevsky / Running_SI_local_stack_using_lima-vm.md
Last active March 29, 2024 07:14
Running SI local stack using lima-vm