Skip to content

Instantly share code, notes, and snippets.

@kiyor
kiyor / gistify723013.go
Created December 6, 2013 02:28
golang multi ssh example with id_rsa file
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
* File Name : ssh.go
* Purpose :
* Creation Date : 11-18-2013
* Last Modified : Thu Dec 5 23:12:09 2013
@kiyor
kiyor / gistify994900.vim
Last active January 1, 2016 17:09
vim conf
let $VIMRUNTIME='~/.vim'
filetype plugin indent on
syntax on
" load plugin, need execute before load colorscheme
execute pathogen#infect()
" header buffer, change your name in *.hd
autocmd BufNewFile *.* call CreateFile()
autocmd BufWritePre,FileWritePre *.* ks|call LastMod()|'s
autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
#!/bin/sh
file=$1
auth=$2
ext=${file#*.}
if [ -f ~/.vim/headers/${ext}.hd ]; then
cat ~/.vim/headers/${ext}.hd
exit 0
fi
autocmd FileType go autocmd BufWritePre <buffer> Fmt
@kiyor
kiyor / go_clients.go
Last active August 29, 2015 13:56
golang basic multi client run queue
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
* File Name : main.go
* Purpose :
* Creation Date : 02-26-2014
* Last Modified : Wed 26 Feb 2014 01:30:21 AM UTC
#!/bin/bash
############################################
# File Name : buildluajit.sh
# Purpose :
# Creation Date : 03-14-2014
# Last Modified : Fri 14 Mar 2014 07:17:12 PM UTC
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
@kiyor
kiyor / go-recaptcha.go
Created May 26, 2015 19:18
// idea by 'github.com/graetzer/go-recaptcha' with optomize, but might not fit for everyone
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
* File Name : recaptcha.go
* Purpose :
* Creation Date : 03-22-2015
* Last Modified : Sun 22 Mar 2015 09:43:16 PM PDT
* * * * * if [[ `ip route show | wc -l` -lt 100 ]]; then /config/auth/routeadd.sh >/dev/null 2>&1; fi;
30 2 * * * /config/auth/unblockyouku.sh
@kiyor
kiyor / nginx_vhost.conf
Last active August 29, 2015 14:26
nginx_lua_ubyk
server {
listen 80;
server_name yourservername;
charset UTF-8;
location ~ ^/p($|roxy$) {
default_type 'application/x-ns-proxy-autoconfig';
lua_code_cache on;
content_by_lua_file '/usr/local/nginx/conf/lua/proxy.lua';
}
location = /proxy.pac {