Skip to content

Instantly share code, notes, and snippets.

View irvingpop's full-sized avatar

Irving Popovetsky irvingpop

View GitHub Profile
@irvingpop
irvingpop / gist:70fa4b9e0a2555e78fad07106e36168d
Created August 21, 2025 00:05 — forked from mollystamos123/gist:7dafaa153d3b6510d9f06ba1558c9f20
Honeycomb Derived Column Natural Language Prompt
You are an AI that creates Honeycomb Derived Columns from natural language.
This is the Derived Column grammar:
```
expr: fun | column| literal;
// Support trailing comma
fun: funcname '(' (params ','?)? ')';
params: expr (',' params)?;
# Original source: https://github.com/sqlfluff/sqlfluff-github-actions/blob/main/menu_of_workflows/surfline/sqlfluff_lint_dbt_models.yml
name: SQLFluff lint dbt data models
on:
push:
branches:
- main
pull_request:
branches:
- main
@irvingpop
irvingpop / ssh_key.tf
Last active January 23, 2025 09:07
Terraform external data source example - dynamic SSH key generation
# ssh key generator data source expects the below 3 inputs, and produces 3 outputs for use:
# "${data.external.ssh_key_generator.result.public_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key_file}" (path)
data "external" "ssh_key_generator" {
program = ["bash", "${path.root}/../ssh_key_generator.sh"]
query = {
customer_name = "${var.customer_name}"
customer_group = "${var.customer_group}"
@irvingpop
irvingpop / hny-column-cleanup.py
Last active November 16, 2024 00:33
Honeycomb column deletion tools
#!/usr/bin/env python3
# usage: hny-column-cleanup.py [-h] -k API_KEY -d DATASET [-m {hidden,spammy}]
# Honeycomb Dataset Column Cleanup tool
# arguments:
# -h, --help show this help message and exit
# -k API_KEY, --api-key API_KEY
# Honeycomb API key
# -d DATASET, --dataset DATASET
# Honeycomb Dataset
@irvingpop
irvingpop / slack-channel-joiner.py
Created March 19, 2024 17:00
Join an app, bot or any named user to all private channels in a Slack team
import requests
# Your LEGACY Slack API token
SLACK_API_TOKEN = "xoxp-my-slack-legacy-token"
def get_channel_list():
"""
Retrieves a list of available channels using the Slack API.
"""
url = "https://slack.com/api/conversations.list"
@irvingpop
irvingpop / .gitignore
Last active January 30, 2023 22:31
Launch EC2 spot instances with tags, like a boss
MY_INSTANCEID
MY_SERVER
user-data.txt
.zshrc
.gitconfig
.ssh
.byobu
.oh-my-zsh
@irvingpop
irvingpop / drbd-lv-shrink.md
Last active November 24, 2022 06:44
EC11 Shrink the DRBD LV to make room for snapshots
@irvingpop
irvingpop / sane_defaults.rb
Created October 31, 2015 17:59
Vagrant: Irving's sane defaults for Virtualbox with better performance
# replaces this file /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/providers/virtualbox/action/sane_defaults.rb
# NOTE: if using a different Vagrant version, adjust the version field accordingly
# NOTE2: only the sections with the IRVING comment have been changed from the default
require "log4r"
module VagrantPlugins
module ProviderVirtualBox
module Action
class SaneDefaults
@irvingpop
irvingpop / README.md
Last active October 25, 2021 10:59
Chef Server Report: Script to list all nodes in all orgs, grouped by org, then environment, then chef client version.

Example output:

root@chef:~# ./chef_server_nodes_report.rb -h
Usage: chef_server_nodes_report.rb [options]
    -g, --group-by TYPE              Group results by: ["version", "org", "environment", "check_in_month", "check_in_date", "platform_family", "platform_version", "platform", "os"]

root@chef:~# ./chef_server_nodes_report.rb --group-by version
loading config from /etc/opscode
{
@irvingpop
irvingpop / ha_drbd.md
Last active July 16, 2021 10:18
Cloning a Chef Server 12 installation

Customer Scenario

A customer has a Chef Server 12 (HA - DRBD) in Production. They want to test an in-place upgrade (or maintenance) using their current OPC Production data and config. This gives us a good chance to make corrections if we find that their data is too broken for the migrations to handle, and gives the customer experience in managing the upgrade in Production.

The sequence of events will broadly be these:

  • Install the same version of Chef Server on the target HA Test cluster
  • Restore data from Production instance backup (LVM snapshot or full-stop backup)
  • Test