Jul 1

由于拜服于mpd的轻巧和简单,决心安装这个linux下最好用的音乐播放器。

(现在已经可以支持ape了)

在ubuntu安装很简单:

 

sudo apt-get install mpd mpc sonata

 

 

sonata是一个同样简洁的前端,配合mpd使用

但是使用过程中却遇到了一些麻烦,首先是

 

更改了端口一样没有效果,烦躁中卸载了mpd打算重新编译,

但发现源码编译还要自己安装库如libcue等,于是放弃。

重新安装是出现:

 

正在设置 mpd (0.14.2-3ubuntu2) ...
 * Starting Music Player Daemon mpd                                             problem opening log file "/home/jack/音乐/mpd/mpd.log" (config line 11) for writing
Aborted
                                                                         [fail]
invoke-rc.d: initscript mpd, action "start" failed.
dpkg:处理 mpd (--configure)时出错:
 子进程 post-installation script 返回了错误号 134
正在处理用于 libc6 的触发器...
ldconfig deferred processing now taking place
在处理时有错误发生:
 mpd
E: Sub-process /usr/bin/dpkg returned an error code (1)

 


 

解决办法是:

sudo rm /var/lib/dpkg/info/mpd.postinst
sudo apt-get --reinstall install mpd

 

 

回到上面的端口占用问题,解决办法是编辑/etc/hosts文件,

去掉里面的ipv6支持如下:

 

# The following lines are desirable for IPv6 capable hosts
#::1     localhost ip6-localhost ip6-loopback
#fe00::0 ip6-localnet
#ff00::0 ip6-mcastprefix
#ff02::1 ip6-allnodes
#ff02::2 ip6-allrouters
#ff02::3 ip6-allhosts

这样就可以修改~/.mpdconf文件来配置mpd了,我的.mpdconf部分如下:

 


######################## REQUIRED PATHS ########################
# You can put symlinks in here, if you like. Make sure that
# the user that mpd runs as (see the 'user' config parameter)
# can read the files in this directory.
music_directory  "/home/jack/音乐"
playlist_directory      "/home/jack/音乐/mpd/playlists"
db_file   "/home/jack/音乐/mpd/tag_cache"
log_file                "/home/jack/音乐/mpd/mpd.log"
error_file            "/home/jack/音乐/mpd/errors.log"
################################################################


######################## OPTIONAL PATHS ########################
#
# If you wish to use mpd --kill to stop MPD, then you must
# specify a file here in which to store MPD's process ID.
#
pid_file                "/home/jack/音乐/mpd/pid"
#
# If specified, MPD will save its current state (playlist,
# current song, playing/paused, etc.) at exit.  This will be
# used to restore the session the next time it is run.
#
state_file            "/home/jack/音乐/mpd/state"
#
################################################################


######################## DAEMON OPTIONS ########################
#
# If started as root, MPD will drop root privileges and run as
# this user instead.  Otherwise, MPD will run as the user it was
# started by.  If left unspecified, MPD will not drop root
# privileges at all (not recommended).
#
user                            "mpd"
#
# The address and port to listen on.
#
#bind_to_address                 "127.0.0.1"
bind_to_address                 "localhost"
port                            "6600"
#
# If the address is a path, then a UNIX domain socket will be
# created instead of listening on a TCP port.
#
#bind_to_address                 "/var/run/mpd/sock"
#
# Controls the amount of information that is logged.  Can be
# "default", "secure", or "verbose".
#
#log_level                       "default"
#
################################################################

########################## AUDIO OUTPUT ########################
#
audio_output {
        type       "pulse"
        name       "My MPD PulseAudio Output"
}

################################################################

###################### CHARACTER ENCODINGS #####################
#
# If file or directory names do not display correctly, then you
# may need to change this.  In most cases it should be either
# "ISO-8859-1" or "UTF-8".  You must recreate your database
# after changing this (use mpd --create-db).
#
filesystem_charset              "UTF-8"
#
# The encoding that ID3v1 tags should be converted from.
#
id3v1_encoding                  "GBK"
#
################################################################


 

 

 

接下来就可以使用

 

sduo mpd --create-db

 

来更新数据库了,还是有问题

 

Can't open db file "/home/jack/音乐/mpd/tag_cache" for reading/writing: Permission denied

 

 

去掉sudo出现

 

cannot setgid for user "mpd" at line 39: Operation not permitted
忽略
 

 

 

应该是权限问题,解决方法;

 

sudo chmod 0777 -R /home/jack/音乐/

 ps:后来发现有些目录无法加载,也同样是权限问题,解决方法同上

 

接下来更新数据库没问题了

 

sudo mpd

 

 

 

打开sonata或gmpc好好享受听歌的乐趣吧,其余的乱码及歌词支持接下来在解决。

 

Jun 30
"E3""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " General
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    set nocompatible " get out of horrible vi-compatible mode
    filetype on " detect the type of file
    set history=100 " How many lines of history to remember
    set ffs=unix,mac,dos " support all three, in this order
    filetype plugin indent on " load filetype plugins
    "set completeopt=menuone,preview
    set completeopt=longest,menu
    set viminfo+=! " make sure it can save viminfo
    set isk+=_,$,@,%,#,- " none of these should be word dividers, so make them not be
    set nobk

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " Theme/Colors
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    set background=dark " we are using a dark background
    syntax on " syntax highlighting on
    colorscheme desert " my theme for gui
    "colorscheme evening " my theme for terminal
    ""colorscheme asu1dark
    "colurscheme oceandeep

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " Files/Backups
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""    set nobackup " make backup file
    set makeef=error.err " When using make, where should it dump the file

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " Vim UI
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    set number
    set wildmenu " turn on wild menu
    set ruler " Always show current positions along the bottom
    set cmdheight=1 " the command bar is 1 high
    set numberwidth=4 " minimum width to use for the number column,not a fix size
    set hid " you can change buffer without saving
    set backspace=2 " make backspace work normal
    set whichwrap+=<,>,h,l  " backspace and cursor keys wrap to
    set mouse=a " use mouse everywhere
    set shortmess=atI " shortens messages to avoid 'press a key' prompt
    set report=0 " tell us when anything is changed via :...
    set lz " do not redraw while running macros (much faster) (LazyRedraw)
    " make the splitters between windows be blank
    set fillchars=vert:\ ,stl:\ ,stlnc:\
    "set lsp=0 " space it out a little more (easier to read)

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " Visual Cues
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    set showmatch " show matching brackets
    set hlsearch " do highlight searched for phrases
    set incsearch " BUT do highlight as you type you search phrase
    set listchars=tab:\|\ ,trail:.,extends:>,precedes:<,eol:$ " what to show when I hit :set list
    set so=15 " Keep 10 lines (top/bottom) for scope
    set novisualbell " don't blink
    set noerrorbells " no noises
    set laststatus=2 " always show the status line

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " File encode
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    set encoding=utf-8
    set fileencoding=chinese
    set fileencodings=ucs-bom,utf-8,chinese
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " Text Formatting/Layout
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    set formatoptions+=mM " for charactors fold and patch
    set ai " autoindent
    set si " smartindent
    set cindent " do c-style indenting
    set tabstop=8 " tab spacing (settings below are just to unify it)
    set softtabstop=4 " unify
    set shiftwidth=4 " unify
    set noexpandtab " real tabs please!
    set nowrap " do not wrap lines
    set smarttab " use tabs at the start of a line, spaces elsewhere
    ":autocmd BufEnter * call DoWordComplete()
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " Folding
    " Enable folding, but by default make it act like folding is off, because folding is annoying in anything but a few rare cases
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    "set foldenable " Turn on folding
    set foldlevel=100 " Don't autofold anything (but I can still fold manually)
        set foldmethod=syntax " use the syntax on methon
    set foldopen-=search " don't open folds when you search into them
    set foldopen-=undo " don't open folds when you undo stuff
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " taglist
    "let Tlist_Use_Right_Window=1
    "let Tlist_File_Fold_Auto_Close=1
    let Tlist_Exit_OnlyWindow=1
    let Tlist_Show_One_File=1

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    "tags
    :if getfsize("vimscript")>0
            source vimscript
    :endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    "WinManager
    let g:winManagerWindowLayout='FileExplorer|TagList'
    nmap wm :WMToggle<cr>

    "minbufExplorer
    let g:miniBufExplMapCTabSwitchBufs = 1
    let g:miniBufExplMapWindowNavVim = 1 "则可以用<C-h,j,k,l>切换到上下左右的窗口中去
    let g:miniBufExplMapWindowNavArrows = 1
    "let g:miniBufExplModSelTarget = 1
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    "omnicpp
    let OmniCpp_GlobalScopeSearch = 1  " 0 or 1
    let OmniCpp_NamespaceSearch = 1   " 0 ,  1 or 2
    let OmniCpp_DisplayMode = 1
    let OmniCpp_ShowScopeInAbbr = 0
    let OmniCpp_ShowPrototypeInAbbr = 1
    let OmniCpp_ShowAccess = 1
    let OmniCpp_MayCompleteDot = 1
    let OmniCpp_MayCompleteArrow = 1
    let OmniCpp_MayCompleteScope = 1   
   
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    "cscope
    ":set cscopequickfix=s-,c-,d-,i-,t-,e-
    ":cs add ~/linux/robocup/seu-spark/src/cscope.out /home/jack/robocup/seu-spark/src
    if has("cscope")
    set csprg=/usr/bin/cscope
    set csto=0
    set cst
    set nocsverb
    " add any database in current directory
    if filereadable("cscope.out")
    cs add cscope.out
    " else add database pointed to by environment
    elseif $CSCOPE_DB != ""
    cs add $CSCOPE_DB
    endif
    set csverb
    set cscopetag
    set cscopequickfix=s-,g-,c-,d-,t-,e-,f-,i-
    endif
    nmap <C-c><C-s> :cs find s <C-R>=expand("<cword>")<CR><CR>
    nmap <C-c><C-g> :cs find g <C-R>=expand("<cword>")<CR><CR>
    nmap <C-c><C-c> :cs find c <C-R>=expand("<cword>")<CR><CR>
    nmap <C-c><C-t> :cs find t <C-R>=expand("<cword>")<CR><CR>
    nmap <C-c><C-e> :cs find e <C-R>=expand("<cword>")<CR><CR>
    nmap <C-c><C-f> :cs find f <C-R>=expand("<cfile>")<CR><CR>
    nmap <C-c><C-i> :cs find i ^<C-R>=expand("<cfile>")<CR><CR>
    nmap <C-c><C-d> :cs find d <C-R>=expand("<cword>")<CR><CR>

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    "Grep
    "nnoremap <silent> <F3> :Grep<CR>

    "SuperTab
    "let g:SuperTabRetainCompletionType=2
    "let g:SuperTabDefaultCompletionType="<C-X><C-O>"

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
:inoremap ( ()<ESC>i
:inoremap ) <c-r>=ClosePair(')')<CR>
:inoremap { {<CR>}<ESC>O
:inoremap } <c-r>=ClosePair('}')<CR>
:inoremap [ []<ESC>i
:inoremap ] <c-r>=ClosePair(']')<CR>
:inoremap " ""<ESC>i
:inoremap ' ''<ESC>i


function ClosePair(char)
  if getline('.')[col('.') - 1] == a:char
      return "\<Right>"
  else
      return a:char
  endif
endfunction


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""latex-suite"""""""
set grepprg=grep\ -nH\ $*
let g:tex_flavor='latex'

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""lookupfile"""""""""""""
""""""""""""""""""""""""""""""
" lookupfile setting
""""""""""""""""""""""""""""""
let g:LookupFile_MinPatLength = 2             "最少输入2个字符才开始查找
let g:LookupFile_PreserveLastPattern = 0      "不保存上次查找的字符串
let g:LookupFile_PreservePatternHistory = 1   "保存查找历史
let g:LookupFile_AlwaysAcceptFirst = 1        "回车打开第一个匹配项目
let g:LookupFile_AllowNewFiles = 0            "不允许创建不存在的文件
if filereadable("./filenametags")              "设置tag文件的名字
let g:LookupFile_TagExpr = '"./filenametags"'
endif
nmap <silent> <leader>lk <Plug>LookupFile<cr> "映射LookupFile为,lk
nmap <silent> <leader>ll :LUBufs<cr>          "映射LUBufs为,ll
nmap <silent> <leader>lw :LUWalk<cr>          "映射LUWalk为,lw
 

 

 

Jun 30

错误提示是:X--tag=CXX: command not found等一系列的以X开头的command not found

解决方法是将源码根目录的libtool文件中的$echo用$ECHO替换。

很奇怪,不知道原因,libtool里面看到了这一行

# An echo program that does not interpret backslashes.
ECHO="echo"