2008年10月21日火曜日

英辞郎フォーマット変換

英辞郎は訳が多くて便利です。Ubuntu上でも利用しない手はない。
ということで、英辞郎の辞書ファイルを1行テキスト形式に変換後の方法を書きます。

Gjiten用に変換
//先ずは辞書ファイルをUTF8+LFに変換します。
$ nkf --guess xxx.txt
Shift_JIS
$ nkf --wLu --overwrite xxx.txt
$ nkf --guess xxx.txt
UTF-8

//続いてGjiten用にファイル内のフォーマットを変更します。
// 1: "///" から "/" へ
$vim xxx.txt
:%s/\/\/\//\//g

//続いて文末へ"/"を追加
:%s/$/\//g

その後、Gjitenを起動して編集>設定>追加 からその辞書を追加すればOk

Firefox Plugin [Mouseover Dictionary ]から最新版(現時点mouseoverdictionary-0.6.4.xpi)をインストールし、設定からその辞書を追加すればOKです。

2008年10月19日日曜日

Inspiron 1720 Mic設定

Dell Inspiron 1720にて環境構築していますが、先ほどSkypeも入れました。このPCにはMicはIntegrateされていますが、初期状態では使えませんので下記の設定が必要です。

パネル上の音量調整アプレットから音量コントロール(GNOME/GStreamer)を立ち上げて編集=>設定から下記をEnableにすればOKです。

Capture
Capture1
Digital
Digital Input Source


これでSkypeも問題なく通話できます。

2008年10月16日木曜日

Ubuntu 8.04にEclipse入れる

本業の開発用の設定を開始します。
本家からEclipse 3.4を落として
m2eclipse
subversive
を入れました。でShiftJISの文字コードファイルを一括してUTF8へ変換して読めるようにしました。
 find ./ -name \*.java -exec nkf -wLu --overwrite {} \; 

Linuxの便利なところはこんなneatなコマンドでいろいろ作業できることですね。

2008年10月13日月曜日

Ubuntuインストール その5

その他の覚書。

1.パフォーマンス系の改善には、↓などを参照
http://www.linuxhaxor.net/2008/09/30/make-linux-harder-better-faster/
http://blog.lxpages.com/2007/04/24/ubuntu-performance-guides/
http://yoten.blogspot.com/2007/04/speed-up-ubuntu.html

2. Manを日本語にする。
$ sudo apt-get install manpages-ja


3. bootプロセスIndex化による高速化
Grub menu にてEscapeからEditしKernelラインの最後に[profile]という文字を追加してBootするとその回のブートは時間かかりますが、次回からは高速になります。

4. Javaのインストール及び設定
Java PFとして下記のどっちかを入れてください。
% sudo apt-get install openjdk-6-jdk
% sudo apt-get install sun-java6-jdk

それから、使用するJavaを選択する。
% sudo /usr/sbin/update-alternatives --config java

設定したものがちゃんと反映しているかチェック。
% java -version


5. 仮想コンソールの設定
 $ sudo vim sudo vim /etc/default/console-setup
#ACTIVE_CONSOLES="/dev/tty[1-2]"とする。

それから、/etc/event.dの tty3-6までを下記のように。
#start on runlevel 2
#start on runlevel 3

stop on runlevel 0
stop on runlevel 1
stop on runlevel 2
stop on runlevel 3
stop on runlevel 4
stop on runlevel 5
stop on runlevel 6

Ubuntuインストール その4

Virtualbox関係
日本語入力でキーボード操作が効かないケースがあるため、下記を入れておきます。
sudo apt-get install scim-bridge-client-qt

インストール後の設定ですが、先ずはユーザをvirtualbox使えるグループに追加します。
sudo adduser $YourName vboxusers

続いてUSB関係。
先ずは、vboxのグループIDを見る。
 $ cat /etc/group
--
vboxusers:x:NUMBER

そのIDを下記行を追加すると供に入れます。
$sudo vim /etc/fstab
##下記を追加
none /proc/bus/usb usbfs devgid=$NUMBER,devmode=664 0 0


$sudo gedit /etc/init.d/mountdevsubfs.sh 
##下記の部分を見つけてコメントオフする。
--
#
# Magic to make /proc/bus/usb work
#
#mkdir -p /dev/bus/usb/.usbfs
#domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
#ln -s .usbfs/devices /dev/bus/usb/devices
#mount --rbind /dev/bus/usb /proc/bus/usb


#Magic to make /proc/bus/usb work

mkdir -p /dev/bus/usb/.usbfs
domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
ln -s .usbfs/devices /dev/bus/usb/devices
mount --rbind /dev/bus/usb /proc/bus/usb

権限を変えておきます。
sudo chown -R root:vboxusers /proc/bus/usb

続いて設定からenable IO APICにチェックをつければOKです。

その他
1)XPをインストールして更新をかけていたんだけどSP3をあててから次の更新が失敗し始めた。現象としてはWindows Updateから更新を押しても、インストール失敗というもの30分ぐらいはまったんだけど、下記の対処で回避できました。
net stop wuauserv
regsvr32 %windir%\system32\wups2.dll
net start wuauserv

なお、詳しいエラー情報は↓から確認できます。
%windir%\Windowsupdate.log


2)なぜかキーボードも英語になっていたので、ここを参考に設定変更。

3)Dell 1720のドライバはここからダウンロードです。

Ubuntuインストール その3

Gnome関係のデザイン
テーマはここを参考にしつつ、
Metacity
GDM Theme
icon
などです。

avant-window-navigatorのデザイン

$ sudo apt-get install avant-window-navigator-bzr awn-core-applets-bzr awn-manager-bzr

としといて、
Icon
Theme

Screenletsのデザイン
Wide Weather
を追加。
お天気コードはここで調べる。

Ubuntuインストール その2

で、続いてconkyいれましょう。とりあえず、.conkyrcです。
先ずは、フォンとのインストールが必要となります。
Cheri
PizzaDude Bullets
StyleBats
Famous Logos
Weather

で、ダウンロードしたTTFファイルをconkyフォルダの中に全部入れてフォントフォルダへ入れて、fc-cacheすれてOK。

$ unzip xxx
$ mkdir conky
$ mv xxx/*.ttf conky
$ sudo mv conky /usr/share/fonts/truetype/
$ sudo fc-cache -f -v /usr/share/fonts/truetype/conky


.conkyrcは現時点では 下記な感じです。

background yes
use_xft yes
xftfont 123:size=10
xftalpha 0.1
update_interval 2
total_run_times 0
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 250 5
maximum_width 400
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color gray
default_shade_color red
default_outline_color green
alignment top_right
gap_x 10
gap_y 10
no_buffers no
uppercase no
cpu_avg_samples 2
net_avg_samples 1
override_utf8_locale yes
use_spacer yes
text_buffer_size 256

TEXT

${font openlogos:size=20}U${font Arial:size=20}${color Tan1}GNU${color Ivory}LINUX${font openlogos:size=20}t
${voffset -90}
${color DimGray}
${font}
${color Tan2}${font StyleBats:size=14}A${font Arial:bold:size=10} SYSTEM ${color DarkSlateGray} ${hr 2}
${color white}${font XSpiralmental:size=14}O${font}${color DimGray} $sysname $kernel $alignr $machine
${color white}${font PizzaDude Bullets:size=14}3${font}${color DimGray} Intel Centrino Duo $alignr${freq_g cpu0}Ghz
${color white}${font PizzaDude Bullets:size=14}D${font}${color DimGray} Uptime $alignr${uptime}
${color white}${font PizzaDude Bullets:size=14}#${font}${color DimGray} File System $alignr${fs_type}

${color Tan2}${font PizzaDude Bullets:size=14}a${font Arial:bold:size=10} TEMPERATURE ${color DarkSlateGray}${hr 2}
${color white}${font Weather:size=14}y${color DimGray}$font CUP Core0: $alignr ${execi 180 sensors | grep 'Core 0' | awk '{print $3}' }
${color white}${font Weather:size=14}y${color DimGray}$font CUP Core1: $alignr ${execi 180 sensors | grep 'Core 1' | awk '{print $3}' }
${color white}${font Weather:size=14}y${color DimGray}$font Nvidia GPU: $alignr ${execi 60 nvidia-settings -query GPUCoreTemp | grep '):' | awk '{print $4}' | sed 's/\.//'}°C
${color white}${font Weather:size=14}y${color DimGray}$font HDD sda: $alignr ${hddtemp /dev/sda}
${color white}${font Weather:size=14}y${color DimGray}$font HDD sdb: $alignr ${hddtemp /dev/sdb}

${color Tan2}${font PizzaDude Bullets:size=14}Z${font Arial:bold:size=10} PROCESSORS ${color DarkSlateGray}${hr 2}
${color white}${font Famous Logos:size=12}:${font}${color DimGray} CPU1 ${cpu cpu1}% ${cpubar cpu1}
${color white}${font Famous Logos:size=12}:${font}${color DimGray} CPU2 ${cpu cpu2}% ${cpubar cpu2}

${color Tan2}${font PizzaDude Bullets:size=14}*${font Arial:bold:size=10} MEMORY ${color DarkSlateGray}${hr 2}
${color white}${font PizzaDude Bullets:size=11})${font}${color DimGray} RAM : $mem/$memmax $alignr $memperc%

${color Tan2}${font StyleBats:size=14}V${font Arial:bold:size=10} HDD ${color DarkSlateGray}${hr 2}
${color white}${font PizzaDude Bullets:size=11}t${color DimGray}$font / $alignr ${fs_used /}/${fs_size /}
${color white}${font PizzaDude Bullets:size=11}t${color DimGray}$font /home $alignr ${fs_used /home}/${fs_size /home}
${color white}${font PizzaDude Bullets:size=11}t${color DimGray}$font /warehouse $alignr ${fs_used /home/nori/warehouse}/${fs_size /home/nori/warehouse}

${color Tan2}${font StyleBats:size=14}J${font Arial:bold:size=10} TOP PROCESSES ${color DarkSlateGray}${hr 2}
${color white}${font Cheri:size=11}1:${color DimGray}$font ${top name 1}${alignr}${top cpu 1} %
${color white}${font Cheri:size=11}2:${color DimGray}$font ${top name 2}${alignr}${top cpu 2} %
${color white}${font Cheri:size=11}3:${color DimGray}$font ${top name 3}${alignr}${top cpu 3} %

${color Tan2}${font StyleBats:size=14}U${font Arial:bold:size=10} TOP MEMORY ${color DarkSlateGray}${hr 2}
${color white}${font Cheri:size=11}1:${color DimGray}$font ${top_mem name 1}${alignr}${top_mem mem 1} %
${color white}${font Cheri:size=11}2:${color DimGray}$font ${top_mem name 2}${alignr}${top_mem mem 2} %
${color white}${font Cheri:size=11}3:${color DimGray}$font ${top_mem name 3}${alignr}${top_mem mem 3} %

${color Tan2}${font StyleBats:size=14}R${font Arial:bold:size=10} NETWORK ${color DarkSlateGray}${hr 2}
${color white}${font PizzaDude Bullets:size=11}Q${font}${color DimGray} External IP$alignr${execi 3600 wget -O - http://whatismyip.org/ | tail}
${color white}${font PizzaDude Bullets:size=11}W${font}${color DimGray} Private IP$alignr ${addr eth0}
${color white}${font PizzaDude Bullets:size=11}T${font}${color DimGray} Download $alignr ${downspeed eth0} kb/s
${downspeedgraph eth0 }
${color white}${font PizzaDude Bullets:size=11}N${font}${color DimGray} Upload $alignr ${upspeed eth0} kb/s
${upspeedgraph eth0}

Ubuntuインストール その1



Work still on goingですが、先ずはデスクトップの外観です。
というわけで、まずはapt lineの状況です。

#deb cdrom:[Ubuntu 8.04 _Hardy Heron_ - Release amd64 (20080423)]/ hardy main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.

deb http://nl.archive.ubuntu.com/ubuntu/ hardy main restricted
deb-src http://nl.archive.ubuntu.com/ubuntu/ hardy main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://nl.archive.ubuntu.com/ubuntu/ hardy-updates main restricted
deb-src http://nl.archive.ubuntu.com/ubuntu/ hardy-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://nl.archive.ubuntu.com/ubuntu/ hardy universe
deb-src http://nl.archive.ubuntu.com/ubuntu/ hardy universe
deb http://nl.archive.ubuntu.com/ubuntu/ hardy-updates universe
deb-src http://nl.archive.ubuntu.com/ubuntu/ hardy-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://nl.archive.ubuntu.com/ubuntu/ hardy multiverse
deb-src http://nl.archive.ubuntu.com/ubuntu/ hardy multiverse
deb http://nl.archive.ubuntu.com/ubuntu/ hardy-updates multiverse
deb-src http://nl.archive.ubuntu.com/ubuntu/ hardy-updates multiverse

## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://nl.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse
deb-src http://nl.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository. This software is not part of Ubuntu, but is
## offered by Canonical and the respective vendors as a service to Ubuntu
## users.
deb http://archive.canonical.com/ubuntu hardy partner
deb-src http://archive.canonical.com/ubuntu hardy partner

deb http://security.ubuntu.com/ubuntu hardy-security main restricted
deb-src http://security.ubuntu.com/ubuntu hardy-security main restricted
deb http://security.ubuntu.com/ubuntu hardy-security universe
deb-src http://security.ubuntu.com/ubuntu hardy-security universe
deb http://security.ubuntu.com/ubuntu hardy-security multiverse
deb-src http://security.ubuntu.com/ubuntu hardy-security multiverse

## Medibuntu - Ubuntu 8.04 "hardy"
## Please report any bug on https://bugs.launchpad.net/medibuntu/
deb http://packages.medibuntu.org/ hardy free non-free

## Virtualbox
deb http://download.virtualbox.org/virtualbox/debian hardy non-free

## Avant Window Navigator
deb http://ppa.launchpad.net/reacocard-awn/ubuntu/ hardy main
deb-src http://ppa.launchpad.net/reacocard-awn/ubuntu/ hardy main

## Ubuntu Japanese LoCo Team's 3rd party repository for Ubuntu 8.04 LTS
## Please report any bug on https://bugs.launchpad.net/ubuntu-jp-improvement
deb http://archive.ubuntulinux.jp/ubuntu-ja hardy/
deb-src http://archive.ubuntulinux.jp/ubuntu-ja hardy/
deb http://archive.ubuntulinux.jp/ubuntu-ja hardy-ja/
deb-src http://archive.ubuntulinux.jp/ubuntu-ja hardy-ja/

## LastFM stable
deb http://apt.last.fm/ debian stable
#deb http://apt.last.fm/ debian testing



引き続いて.zshrcです。

#Created by cavalierski
#2008-10-11

export EDITOR=vim
export JAVA_HOME=/usr/lib/jvm/java-6-sun
export MAVEN_HOME=/opt/apache-maven-2.0.9
export ANT_HOME=/opt/apache-ant-1.7.1
export PATH=$PATH:$JAVA_HOME/bin:$EDITOR:$ANT_HOME/bin:$MAVEN_HOME/bin

alias eclipse='/opt/eclipse/eclipse'
alias update='sudo apt-get update'
alias upgrade='sudo apt-get upgrade'
alias du="du -h"
alias df="df -h"
alias ps="ps -aux"

# For auto compinit
autoload -U compinit
compinit

# For prompt
PROMPT="%/%% "
PROMPT2="%_%% "
SPROMPT="%r is correct? [n,y,a,e]: "

# For title bar
case "${TERM}" in
kterm*|xterm)
precmd() {
echo -ne "\033]0;${USER}@${HOST%%.*}:${PWD}\007"
}
;;
esac

# For history function
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
setopt hist_ignore_dups # ignore duplication command history list
setopt share_history # share command history data

# For History search shortcut
autoload history-search-end
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
bindkey "^P" history-beginning-search-backward-end
bindkey "^N" history-beginning-search-forward-end

# Editor vi mode
bindkey -v

# For remembering the previous folder
setopt auto_pushd

# No beep
setopt nolistbeep

# For auto-prediction function
#autoload predict-on
#predict-on

Dell Inspiron 1720へOS再インストール

 以前つかってたパソコンが5年間使い倒し、そろそろGPUも苦しくなってきつつあったので、嫁用(Windows)と子供用(Edubuntu)にして、昨年末に、Dell Inspiron1720 (1ヶ月前ぐらいに販売完了)を購入しました。

 Vistaは40Gほどで残してMS Moneyのためだけに使用していたのですが、この半年Ubuntu上でVirtualBoxを走らせてその上でXP+MS Moneyという使い方をしていました。結果、予想以上に快適だったので、Dellで使われているその他のパーテーションなどを綺麗に消してUbuntuマシン100%とすることにしました。

 1720はHDDも2つスロットがあるので、USからDell 1720用専用キャディーと近場で2.5インチHDD250Gを手に入れてHDDも拡張して1からやり直すことにしました。もうすぐUbuntu 8.10が出るのでベータを入れて作りましたが、まだ不安定なところがあったので今回は8.04で作りました。

 過去のいろいろな設定を消したので、この場を将来の保存用として、自分の設定をさらします。。