Skip to content

Instantly share code, notes, and snippets.

View xiaods's full-sized avatar
🌏
Coding for Fun

Deshi Xiao xiaods

🌏
Coding for Fun
View GitHub Profile
@xiaods
xiaods / .screenrc
Created June 22, 2018 05:14 — forked from joaopizani/.screenrc
A killer GNU Screen Config
# the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
# huge scrollback buffer
defscrollback 5000
# no welcome message
startup_message off
@xiaods
xiaods / .vimrc
Created April 2, 2018 00:37 — forked from algermissen/.vimrc
My vimrc focussing on Rust development
" HOW TO DO 90% OF WHAT PLUGINS DO (WITH JUST VIM)
" Max Cantor
" NYC Vim Meetup -- August 3, 2016
@xiaods
xiaods / go-lang-continuous-test.md
Created July 18, 2017 16:22
go lang continuous test shell function

Go lang continuous test shell function

This function is assumed to be run from the root of a Go lang project. It calculates the sha1 value of the project's directory tree every 10 seconds. If the value of the command has changed then go test ./... is executed causing all the tests in the project to be run.

Shell function

function goct() {
    local project_hash=-1
    while true; do
yum update
yum install -y tar wget
wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
cat <<EOF > /etc/yum.repos.d/wandisco-svn.repo
[WANdiscoSVN]
name=WANdisco SVN Repo 1.9
enabled=1
baseurl=http://opensource.wandisco.com/centos/7/svn-1.9/RPMS/$basearch/
@xiaods
xiaods / create-docker-tls.sh
Last active June 10, 2017 11:28 — forked from Stono/create-docker-tls.sh
Creating and setting up Docker for TLS
#!/bin/bash
# This script will help you setup Docker for TLS authentication.
# Run it passing in the arguement for the FQDN of your docker server
#
# For example:
# ./create-docker-tls.sh myhost.docker.com
#
# The script will also create a profile.d (if it exists) entry
# which configures your docker client to use TLS
#
@xiaods
xiaods / gist:a86ed470969d3dc344c2ef2adaa45a32
Created February 3, 2017 20:53 — forked from jordelver/gist:3073101
Set the Mac OS X SOCKS proxy on the command line

Set the Mac OS X SOCKS proxy on the command line

a.k.a. what to do when your ISP starts blocking sites :(

Set the SOCKS proxy to local SSH tunnel

networksetup -setsocksfirewallproxy "Ethernet" localhost 8080

To clear the domain and port

@xiaods
xiaods / dki
Created October 16, 2015 02:30 — forked from itoffshore/dki
Create Docker data-only container + container with static ip address
#!/bin/sh
##############################################
data_paths=/srv/dockerdata/debuild:/build #
data_name=debdata #
data_image=user/debdata #
bridge=br0 #
ipfile=/etc/default/docker_ips #
##############################################
@xiaods
xiaods / sparkOnShurenyun.md
Last active October 15, 2015 03:16 — forked from cfmcgrady/sparkOnMesos.md
玩转Spark on 数人云

###RUN SPARK ON 数人云

###单机版

  • Mesos运行在host上
  • Spark driver 和 executor运行docker上

#####1.搭建Mesos集群环境 详情 ,登录数人云,登录控制台后,通过集群管理创建自己的集群 #####2.运行Spark demo

@xiaods
xiaods / gist:952663
Created May 3, 2011 01:19 — forked from anonymous/gist:887026
reverse proxy for tumblr,reference
upstream tumblr {
server 72.32.231.8:80;
}
server {
listen 80;
server_name jyorr.com;
access_log /var/log/nginx/jyorr.access.log;