Skip to content

Instantly share code, notes, and snippets.

View imran-baig-se's full-sized avatar

Imran Baig imran-baig-se

View GitHub Profile
@imran-baig-se
imran-baig-se / ipassign
Created December 31, 2017 11:48 — forked from jsianes/ipassign
Script to assign Public IP from Elastic IP pool for instances hosted in AWS. 'ec2-utils' and AWS CLI packages required. Instance role or access keys need to allow at least next EC2 actions: describe-addresses, associate-address and disassociate-address. Shell script is designed to be integrated with instance start-up
#!/bin/bash
# chkconfig: 2345 99 10
# description: Set Public IP from ElasticIP pool during instance startup
# processname: ipassign
# Provides: ipassign
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Set Public IP from ElasticIP pool during instance startup
@imran-baig-se
imran-baig-se / check_docker_tag.sh
Created August 19, 2017 08:44 — forked from ryanmaclean/check_docker_tag.sh
Check if Docker Image with Tag Exists
#!/bin/bash
# This script will check to see if a Docker image exists for a specific tag.
# Taken from here, with love: https://www.reddit.com/r/docker/comments/4hwdma/check_if_an_image_tag_for_a_private_repo_exists/
TOKEN=$( curl -sSLd "username=${DOCKER_HUB_USERNAME}&password=${DOCKER_HUB_PASSWORD}" https://hub.docker.com/v2/users/login | jq -r ".token" )
curl -sH "Authorization: JWT $TOKEN" "https://hub.docker.com/v2/repositories/${DOCKER_REPO}/tags/${DOCKER_TAG}/" | jq .
#{
# "name": "latest",
# "id": 780668,