Skip to content

Instantly share code, notes, and snippets.

@markhuyong
markhuyong / explain
Created November 20, 2018 07:05
explain shell in command line
#!/bin/bash
# explain.sh begins
explain () {
if [ "$#" -eq 0 ]; then
while read -p "Command: " cmd; do
curl -Gs "https://www.mankier.com/api/explain/?cols="$(tput cols) --data-urlencode "q=$cmd"
done
echo "Bye!"
elif [ "$#" -eq 1 ]; then
curl -Gs "https://www.mankier.com/api/explain/?cols="$(tput cols) --data-urlencode "q=$1"
@markhuyong
markhuyong / .editorconfig
Created January 30, 2019 05:55
unicloud editconfig
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
image=$1
echo $1
img=`echo $image | sed 's/k8s\.gcr\.io/anjia0532\/google-containers/g;s/gcr\.io/anjia0532/g;s/\//\./g;s/ /\n/g;s/_/-/g;s/anjia0532\./anjia0532\//g' | uniq | awk '{print ""$1""}'`
echo "docker pull $img"
docker pull $img
echo "docker tag $img $image"
docker tag $img $image
#!/bin/bash
uri=$1
echo $uri
echo -e "[Service]\nExecStart=\nExecStart=/usr/bin/dockerd -H fd:// --insecure-registry $uri" | sudo SYSTEMD_EDITOR=tee systemctl edit docker
sudo systemctl daemon-reload || failed "failed to reload docker"
sudo systemctl restart docker || failed "failed to restart docker"
sudo systemctl status docker || failed "failed to status docker"
@markhuyong
markhuyong / diagrams.md
Created May 12, 2022 08:03 — forked from yhatt/diagrams.md
Marp diagram plugin example (Powered by kroki.io)
marp theme
true
default

Marp diagram plugin example

Powered by kroki.io