Skip to content

Instantly share code, notes, and snippets.

@cbron
cbron / images.sh
Created June 18, 2020 23:06 — forked from alena1108/images.sh
images digests generation
while read in
do
docker pull "$in"
repo=$(echo $in | cut -f1 -d/)
image_tmp=$(echo $in | cut -f2 -d/)
image=$(echo $image_tmp | cut -f1 -d:)
tag=$(echo $image_tmp | cut -f2 -d:)
docker images --digests | grep "$image" | grep "$repo" | grep "$tag" | awk '{print "| " $1 ":" $2 " | " $3 " |"}' | sed 's/| //g' | sed 's/ |//g' >> rancher-images-digests.txt
docker rmi "$in"
done < rancher-images.txt
@cbron
cbron / k3dStart.sh
Last active November 13, 2019 15:10 — forked from daxmc99/k3dStart.sh
k3d local development script
#!/bin/bash
#set -x
#set -e
# Run with: k3dStart test
# This will remove and recreate a k3s cluster named test
[[ -z "$1" ]] && { echo "You must specify a cluster name" ; exit 1; }
name=$1
@cbron
cbron / instance-types.sh
Last active August 22, 2019 18:22 — forked from trestletech/instance-types.sh
Check a specific EC2 Instance Type in All Availability Zones
#!/bin/bash
check_instance_type="m5.large"
product_description="Linux/UNIX"
echo > instance-types.csv
echo "Getting list of Availability Zones"
all_regions=$(aws ec2 describe-regions --region us-east-1 --output text --query 'Regions[*].[RegionName]' | sort)
all_az=()
@cbron
cbron / reddit.py
Last active December 18, 2015 15:49 — forked from cbronazc/gist:5767996
#!/usr/bin/env python
import json
import urllib2
running = True
hdr = { 'User-Agent' : 'Someone is browsing reddit on their console' }
print "`exit` exits"
while running:
sub = str(raw_input("Enter a subreddit: "))