Skip to content

Instantly share code, notes, and snippets.

View larrycai's full-sized avatar
💭
I may be slow to respond.

Larry Cai larrycai

💭
I may be slow to respond.
View GitHub Profile
@larrycai
larrycai / ipv6-httpd.py
Created August 24, 2022 06:15 — forked from akorobov/ipv6-httpd.py
quick ipv6 http server using python's SimpleHttpServer
import socket
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
class MyHandler(SimpleHTTPRequestHandler):
def do_GET(self):
if self.path == '/ip':
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.end_headers()
@larrycai
larrycai / argo-workflow-template-ref.yaml
Created June 17, 2022 09:21
argoworkflow templateref using variable
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: hello-world-at-v0.1.0
spec:
templates:
- name: hello-world
inputs:
parameters:
- name: msg
@larrycai
larrycai / argo-workflow-for-ci.md
Last active May 28, 2022 15:37
argo workflow for normal CI flow

It is for discussiion in argo-workflows forum

Introduction

It is just my understanding now, can be totally wrong ;-)

Here gives a short explanation for user wants to use argo workflow as alternative for your CI framework (gitlab-ci, github actions, travis-ci, jenkins)

argo workflow is not a complete CI solution, it needs other compoments to fullfil your tasks. it is cloud native workflow execution engine

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import requests
import json
import re
# https://stackoverflow.com/questions/27981545/suppress-insecurerequestwarning-unverified-https-request-is-being-made-in-pytho
from requests.packages.urllib3.exceptions import InsecureRequestWarning
@larrycai
larrycai / 0601.md
Created June 1, 2021 06:29
markdown.md

6.西交一队 3.成中医二队 11.西交二队 7.地鼠队 14.混合队 8.南通大学队 5.龙岩学院二队 1.中山大学队 2.成中医一队 4.龙岩学院一队 13.绵阳师范学院队 9.西交三队 10.华南农业大学队 12.武汉大学队

@larrycai
larrycai / tcp-services.yaml
Created October 26, 2020 07:33 — forked from chrisedrego/tcp-services.yaml
Ingress TCP Configuration for MYSQL
apiVersion: v1
data:
"3306": mysql/mysql-service:3306
kind: ConfigMap
metadata:
name: tcp-services
namespace: ingress-nginx
@larrycai
larrycai / mysql-ingress.yaml
Created October 26, 2020 07:33 — forked from chrisedrego/mysql-ingress.yaml
Ingress defintion for mysql
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/server-alias: mysql.<YOUR_DOMAIN>.com
labels:
app: mysql
name: mysql
#!/bin/env python
# https://towardsdatascience.com/stop-waiting-start-using-async-and-await-18fcd1c28fd0
# docker run -it -v $PWD:/src -w /src python:3.7-slim
# pip install aiohttp asyncio requests
import aiohttp
import asyncio
import time
from typing import Any, Iterable, List, Tuple, Callable
@larrycai
larrycai / Jenkinsfile
Created September 6, 2017 19:43 — forked from abayer/Jenkinsfile
An example Declarative Pipeline Jenkinsfile for Feb 15 2017 demo
// A Declarative Pipeline is defined within a 'pipeline' block.
pipeline {
// agent defines where the pipeline will run.
agent {
// This also could have been 'agent any' - that has the same meaning.
label ""
// Other possible built-in agent types are 'agent none', for not running the
// top-level on any agent (which results in you needing to specify agents on
// each stage and do explicit checkouts of scm in those stages), 'docker',
@larrycai
larrycai / nginx-pod.yaml
Created July 24, 2017 11:42
nginx simple pod yaml file
---
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
containers:
- name: nginx
image: nginx
ports: