Skip to content

Instantly share code, notes, and snippets.

View dixudx's full-sized avatar
:octocat:

Di Xu dixudx

:octocat:
View GitHub Profile
@dixudx
dixudx / tmux.conf
Created May 24, 2017 01:22 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@dixudx
dixudx / gist:5217d17e110d98ce11f3d34cc8ae9bbb
Created May 27, 2017 05:31 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@dixudx
dixudx / tmux.md
Created July 7, 2017 06:52 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@dixudx
dixudx / happy_git_on_osx.md
Created July 11, 2017 13:45 — forked from trey/happy_git_on_osx.md
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "[email protected]"

@dixudx
dixudx / tmux-cheatsheet.markdown
Created July 12, 2017 14:40 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@dixudx
dixudx / .tmux.conf
Created July 12, 2017 14:44 — forked from iboard/.tmux.conf
My .tmux-config for Mac OS X, iTerm2, vim, UTF8 and working Copy&Paste to OSX-clipboard
set-window-option -g utf8 on
set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on
set-option -g prefix C-q
set -g history-limit 50000
unbind-key C-b
bind-key q send-prefix
set -g base-index 1
@dixudx
dixudx / cross-compile-go-arm64.md
Created July 31, 2017 08:39 — forked from conoro/cross-compile-go-arm64.md
Cross-compiling Golang for ARM64 (aarch64) e.g. Pine64 on Fedora AMD64
  • Install Go for Linux the usual way on your main Linux box:
cd
wget https://storage.googleapis.com/golang/go1.6.2.linux-amd64.tar.gz
tar -zxvf go1.6.2.linux-amd64.tar.gz
sudo mv go /usr/local/
export GOROOT=/usr/local/go
mkdir -p ~/gitwork/go/src
mkdir ~/gitwork/go/bin
@dixudx
dixudx / gist:c9b90417eaf23cf780c0f3b41ab6dae2
Created September 13, 2017 02:45
HostPathType Debuging Log
node-01 system # docker logs kubelet
2017-09-13 02:13:40.186868 I | proto: duplicate proto type registered: google.protobuf.Any
2017-09-13 02:13:40.187008 I | proto: duplicate proto type registered: google.protobuf.Duration
2017-09-13 02:13:40.187026 I | proto: duplicate proto type registered: google.protobuf.Timestamp
Flag --network-plugin-dir has been deprecated, Use --cni-bin-dir instead. This flag will be removed in a future version.
I0913 02:13:40.222607 11616 feature_gate.go:156] feature gates: map[]
I0913 02:13:40.228852 11616 client.go:75] Connecting to docker on unix:///var/run/docker.sock
I0913 02:13:40.229874 11616 client.go:95] Start docker client with request timeout=2m0s
W0913 02:13:40.232306 11616 cni.go:196] Unable to update cni config: No networks found in /etc/kubernetes/cni/net.d
W0913 02:13:40.257783 11616 server.go:288] --cloud-provider=auto-detect is deprecated. The desired cloud provider should be set explicitly
@dixudx
dixudx / jstnow.py
Created November 22, 2017 06:49 — forked from remino/jstnow.py
Python: Print date & time in JST time zone without pytz module
# Print date & time in JST time zone
# For Python 2.7.x without pytz module
import datetime
from datetime import datetime, timedelta, tzinfo
class JST(tzinfo):
def utcoffset(self, dt):
return timedelta(hours=9)
@dixudx
dixudx / deployment_initializer.go
Last active December 14, 2017 09:54
Sample Kubernetes Initializer Controller
package main
import (
"encoding/json"
"flag"
"log"
"os"
"os/signal"
"syscall"
"time"