Skip to content

Instantly share code, notes, and snippets.

View argo-images.py
#!/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
View 0601.md

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

@larrycai
larrycai / tcp-services.yaml
Created Oct 26, 2020 — forked from chrisedrego/tcp-services.yaml
Ingress TCP Configuration for MYSQL
View tcp-services.yaml
apiVersion: v1
data:
"3306": mysql/mysql-service:3306
kind: ConfigMap
metadata:
name: tcp-services
namespace: ingress-nginx
@larrycai
larrycai / mysql-ingress.yaml
Created Oct 26, 2020 — forked from chrisedrego/mysql-ingress.yaml
Ingress defintion for mysql
View mysql-ingress.yaml
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
View aio.py
#!/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 Sep 6, 2017 — forked from abayer/Jenkinsfile
An example Declarative Pipeline Jenkinsfile for Feb 15 2017 demo
View Jenkinsfile
// 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 Jul 24, 2017
nginx simple pod yaml file
View nginx-pod.yaml
---
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
View next_execution.py
#!/usr/bin/env python
import sys
import urllib2
import ssl
import lxml
import lxml.html
CTX = ssl.create_default_context()
CTX.check_hostname = False
CTX.verify_mode = ssl.CERT_NONE
@larrycai
larrycai / long_duration.groovy
Last active Aug 29, 2015
Some groovy scripts for running jobs which executed time is longer than expected, also waiting time in queue
View long_duration.groovy
import groovy.json.JsonBuilder
import org.apache.commons.httpclient.*
import org.apache.commons.httpclient.methods.*
import hudson.model.Queue.Executable
int WARNING_DURATION_IN_SECONDS = 100 * 2 // 6 hours
dashing_url="http://172.17.0.2:3030/widgets/events"
def busyExecutors = Jenkins.instance.computers
.collect {
@larrycai
larrycai / complete.groovy
Last active Jun 24, 2017
CodingWithMe Learn JobDSL for Jenkins in 90 minutes
View complete.groovy
freeStyleJob("Hello3") {
logRotator(2, 30)
scm {
git('https://github.com/larrycai/docker-images.git')
}
triggers {
scm('H/15 * * * *')
}
wrappers {
preBuildCleanup()