This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[unix_http_server] | |
file=/tmp/supervisor.sock ; path to your socket file | |
[supervisord] | |
logfile=/var/log/supervisord/supervisord.log ; supervisord log file | |
logfile_maxbytes=50MB ; maximum size of logfile before rotation | |
logfile_backups=10 ; number of backed up logfiles | |
loglevel=error ; info, debug, warn, trace | |
pidfile=/var/run/supervisord.pid ; pidfile location | |
nodaemon=false ; run supervisord as a daemon |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# download latest libevent2 and tmux sources, and extract them somewhere | |
# (thx bluejedi for tip on latest tmux URL) | |
# | |
# at the time of writing: | |
# https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz | |
# http://sourceforge.net/projects/tmux/files/latest/download?source=files | |
# | |
# install deps | |
yum install gcc kernel-devel make ncurses-devel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package utils | |
import ( | |
"fmt" | |
"reflect" | |
) | |
func SmartPrint(data interface{}) { | |
indent := "\t" | |
var printer func(reflect.Value, int) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <stdlib.h> | |
#include <dirent.h> | |
#include <clang-c/Index.h> | |
#define ERR(msg) fprintf(stderr, "[%s] [%s] at %s line %d\n", msg, strerror(errno), __FILE__, __LINE__) | |
//#define DEBUG(msg) fprintf(stderr, "[DEBUG] file %s line %d : %s", __FILE__, __LINE__, msg) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _GNU_SOURCE | |
#include <sched.h> | |
#include <stdio.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
#include <stdlib.h> /* abort() */ | |
#include <stdarg.h> | |
#include <string.h> | |
#include <errno.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. install plugin manager vundle | |
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim | |
# 2. save vimrc | |
curl https://gist.github.com/sillyousu/c0fada443c00869f436e5daf7a0f4765/raw/8c5ed19be89a786873759ac1c78d56d0ebd99489/vimrc > $HOME/.vimrc | |
# 3. install other plugin | |
vim +PluginInstall +qall | |
# 4. install vim-go dependency |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
find $PWD -name '*.go' -exec echo \"{}\" \; | sort -u > cscope.files | |
#cscope -bvq | |
cscope -b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#此类配置可以在命令行模式中输入show-options -g查询 | |
set-option -g base-index 1 #窗口的初始序号;默认为0,这里设置为1 | |
set-option -g display-time 5000 #提示信息的持续时间;设置足够的时间以避免看不清提示,单位为毫秒 | |
set-option -g repeat-time 1000 #控制台激活后的持续时间;设置合适的时间以避免每次操作都要先激活控制台,单位为毫秒 | |
set-option -g status-keys vi #操作状态栏时的默认键盘布局;可以设置为vi或emacs | |
set-option -g status-right "#(date +%H:%M' ')" #状态栏右方的内容;这里的设置将得到类似23:59的显示 | |
set-option -g status-right-length 10 #状态栏右方的内容长度;建议把更多的空间留给状态栏左方(用于列出当前窗口) | |
set-option -g status-utf8 on #开启状态栏的UTF-8支持 | |
set -g default-terminal "xterm-256color" # VIM 配色 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias tlist="tmux list-session" | |
alias tnew="tmux new -s" | |
alias tattach="tmux attach -t" | |
alias siftx="sift -n -A3 -B3 --binary-skip --exclude-ext out" | |
alias siftn="sift -n --binary-skip --exclude-ext out, --exclude-dirs .svn" | |
alias svnst="svn st|grep -v \"?\"" | |
export TERM="xterm-256color" | |
# https://github.com/zeit/hyper/issues/1613#issuecomment-311172029 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# via http://osxdaily.com/2014/10/25/fix-wi-fi-problems-os-x-yosemite/ | |
launchctl unload -w /System/Library/LaunchDaemons/com.apple.wifid.plist | |
launchctl load -w /System/Library/LaunchDaemons/com.apple.wifid.plist |
OlderNewer