2009年12月18日金曜日

mysqldumpでStored ProcedureをDumpする

通常のmysqldumpではtrigerはDumpされるのですが、Stored ProcedureはDumpされないので、"--routines" スイッチを入れればOKです。
mysqldump -uxxx -p  --routines _database_name_ > outputfile.sql 

2009年12月3日木曜日

JBoss CUPの使用量が100%を超えている

新しいアプリをリリースして数時間後、どうもアクセスを受け付けなくなっていた。
JBossのCPU使用率が100%を超えていた。どうもメモリ不足が影響していそうという勘から
Parmanet Spaceのサイズなどを変更。


# vi /<JBoss_HOME>/bin/run.conf

JAVA_OPTS="-Xms512m -Xmx1024m -XX:MaxPermSize=512m -XX:PermSize=128m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.lang.ClassLoader.allowArraySyntax=true"

2009年11月12日木曜日

You have an error in your SQL syntax … USING BTREE

MySQLの5.0と5.1でBTREEのSyntaxで少しはまりました。。

■MySQL 5.0のsyntax:
{INDEX|KEY} [index_name] [index_type] (index_col_name,...)

■MySQL 5.1のsyntax:
{INDEX|KEY} [index_name] (index_col_name,...) [index_type]
..which lead to incompatible dump.


と、微妙にかわっているので5.1のものを使う際は5.0向けに位置を変えてOKでした。

2009年11月3日火曜日

UbuntuでEclipseの補完がつかえない


と、長いことほったらかしでしたが、少し探すとキーバインドが下記のところにありました。
ここをAnthy/IBusとかぶらないものに設定すればOKです。ちなみに私のデフォルトはALT+/になってましたので、
Ctl+Spaceにして今まで通りの操作感でハッピーコーディングです。
Window→Preferences→General→Keys→ViewタブのCommand:Content Assist

mavenとeclipseの結合

 最近MavenとEclipseで開発を効率化させようとしています。WTPとM2を組み合わせて環境を作る際、
いろいろとハマるところがあるのですが、ここに素晴らしい解説が!

 内容はそこで読んでもらうとして、要点だけ備忘禄として、、

1)Mavenのフォルダ構成を作成する
src/main/java、src/main/resources、src/main/webapp、src/test/java、src/test/resources、target/classes、target/test-classesの各フォルダを作成します。

2)ソースフォルダを更新する
.classpathファイルを書き換える
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes"
path="src/test/java"/>
<classpathentry kind="src" output="target/test-classes"
path="src/test/resources"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con"
path="org.eclipse.jst.server.core.container/org.eclipse.
jst.server.tomcat.runtimeTarget/Apache Tomcat v6.0"/>
<classpathentry kind="con"
path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="con"
path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con"
path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>


3)WTPの内部をいくつか自分で調整する
.settings/org.eclipse.wst.common.componentファイルを編集します。
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="sample1">
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
<wb-resource deploy-path="/WEB-INF/classes"
source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes"
source-path="/src/main/resources"/>
<property name="context-root" value="sample1"/>
<property name="java-output-path" value="target/classes"/>
</wb-module>
</project-modules>


4)J2EEモジュールの依存関係を設定する
プロジェクトを右クリックし、ポップアップメニューから[Properties]を選択して、プロジェクトのプロパティを表示します。左側のパネルで[J2EE Module Dependencies]を選択し、画面(図4)に表示されるチェックボックスをオンにして、maven2の依存関係をJ2EEモジュールの依存関係に関連付けます。

でOK。MVNの実行は[Open External Tools Dialog]をクリックして設定でOK。

mod_jkとmod_sslでApacheからJBossへ

最近、CentOSでいろいろいじっていますが、SSLにてApacheからJBossへの接続を
させたので、そのときの設定めも。といっても、SSLポートのVirtualHostにJK変数追記するだけですが。。
<VirtualHost _default_:443>
JkMount /alesia/*.jsp ajp13
</VirtualHost>

Eclipseで新規プロジェクトつくれない

Ubuntuを9.10へアップグレードして、特に問題は発生していなかったんですが、
昨日Eclipseを立ち上げると新規プロジェクトなど作成できなくなっていました。
ボタンを押しても反応していないかんじでした。

ぐぐっていると解決策がありましたので乗せておきます。
本件に関しては2つ。LaunchpadEclipse本家でバグのトラッキングがされていますが、下記のコマンドをたたいてから起動するとOKみたいです。
export GDK_NATIVE_WINDOWS=true

2009年10月17日土曜日

CentOS/RedhatのJboss起動スクリプト

#!/bin/sh
# chkconfig: 35 80 20
# description: JBoss EJB container
#
# $Id: jboss_init_redhat.sh 71029 2008-03-19 21:58:46Z dbhole $
#
# JBoss Control Script
#
# To use this script run it as root - it will switch to the specified user
#
# Here is a little (and extremely primitive) startup/shutdown script
# for RedHat systems. It assumes that JBoss lives in /usr/local/jboss,
# it's run by user 'jboss' and JDK binaries are in /usr/local/jdk/bin.
# All this can be changed in the script itself.
#
# Either modify this script for your requirements or just ensure that
# the following variables are set correctly before calling the script.

#define where jboss is - this is the directory containing directories log, bin, conf etc
JBOSS_HOME=${JBOSS_HOME:-"/usr/local/jboss"}

#define the user under which jboss will run, or use 'RUNASIS' to run as the current user
JBOSS_USER=${JBOSS_USER:-"jboss"}

#make sure java is in your path
#JAVAPTH=${JAVAPTH:-"/usr/local/jdk/bin"}
JAVAPTH=${JAVAPTH:-"/usr/lib/jvm/java/bin"}

#configuration to use, usually one of 'minimal', 'default', 'all', 'production'
JBOSS_CONF=${JBOSS_CONF:-"all"}

#if JBOSS_HOST specified, use -b to bind jboss services to that address
JBOSS_BIND_ADDR=${JBOSS_HOST:+"-b $JBOSS_HOST"}

#define the script to use to start jboss
JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh -c $JBOSS_CONF $JBOSS_BIND_ADDR"}

if [ "$JBOSS_USER" = "RUNASIS" ]; then
SUBIT=""
else
SUBIT="su - $JBOSS_USER -c "
fi

if [ -n "$JBOSS_CONSOLE" -a ! -d "$JBOSS_CONSOLE" ]; then
# ensure the file exists
touch $JBOSS_CONSOLE
if [ ! -z "$SUBIT" ]; then
chown $JBOSS_USER $JBOSS_CONSOLE
fi
fi

if [ -n "$JBOSS_CONSOLE" -a ! -f "$JBOSS_CONSOLE" ]; then
echo "WARNING: location for saving console log invalid: $JBOSS_CONSOLE"
echo "WARNING: ignoring it and using /dev/null"
JBOSS_CONSOLE="/dev/null"
fi

#define what will be done with the console log
JBOSS_CONSOLE=${JBOSS_CONSOLE:-"/dev/null"}

JBOSS_CMD_START="cd $JBOSS_HOME/bin; $JBOSSSH"

if [ -z "`echo $PATH | grep $JAVAPTH`" ]; then
export PATH=$PATH:$JAVAPTH
fi

if [ ! -d "$JBOSS_HOME" ]; then
echo JBOSS_HOME does not exist as a valid directory : $JBOSS_HOME
exit 1
fi

echo JBOSS_CMD_START = $JBOSS_CMD_START

function procrunning() {
procid=0
JBOSSSCRIPT=$(echo $JBOSSSH | awk '{print $1}' | sed 's/\//\\\//g')
for procid in `/sbin/pidof -x "$JBOSSSCRIPT"`; do
ps -fp $procid | grep "${JBOSSSH% *}" > /dev/null && pid=$procid
done
}


stop() {
pid=0
procrunning
if [ $pid = '0' ]; then
echo -n -e "\nNo JBossas is currently running\n"
exit 1
fi

RETVAL=1

# If process is still running

# First, try to kill it nicely
for id in `ps --ppid $pid | awk '{print $1}' | grep -v "^PID$"`; do
if [ -z "$SUBIT" ]; then
kill -15 $id
else
$SUBIT "kill -15 $id"
fi
done

sleep=0
while [ $sleep -lt 120 -a $RETVAL -eq 1 ]; do
echo -n -e "\nwaiting for processes to stop";
sleep 10
sleep=`expr $sleep + 10`
pid=0
procrunning
if [ $pid == '0' ]; then
RETVAL=0
fi
done

# Still not dead... kill it

count=0
pid=0
procrunning

if [ $RETVAL != 0 ] ; then
echo -e "\nTimeout: Shutdown command was sent, but process is still running with PID $pid"
exit 1
fi

echo
exit 0
}

case "$1" in
start)
cd $JBOSS_HOME/bin
if [ -z "$SUBIT" ]; then
eval $JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&1 &
else
$SUBIT "$JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&1 &"
fi
;;
stop)
stop
;;
restart)
$0 stop
$0 start
;;
*)
echo "usage: $0 (start|stop|restart|help)"
esac



2009年10月11日日曜日

conky-colorってのがあるのね


 昔、自分用のconkyファイルを作るのに、いろいろなスクリプトを参考にしながら手探りでがんばったんですが、いまふと探してみるとgnome-lookに素敵なスクリプト(Conky-colors)というものがありました。上は今の私のデスクトップ画像です。
 
 今自分が使っているものとほぼ似たような構成なんだけど、時間は10分の1以下でできてしまいますね。良い時代になりました;-) 下のようなものなどが簡単に作成できるそうです。下はそこのサイトで紹介されているサンプルのスクリーンショットです。


ということで、久しぶりにConkyの記事を読んで、Hardcoreなサイトも発見。で、天気を追加したくなりついつい。。でもこれはハマると時間がいくらあってもたりないですね。。

2009年9月26日土曜日

grub2 起動時の解像度設定

Grub2で解像度を変更する際の設定
#vim /etc/default/grub
にて下記を追加
GRUB_CMDLINE_LINUX="vga=791"
--

#update-grub


設定ファイルを見ると
# cat /etc/default/grub
--
# This file is sourced by update-grub, and its variables are propagated
# to its children in /etc/grub.d/
GRUB_DEFAULT=0
GRUB_TIMEOUT=2
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet locale=ja_JP"
GRUB_CMDLINE_LINUX="vga=791"

# Uncomment to disable graphical terminal (grub-pc only)
GRUB_TERMINAL=console

2009年9月25日金曜日

Debian dist-upgrade後のTracのError

最近、放置気味だったDebian Serverのdist-upgradeを実施。
基本的にレポジトリサーバとしてつかっていたんだが、どうもTracの具合が悪かった。Errorは下記のような感じ。
.egg-cache: Error
([Errno 2] No such file or directory: '/usr/local/xxx/.egg-cache/VERSION')


で、本家のTicketに解決策がありました。
http://trac.edgewall.org/ticket/7521

Fixには2つ。
1)apache2の設定にPythonOption PYTHON_EGG_CACHEを追加

<Location "/tracsvn">
SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler trac.web.modpython_frontend
PythonOption TracUriRoot/tracsvn
PythonOption TracEnvParentDir /var/trac
PythonOption PYTHON_EGG_CACHE /tmp
PythonDebug on
</Location>


2)既存の.egg-cache: Errorファイルを削除

で、無事エラーはなくなりました。

2009年9月18日金曜日

Eclipse HTMLファイルの文字化け

EclipseでHTMLとかがUTF-8で保存されていたりしたら、日本語などが文字化けしてしまうという問題の解決策を書いてくれているブログを見つけたので忘れないよう

[Preference] - [General] - [Content-Type] を選択
Text を選択
File Associetions に *.html *.css *.js など文字化けする拡張子を追加
Default encoding に UTF-8 に指定する。
Update を押す


でもこれだとダメなケースあったので
-Duser.language=en

2009年8月7日金曜日

JbossからのレスポンスでChunkedを無効にする

■Jboss単体で走らせている場合
Server.xmlに
restrictedUserAgents="^.*MS Web Services Client Protocol.*$"

を追加する。
http://www.jboss.org/file-access/default/members/jbossweb/freezone/docs/latest/config/http.html
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3968063

■Apacheとmod_jkでつながっている場合
httpd.confに
BrowserMatch \".*\" downgrade-1.0 force-response-1.0

http://httpd.apache.org/docs/2.2/env.html#special

2009年8月5日水曜日

TCPDUMPでログをとる

tshark とか wiresharkとか入ってないけどtcpdumpはあるようなサーバでログをとるには。。
# /usr/sbin/tcpdump -ieth0 -w output.pacp host 11.111.111.XX -s0

2009年6月26日金曜日

Jboss4.3 商用版で任意のレスポンスメッセージを送る

セキュリティ脆弱性CVE-2008-1232に関係して「Unknown Reason」と書き換えられるので下記の起動パラメタを設定する。
http://tomcat.apache.org/security-6.html


-Dorg.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER=true

convert イメージ サイズ

イメージファイルを違った大きさに縮小・拡大するスクリプトです。

#!/bin/bash

searchPath="."
if [ ! $# -eq 0 ]; then
searchPath=$1
fi

echo "searth path: $searchPath"

for file in `find $searchPath -type f \( -name \*.jpg -o -name \*.jpeg -o -name \*.png -o -name \*.gif \) `
do
if [ -f $file ]; then
echo "converting $file ..."
basename=${file##*/}
filename=${basename%.*}
echo "filename : $filename"

extension=${basename##*.}
echo "extension : $extension"

convert -equalize -geometry 128x160 $file "${filename}_S.${extension}"
convert -equalize -geometry 176x220 $file "${filename}_M.${extension}"
convert -equalize -geometry 240x320 $file "${filename}_L.${extension}"
fi
done

2009年6月25日木曜日

googleearth5のpanoramio画像が表示できない

長期出張から帰って少しJauntyと遊んでいます。
が、googleearth5をインストール後、Panoramioの画像が?となり表示できませんでした。
Webで探すと64Bit OSで発生している模様。

$ sudo vim /usr/share/googleearth/qt.conf
#で下を書き込む
[Paths]
Documentation=/usr/share/doc
Libraries=/usr/lib32
Plugins=/usr/lib32/qt4/plugins
Translations=/usr/share/qt4/translations

#そしてシンボリックリンクをはればOkでした。
$ cd /usr/lib32/googleearth
$ sudo ln -s ../../share/googleearth/qt.conf qt.conf

2009年4月10日金曜日

GRUBのdefoptionsでVGA指定

Grubで起動時VGA指定できます。

Definition 8 bits 16 bits 24 bits
Resolution Type decimal Hex decimal Hex decimal Hex
640 × 480 VGA 769 0x301 785 0x311 786 0x312
800 × 600 SVGA 771 0x303 788 0x314 789 0x315
1024 × 768 XGA 773 0x305 791 0x317 792 0x318
1152 × 864 XGA+ 353 ? 0x161 355 ? 0x163 356 ? 0x164
1400 × 1050 SXGA+ 839 ? 0x347 ? 834 0x342 835 0x343
1600 × 1200 UXGA 796 0x31C 798 0x31E 799 0x31F
2048 × 1536 QXGA ? ? ? ? 850 ? 0x352 ?
3200 × 2400 QUXGA ? ? ? ? ? ?
640 × 400 ? ? ? 829 0x33D 830 0x33E
1280 × 800 WXGA 867 0x363 868 0x364 869 0x365
1440 × 900 WXGA+ 864 0x360 866 0x362 867 0x363
1680 × 1050 WSXGA+ 872 ? 0x368 ? ? ? 873 0x369
1920 × 1200 WUXGA 892 ? 0x37c ? ? ? 893 ? 0x37d ?
1280 × 1024 SXGA 775 0x307 794 0x31A 795 0x31B
2560 × 2048 QSXGA ? ? ? ? ? ?
1280 × 720 WXGA ? ? ? ? ? ?
1600 × 1024 WSXGA ? ? ? ? ? ?

2009年4月6日月曜日

Dell Inspiron 1720 Biosアップデート

私は2007年11月購入のDell Inspiron 1720を使ってます。
Jaunty 9.04 betaにアップグレードしてから、シャットダウン時に電源が自動で切れなくなり、下記のラインをカーネルオプションとして付け足してました。
 kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=ef3df5a7-8776-4161-803a-1bce9b970ddc ro vga=791 acpi=force


 もしかしたらBIOSの問題かもと思い、現在のBIOSヴァージョンを見てみるとA03でした。最新はA09なので、Ubuntuからアップグレードできるか調べて実施したところ、かなり簡単にヴァージョンアップできました。これで電源問題解決しました。

# apt-get install libsmbios-bin

システムIDを取得
# getSystemId

Libsmbios version: 2.2.13
Product Name: Inspiron 1720
Vendor: Dell Inc.
BIOS Version: A09
System ID: 0x01F2
Service Tag: FTQDBBX
Express Service Code: 34449545373
Asset Tag:
Property Ownership Tag:


ここからhttp://linux.dell.com/repo/firmware/bios-hdrs/自分のSystem IDに合ったフォルダ内の"bios.hdr"ファイルをダウンロード。(system_bios_ven_0x1028_dev_SYSTEM_ID_version_BIOS_VERSION)

DELLのドライバをロードする。
# modprobe dell_rbu


BIOSのアップデート
# dellBiosUpdate -u -f ./bios.hdr 


/boot/grub/menu.lstにBIOS再読み込みのオプション(reboot=bios)をつけて再起動。次回以降は削除してよい。
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=ef3df5a7-8776-4161-803a-1bce9b970ddc ro vga=791  reboot=bios


これで再起動するとBIOSの読み込み画面になって、1分後、再度自動で再起動して初回の起動はデバイス読み込みに時間が少しかかりますが、何とも簡単にアップデート完了しました。

Appendix: BIOS間の修正事項
A09
公開日: 2008/07/14
Fixes/Enhancements
------------------
1. Update GM965 Graphics VBIOS from 1466 to 1588.
2. Update Intel CPU family name.

A08
Fixes/Enhancements
公開日: 2008/05/23
------------------
1. Improve compatibility with Dell Wireless 1390 & 1490 Dell WLAN.
2. Fixed: System Hangs on Resume from S3 with Driver Verifier enabled.
3. Added enhancement for optical drives.

A07
公開日: 2008/02/06
Fixes/Enhancements
------------------
1. Updated Intel uCode.
2. Added support for New optical drives.
3. Support new CPUs.
4. Added enhancement for thermal control.
5. Added enhancement for MediaDirect control.

A04
公開日: 2007/12/25
Issues Fixed:
1. On N-Series Platforms, remove SLIC table and pointer to resolve OS bug with KMS activation.

New Features and Enhancements:
1. Add support for Wifi Catcher of Dell wireless 1395.
2. Support 17" Brazil KB .
3. Audio Verb Table update

2009年4月5日日曜日

【解決】JauntyでのVirtualbox USB問題

ということで、快速起動のJauntyにアップグレードして1週間がたちます。
仕事が忙しくてそれほど満喫したJauntyライフを過ごしているわけではないのですがVirtualBoxでのUSB問題が解決したので取り上げておきます。

Interpid Ibex 8.10 の時のそこら辺の記事はここにありますが、アップグレード後、これにしたがって設定してもUSBの制御をゲストへ持っていくことができませんでした。

/etc/fstabの内容で下記を追記するのはいいんだけど、
#usbfs
none /proc/bus/usb usbfs devgid=46,devmode=664 0 0

devgid=${xxx}のxxxの値は、

#cat /etc/group | grep plugdev
--
plugdev:x:46:nori

の【46】となります。

この設定でホスト再起動後、うまくUSBの制御をゲストへ持っていくことができました。

2009年3月31日火曜日

9.04 jauntyのApt Line

2009/3/30現在のApt lineです。
#deb cdrom:[Ubuntu 9.04 _Jaunty Jackalope_ - Beta amd64 (20090324)]/ jaunty 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/ jaunty main restricted
deb-src http://nl.archive.ubuntu.com/ubuntu/ jaunty main restricted

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

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. 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/ jaunty universe
deb-src http://nl.archive.ubuntu.com/ubuntu/ jaunty universe
deb http://nl.archive.ubuntu.com/ubuntu/ jaunty-updates universe
deb-src http://nl.archive.ubuntu.com/ubuntu/ jaunty-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/ jaunty multiverse
deb-src http://nl.archive.ubuntu.com/ubuntu/ jaunty multiverse
deb http://nl.archive.ubuntu.com/ubuntu/ jaunty-updates multiverse
deb-src http://nl.archive.ubuntu.com/ubuntu/ jaunty-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/ jaunty-backports main restricted universe multiverse
deb-src http://nl.archive.ubuntu.com/ubuntu/ jaunty-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 jaunty partner
deb-src http://archive.canonical.com/ubuntu jaunty partner

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

#Medibuntu
deb http://packages.medibuntu.org jaunty free non-free

#Virtual host
deb http://download.virtualbox.org/virtualbox/debian intrepid non-free

# lastfm
deb http://apt.last.fm/ debian stable

# Dropbox
deb http://linux.getdropbox.com/ubuntu intrepid main
deb-src http://linux.getdropbox.com/ubuntu intrepid main

# Google testing
deb http://dl.google.com/linux/deb/ testing non-free

VirtualBoxなどはintrepidのレポしかないので流用してますが、今のところ何も問題なしです。

Medibuntu追加後
$wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | sudo apt-key add - && sudo apt-get update
$sudo apt-get install acroread w64codecs skype

で少し幸せ。

9.04 jaunty Betaインストール


正式版リリースから1ヶ月ぐらいして落ち着いてからアップグレードしようと思ってました。。
やっちゃいました。ベータ版からのアップグレード。。最近いろいろといじってブートが50秒近くかかってたので、
今回のFast Bootが気になって。。おかげさまで現在Bootchartによると15秒です。。

Homeを別パーティションにしているので、インストール後のデータの引き継ぎなどは超簡単!ちなみにルートのマウントポイントのファイルシステムをExt4にしてみました。今のところ、特に問題もなくうごいていますが、各種設定で覚書を書き留めるようにしたいです。

2009年3月21日土曜日

64bit Flash plugin

以前までnspluginwrapper を噛ませてFlashを使ってたんですが、良く見るとAdobeから64Bit向けFlash10がプレリリースされているではないですか! ここ

実はiKnowでFlash上で文字入力ができないという問題があったのでVirtualbox内でWindows環境からFFを使ってたんですが、これで入力問題は解決しました。

sudo apt-get remove nspluginwrapper 
tar xvfz libflashplayer-10.0.d20.7.linux-x86_64.so.tar.gz
sudo cp libflashplayer.so /usr/lib/firefox-addons/plugins/

2009年3月16日月曜日

VIMRCです。


 VimのStatuslineにカーソルの位置情報などを表示しようと思い試していたがうまく行かず。。
結論から言うと、私がインストールしていたパッケージはvim-tinyでフル機能のVimではなかったということでした。。で、改めてVimrcを晒してみます。
" .vimrc
" Clear any existing autocommands:
if has("autocmd")
" Restore cursor position
au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif

" Filetypes (au = autocmd)
au FileType helpfile set nonumber " no line numbers when viewing help
au FileType helpfile nnoremap <buffer><cr> <c-]> " Enter selects subject
au FileType helpfile nnoremap <buffer><bs> <c-T> " Backspace to go back

" When using mutt, text width=72
au FileType mail,tex set textwidth=72
au FileType cpp,c,java,sh,pl,php,asp set autoindent
au FileType cpp,c,java,sh,pl,php,asp set smartindent
au FileType cpp,c,java,sh,pl,php,asp set cindent
"au BufRead mutt*[0-9] set tw=72

" Automatically chmod +x Shell and Perl scripts
"au BufWritePost *.sh !chmod +x %
"au BufWritePost *.pl !chmod +x %

" File formats
au BufNewFile,BufRead *.pls set syntax=dosini
au BufNewFile,BufRead modprobe.conf set syntax=modconf
endif

" *** User Interface
" use indents of 4 spaces, and have them copied down lines:
set shiftwidth=4
set tabstop=4
set shiftround
set expandtab
set autoindent

" allways show status line
set ls=2

" Set for visible tab
"set listchars=tab:>-,extends:<,trail:-,eol:<
set listchars=tab:>-
set list

" The format of status line
"set statusline=%<%f\%m%r%h%w%y%{'['.(&fenc!=''?&fenc:&enc).']['.&ff.']'}%=%4v\ %l/%L
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]
set laststatus=2

" No beep
" set vb t_vb=
set visualbell

" No auto NL
set formatoptions=q

" Show line number
set number

" have syntax highlighting in terminals which can display colours:
"if has('syntax') &amp;amp;amp;& (&t_Co > 2)
syntax on
"endif

" have fifty lines of command-line (etc) history:
set history=50

" display the current mode and partially-typed commands in the status line:
set showmode
set showcmd

" have the mouse enabled all the time:
"set mouse=a

" don't have files trying to override this .vimrc:
set nomodeline

" Set the type of background color
set background=dark

" *** Text Formatting -- Specific File Formats
" enable filetype detection:
"filetype on

" for C-like programming, have automatic indentation:
"autocmd FileType c,cpp,slang set cindent

" for actual Java C (not C++) programming where comments have explicit end
" characters, if starting a new line in the middle of a comment automatically
" insert the comment leader characters:
"autocmd FileType c,java set formatoptions+=ro smartindent noexpandtab tabstop=4

" for Perl programming, have things in braces indenting themselves:
"autocmd FileType perl set smartindent

" for CSS, also have things in braces indented:
"autocmd FileType css set smartindent

" for HTML, generally format text, but if a long line has been created leave it
" alone when editing:
"autocmd FileType html set formatoptions+=tl

" for both CSS and HTML, use genuine tab characters for indentation, to make
" files a few bytes smaller:
"autocmd FileType html,css set noexpandtab tabstop=4

" in makefiles, don't expand tabs to spaces, since actual tab characters are
" needed, and have indentation at 4 chars to be sure that all indents are tabs
" (despite the mappings later):
"autocmd FileType make set noexpandtab shiftwidth=4

" *** Search & Replace
" make searches case-insensitive, unless they contain upper-case letters:
set ignorecase
set smartcase
set hlsearch

" show the `best match so far' as search strings are typed:
set incsearch

Firefox3のabout:config

Firefox3のabout:configの設定でいろいろいい感じのがまとまっている海外サイトがありました。
ここです。

あなたのUbuntuシステムを綺麗にする方法

ネットサーフィンしてたら海外のサイトでいろいろとUbuntuのシステムを綺麗にしておくTipsがあったので書いておきます。

1)重複するファイルを見つける
sudo apt-get install fslint

で、Applications-> System Tools-> FSlint.からアプリを起動すると重複するファイルやリンクの切れたSymlinkなどが検索できます。

2)パッケージを綺麗にする
・部分的なパッケージを削除
sudo apt-get autoclean

・Aptのキャッシュを削除
sudo apt-get clean

・使用されてないパッケージの削除
sudo apt-get autoremove


3)orphaned packageを削除する
sudo apt-get install gtkorphan

で、インストールしてからSystem-> Administration-> Removed Orphaned packageより起動し、orphaned packageを削除することができます。

4)インストールパッケージの管理
debfosterというパッケージを入れることで、パッケージ管理ができます。アンインストール時などにorphanedパッケージがあれば、削除しますか?と効いてくれたりするみたいです。
sudo apt-get install debfoster

・新たにKeeperファイルを作成
sudo debfoster -q

・システムにKeeperファイルを使うよう設定
sudo debfoster -f

・もしシステムから自動的に削除などしたくないパッケージがある場合は、下記のファイルからパッケージを削除するれば管理管轄外になります。
sudo vim /var/lib/debfoster/keepers

・削除対象のファイルがあるか確認
sudo debfoster


7)不要なロケールファイルの削除
sudo apt-get install localepurge

でインストールして、必要なロケールのみマークをつけます。すると不要なロケールのファイルは削除してくれます。

mac4linがSubversionで最新版利用可能に


ということで、開発ではいつもお世話になっているバージョン管理システムのSubversionですが、Mac4LinのプロジェクトもSubversionを使用してアクセス可能になりました。

取り合えず、SVNクライアントとしてRapidSVN何かを使って最新のリソースをDLし、Macテーマを更新しました。以前は、再起動のアイコンがなかったのですが、最新版ではそのアイコンも配備され良い感じになってます。

% sudo apt-get install rapidsvn


なおSubversionのアカウントは下記でOKです。
* Hostname: mac4lin.svn.sourceforge.net
* Port: 443
* Protocol: HTTPS
* Repository Path: /svnroot/mac4lin

2009年3月11日水曜日

Firefox の高速化

FFは内部でSQLiteを使ってるらしいんだけど、使っていると起動・終了時のI/Oで結構しんどくなってきてました。
そこで下記のコマンドでデータを綺麗にすると、かなりパフォーマンス改善しました。
*   For Linux
$ for i in *.sqlite; do echo "VACUUM;" | sqlite3 $i ; done

* For Windows
for %i in (*.sqlite) do @echo VACUUM; | sqlite3 %i

2009年2月16日月曜日

Ubuntu プロモーション用素材






 Ubuntuのプロモーションに使ってよい素材がここで配布されてますね。こういう活動もあるんですね。いろいろおせわになっているので、私のサイトでも少しばかりバナーを張ってプロモーション活動参加させていただきます;ー)

Ubuntu 8.10 Kernelのコンパイル


 今月のLinux Magazine誌にPerformance Tuneが取り上げられていたので、久しぶりにKernelからのコンパイルを試してみました。今回はバニラカーネルではなく、UbuntuパッチKernelで.configを私のマシン用(CUPをCore2にしたり)に設定して再構築しました。が、、結果は、パフォーマンスも遅くなりかつGnomeが不安定に。。ということで、コンパイル40分かかったのですが、早速アンインストールしてもとのUbuntuのデフォルトにもどしました。。

 カーネルの構築は簡単にできるのですが、なかなかパフォーマンスチューニングは難しいですね。

2009年2月15日日曜日

【解決】画面の解像度


 嫁と子供が外出するというので、嫁機(2年ほど前にUbuntu機へ変更)のメインテナンスをしていました。最近、私機はグラフィックボードの性能は変わりませんが、解像度を低くみせるためシステムで使うフォントなどを少し小さくして画面に表示する領域が広くなる工夫をしていたので、嫁機がどうしても解像度高すぎるように写り、「システム 設定 画面の解像度」から解像度を高くしてしまいました。。。

 するとモニタにシグナルなし。。。慌てて子供用に作ってたアカウントで入りなおしどこかにある個人設定ファイルをさがしまくりました。いろいろネットでも調べてあれでもないこれでもない。で、結局、Gnome 2.24では
/home/$YOUSER_NAME/.config/monitors.xml
にありました!そこにそのユーザが設定した解像度がかかれていましたので、それを変更していざ再起動!

 直りました(涙目)。解像度を変更して画面表示されないトラブルで、嫁の帰宅制限時間がせまりつつ涙目でしたが、なんとかなおりました。でGnomeでもバージョンによってあっちこちへ設定ファイルが移動していることがわかり、改めて歴史を感じつつコーヒーをすすりました。。

 で、Ubuntu 9.04で開発中の機能に下記があるのですが、これはXorg系のやつなので、今回のケースはやはり手動で自力修正が必要みたいですね。
Xorg.confのバックアップ・復元に関する何らかの仕組みが用意され,アップデートやデバイス変更などの
影響で「画面が出ない」といった現象への対処が行われる予定です。

2009年2月10日火曜日

preloadを再度入れました

 アプリケーションの起動パフォーマンスをあげるため、よく使用するアプリをあらかじめメモリ上に展開するというPreloadというアプリケーションがあります。以前、2Gメモリで使っていましたが、少しメモリ容量がきつかったので最近はUbuntuのオリジナルで入っているReadaheadだけにしていました。
 
 が、最近のDRAM価格の下落でDDR2 SO-DIMM 2G 667MHzが1枚3000円ぐらいということで思い切って景気刺激?のために2枚購入して合計4Gのせたのを記念してPreloadを再度いれました。やはり起動が高速化していい感じです!

 詳しい説明はこのページ(英文)ありますのでご参考に。

mac4lin間もなくリリース?


Mac OSXライクなThemeを実現できるMac4Linプロジェクトですが、次期リリースを心待ちに毎日Ubuntu Forumの開発者スレッドを確認している今日この頃。かれこれもう2ヶ月ほど追いかけてます。。。ちなみに現在の私のThemeもこれ使ってますがいい感じです。

で、このところそろそろリリースしますとのことで!あと数日でリリースされそうです。ちなみにSource Forgeはここです。

2009年2月8日日曜日

VirtualBox2.1xにアップグレード


ここ1ヶ月、開発がぴーくで日付変わって帰宅している今日この頃です。
で、ようやく今日はすこしパソコンいじれたので、いろいろとキャッチアップしてます。
で、VirtualBoxですが、昨年末に2.1系がリリースされたみたいで早速2.0系からアップしてみました。
$sudo apt-get install virtualbox-2.1

で、今回のリリースでは、下記が目玉らしいです。

  1. OpenGLによる3Dアクセラレーションをサポート

  2. Intel Core i7 (Nehalem)のサポート

  3. 32-bitのホストOS上で64-bitのゲストOSのサポート

2009年2月7日土曜日

GPGエラー

そういえば、仕事がいそがしかったんでほっていたんだけど、先週ぐらいから下記のエラーがでてました。
W: GPG error: http://ppa.launchpad.net intrepid Release: 公開鍵を利用できないため、以下の署名は検証できませんでした: NO_PUBKEY 60D11217247D1CFF
W: これらの問題を解決するためには apt-get update を実行する必要があるかもしれません


OpenOffice3系のやつなんですが、下記更新が必要です。
$ gpg --keyserver hkp://wwwkeys.eu.pgp.net --recv-keys 60D11217247D1CFF
$ gpg --armor --export 60D11217247D1CFF | sudo apt-key add -


はい。これでOKでした。

2009年1月17日土曜日

Hotmail が POP/SMTP 対応で Thunderbird で送受信可能に


とうことで、HotmailがとうとうPOP3に対応です。
早速、Ubuntu Thunderbirdにアカウント追加! といっても時既に遅しな感じで私のメインはGmailでHotmailは稼働率限りなく0%です。。。

鳥獣保護区 | Hotmail が POP/SMTP 対応で Thunderbird で送受信可能に: "

# 受信設定
* POP サーバ:pop3.live.com
* ポート番号:995(SSL)
* ユーザ名:メールアドレス(example@hotmail.comとか)
* パスワード:Hotmail のパスワード

# 送信設定
* SMTP サーバ:smtp.live.com
* ポート番号:25 or 587(TLS)
* SMTP認証:必要(受信用ユーザ名、パスワードと同じ)"

WebメーラのInboxにあるメールは無条件にDLさせられます。700件のJunk メールDL。。で、WebメーラのInboxにあったメールはなくなります。ってIMAPサポートしてないところをみるとInboxのメール容量減らそうとしてるんじゃないかと透けて戦略がみえるような。。う〜ん、もうどうでもよいHotmailアカウントなので私の場合はもうどうでもいいす。GmailのIMAPになれた身としてはもうそんなオールドファッションなものには戻れません。すいません。。