Skip to content

Instantly share code, notes, and snippets.

@Jimmy-Xu
Jimmy-Xu / install-scribe-under-centos.sh
Last active Sep 30, 2015
scribe installation script on CentOS
View install-scribe-under-centos.sh
#!/bin/bash
#install scribe in docker container
echo '=================================================='
echo '===============Install necessary tools==============='
echo '=================================================='
yum update
yum install -y wget tar git make flex bison libtool autoconf automake openssl-devel libevent libevent-devel python-devel gcc-c++ byacc
@Jimmy-Xu
Jimmy-Xu / secure-k8s-api-server.md
Created Oct 22, 2015 — forked from yuanying/secure-k8s-api-server.md
Build a secure kubernetes api server
View secure-k8s-api-server.md

Build a secure kubernetes api server

Add Security Group

$ nova secgroup-add-rule \
       k8sbay-wlun44ixfi2o-secgroup_kubernetes-ahsiqsc4vgqj \
       tcp 6443 6443 0.0.0.0/0

CA

@Jimmy-Xu
Jimmy-Xu / install-comodo-ssl-cert-for-nginx.rst
Created Dec 9, 2015 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.
View install-comodo-ssl-cert-for-nginx.rst

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@Jimmy-Xu
Jimmy-Xu / setup-mysql.sh
Created Dec 29, 2015 — forked from sheikhwaqas/setup-mysql.sh
Install MySQL Server on Ubuntu (Non-Interactive Installation)
View setup-mysql.sh
# Download and Install the Latest Updates for the OS
apt-get update && apt-get upgrade -y
# Set the Server Timezone to CST
echo "America/Chicago" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
# Enable Ubuntu Firewall and allow SSH & MySQL Ports
ufw enable
ufw allow 22
@Jimmy-Xu
Jimmy-Xu / ftpserver.py
Created Jan 5, 2016 — forked from scturtle/ftpserver.py
simple ftp server by python
View ftpserver.py
#!/usr/bin/env python2
# coding: utf-8
import os,socket,threading,time
#import traceback
allow_delete = False
local_ip = socket.gethostbyname(socket.gethostname())
local_port = 8888
currdir=os.path.abspath('.')
@Jimmy-Xu
Jimmy-Xu / build-golang-with-docker.md
Last active Jan 20, 2016
利用golang:1.5.3的docker镜像重新编译golang源码
View build-golang-with-docker.md

下载go源码

$ cd ~
$ wget https://storage.googleapis.com/golang/go1.5.3.linux-amd64.tar.gz
$ tar xzvf go1.5.3.linux-amd64.tar.gz

覆盖( 否则缺少~/go/src/cmd/api )

$ wget https://storage.googleapis.com/golang/go1.5.3.src.tar.gz
$ tar xzvf go1.5.3.src.tar.gz
@Jimmy-Xu
Jimmy-Xu / run-multiple-docker-version-with-dind.md
Created Jan 27, 2016
Run multiple docker version with `dind`
View run-multiple-docker-version-with-dind.md

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

View dns tuning ssh login speedup 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.service
Created Feb 20, 2016 — forked from ygmpkk/sslocal.service
ShadowSocks Client Systemd Service
View sslocal.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]