Skip to content

Instantly share code, notes, and snippets.

View Jimmy-Xu's full-sized avatar

Jimmy Xu Jimmy-Xu

  • Ant Group
  • Beijing, China
View GitHub Profile
@Jimmy-Xu
Jimmy-Xu / zabbix-alert-smtp.sh
Created April 16, 2016 01:57 — forked from superdaigo/zabbix-alert-smtp.sh
Zabbix SMTP Alert script for gmail
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Zabbix SMTP Alert script for gmail.
"""
import sys
import smtplib
from email.MIMEText import MIMEText
from email.Header import Header
@Jimmy-Xu
Jimmy-Xu / docker cli log for docker-slaves-plugin.md
Created July 20, 2016 07:38
docker-slaves-plugin build job时,调用的docker cli列表
//所需容器:
- plumbing容器: plumbing 'jenkins-slave' container
- build容器:    user's build container


//创建data volume
[launchDockerCLI()] caller => CliDockerDriver.java - it.dockins.dockerslaves.drivers.CliDockerDriver - createVolume()
----------------------------
@Jimmy-Xu
Jimmy-Xu / jdk_download.sh
Created July 22, 2016 17:13 — forked from P7h/jdk_download.sh
Script to download JDK / JRE / Java binaries from Oracle website from terminal / shell / command line / command prompt
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget.
### You can download all the binaries one-shot by just giving the BASE_URL.
### Script might be useful if you need Oracle JDK on Amazon EC2 env.
### Script is updated for every JDK release.
### Features:-
# 1. Resumes a broken / interrupted [previous] download, if any.
# 2. Renames the file to a proper name with including platform info.

Intercom user_hash

Remember that your secret key should never be exposed to the public

  • So Javascript code below should only be used for testing unless modified and used to run on a server
@Jimmy-Xu
Jimmy-Xu / test-hyper-sg-win10.md
Last active September 20, 2016 08:54
Test hyper sg sub-command in Windows 10

【测试步骤】

1. 创建jenkins-server-no-sg容器(无sg),分配fip,可以访问8080
2. 创建sg-50000
3. 创建jenkins-server-with-sg容器(带sg-50000),分配fip,无法访问8080
4. 创建sg-8080,添加到jenkins-server-with-sg容器上,可以访问8080
5. 从jenkins-server-with-sg移除sg-8080,无法访问8080
6. 用sg-jenkins-create.yaml创建sg-jenkins,添加到jenkins-server-with-sg容器上,无法访问8080
7. 用sg-jenkins-update.yaml更新sg-jenkins,可以访问8080
8. 从容器jenkins-server-with-sg移除sg-jenkins,无法访问8080
@Jimmy-Xu
Jimmy-Xu / codefresh-compose-up.log
Created September 26, 2016 16:18
codefresh compse up log
stop all
Gathering containers information
sessionId rkinjsit, self.session.sessionId rkinjsit
[list method] detected 0 containers
Pulling xjimmyshcn/hyperkins:be0232ac35d96b4cbb0113e1444165882a3b9051
Starting to pull from local registry
Layer '6a5a5368e0c2' already exists
...
Layer 'eccda1695d2b' already exists
Image pull took: 953 ms
@Jimmy-Xu
Jimmy-Xu / codefresh-integration-test.log
Last active September 26, 2016 16:40
codefresh run integration test result
Pulling cf-integration image...
Creating machine
zone: us-central1-a
type: n1-standard-4
Creating CA: /root/.docker/machine/certs/ca.pem
Creating client certificate: /root/.docker/machine/certs/cert.pem
Running pre-create checks...
(cf-integration-201609261611-050151665) Check that the project exists
(cf-integration-201609261611-050151665) Check if the instance already exists
Creating machine...
@Jimmy-Xu
Jimmy-Xu / interfaces.groovy
Created September 27, 2016 16:50 — forked from djKianoosh/interfaces.groovy
List out network interfaces
def interfaces = NetworkInterface.getNetworkInterfaces()
while (interfaces.hasMoreElements()) {
def addresses = interfaces.nextElement().getInetAddresses()
while (addresses.hasMoreElements()) {
println addresses.nextElement().getHostAddress()
}
}
@Jimmy-Xu
Jimmy-Xu / README.md
Created October 24, 2016 12:08 — forked from julianxhokaxhiu/README.md
How to install OSX 10.11 El Capitan on VMWare

How to install OSX 10.11 El Capitan on VMWare

To accomplish this tutorial you already need a previous copy of OSX installed on VMWare Player or Workstation.

0) Acquire a copy of OSX 10.11 El Capitan

First of all you need to acquire a legal copy of OSX El Capitan from the App Store. This tutorial will not cover this part. Sorry :)

1) Unlock OSX option on VMWare

Download the latest version of VMWare Unlocker and use the relative binary to unlock it ( based on your Host OS ).

@Jimmy-Xu
Jimmy-Xu / hyper-cron-test.md
Last active November 12, 2016 16:13
hyper cron test

command line help

$ hyper cron

/usr/bin/hyper: "cron" requires a minimum of 1 argument.
See '/usr/bin/hyper cron --help'.

Usage:	hyper cron [OPTIONS] COMMAND [OPTIONS]

Commands: