nya-tex

NYA-NYA-TeX

autodetach on
bell_msg "^G"
defkanji utf-8
defencoding utf-8
encoding utf-8 utf-8
defscrollback 10000
escape ^Jj
startup_message off
vbell off
caption always "%{= wb} %-w%{=bu dr}%n %t%{-}%+w %= %{=b wk} [%l] %{=b wb}%y/%m/%d(%D) %{=b wm}%c"
bind n screen
bind h prev
bind j next
bind l windowlist
bind r eval 'echo "Resize window"' 'command -c resize'
bind -c resize ^] command
bind -c resize + eval 'resize +1' 'command -c resize'
bind -c resize - eval 'resize -1' 'command -c resize'
proxy-ssh
Host ssh_server
Hostname xxx.xxx.xxx.xxx
Port 9222
User ec2-user
ForwardAgent yes
Host target_server
Hostname ddd.ddd.ddd.ddd
Port 22
User ec2-user
ProxyCommand ssh -W %h:%p ssh_server

いいの見つけた! -> http://vim-bootstrap.com/

set tabstop=4
set shiftwidth=4
set shiftround
"set expandtab
set autoindent
set smartindent
set hlsearch
set nu
"set paste

hi Search ctermbg=LightGreen
nmap :nohlsearch

"if has(‘syntax’) && (&t_Co > 2)
" syntax on
"endif

"colorscheme molokai
syntax on

autocmd BufNewFile,BufRead *.ja set filetype=php
autocmd BufNewFile,BufRead *.en set filetype=php
"autocmd BufNewFile,BufRead *.tx setfiletype xslate
autocmd BufNewFile,BufRead *.html if search(‘^: ‘) > 0 | set filetype=xslate | endif

" todoリストを簡単に入力する
abbreviate tl – [ ]

" 入れ子のリストを折りたたむ
"setlocal foldmethod=indent

" todoリストのon/offを切り替える
nnoremap :call ToggleCheckbox()

function! ToggleCheckbox()
let l:line = getline(‘.’)
if l:line =~ ‘\-\s\[\s\]’
let l:result = substitute(l:line, ‘-\s\[\s\]’, ‘- [x]’, ”)
call setline(‘.’, l:result)
elseif l:line =~ ‘\-\s\[x\]’
let l:result = substitute(l:line, ‘-\s\[x\]’, ‘- [ ]’, ”)
call setline(‘.’, l:result)
end
endfunction

"autocmd FileType php,ctp :set dictionary=~/.vim/dict/php.dict

hi Comment ctermfg=lightblue
hi perlComment ctermfg=darkgray
hi perlDATA ctermfg=cyan
hi perlPOD ctermfg=darkred

munin for xinetd

like a munin

make a script

$ vim /usr/local/bin/mm
#!/bin/bash

read arg0 arg1

arg0=$(echo $arg0 | tr -d "\r" | tr -d "\n");
arg1=$(echo $arg1 | tr -d "\r" | tr -d "\n");

echo "#"

#if [ $# -eq 0 -o $arg1 = "cpu" ]; then
  echo "cpu `ps aux | awk '{total = total + $3} END{print total}'`"
#fi
echo "memory `free | awk '/buffers\/cache/{print $3/($3+$4)*100}'`"
echo "hdd `df --portability | awk '/md0/{print $3/($3+$4)*100}'`"

echo "."

regist xinetd

$ vim /etc/xinetd.d/mm
service mm
{
  disable         = no
  port            = 4950
  socket_type     = stream
  wait            = no
  only_from       = 127.0.0.1 192.168.1.0/24
  user            = root
  server          = /usr/local/bin/mm
  log_on_failure  += USERID
}

follow-up work?

$ telnet localhost 4950
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

#
cpu 0.7
memory 51.2232
hdd 61.4268
.
Connection closed by foreign host.
Written on June 12, 2015