Skip to content

Instantly share code, notes, and snippets.

@lalyos
lalyos / README.md
Last active August 6, 2018 22:05
k8s with curl
curl -s -k \
  --cert ~/.minikube/client.p12 \
  --key  ~/.minikube/client.key \
  --pass tcuser \
  https://192.168.64.8:8443/api/v1/pods \
    |jq '.items[].metadata.name'
@lalyos
lalyos / pwd-api.md
Last active March 15, 2018 22:03
play with docker API pwd

save session id

export SESSION=balei8na02jg00e4suhg

create instance:

curl https://labs.play-with-docker.com/sessions/$SESSION/instances -X POST
@lalyos
lalyos / worshop.md
Last active January 30, 2018 18:06
docker hybrid workshop
@lalyos
lalyos / bash-prompt-with-git-branch.md
Created January 29, 2018 20:35
bash prompt PS1 with actual git branch
export PS1="${debian_chroot:+($debian_chroot)}\u@\h:\w\$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/')\$"
@lalyos
lalyos / Readme.md
Created January 17, 2018 13:58
Golang Training gist play playground examples
@lalyos
lalyos / azure-resources.sh
Created January 5, 2018 16:48
azure cli script
az group list --query '[].{name:name,loc:location}' --output table
az vm list --query '[].{name:name,rg:resourceGroup,loc:location}' --output table
@lalyos
lalyos / k8s-isuue.md
Last active January 4, 2018 18:12
docker-for-mac k8s issue

After my DockerForMac update itself to Version 17.12.0-ce-rc4-mac44 (21438) k8s is not starting.

Exited containers

after nsentering the VM, i found 2 containers exiting:

/ # docker ps --filter status=exited
CONTAINER ID        IMAGE                                           COMMAND                  CREATED             STATUS                            PORTS               NAMES
b2b6f7eba42e        gcr.io/google_containers/kube-apiserver-amd64   "kube-apiserver --ad…"   2 minutes ago       Exited (255) About a minute ago                       k8s_kube-apiserver_kube-apiserver-docker-for-desktop_kube-system_9999fff5022435b112a99158001bcaa3_10
@lalyos
lalyos / hexa.md
Created December 28, 2017 14:13
hexa dump cli bash

a self note about hexa dumps:

hexdump

default formatting, with address prefix:

$ hexdump .git/objects/b6/fc4c620b67d95f953a5c1c1230aaab5db5a1b0
0000000 78 01 4b ca c9 4f 52 30 65 c8 48 cd c9 c9 07 00
0000010 19 aa 04 09                                    
0000014
@lalyos
lalyos / download-alpine-tar.sh
Last active March 15, 2018 21:40
docker registry donload alpine layer blob
token() {
scope=${1:?scope required}
export T=$(curl -s 'https://auth.docker.io/token?service=registry.docker.io&scope=repository:'$scope | jq .token -r; )
}
blobUrl() {
repo=${1:?required repo (library/alpine)}
token ${repo}:pull
export BLOBURL=$(curl -Lsi -H "Authorization: Bearer $T" https://registry-1.docker.io/v2/library/alpine/blobs/${BLOB}| sed -n '/^Location:/ {s/.$//;s/Location: //p;}')
echo BLOBURL=$BLOBURL