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 / run-multiple-docker-version-with-dind.md
Created January 27, 2016 08:37
Run multiple docker version with `dind`

1.pull docker image https://hub.docker.com/r/library/docker/

docker daemon image (docker in docker)

docker pull  docker:1.8-dind      # base image docker:1.8
docker pull  docker:1.9-dind      # base image docker:1.9
docker pull  docker:1.10-rc-dind  # base image docker:1.10-rc

docker client image

@Jimmy-Xu
Jimmy-Xu / dns tuning ssh login speedup vagrant
Created February 1, 2016 02:37 — forked from jedi4ever/dns tuning ssh login speedup vagrant
speeding up DNS/SSH connections in vagrant
- Tune /etc/ssh/sshd_config
UseDNS no # Disable DNS lookups
GSSAPIAuthentication no # Disable negotation of slow GSSAPI
don't forget to restart it, use a script provider to set it , or create it with veewee or snapshot it
- Tune Vagrantfile
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
@Jimmy-Xu
Jimmy-Xu / sslocal
Created February 4, 2016 06:20
/etc/init.d/sslocal
#!/bin/bash
set -e
### BEGIN INIT INFO
# Provides: sslocal
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
@Jimmy-Xu
Jimmy-Xu / shadowsocks_privoxy_tsocks.md
Last active April 29, 2022 15:00
shadowsocks+privoxy/tsocks

shadowsocks + privoxy/tsocks

  • shadowsocks: service, socks proxy
  • privoxy: service, convert socks proxy to http proxy
  • tsocks: tool, use socks proxy for any command line

Usage

tested under ubuntu14.04

@Jimmy-Xu
Jimmy-Xu / sslocal.service
Created February 20, 2016 14:46 — forked from ygmpkk/sslocal.service
ShadowSocks Client Systemd Service
[Unit]
Description=Daemon to start Shadowsocks Client
Wants=network-online.target
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/sslocal -c /etc/shadowsocks/client.json --pid-file /var/run/sslocal.pid --log-file /var/log/sslocal.log
[Install]
@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 / run-openvpn-on-hyper.md
Last active December 22, 2017 07:21
Run OpenVPN on Hyper.sh
  1. openvpn client(localhost) -> openvpn server(hyper container)
  2. openvpn client(hyper container) -> openvpn server(hyper container) #different hyper account
$ docker search openvpn | head -n 5
NAME                           DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
kylemanna/openvpn              OpenVPN server in a Docker container compl...   316                  [OK]
haugene/transmission-openvpn   Docker container which runs Transmission t...   47                   [OK]
dperson/openvpn-client                                                         29                   [OK]
@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