Skip to content

Instantly share code, notes, and snippets.

@nyetwurk
Created August 10, 2018 16:03
Show Gist options
  • Save nyetwurk/9c1323f27fd8fd7b72382b3af17cd070 to your computer and use it in GitHub Desktop.
Save nyetwurk/9c1323f27fd8fd7b72382b3af17cd070 to your computer and use it in GitHub Desktop.
#!/bin/bash
HERE=$(dirname $0)
SED="sed -r s/[[:blank:]]+/,/g"
function lxd-images()
{
# snap install lxd
lxc image list -c fl --format csv
}
# Google
function goc-images()
{
# https://cloud.google.com/sdk/docs/#install_the_latest_cloud_tools_version_cloudsdk_current_version
gcloud compute images list --project=blockdaemon-development --filter=local-dev | $SED
}
# Amazon
function aws-images()
{
# sudo aptitude install awscli
for region in `aws ec2 describe-regions --output text | cut -f3`; do
OUT=$(aws ec2 describe-images --owners=self --filters Name=name,Values="*-local-dev-*" --output text --region $region | grep IMAGES | cut -f6,9,10 | $SED)
if [ ! -z "$OUT" ]; then
echo "$OUT,$region"
fi
done
}
# Digital ocean
function doc-images()
{
# snap install doctl
doctl compute image list --format ID,Name | grep -- -local-dev- | $SED
}
function arts-images()
{
pushd $HERE/.. > /dev/null
./task-run.sh cloudarts list vmimage 2>/dev/null | $SED
popd > /dev/null
}
@nyetwurk
Copy link
Author

nyetwurk commented Aug 10, 2018

$ ./image-list
LXD images:
4254d309b300,
6713f23c814b,ethpub-nyet-local-dev-1533250144
8e645e6c3298,ethpub-nyet-local-dev-1533229406
a1b8c664312b,ethpub-nyet-local-dev-1533249428
b0fd9d49d47b,ethpub-nyet-local-dev-1533165331
b973786af399,ethpub-nyet-local-dev-1533231144
GOC images:
ethpub-nyet-local-dev-1532449850,blockdaemon-development,blockdaemon-ethpub,READY
ethpub-nyet-local-dev-1532450603,blockdaemon-development,blockdaemon-ethpub,READY
ethpub-nyet-local-dev-1532451276,blockdaemon-development,blockdaemon-ethpub,READY
ethpub-nyet-local-dev-1532649481,blockdaemon-development,blockdaemon-ethpub,READY
ethpub-nyet-local-dev-1533850248,blockdaemon-development,blockdaemon-ethpub,READY
DOC images:
37056282,ethpub-nyet-local-dev-1533853166
AWS images:
ami-03e354d908eb2f619,ethpub-nyet-local-dev-1533855372,377710252760,ap-northeast-1
ami-083150c18aaedcbfe,ethpub-nyet-local-dev-1533855372,377710252760,eu-central-1
ami-0c3da9e7a1e13e5de,ethpub-nyet-local-dev-1533855372,377710252760,us-east-1
db images:
1533856373,ethpub,AWS,us-east-1,ami-0c3da9e7a1e13e5de,nyet-local-dev,true,false,false
1533856373,ethpub,AWS,eu-central-1,ami-083150c18aaedcbfe,nyet-local-dev,true,false,false
1533856373,ethpub,AWS,ap-northeast-1,ami-03e354d908eb2f619,nyet-local-dev,true,false,false
1533853820,ethpub,DOC,37056282,nyet-local-dev,true,false,false
1533850746,ethpub,GOC,ethpub-nyet-local-dev-1533850248,nyet-local-dev,true,false,false
1533250949,ethpub,LXD,6713f23c814b4f571835c0989acf430be3dde7f218222f9ff5270039a2285eb1,nyet-local-dev,true,false,false
1533250108,ethpub,LXD,a1b8c664312b5256ebf4faa754ce10ce3f2ec5fa3aaf5e78814490252230eaf6,nyet-local-dev,true,false,false
1533231892,ethpub,LXD,b973786af399269b949b7b8ca23c7dc541521b1af647ae715664612def3ff692,nyet-local-dev,true,false,false
1533230153,ethpub,LXD,8e645e6c329858cb972cb911733a0e8a6a33bc08ae2a925d99fa1673416c4eb2,nyet-local-dev,true,false,false
1533165867,ethpub,LXD,b0fd9d49d47ba996759e96ca4fec20417c2f3304c241dc26727263f170cced88,nyet-local-dev,true,false,false
1532649935,ethpub,GOC,ethpub-nyet-local-dev-1532649481,nyet-local-dev,true,false,false
1532451785,ethpub,GOC,ethpub-nyet-local-dev-1532451276,nyet-local-dev,true,false,false
1532451098,ethpub,GOC,ethpub-nyet-local-dev-1532450603,nyet-local-dev,true,false,false
1532450327,ethpub,GOC,ethpub-nyet-local-dev-1532449850,nyet-local-dev,true,false,false
1531321484,ethpub,GOC,ethpub-nyet-local-dev-1531321024,nyet-local-dev,true,false,false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment