1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-11-24 20:41:31 +01:00

add dockertags() function

This commit is contained in:
bretello 2020-02-14 16:37:50 +01:00
parent a94fb316c1
commit e2e4d1cda8
2 changed files with 19 additions and 3 deletions

View File

@ -46,13 +46,14 @@ in your .zshrc. This requires antigen installed.
0. `cheat`, show cheat sheet for commands using cheat.sh (`cheat commandname`)
1. Quickly edit/reload profile (`esource`/`resource`)
2. `ramdisk` (only on OSX) create a RAM disk. Default size: 1GB
2. `dockertags` list all tags for a given docker image
3. `ramdisk` (only on OSX) create a RAM disk. Default size: 1GB
` ramdisk 4`
creates a 4GB RAM disk
3. `color` to print colored text (see 3. in the Misc section):
4. `color` to print colored text (see 3. in the Misc section):
color $Red "This will be printed in red"
color $Yellow "This will be printed in red"
4. `mecp` to copy files back to the machine from wich you are ssh-ing.
5. `mecp` to copy files back to the machine from wich you are ssh-ing.
For this to work an ssh tunnel with Remoteforward is needed:
ssh -R 22:localhost:2222 YOURHOSTNAMEHERE
or specify this in ~/.ssh/config:

View File

@ -17,6 +17,21 @@ function cheatall
{
curl "https://cheat.sh/~$1"
}
# List all docker tags for an image
function dockertags
{
if [[ -z `which jq` ]]; then
echo "jq not installed. Please install jq." 1>&2
return
fi
i=0
while [[ $? == 0 ]]; do
i=$(($i+1))
curl "https://registry.hub.docker.com/v2/repositories/library/$1/tags/?page=$i" 2>/dev/null | jq '."results"[]["name"]'
done
}
## Simple calculator. Usage: calc 1+1, calc 5/7, calc "sqrt(2)"
function calc
{