Skip to content

Instantly share code, notes, and snippets.

Avatar

Irving Popovetsky irvingpop

View GitHub Profile
@irvingpop
irvingpop / hny-column-cleanup.py
Last active July 7, 2022 18:27
Honeycomb column deletion tools
View hny-column-cleanup.py
#!/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 / how_big_is_my_node.md
Last active September 26, 2018 18:26
How big is my Chef node object?
View how_big_is_my_node.md

first, enter chef-shell:

$ chef-shell
loading configuration: none (standalone session)
Session type: standalone
Loading.........done.

This is the chef-shell.
 Chef Version: 14.3.37
@irvingpop
irvingpop / okta-aws.plugin.zsh
Created September 17, 2018 20:32
okta_aws plugin for oh-my-zsh
View okta-aws.plugin.zsh
# shellcheck disable=SC2148
# shellcheck disable=SC2034
# okta-aws plugin for oh-my-zsh
# for use with the bullet-train oh-my-zsh theme: https://github.com/caiogondim/bullet-train.zsh
# (although this could be easily changed)
# Irving Popovetsky <irving@chef.io>
# default profile is used if you don't set one using AWS_PROFILE, which is recommended
OKTA_AWS_DEFAULT_PROFILE="chef-engineering"
@irvingpop
irvingpop / Install-DockerOnWS2016ByDSC.ps1
Created August 10, 2018 21:16 — forked from PlagueHO/Install-DockerOnWS2016ByDSC.ps1
Install Docker on Windows Server 2016 RTM using DSC
View Install-DockerOnWS2016ByDSC.ps1
Configuration ContainerHostDsc
{
# Set up general parameters used to determine paths where Docker will
# be installed to and downloaded from.
$ProgramFiles = $ENV:ProgramFiles
$DockerPath = Join-Path -Path $ProgramFiles -ChildPath 'Docker'
$DockerZipFileName = 'docker.zip'
$DockerZipPath = Join-Path -Path $ProgramFiles -ChildPath $DockerZipFilename
$DockerUri = 'https://download.docker.com/components/engine/windows-server/cs-1.12/docker.zip'
@irvingpop
irvingpop / travis.yml
Last active May 8, 2018 04:19
Example Travis config to build, smoketest and publish a hab package as a docker container
View travis.yml
sudo: required
dist: trusty
services: docker
language: bash
install:
- 'curl https://raw.githubusercontent.com/habitat-sh/habitat/master/components/hab/install.sh | sudo bash'
branches:
only:
@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.
View README.md

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 / launch_ec2_windows_spot.sh
Last active June 18, 2018 18:47
Quickly launch and preconfigure a Windows 2016 dev machine in AWS with spot pricing, from your mac
View launch_ec2_windows_spot.sh
#!/bin/bash -ex
# Quickly launch and preconfigure a Windows 1803 dev machine in AWS with spot pricing, from your mac
usage='
launch_ec2_windows_spot.sh --username irving --password Cod3Can! --ssh-key irving --subnet subnet-7fd06308 --security-group-id sg-8a0f82f5
NOTE: Due to a weird assumption in the UserData script, the password must be exactly 8 characters long and meet complexity requirements
NOTE2: Create a SECURITY_GROUP_ID that allows port 3389 from your IP address
NOTE3: Install Microsoft Remote Desktop 10 from the app store ( https://itunes.apple.com/us/app/microsoft-remote-desktop-10/id1295203466?mt=12 )
'
@irvingpop
irvingpop / .gitignore
Last active January 30, 2023 22:31
Launch EC2 spot instances with tags, like a boss
View .gitignore
MY_INSTANCEID
MY_SERVER
user-data.txt
.zshrc
.gitconfig
.ssh
.byobu
.oh-my-zsh
@irvingpop
irvingpop / ssh_key.tf
Last active March 2, 2023 00:45
Terraform external data source example - dynamic SSH key generation
View ssh_key.tf
# 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}"
View fix_notifications_binds.patch
From 4fb2f312c60cd10f57c08051d4243d3e62b1fbfb Mon Sep 17 00:00:00 2001
From: Irving Popovetsky <irving@chef.io>
Date: Fri, 18 Aug 2017 13:05:55 -0700
Subject: [PATCH] Fix notifications habitat binds so that they can be optional
and remove an unneeded one for database
---
diff --git a/notifications/habitat/config/env b/notifications/habitat/config/env
index faa23c642..19d70da22 100644
--- a/notifications/habitat/config/env