-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathzshrc.custom.functions
More file actions
39 lines (32 loc) · 885 Bytes
/
zshrc.custom.functions
File metadata and controls
39 lines (32 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# my custom functions
# docker functions
function dstopall() {
docker stop -t 0 $(docker ps -a -q)
}
function drmall() {
docker rm -vf $(docker ps -a -q)
}
function drminone() {
docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
}
function drmiall() {
docker rmi -f $(docker images -a -q)
}
# restart services in docker-compose
function docker-compose-restart() {
docker-compose stop $@
docker-compose rm -f -v $@
docker-compose create --force-recreate $@
docker-compose start $@
}
# timestamp functions
function timestamp() {
date +%s
}
# k8s quick get all resources
function kubectlgetall {
for i in $(kubectl api-resources --verbs=list --namespaced -o name | grep -v "events.events.k8s.io" | grep -v "events" | sort | uniq); do
echo "Resource:" $i
kubectl -n ${1} get --ignore-not-found ${i}
done
}