Skip to content

Instantly share code, notes, and snippets.

@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

#!/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"
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
@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
@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 / System Design.md
Created September 3, 2016 00:36 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@markhuyong
markhuyong / .bash_profile
Created September 2, 2016 11:50 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@markhuyong
markhuyong / The Technical Interview Cheat Sheet.md
Created September 2, 2016 11:35 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.