Skip to content

Instantly share code, notes, and snippets.

View ademidoff's full-sized avatar
🎯
Focusing

Alex Demidoff ademidoff

🎯
Focusing
View GitHub Profile
@ademidoff
ademidoff / index.html
Created April 29, 2022 00:45
Minimalist Thermostat
<div class="t">
<div class="t__inner">
<div class="t__value">
<span class="t__digit" data-temp>-</span><span class="t__digit" data-temp>-</span><span class="t__degree">°</span>
</div>
<button class="t__drag" type="button" data-drag>
<span class="t__sr" data-temp-sr>--</span>
</button>
<svg class="t__arrows" width="256px" height="256px" viewBox="0 0 256 256">
<g fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" opacity="0.2">
@ademidoff
ademidoff / purge-ami-images
Created December 26, 2022 12:59
Purge AMI images and their snapshots
# get a list of AMI Images in a region
aws ec2 describe-images --owners self --filters "Name=tag:name,Values=PMM2 Server*" --region us-east-1 --output json | jq '.Images' > ~/IMAGES.json
# save just AMI IDs and their snapshot IDs
jq -r '.[] | .ImageId + " " + .BlockDeviceMappings[1].Ebs.SnapshotId' IMAGES.json > IMAGES_AND_SNAPSHOTS.txt
# first deregister the image
for AMI_ID in $(cat IMAGES_AND_SNAPSHOTS.txt); do
if [[ "$AMI_ID" =~ snap-* ]]; then
continue
@ademidoff
ademidoff / docker-tags.sh
Created December 14, 2023 15:43
List Docker Image Tags
#!/usr/bin/env bash
# Gets all tags for a given docker image.
# Examples:
# retrieve all tags for a single library
# docker-tags "library/redis"
### Keybase proof
I hereby claim:
* I am ademidoff on github.
* I am ademidoff (https://keybase.io/ademidoff) on keybase.
* I have a public key whose fingerprint is 30AB 3CC3 F763 49F7 E109 0A2F 5490 45C1 8579 B0EE
To claim this, I am signing this object:
@ademidoff
ademidoff / k8s-pmm.sh
Last active November 27, 2025 23:22
k8s-pmm
#!/bin/bash
set -e
# eksctl utils describe-stacks --region=us-east-2 --cluster=pmm-ha
# ClickHouse
#
# for i in {0..2}; do echo "pmm-ha-pmmdb-0-$i-0"; \
# kubectl exec "pmm-ha-pmmdb-0-$i-0" -n pmmha -- \
# clickhouse client --user=chuser --password=chpass --query "SHOW CREATE TABLE pmm.schema_migrations;"; \