mirror of
https://git.decapod.one/brethil/dotfiles
synced 2024-11-22 03:21:30 +01:00
add dockertags() function
This commit is contained in:
parent
a94fb316c1
commit
e2e4d1cda8
|
@ -46,13 +46,14 @@ in your .zshrc. This requires antigen installed.
|
||||||
|
|
||||||
0. `cheat`, show cheat sheet for commands using cheat.sh (`cheat commandname`)
|
0. `cheat`, show cheat sheet for commands using cheat.sh (`cheat commandname`)
|
||||||
1. Quickly edit/reload profile (`esource`/`resource`)
|
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`
|
` ramdisk 4`
|
||||||
creates a 4GB RAM disk
|
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 $Red "This will be printed in red"
|
||||||
color $Yellow "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:
|
For this to work an ssh tunnel with Remoteforward is needed:
|
||||||
ssh -R 22:localhost:2222 YOURHOSTNAMEHERE
|
ssh -R 22:localhost:2222 YOURHOSTNAMEHERE
|
||||||
or specify this in ~/.ssh/config:
|
or specify this in ~/.ssh/config:
|
||||||
|
|
15
functions.sh
15
functions.sh
|
@ -17,6 +17,21 @@ function cheatall
|
||||||
{
|
{
|
||||||
curl "https://cheat.sh/~$1"
|
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)"
|
## Simple calculator. Usage: calc 1+1, calc 5/7, calc "sqrt(2)"
|
||||||
function calc
|
function calc
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user