2013年4月29日 星期一

Ubuntu /var/log/uvcdynctrl-udev.log佔容量問題

之前系統警告/var滿了,
查看一下發現/var/log佔了很大的空間,
其中95%的佔用來自於/var/log/uvcdynctrl-udev.log
因為當初以為/var/log是必須定期手動清理的,
(其實系統會自動清理)
於是就直接
sudo rm -r /var/log/*
接著我的apache http server找不到error.log,
就無法啟動了...

其實下面這個解決方法不能解決根本問題,
他只是強制不讓uvcdynctrl寫入/var/log
但是至少uvcdynctrl-udev.log不會再出現了...

有更好的方法以後會再補上!

解決方法:
sudo cp /lib/udev/uvcdynctrl /lib/udev/uvcdynctrl_backup
#備份原始的/lib/udev/uvcdynctrl
gksu gedit /lib/udev/uvcdynctrl

#執行gedit來編輯/lib/udev/uvcdynctrl
#找到"debug=1"並改成"debug=0"

sudo rm /var/log/uvcdynctrl-udev.log

#刪除討人厭佔很大空間的uvcdynctrl-udev.log

參考資料:http://askubuntu.com/questions/177312/filesystem-filling-up-due-to-large-uvcydnctrl-udev-log-file

2013年4月28日 星期日

~/.vimrc

" vundle config
set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

Plugin 'scrooloose/nerdtree'
Plugin 'Lokaltog/vim-powerline'
"Plugin 'vim-airline/vim-airline'
"Plugin 'vim-airline/vim-airline-themes'
Plugin 'Yggdroot/indentLine'
Plugin 'kien/ctrlp.vim'
"Plugin 'Valloric/YouCompleteMe'

call vundle#end()            " required
filetype plugin indent on    " required

set hlsearch

" syntastic setting
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0

" shown powerline in sigle buffer
set laststatus=2
set t_Co=256
let g:Powerline_colorscheme='solarized256'
"let g:Powerline_symbols = 'fancy'
"let g:airline_powerline_fonts = 1

" airline setting
"set laststatus=2
"set t_Co=256
"let g:airline_theme="bubblegum"
"let g:airline#extensions#tabline#enabled = 1

" tab
map <C-t>l <ESC>:tabnext<CR>
map <C-t>h <ESC>:tabprev<CR>
map <C-t>n <ESC>:tabnew<CR>:NERDTree<CR>
map <C-t>c <ESC>:tabclose<CR>
map <C-t>0 <ESC>:tabfirst<CR>
map <C-t>$ <ESC>:tablast<CR>
map <C-t>q <ESC>:qall<CR>

set expandtab
set tabstop=4
set shiftwidth=4
set softtabstop=4

set autoindent
" C語言的縮排方法
"set cindent

set ruler
set showmode
set bg=dark
set nu

" terminal的title會設成filename
"set title

" 可以用 {{{ }}} 縮排 Folded
set foldmethod=marker
" 預設關閉
set foldlevel=0

" 編碼設定
set fileencoding=utf-8
set fileencodings=utf8,big5
set termencoding=utf-8
set enc=utf-8
set tenc=utf8

nmap <silent> <F5> <ESC>:NERDTree<CR>

" indent line 縮排對齊線plugin,預設關閉。
nmap <silent> <F6> <ESC>:IndentLinesToggle<CR>
let g:indentLine_enabled = 0

" 自動補齊括號
"inoremap ( ()<ESC>i
"inoremap [ []<ESC>i
"inoremap { {}<ESC>i

nnoremap <silent> <F8> :set paste<CR>
nnoremap <silent> <F9> :set nopaste<CR>

" vim color theme
colorscheme default
syntax on

" hightlight current line
set cursorline
hi CursorLine cterm=NONE ctermbg=234 ctermfg=NONE

" highlight TODO FIXME XXX with bold
hi Todo cterm=bold ctermbg=11

" highlight current line number
hi LineNr cterm=NONE ctermbg=234 ctermfg=245
"hi CursorLineNR cterm=NONE ctermbg=234 ctermfg=245

" 改變背景顏色顏色
"highlight Comment ctermbg=DarkGray
" 改變字體顏色
"highlight Comment ctermfg=DarkGray

php的箭頭符號(減號+大於)

php的「->」用來引用某個class中的函式或變數,
或者是說調用某個class中的函式或變數。

example:

class a
{
    function  b()
    {
        echo 'hello';
    }
}

$c = new a;
$c -> b();

output: hello


參考資料:http://a22710518.pixnet.net/blog/post/28763791


2013年4月27日 星期六

start

這個blog是一個紀錄IT技術的筆記,希望可以一直持續下去。
-Kurt 2013.04.27