Skip to content

Instantly share code, notes, and snippets.

View ry4nz's full-sized avatar

Ryan Zhang ry4nz

View GitHub Profile
To install MKE, make sure you have `docker` installed on your VM. Then run the following command
docker run --rm -it --name ucp -v /var/run/docker.sock:/var/run/docker.sock \
mirantis/ucp:3.4.1 \
install \
--swarm-port 3376 --admin-password supersecret
@ry4nz
ry4nz / win-webserver.yaml
Created April 28, 2020 14:17
wargame yaml
# win-webserver.yaml
apiVersion: v1
kind: Service
metadata:
name: win-webserver
namespace: demo
labels:
app: win-webserver
spec:
ports:
// Generated by curl-to-Go: https://mholt.github.io/curl-to-go
// TODO: This is insecure; use only in dev environments.
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
client := &http.Client{Transport: tr}
req, err := http.NewRequest("GET", "https://api.pro.coinbase.com/products", nil)
@ry4nz
ry4nz / gitflow.md
Created September 25, 2019 16:02
Keep main repo clean
# Make the main repo clean of branches and use people repo.
git clone git@github.com:ry4nz/enzi.git
cd enzi
git remote add upstream git@github.com:docker/enzi.git
git fetch upstream
git checkout -b new-feature upstream/master
git commit -m "commit message"
git push origin new-feature
hub pull-request

Keybase proof

I hereby claim:

  • I am ry4nz on github.
  • I am ryanzhang (https://keybase.io/ryanzhang) on keybase.
  • I have a public key ASAj_wT0kHRUEDoFX46ELalIwe9OkG8d6eehkPE8igHWrgo

To claim this, I am signing this object:

#!/usr/bin/env bash
export HOST=
export TOKEN=
# Add user Robin
curl -k -X POST https://${HOST}/enzi/v0/scim/v2/Users -H 'Authorization: Bearer ${TOKEN}' -H 'Content-Type: application/json' -d '{"userName":"robin","Name":{"givenName":"Robin","familyName":"Rivas","formatted":"Robin Rivas"},"Emails":[{"value":"robin@company.com","type":"","primary":false}],"active":true}'
curl -k -X GET https://${HOST}/enzi/v0/scim/v2/Users/234948b5-f9be-4ffb-b95c-d75f69711c4c -H 'Authorization: Bearer ${TOKEN}'
curl -k -X GET https://${HOST}/enzi/v0/scim/v2/Users \
-H 'Authorization: Bearer ${TOKEN}'
# show all PRs that is merged between two tags
git log --merges --pretty=oneline --abbrev-commit --grep="Merge pull request #" release/v3.0.0..upstream/release/v3.0.1-branch --no-decorate | awk -F" " '{print $5}'
# delete a remote branch
git push upstream --delete release/v2.2.8-branch
# Pull UCP images
export TAG=3.1.1
docker pull docker/ucp:${TAG}
docker run --rm docker/ucp:${TAG} images --list | xargs -L 1 docker pull
@ry4nz
ry4nz / gist:13795dbd1e82f0f392c217c899c9ec7a
Last active February 6, 2017 23:37
How service providers using SAML
Slack: https://get.slack.help/hc/en-us/articles/203772216-SAML-single-sign-on
Zoom: https://support.zoom.us/hc/en-us/articles/201363003-Getting-Started-with-SSO
Blue Jeans: http://na38.salesforce.com/_ui/selfservice/pkb/PublicKnowledgeSolution/d?orgId=00DE0000000IOFe&id=501E000000090rI&retURL=%2Fsol%2Fpublic%2Fsolutionbrowser.jsp%3Fsearch%3Dsso%26cid%3D000000000000000%26orgId%3D00DE0000000IOFe%26t%3D4&ps=1