さくらサーバにvimをインストール

10月 5th, 2011 by gen No comments »


Check


 さくらインターネットはSSHでログインできるのですが、viしか使えません。  
私は、通常vimを使っているのでvimを使おうと思いインストールしてみました。  
バージョンはvimに7.3がでているのでそちらを使ってみています。 
$ mkdirlocal 
ここでソースをダウンロードします。
$ wget ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2
$ wget ftp://ftp.vim.org/pub/vim/extra/vim-7.2-extra.tar.gz
$ wget ftp://ftp.vim.org/pub/vim/extra/vim-7.2-lang.tar.gz
tarjxf vim-7.3.tar.bz2
tarzxf vim-7.2-extra.tar.gz
tarzxf vim-7.2-lang.tar.gz
mkdirpatches
cdpatches/
$ curl -O 'ftp://ftp.vim.org/pub/vim/patches/7.2/7.3.[001-333]'

$  catpatches/7.2.* | patch -p0
$ ./configure --enable-multibyte --enable-xim --enable-fontset --with-features=big --prefix=$HOME/loca


$HOMEに以下の内容を記述して.vimrcの名前で保存
" 文字コードの自動認識
if &encoding !=# 'utf-8'
  set encoding=japan
  set fileencoding=japan
endif
if has('iconv')
  let s:enc_euc = 'euc-jp'
  let s:enc_jis = 'iso-2022-jp'
  " iconvがeucJP-msに対応しているかをチェック
  if iconv("\x87\x64\x87\x6a", 'cp932', 'eucjp-ms') ==# "\xad\xc5\xad\xcb"
    let s:enc_euc = 'eucjp-ms'
    let s:enc_jis = 'iso-2022-jp-3'
  " iconvがJISX0213に対応しているかをチェック
  elseif iconv("\x87\x64\x87\x6a", 'cp932', 'euc-jisx0213') ==# "\xad\xc5\xad\xcb"
    let s:enc_euc = 'euc-jisx0213'
    let s:enc_jis = 'iso-2022-jp-3'
  endif
  " fileencodingsを構築
  if &encoding ==# 'utf-8'
    let s:fileencodings_default = &fileencodings
    let &fileencodings = s:enc_jis .','. s:enc_euc .',cp932'
    let &fileencodings = &fileencodings .','. s:fileencodings_default
    unlet s:fileencodings_default
  else
    let &fileencodings = &fileencodings .','. s:enc_jis
    set fileencodings+=utf-8,ucs-2le,ucs-2
    if &encoding =~# '^\(euc-jp\|euc-jisx0213\|eucjp-ms\)$'
      set fileencodings+=cp932
      set fileencodings-=euc-jp
      set fileencodings-=euc-jisx0213
      set fileencodings-=eucjp-ms
      let &encoding = s:enc_euc
      let &fileencoding = s:enc_euc
    else
      let &fileencodings = &fileencodings .','. s:enc_euc
    endif
  endif
  " 定数を処分
  unlet s:enc_euc
  unlet s:enc_jis
endif
" 日本語を含まない場合は fileencoding に encoding を使うようにする
if has('autocmd')
  function! AU_ReCheck_FENC()
    if &fileencoding =~# 'iso-2022-jp' && search("[^\x01-\x7e]", 'n') == 0
      let &fileencoding=&encoding
    endif
  endfunction
  autocmd BufReadPost * call AU_ReCheck_FENC()
endif
" 改行コードの自動認識
set fileformats=unix,dos,mac
" □とか○の文字があってもカーソル位置がずれないようにする
if exists('&ambiwidth')
  set ambiwidth=double
endif

以下を参照

ずんvim
http://www.kawaz.jp/pukiwiki/index.php?vim#cb691f26
http://www.magiccircuit.com/2009/09/03/419

debian leenyからSqueezeへのアップグレード

3月 14th, 2011 by gen No comments »


Check


 

apt-get update
apt-get upgrade
apt-get install linux-image-2.6-686
apt-get install udev
reboot

ここで、ネットワークカードを認識しなくなってかつrootのファイルシステムも読み込めなくなるエラーで5日間をすごす。
結論は、/dev/hda1/が/dev/sda1/に変わっていたので起動しなくなっていたようだ。Grubのブートスクリプトを変更して起動したらどうにか起動した。ここで、ネットでの情報を参考に、ファームウェアのアップデートなどを作業。

 

apt-get install firmware-realtek
update-initramfs -u
apt-get –purge remove iscan
update-initramfs -u
apt-get –purge remove iscan
apt-get purge splashy
apt-get dist-upgrade
dpkg-reconfigure locales
upgrade-from-grub-legacy

イーモバイルのデータ通信が0円だって

9月 2nd, 2010 by gen No comments »


Check


イーモバイルのデータ通信端末が0円だって。

気になる人は、下をクリック。