Skip to content

Instantly share code, notes, and snippets.

@outofcoffee
outofcoffee / find-ecr-image.sh
Last active Mar 4, 2021
Check if Docker image exists with tag in AWS ECR
View find-ecr-image.sh
#!/usr/bin/env bash
# Example:
# ./find-ecr-image.sh foo/bar mytag
if [[ $# -lt 2 ]]; then
echo "Usage: $( basename $0 ) <repository-name> <image-tag>"
exit 1
fi
IMAGE_META="$( aws ecr describe-images --repository-name=$1 --image-ids=imageTag=$2 2> /dev/null )"
@ejmr
ejmr / git-branch-show-description.sh
Last active Apr 15, 2021
Show the Description for the Current Branch
View git-branch-show-description.sh
#!/bin/bash
#
# You can use `git branch --edit-description` to write a description
# for a branch, but Git provides no simple command to display that
# description. The "easiest" way to see it is via `git config --get
# branch.BRANCH_NAME.description`.
#
# This script automates that process and is meant to be used as
# a Git alias to provide a shorter command for showing the
# description of the current branch.
View gist:5fc18c659814c078378d
package main
import (
"net/http"
"database/sql"
"fmt"
"log"
"os"
)
@scottjacobsen
scottjacobsen / git+clone+ssh+agent+forward+sudo
Created Dec 14, 2012
Git clone using ssh agent forwarding and sudo
View git+clone+ssh+agent+forward+sudo
SSH agent forwarding is great. It allows you to ssh from one server to
another all the while using the ssh-agent running on your local
workstation. The benefit is you don't need to generate ssh key pairs
on the servers you are connecting to in order to hop around.
When you ssh to a remote machine the remote machine talks to your
local ssh-agent through the socket referenced by the SSH_AUTH_SOCK
environment variable.
So you the remote server you can do something like: