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
#!/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 August 29, 2015 14:27
Some groovy scripts for running jobs which executed time is longer than expected, also waiting time in queue
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 June 24, 2017 00:09
CodingWithMe Learn JobDSL for Jenkins in 90 minutes
freeStyleJob("Hello3") {
logRotator(2, 30)
scm {
git('https://github.com/larrycai/docker-images.git')
}
triggers {
scm('H/15 * * * *')
}
wrappers {
preBuildCleanup()
@larrycai
larrycai / README.md
Created April 2, 2015 00:25
RabbitMQ + Python in docker
@larrycai
larrycai / Dockerfile
Created March 19, 2015 15:16
Simple Dockefile
FROM ubuntu:trusty
RUN apt-get update && apt-get install -y apache2
@larrycai
larrycai / Dockerfile
Created July 4, 2014 00:21
docker's Dockerfile
FROM ubuntu:latest
RUN apt-get update
MAINTAINER Larry Cai "larry.caiyu@gmail.com"
RUN apt-get install -y curl make
RUN curl https://get.docker.io/builds/Linux/x86_64/docker-latest -o /usr/local/bin/docker
RUN chmod +x /usr/local/bin/docker
@larrycai
larrycai / README.mkd
Last active August 29, 2015 14:02
rpmbuild for auto-create buildroot

rpmbuild

Check how to build the rpm package from existing packages

$ tar -zcvf ~/wget.tar.gz /usr/bin/wget
$ rpm -bb wget.spec

I got message like below, my questions is why line mkdir /home/larry/rpmbuild/BUILDROOT/wget-1.12-1.x86_64 is executed automatically

Since in the redhat 6.4 docker container, the folder will not be created automatically

@larrycai
larrycai / README.mkd
Last active September 5, 2019 14:20
log sample dashing widget
@larrycai
larrycai / README.markdown
Last active September 16, 2022 03:59
check the plugin usage in jenkins
@larrycai
larrycai / ci.coffee
Created January 16, 2014 05:20
it is jenkins coffeescript used for hubot, it use jenkins-api nodejs module.
# Description:
# Interact with your Jenkins CI server
#
# Dependencies:
# None
#
# Configuration:
# HUBOT_JENKINS_HOST
# HUBOT_JENKINS_AUTH
#