Skip to content

Instantly share code, notes, and snippets.

View glidenote's full-sized avatar

Akira Maeda glidenote

View GitHub Profile
@glidenote
glidenote / .vimrc
Created April 1, 2012 15:29
.vimrc for octoeditor.vim
Bundle 'glidenote/octoeditor.vim'
let g:octopress_path = '~/octopress'
let g:octopress_prompt_categories = 1
let g:octopress_qfixgrep = 1
map <Leader>on :OctopressNew<CR>
map <Leader>ol :OctopressList<CR>
map <Leader>og :OctopressGrep<CR>
nmap ,og :OctopressGenerate<CR>
nmap ,od :OctopressDeploy<CR>
" For FuzzyFinder
#######################################################################
#
# This is the main Nginx configuration file.
#
# More information about the configuration options is available on
# * the English wiki - http://wiki.nginx.org/Main
# * the Russian documentation - http://sysoev.ru/nginx/
#
#######################################################################
@glidenote
glidenote / add_route.sh
Created April 5, 2012 03:18
/etc/rc.d/init.d/utvpnclient
#!/bin/sh
/sbin/ifconfig utvpn_vpn 192.168.100.60 netmask 255.255.255.0
#=============================
# source auto-fu.zsh
#=============================
if [ -f ~/.zsh/auto-fu.zsh ]; then
source ~/.zsh/auto-fu.zsh
function zle-line-init () {
auto-fu-init
}
zle -N zle-line-init
zstyle ':completion:*' completer _oldlist _complete
@glidenote
glidenote / .vimrc
Created April 7, 2012 19:28
nginx.vim
Bundle 'nginx.vim'
au BufRead,BufNewFile /etc/nginx/* set ft=nginx
@glidenote
glidenote / .zshrc
Last active October 3, 2015 01:07
.zshrc for mosh_tmux
if [ $TERM = screen ]; then
function mosh_tmux() {
tmux new-window -n $@ "exec mosh $@"
}
alias mosh=mosh_tmux
fi
@glidenote
glidenote / head.html.diff
Created April 12, 2012 07:12
octopress head.html.diff
diff --git a/source/_includes/head.html b/source/_includes/head.html
index 0fdc401..198cd0d 100644
--- a/source/_includes/head.html
+++ b/source/_includes/head.html
@@ -17,7 +17,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
{% capture canonical %}{{ site.url }}{% if site.permalink contains '.html' %}{{ page.url }}{% else %}{{ page.url | remove:'index.html' | strip_slash }}{% endif %}{% endcapture %}
- <link rel="canonical" href="{{ canonical }}">
+ <link rel="canonical" href="{{ canonical }}/">
@glidenote
glidenote / .zshrc
Created April 13, 2012 08:06
.zshrc for sheet
# sheet
compdef _sheets sheet
function _sheets {
local -a cmds
_files -W ~/.sheets/ -P '~/.sheets/'
cmds=('list' 'edit' 'copy')
_describe -t commands "subcommand" cmds
return 1;
@glidenote
glidenote / .zshrc
Created April 14, 2012 00:45
.zshrc for mosh
# mosh
function _mosh_hosts {
local -a config_hosts
local config
integer ind
# If users-hosts matches, we shouldn't complete anything else.
if [[ "$IPREFIX" == *@ ]]; then
_combination -s '[:@]' my-accounts users-hosts "users=${IPREFIX/@}" hosts "$@" && return
else
@glidenote
glidenote / apache-command.sh
Created April 15, 2012 17:49
sheet command
# 直近5000アクセス中、アクセスが集中しているURLを調べ、上位4件を表示。
tail -5000 /usr/local/apache2/logs/access_log|awk '{print $1}'|sort | uniq -c |sort -gr|head -n 4
# 直近5000アクセス中、アクセス元のIPアドレスを調べ、上位4件を表示。
tail -5000 /usr/local/apache2/logs/access_log|awk '{print $2}'|sort | uniq -c |sort -gr|head -n 4
# 直近5000アクセス中アクセスの多いリダイレクト元(アクセス元)を調べ、上位4件を表示。
tail -n 5000 /usr/local/apache2/logs/access_log | awk '{print $12}' | sort | uniq -c | sort -gr | head -n 4
# 直近5000アクセス中アクセスの多いU/Aを調べ、上位4件を表示。