2010/11/06

【jpegtran】

http://jpegclub.org/

jpegの余分なコメント欄を消したり、
プログレッシブに変換したりできるツール
コンパイルは特に必要ないかも。

使いかた
・ベースライン
$ jpegtran -copy none picture.jpg > picture2.jpg

・ベースライン・最適化
$ jpegtran -copy none -optimize picture.jpg > picture2.jpg

・プログレッシブ
$ jpegtran -copy none progressive picture.jpg > picture2.jpg

などなど、コメント欄を消して、プログレッシブだと画像サイズが大体94%〜97%に落とせる。

追記.
>匿名さんからの情報
-copy none でカラーマネージメントが無効になるので、
ビューアーによっては画質悪くなる可能性あるので使用には注意を。

2010/09/20

[font - vl gothic]

http://vlgothic.dicey.org/
DL: VLGothic-20100818.tar.bz2

# tar jxf VLGothic-20100818.tar.bz2
# cp VLGothic/*.ttf /usr/share/wine/fonts/

[PHP - Command Line]

$ /usr/local/bin/php -f xxxxx.php

or

$ vi xxxxx.php
#!/usr/local/bin/php
<?php
    ・
    ・
    ・
?>
$ ./xxxxx.php

2010/09/18

[PHP - Image Resize]

大きいイメージデータの解像度を下げて、
ファイルサイズも抑えるようなPHPサンプルコード

$filename="xxx.png";
$filename_new="xxx.jpg";

$fp=fopen($filename,"rb");
$imgdata=fread($fp,8);
fclose($fp);

if(preg_match('/^\x89PNG\x0d\x0a\x1a\x0a/',$imgdata)){
    $img=imagecreatefrompng($filename);
}elseif(preg_match('/^GIF8[79]a/',$imgdata)){
    $img=imagecreatefromgif($filename);
}elseif(preg_match('/^\xff\xd8/',$imgdata)){
    $img=imagecreatefromjpeg($filename);
}

list($width,$height)=getimagesize($filename);
$new_height=1024;
$new_width=($new_height/$height)*$width;
$new_img=ImageCreateTrueColor($new_width, $new_height);
ImageCopyResampled($new_img,$img,0,0,0,0,$new_width,$new_height,$width,$height);
imagejpeg($new_img,$filename_new,50);

2010/09/15

[FlashMediaServer Setting]

インストールディレクトリにconf/fms.iniがあるので目的に応じて編集

動画ファイルをダウンロードせずに再生が目的なので、
RTMPだけ使えればいいので余計なのはコメントアウトなど

# vi /usr/local/fms/conf
SERVER.ADMIN_USERNAME = xxxxxx
SERVER.ADMIN_PASSWORD = xxxxxx
SERVER.ADMINSERVER_HOSTPORT = :1111
SERVER.PROCESS_UID = 99
SERVER.PROCESS_GID = 99
SERVER.LICENSEINFO =
VOD_COMMON_DIR = /work/media ←動画ファイルの場所
SERVER.FLVCACHE_MAXSIZE=1000
SERVER.HTTPD_ENABLED = false
ADAPTOR.HOSTPORT = :1935 ←使用ポート
HTTPPROXY.HOST = :8134
VHOST.APPSDIR = /usr/local/fms/applications
APP.JS_SCRIPTLIBPATH = /usr/local/fms/scriptlib
LOGGER.LOGDIR =
USERS.HTTPCOMMAND_ALLOW = false

付属のサンプルページがあるのでapacheの設定を行ってテストを行う
# vi /usr/local/apache2/conf/http.conf
Alias /fmsadmin/ "/usr/local/fms/webroot/"
<Directory /usr/local/fms/webroot/>
    Options +MultiViews
    AllowOverride AuthConfig
    order deny,allow
    allow from 192.168
</Directory>

クライアントで再生するために必要なswf、jsなども用意されてるので
htmlを読むとこれらの使いかたを理解できるのではないかと思う・・・

ちなみに再生できるエンコードはFLVやmp4(h264/aac)

2010/09/10

[GoogleChrom Install for CentOS]

[Reference site]
http://slashdot.jp/~RK/journal/502045
http://www.linux-powered.com/~ryoji.kamei/ChromiumCentOS5.xhtml

[FlashMediaServer Update]

サイトを確認したらアップデート版があったので
ダウンロードしてみたら、普通にこれだけでインストールできるものだった。

FlashMediaServer3.5.4 と FlashMediaServer4があったが
始めはVer.3の方をインストール

# tar zxf FlashMediaServer3.5.tar.gz
# cd FMS_3_5_4_r210
# ls -la
drwxrwxr-x 14 root   root      4096  9月 10 13:08 Apache2.2
-rw-r--r--  1 root   root     81389  7月 16 14:01 License.htm
-rw-r--r--  1 root   root     39294  7月 16 14:01 License.txt
-rwxr-xr-x  1 root   root      2886  7月 16 14:28 adminserver
drwxr-xr-x  4 root   root      4096  7月 16 14:28 applications
-rwxr-xr-x  1 root   root     16159  7月 16 14:01 checksn
drwxrwxr-x  3 root   root      4096  9月 10 14:20 conf
drwxrwxr-x  5 root   root      4096  9月 10 14:20 documentation
-rwxr-xr-x  1 root   root    877260  7月 16 14:29 far
-rwxr-xr-x  1 root   root      1699  7月 16 14:28 fms
-rwxr-xr-x  1 root   root   3624248  7月 16 14:29 fmsadmin
-rwxr-xr-x  1 root   root    438756  7月 16 14:29 fmsconfig
-rwxr-xr-x  1 root   root   8168992  7月 16 14:29 fmscore
-rwxr-xr-x  1 root   root   3837608  7月 16 14:29 fmsedge
-rwxr-xr-x  1 root   root    273776  7月 16 14:29 fmsini
-rwxr-xr-x  1 root   root   3154956  7月 16 14:29 fmsmaster
-rwxr-xr-x  1 root   root      5252  7月 16 14:28 fmsmgr
-rwxr-xr-x  1 root   root     35168  7月 16 14:28 installFMS
-rwxr-xr-x  1 root   root     36056  7月 16 14:29 libasneu.so.1
-rw-r--r--  1 root   root    135920  7月 16 14:01 libexpat.so.1
drwxr-xr-x  2 root   root      4096  9月 10 14:20 licenses
-rw-r--r--  1 root   root     52278  7月 16 14:01 logo.gif
drwxrwxr-x  4 root   root      4096  9月 10 13:08 modules
-rw-r--r--  1 root   root     67417  7月 16 14:01 readme.htm
drwxrwxr-x  5 root   root      4096  9月 10 13:08 samples
drwxrwxr-x  4 root   root      4096  9月 10 14:20 scriptlib
-rwxr-xr-x  1 root   root      4812  7月 16 14:28 server
-rwxr-xr-x  1 root   root    286396  7月 16 14:29 shmrd
-rwxr-xr-x  1 root   root     32213  7月 16 14:04 tcSrvMsg
drwxrwxr-x  2 root   root      4096  9月 10 14:20 tools
-rwxr-xr-x  1 root   root      2250  7月 16 14:28 uninstallFMS
drwxrwxr-x  7 root   root      4096  9月 10 14:20 webroot
# ./installFMS

[FlashMediaServer Install]

# unzip Flashmedia3_5_Int_Strm_ALP.zip
# cd Flashmedia3_5_Int_Strm_ALP
# ls -la
drwxr-xr-x 4 root root 4096 1月 15 2010 .
drwxr-xr-x 7 root root 4096 9月 10 12:46 ..
drwxr-xr-x 5 root root 4096 2月 17 2009 Documentation
-rw-r--r-- 1 root root 100154880 2月 5 2009 FlashMediaServer3.5.exe
-rw-r--r-- 1 root root 104494514 2月 4 2009 FlashMediaServer3.5.tar.gz
-rw-r--r-- 1 root root 39471 12月 11 2008 License.txt
drwxr-xr-x 3 root root 4096 2月 17 2009 Sample Video
-rw-r--r-- 1 root root 58 12月 8 2008 autorun.inf
-rw-r--r-- 1 root root 25214 10月 13 2008 cdicon.ico
-rw-r--r-- 1 root root 61442 1月 14 2009 readme.htm
# tar zxf FlashMediaServer3.5.tar.gz
# cd FMS_3_5_1_r516
# ./installFMS
WARNING: Your distribution, unknown, is not supported by this
Adobe Flash Media Server installer.


Copyright(C) 1993-2009 Adobe Systems Incorporated. All rights reserved.

Adobe Flash Media Server 3.5.1 for Linux

Adobe Flash Media Server 3.5.1 will be installed on this machine.

You will be asked a series of questions during the install
process and will be presented with the defaults for these questions.

Support is available at http://www.adobe.com/go/flashmediaserver_en

To install Adobe Flash Media Server now, press ENTER.

To cancel the installation at any time, press Control-C.
[ENTER]

Do you agree with the license agreement? (y/n): y

Please enter your Flash Media Server 3.5.1 serial number.

You have not entered a serial number. Falling back to
the Adobe Flash Media Development Server!

Would you like to try again? y/n: Default [n]:

Adobe Flash Media Server 3.5.1 requires approximately 200MB of
disk space.

The installer will install Adobe Flash Media Server 3.5.1 in the
following directory
Default [/opt/adobe/fms]:


The Adobe Flash Media Server communicates on the IANA-assigned
port of 1935, which is the port most Flash applications expect,
and can also communicate on port 80, both for tunneling Flash
over HTTP, and for proxying HTTP to a webserver.

Please enter the Adobe Flash Media Server port(s), comma-separated
Default [1935,80]:

Please enter the port to use for the Admin service. You can only specify one
admin port.
Default [1111]:


The administrative user name and password you provide here is required to use
the Adobe Flash Media Server Management Console for
administration, monitoring, and debugging.

Please enter the administrative username:

Please enter the administrative password:
Confirm password:


When the Adobe Flash Media Server service is started, the service
can be run as a user other than "root". The server would change to this user
when the server is started and has acquired its ports.

Please enter the user that the Adobe Flash Media Server service will run as
Default user [nobody]:

Please enter a valid user group for the "nobody" user: Default group [nobody]:


Do you want to install apache? (y/n)
Default [y]: n



Do you want the Adobe Flash Media Server service to run as a
daemon? (y/n)
Default [y]:


Do you want to start the Adobe Flash Media Server
after the installation is done? (y/n)
Default [y]:


----------- Install Action Summary -----------

Installation directory = /opt/adobe/fms

Flash Media Server Port = 1935,80
Flash Media Admin Server Port = 1111


Administrative username = xxxxxx
Administrative password = (suppressed)

service owner = nobody

service user = nobody
service group = nobody

Run as daemon = Yes
Start Flash Media Server = Yes

Proceed with the installation? (y/n/q): y

Installing Adobe Flash Media Server files...

Configuring Adobe Flash Media Server...
Adding "fms" service.
Setting default admin to "fms".
Setting autostart for "fms".
Server:fms command:start
NPTL 2.5
Starting Adobe Flash Media Server (please check /var/log/messages)

Admin server:fmsadmin command:start
Starting Adobe Flash Media Admin Server (please check /var/log/messages)


The Adobe Flash Media Server installation is complete.

2010/09/05

[Repository - CentOS-Extras,CentOS-Testing]

# rpm --import http://centos.karan.org/RPM-GPG-KEY-karan.org.txt
# vi /etc/yum.repos.d/kbsingh-CentOS-Extras.repo
[kbs-CentOS-Extras]
name=CentOS.Karan.Org-EL$releasever - Stable
gpgcheck=1
gpgkey=http://centos.karan.org/RPM-GPG-KEY-karan.org.txt
enabled=0
baseurl=http://centos.karan.org/el$releasever/extras/stable/$basearch/RPMS/
[kbs-CentOS-Testing]
name=CentOS.Karan.Org-EL$releasever - Testing
gpgcheck=1
gpgkey=http://centos.karan.org/RPM-GPG-KEY-karan.org.txt
enabled=0
baseurl=http://centos.karan.org/el$releasever/extras/testing/$basearch/RPMS/

[Repository - DAG]

DAG(rpmforge)

# vi /etc/yum.repos.d/CentOS-Dag.repo
[dag]
name=CentOS-$releasever - Dag
baseurl=http://ftp.riken.jp/Linux/dag/redhat/el$releasever/en/$basearch/dag
http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=0
gpgkey=http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt

[rhythmbox plugin for mp3]

-->Repository

# yum --enablerepo=dag install gstreamer-plugins-ugly

[USB Flash Mount on Linux]

# dmesg


sda: sda1


# mount -t vfat /dev/sda1 /mnt/flash
# umount /mnt/flash

2010/09/01

[PEAR - HTTP Access]

PHPからHTTPアクセスするために必要なもの

# pear install pager
# pear install HTTP_Request
# pear install Cache
# pear install Cache_Lite

ついでにモバイルのUser-Agentも(β版かも)
# pear install -f Net_UserAgent_Mobile

[PEAR Update]

バージョンが1.36未満の場合は一度バージョンをアップデートを行う
# pear upgrade -a PEAR-1.3.6

最新バージョンにアップデート
# pear upgrade PEAR

各種パッケージもアップデート
# pear upgrade Archive_Tar
# pear upgrade Structures_Graph
# pear upgrade PEAR

チャンネルもアップデート
# pear update-channels pear.php.net

2010/08/25

[3D Desktop 2]

問題が発生していたものですがTWINVIEWの機能を使えば問題なく動きました
以前はスクリーン間にウィンドウを通すとカクカクしていたのもなくなったし

・環境
ビデオカード:Quadro4 980 XGL
モニタ1:MITSUBISHI RDT1712S
モニタ2:HYUNDAI X93W

# vi /etc/X11/xorg.conf
Section "ServerLayout"
    Identifier "Layout0"
    Screen 0 "Screen0"
    Screen 1 "Screen1"
    InputDevice "Keyboard0" "CoreKeyboard"
    InputDevice "Mouse0" "CorePointer"
    Option "Xinerama" "off"
EndSection

Section "Files"
    FontPath "unix/:7100"
EndSection

Section "Module"
    Load "dbe"
    Load "extmod"
    Load "type1"
    Load "freetype"
    Load "glx"
EndSection

Section "InputDevice"
    # generated from default
    Identifier "Mouse0"
    Driver "mouse"
    Option "Protocol" "auto"
    Option "Device" "/dev/input/mice"
    Option "Emulate3Buttons" "no"
    Option "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from data in "/etc/sysconfig/keyboard"
    Identifier "Keyboard0"
    Driver "kbd"
    Option "XkbLayout" "jp"
    Option "XkbModel" "jp106"
EndSection

Section "Monitor"
    Identifier "Monitor0"
    VendorName "Unknown"
    ModelName "Unknown"
    HorizSync 31.5 - 81.0
    VertRefresh 50.0 - 75.0
    Option "DPMS"
EndSection

Section "Monitor"
    Identifier "Monitor1"
    VendorName "Unknown"
    ModelName "Unknown"
    HorizSync 31.5 - 56.0
    VertRefresh 56.0 - 65.0
    Option "DPMS"
EndSection

Section "Device"
    Identifier "Device0"
    Driver "nvidia"
    VendorName "NVIDIA Corporation"
    Option "TwinView"
    Option "MetaModes" "1280x1024, 1440x900"
    Option "TwinViewOrientation" "LeftOf"
    Option "ConnectedMonitor" "DFP-0,DFP-1"
    Option "SecondMonitorHorizSync" "UseEdidFreqs"
    Option "SecondMonitorVertRefresh" "UseEdidFreqs"
EndSection

Section "Screen"
    Identifier "Screen0"
    Device "Device0"
    Monitor "Monitor0"
    DefaultDepth 24
    Option "DisableGLXRootClipping" "True"
    Option "RenderAccel" "True"
    Option "AddARGBGLXVisuals" "True"
    SubSection "Display"
        Depth 24
        Modes "1280x1024" "1024x768" "800x600" "640x480"
    EndSubSection
EndSection

Section "Screen"
    Identifier "Screen1"
    Device "Device0"
    Monitor "Monitor1"
    DefaultDepth 24
    Option "DisableGLXRootClipping" "True"
    Option "RenderAccel" "True"
    Option "AddARGBGLXVisuals" "True"
    SubSection "Display"
        Depth 24
        Modes "1440x900"
    EndSubSection
EndSection

[3D Desktop]

3Dデスクトップ環境を使用するために。

・xorg.confの設定追加
# nvidia-xconfig --composite
# nvidia-xconfig --render-accel
# nvidia-xconfig --add-argb-glx-visuals -d 24

・Conpizインストール
# yum install gconf-editor
# yum install compiz
compiz.i386 0:0.0.13-0.37.20060817git.el5.centos.1
[システム]-->[設定]-->[デスクトップ効果]で有効

・Beyrlインストール

-->Repository

# yum --enablerepo=kbs-CentOS-Testing install beryl* emerald*

システムツールに宝石のアイコンのbeyrlがあるのでそこから起動できる。
ただ、いまの環境だとデュアルモニタでウィンドウ移動できるように
xorg.confで設定してある
Option "Xinerama" "on" が無理っぽい、やむえずoffにしてX立ち上げて
beyrlを起動すると片方のモニタが無反応になってしまう

問題発生(・・;

[Super User Making]

SUDOを使えるようにしてSSH接続もそのユーザーだけからしかできないように設定

# sed -e 's/#auth/auth/g' /etc/pam.d/su > /etc/pam.d/su.edit
# mv -f /etc/pam.d/su.edit /etc/pam.d/su
# groupadd ugroup
# echo "PermitRootLogin no" >> /etc/ssh/sshd_config
# echo "AllowGroups ugroup" >> /etc/ssh/sshd_config
# echo "username ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
# useradd -G wheel,ugroup,adm username
# /etc/init.d/sshd restart

2010/08/20

[Wine Install]

Windowsの環境?のようなものをエミュレートして
アプリケーションが実行できるというもの

Windowsアプリを実行するのはwine
ランタイムやパッケージをインストールしてくれるのがwinetricks

-->Repository

# yum -y --enablerepo=dag install wine

・他に必要なランタイムをインストール
# yum -y install cabextract p7zip p7zip-plugins
# cd /usr/local/bin
# wget http://www.kegel.com/wine/winetricks
# chmod 755 winetricks
# winetricks gecko

・バージョン
$ wine --version
wine-1.2
$ winetricks -V
Winetricks version 20100811. (C) 2007-2009 Dan Kegel et al. LGPL.


・インストールしたいランタイムはそのまま実行すればGUIが立ち上がって一覧がでる
# winetricks

・Windowsアプリの起動、またはインストーラーの起動
$ wine xxxsetup.exe

・インストールされたものなどは下記に入っているので
 winetricksでインストールがおかしくなったら、
 このディレクトリを削除して最初からやりなおす
${HOME}/.wine/

・ネトゲを動かしてみる
# winetricks winxp
# winetricks gecko
# winetricks allfonts
# winetricks allcodecs
# winetricks d3dx9 d3dxof dinput8 directmusic directplay quartz xact
# winetricks ddr=gdi
# wine UOSAClassic_7_0_7_1.exe
・msvcrt.dllが問題あったようなので拾ってきてインストール完了

「とりあえずランタイムとかDLL全部入れておくか」とやると
あちこちで問題が出るので必要なものだけを入れるようにする。

これやってDOTNETランタイムが入らなくなりました・・・


・winetricks オプション一覧
Packages:
7zip 7-zip file archiver
adobeair Adobe AIR runtime
art2kmin MS Access 2007 runtime
atmlib Adobe Type Manager. Needed for Adobe CS4
autohotkey Autohotkey (open source gui scripting language)
cmake CMake, the cross-platform, open-source build system
colorprofile Standard RGB color profile
comctl32 MS common controls 5.80
comctl32.ocx MS comctl32.ocx and mscomctl.ocx, comctl32 wrappers for VB6
controlpad MS ActiveX Control Pad
corefonts MS Arial, Courier, Times fonts
cygwin Unix apps for Windows (needed by some build scripts)
d3dx9 MS d3dx9_??.dll (from DirectX 9 user redistributable)
d3dx9_28 MS d3dx9_28.dll
d3dx9_36 MS d3dx9_36.dll
d3dx10 MS d3dx10_??.dll (from DirectX user redistributable)
d3dxof MS d3dxof.dll (from DirectX user redistributable)
dcom98 MS DCOM (ole32, oleaut32); requires Windows 98 license, but does not check for one
dinput8 MS dinput8.dll (from DirectX 9 user redistributable)
dirac the Dirac directshow filter
directmusic MS DirectMusic (from DirectX 9 user redistributable)
directplay MS DirectPlay (from DirectX 9 user redistributable)
directx9 MS DirectX 9 user redistributable (not recommended! use d3dx9 instead)
directx9-beta MS DirectX 9 user redistributable - beta verb (not recommended! use d3dx9 instead)
divx divx video codec
dotnet11 MS .NET 1.1 (requires Windows license, but does not check for one)
dotnet20 MS .NET 2.0 (requires Windows license, but does not check for one)
dotnet20sp2 MS .NET 2.0 sp2 (requires Windows license, but does not check for one)
dotnet30 MS .NET 3.0 (requires Windows license, but does not check for one, might not work yet)
droid Droid fonts (on LCD, looks better with fontsmooth-rgb)
dxsdk_nov2006 DirectX Software Development Kit, November 2006 version
eadm EA Download Manager
eufonts Updated fonts for Romanian and Bulgarian
ffdshow ffdshow video codecs
firefox Firefox web browser
flash Adobe Flash Player ActiveX and firefox plugins
fm20 MS Forms 2.0 Object Library
fontfix Fix bad fonts which cause crash in some apps (e.g. .net).
fontsmooth-bgr Enables subpixel smoothing for BGR LCDs
fontsmooth-disable Disables font smoothing
fontsmooth-gray Enables grayscale font smoothing
fontsmooth-rgb Enables subpixel smoothing for RGB LCDs
gdiplus MS gdiplus.dll
gecko-dbg The HTML rendering Engine (Mozilla), with debugging symbols
gecko The HTML rendering Engine (Mozilla)
gfw MS Game For Windows Live (xlive.dll)
glut The glut utility library
hosts Adds empty C:\windows\system32\drivers\etc\{hosts,services} files
ie6 Microsoft Internet Explorer 6.0
ie7 Microsoft Internet Explorer 7.0
ie8 Microsoft Internet Explorer 8.0
jet40 MS Jet 4.0 Service Pack 8
kde KDE for Windows installer
liberation Red Hat Liberation fonts (Sans, Serif, Mono)
mdac25 MS MDAC 2.5: Microsoft ODBC drivers, etc.
mdac27 MS MDAC 2.7
mdac28 MS MDAC 2.8
mfc40 MS mfc40 (Microsoft Foundation Classes from Visual C++ 4)
mfc42 MS mfc42 (same as vcrun6 below)
mingw-gdb GDB for MinGW
mingw Minimalist GNU for Windows, including GCC for Windows!
mono20 mono-2.0.1
mono22 mono-2.2
mono24 mono-2.4
mono26 mono-2.6
mozillabuild Mozilla build environment
mpc Media Player Classic
mshflxgd MS Hierarchical Flex Grid Control
msi2 MS Installer 2.0
msls31 MS Line Services 3.1 (needed by native riched?)
msmask MS Masked Edit Control
mspaint MS Paint (gotta draw stick figures somehow...)
msscript MS Script Control
msxml3 MS XML version 3
msxml4 MS XML version 4
msxml6 MS XML version 6
ogg ogg filters/codecs: flac, theora, speex, vorbis, schroedinger
ole2 MS 16 bit OLE
openwatcom Open Watcom C/C++ compiler (can compile win16 code!)
pdh MS pdh.dll (Performance Data Helper)
physx NVIDIA/AGEIA PhysX runtime
psdk2003 MS Platform SDK 2003
psdkvista MS Vista SDK (does not install yet)
psdkwin7 MS Windows 7 SDK (installing just headers and c++ compiler works)
python26 Python 2.6.2 (and pywin32)
python-comtypes Python 0.6.1-1 comtypes package
quartz quartz.dll (from Directx 9 user redistributable)
quicktime72 Apple Quicktime 7.2
riched20 MS riched20 and riched32
riched30 MS riched30
richtx32 MS Rich TextBox Control 6.0
safari Apple Safari web browser
secur32 MS secur32
shockwave Adobe Shockwave Player
steam Steam Client App from Valve
tahoma MS Tahoma font (not part of corefonts)
urlmon MS urlmon.dll
usp10 MS usp10.dll (Uniscribe)
utorrent uTorrent
vb2run MS Visual Basic 2 runtime
vb3run MS Visual Basic 3 runtime
vb4run MS Visual Basic 4 runtime
vb5run MS Visual Basic 5 runtime
vb6run MS Visual Basic 6 Service Pack 6 runtime
vc2005express MS Visual C++ 2005 Express
vc2005expresssp1 MS Visual C++ 2005 Express SP1 (does not work yet)
vc2005sp1 MS Visual C++ 2005 Service Pack 1 and ATL fix (install trial 1st)
vc2005hotfix MS Visual C++ 2005 hotfixes (install sp1 1st)
vc2005trial MS Visual C++ 2005 Trial
vcrun2003 MS Visual C++ 2003 libraries (mfc71,msvcp71,msvcr71)
vcrun2005 MS Visual C++ 2005 sp1 libraries (mfc80,msvcp80,msvcr80)
vcrun2008 MS Visual C++ 2008 libraries (mfc90,msvcp90,msvcr90)
vcrun6 MS Visual C++ 6 sp4 libraries (mfc42, msvcp60, msvcrt)
vcrun6sp6 MS Visual C++ 6 sp6 libraries (mfc42, msvcp60, msvcrt; 64 MB download)
vjrun20 MS Visual J# 2.0 SE libraries (requires dotnet20)
vlc VLC media player
wenquanyi WenQuanYi CJK font (on LCD looks better with fontsmooth-rgb)
windowscodecs MS Windows Imaging Component
wininet MS wininet.dll (requires Windows license, but does not check for one)
wme9 MS Windows Media Encoder 9 (requires Windows license, but does not check for one)
wmp10 MS Windows Media Player 10 (requires Windows license, but does not check for one)
wmp9 MS Windows Media Player 9 (requires Windows license, but does not check for one)
wsh56js MS Windows scripting 5.6, jscript only, no cscript
wsh56 MS Windows Scripting Host 5.6
wsh56vb MS Windows scripting 5.6, vbscript only, no cscript
xact MS XACT Engine (x3daudio?_?.dll, xactengine?_?.dll)
xvid xvid video codec
Pseudopackages:
alldlls=builtin Force use of builtin dlls (even if loaded with absolute path) (except for msvcp80 and d3dx9_*)
alldlls=default Remove all DLL overrides
allfonts All listed fonts (corefonts, droid, eufonts, tahoma, liberation)
allcodecs All listed codecs (xvid, ffdshow)
ddr=gdi Set DirectDrawRenderer to GDI (default)
ddr=opengl Set DirectDrawRenderer to OpenGL
dsoundbug9612 Use DirectSound MaxShadowSize=0 workaround for bug #9612
fakeie6 Set registry to claim IE6sp1 is installed
forcemono Force using mono instead of .Net (for debugging)
glsl-disable Disable GLSL use by Wine Direct3D
glsl-enable Enable GLSL use by Wine Direct3D (default)
heapcheck Enable heap checking
multisampling=enabled Enable Direct3D multisampling
multisampling=disabled Disable Direct3D multisampling (default)
native_mdac Override odbc32, odbccp32 and oledb32
native_oleaut32 Override oleaut32
nocrashdialog Disable the graphical crash dialog
orm=backbuffer Registry tweak: OffscreenRenderingMode=backbuffer
orm=fbo Registry tweak: OffscreenRenderingMode=fbo (default)
orm=pbuffer Registry tweak: OffscreenRenderingMode=pbuffer
rtlm=auto Set RenderTargetLockMode to auto (default)
rtlm=disabled Set RenderTargetLockMode to disabled
rtlm=readdraw Set RenderTargetLockMode to readdraw
rtlm=readtex Set RenderTargetLockMode to readtex
rtlm=texdraw Set RenderTargetLockMode to texdraw
rtlm=textex Set RenderTargetLockMode to textex
sandbox Sandbox the wineprefix - remove links to ~
sound=alsa Set sound driver to ALSA
sound=audioio Set sound driver to AudioIO
sound=coreaudio Set sound driver to CoreAudio
sound=esd Set sound driver to Esound
sound=jack Set sound driver to Jack
sound=nas Set sound driver to Nas
sound=oss Set sound driver to OSS
sound=disabled Disable sound
strictdrawordering=enabled Enable StrictDrawOrdering (default)
strictdrawordering=disabled Disable StrictDrawOrdering
nt40 Set windows version to nt40
win98 Set windows version to Windows 98
win2k Set windows version to Windows 2000
winxp Set windows version to Windows XP
vista Set windows version to Windows Vista
win7 Set windows version to Windows 7
winver= Set windows version to default (winxp)
volnum Rename drive_c to harddiskvolume0 (needed by some installers)
mwo=force Set MouseWarpOverride to force (needded by some games
mwo=enabled Set MouseWarpOverride to enabled (default)
mwo=disable Set MouseWarpOverride to disable
npm-repack Set NonPower2Mode to repack
psm=on Set PixelShaderMode to enabled
psm=off Set PixelShaderMode to disabled
vsm-hard Set VertexShaderMode to hardware

2010/08/19

[PHP Install]

# tar zxf php-5.3.3.tar.gz
# cd php-5.3.3
# ./configure \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-curl=/usr \
--with-pgsql=/usr/local/pgsql \
--with-zlib \
--with-gd \
--with-jpeg-dir=/usr/local/lib \
--with-png-dir=/usr/local/lib \
--with-openssl \
--enable-zip \
--enable-mbstring=all \
--enable-mbregex \
# make
# make install
# cat php.ini-production|\
sed -e "s/^;output_handler =/output_handler = mb_output_handler/" \
> /usr/local/lib/php.ini

# vi /usr/local/apache2/conf/httpd.conf
※追加
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

※変更
DirectoryIndex index.html

DirectoryIndex index.html index.php

# /etc/init.d/httpd restart

[Postgres Install]

# useradd postgres
# tar zxf postgresql-8.4.4.tar.gz
# cd postgresql-8.4.4
# ./configure
# make
# make install
# cat contrib/start-scripts/linux |\
sed -e "s/-s -l/-o \'-i\' -s -l/g" |\
sed -e "s/-s -m/-o \'-i\' -s -m/g" > /etc/init.d/postgres
# chmod 755 /etc/init.d/postgres
# chkconfig --add postgres
# mkdir /var/log/postgresql
# chown postgres:adm /var/log/postgresql
# chmod 750 /var/log/postgresql

# vi /home/postgres/.bash_profile
#LANG=ja_JP.eucJP
LANG=ja_JP.UTF-8
PATH=${PATH}:/usr/local/pgsql/bin:/home/postgres/bin
MANPATH=${MANPATH}:/usr/local/pgsql/man
PGDATA=/usr/local/pgsql/data
PGLIB=/usr/local/pgsql/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PGLIB
export LANG PATH MANPATH PGDATA PGLIB LD_LIBRARY_PATH

# vi /home/postgres/.bashrc
#LANG=ja_JP.eucJP
LANG=ja_JP.UTF-8
export LANG

# mkdir /usr/local/pgsql/data
# chown postgres:postgres /usr/local/pgsql/data

# su - postgres
$ initdb
$ exit
# /etc/init.d/postgres start

[LANG Setting]

# vi /etc/sysconfig/i18n
LANG="ja_JP.UTF-8"
SUPPORTED="ja_JP.UTF-8:ja_JP:ja"
SYSFONT="lat0-sun16"

#SYSFONTACM="8859-15"

#LANG="ja_JP.eucJP"
#SUPPORTED="ja_JP.eucJP:ja_JP:ja"

#LANG="ja_JP.UTF-8"
#SUPPORTED="ja_JP.UTF-8:ja_JP:ja"

#LANG="ja_JP.SJIS"
#SUPPORTED="ja_JP.SJIS:ja_JP:ja"

[Apache Install]

# tar zxf httpd-2.2.16.tar.gz
# cd httpd-2.2.16
# ./configure --enable-mods-shared=most --with-mpm=prefork --enable-ssl=shared
# make
# make install
# cat /usr/local/apache2/bin/apachectl | sed "3 i\# chkconfig: 345 85 15" | sed "4 i\# description: Apache Web Server daemon" | sed "5 i\#" > /etc/init.d/httpd
# chmod 755 /etc/init.d/httpd
# chkconfig --level 2345 httpd on
# mkdir -m 750 /var/log/apache2
# chown root:adm /var/log/apache2

# vi /etc/logrotate.d/apache2
/var/log/apache2/*log {
    daily
    rotate 15
    missingok
    notifempty
    create 644 root adm
    sharedscripts
    postrotate
    /etc/init.d/httpd restart
    endscript
}

2010/08/18

[GNOME Install with yum]

あんまり使わなくて忘れるのでめもめも
yum groupinstall "X Window System" "GNOME Desktop Environment"

KDEの場合
yum groupinstall "X Window System" "KDE (K Desktop Environment)"

[key setting of vmware server client]

Linuxのvmware server clientでアンダーバー「 _ 」が入力できない場合
設定ファイルに↓を追記すると入力できるようになる。

$ vi ${HOME}/.vmware/preferences
xkeymap.keycode.208 = 0x070
xkeymap.keycode.211 = 0x073

2010/08/15

[vmware server Install]

まず始めにvmwareのホームページでアカウント登録をして
vmware serverのシリアルと取得と、ファイルのダウンロードは行っておく

Kernelソースも必要なのでインストール、あとコンパイラ等も最新へ。
※起動しているカーネルとソースのバージョンはいっしょで無ければいけない
# yum update
# yum install inetd
# yum install kernel
# yum install kernel-devel
# reboot

# tar zxf VMware-server-1.0.8-126538.tar.gz
# cd vmware-server-distrib
# ./vmware-install.pl
A previous installation of VMware software has been detected.
The previous installation was made by the tar installer (version 3).
Keeping the tar3 installer database format.
Uninstalling the tar installation of VMware Server.
xinetd: no process killed
Stopping VMware services:
Virtual machine monitor [ OK ]
The removal of VMware Server 1.0.8 build-126538 for Linux completed
successfully. Thank you for having tried this software.
Installing the content of the package.
In which directory do you want to install the binary files?
[/usr/bin]
In which directory do you want to install the binary files?
[/usr/bin]
What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
[/etc/rc.d]
What is the directory that contains the init scripts?
[/etc/rc.d/init.d]
In which directory do you want to install the daemon files?
[/usr/sbin]
In which directory do you want to install the library files?
[/usr/lib/vmware]
The path "/usr/lib/vmware" does not exist currently. This program is going to
create it, including needed parent directories. Is this what you want?
[yes]
In which directory do you want to install the manual files?
[/usr/share/man]
In which directory do you want to install the documentation files?
[/usr/share/doc/vmware]
The path "/usr/share/doc/vmware" does not exist currently. This program is
going to create it, including needed parent directories. Is this what you want?
[yes]
The installation of VMware Server 1.0.8 build-126538 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command: "/usr/bin/vmware-uninstall.pl".
Before running VMware Server for the first time, you need to configure it by
invoking the following command: "/usr/bin/vmware-config.pl". Do you want this
program to invoke the command for you now? [yes]
Making sure services for VMware Server are stopped.
Stopping VMware services:
Virtual machine monitor [ OK ]
Bridged networking on /dev/vmnet0 [ OK ]
DHCP server on /dev/vmnet1 [ OK ]
Host-only networking on /dev/vmnet1 [ OK ]
DHCP server on /dev/vmnet8 [ OK ]
NAT service on /dev/vmnet8 [ OK ]
Host-only networking on /dev/vmnet8 [ OK ]
Virtual ethernet [ OK ]
You must read and accept the End User License Agreement to continue.
Press enter to display it.



Do you accept? (yes/no) yes
Thank you.
Configuring fallback GTK+ 2.4 libraries.
In which directory do you want to install the mime type icons?
[/usr/share/icons]
What directory contains your desktop menu entry files? These files have a
.desktop file extension. [/usr/share/applications]
In which directory do you want to install the application's icon?
[/usr/share/pixmaps]
Trying to find a suitable vmmon module for your running kernel.
None of the pre-built vmmon modules for VMware Server is suitable for your
running kernel. Do you want this program to try to build the vmmon module for
your system (you need to have a C compiler installed on your system)? [yes]
Using compiler "/usr/bin/gcc". Use environment variable CC to override.
What is the location of the directory of C header files that match your running
kernel? [/lib/modules/2.6.18-194.11.1.el5/build/include]
Extracting the sources of the vmmon module.
Building the vmmon module.
Using 2.6.x kernel build system.
make: ディレクトリ `/tmp/vmware-config0/vmmon-only' に入ります
make -C /lib/modules/2.6.18-194.11.1.el5/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: ディレクトリ `/usr/src/kernels/2.6.18-194.11.1.el5-i686' に入ります
CC [M] /tmp/vmware-config0/vmmon-only/linux/driver.o
CC [M] /tmp/vmware-config0/vmmon-only/linux/hostif.o
CC [M] /tmp/vmware-config0/vmmon-only/common/cpuid.o
CC [M] /tmp/vmware-config0/vmmon-only/common/hash.o
CC [M] /tmp/vmware-config0/vmmon-only/common/memtrack.o
CC [M] /tmp/vmware-config0/vmmon-only/common/phystrack.o
CC [M] /tmp/vmware-config0/vmmon-only/common/task.o
CC [M] /tmp/vmware-config0/vmmon-only/common/vmx86.o
CC [M] /tmp/vmware-config0/vmmon-only/vmcore/moduleloop.o
LD [M] /tmp/vmware-config0/vmmon-only/vmmon.o
Building modules, stage 2.
MODPOST
CC /tmp/vmware-config0/vmmon-only/vmmon.mod.o
LD [M] /tmp/vmware-config0/vmmon-only/vmmon.ko
make[1]: ディレクトリ `/usr/src/kernels/2.6.18-194.11.1.el5-i686' から出ます
cp -f vmmon.ko ./../vmmon.o
make: ディレクトリ `/tmp/vmware-config0/vmmon-only' から出ます
The module loads perfectly in the running kernel.
You have already setup networking.
Would you like to skip networking setup and keep your old settings as they are?
(yes/no) [yes]
------------------------------------------------------------------------
※ここからネットワーク設定
Do you want networking for your virtual machines? (yes/no/help) [yes]
Configuring a bridged network for vmnet0.
The following bridged networks have been defined:
. vmnet0 is bridged to eth0
All your ethernet interfaces are already bridged.
Do you want to be able to use NAT networking in your virtual machines? (yes/no)
[yes]
Configuring a NAT network for vmnet8.
Do you want this program to probe for an unused private subnet? (yes/no/help)
[yes]
Probing for an unused private subnet (this can take some time)...
The subnet 192.168.0.0/255.255.255.0 appears to be unused.
The following NAT networks have been defined:
. vmnet8 is a NAT network on private subnet 192.168.0.0.
Do you wish to configure another NAT network? (yes/no) [no]
Do you want to be able to use host-only networking in your virtual machines?
[yes]
Configuring a host-only network for vmnet1.
Do you want this program to probe for an unused private subnet? (yes/no/help)
[yes]
Probing for an unused private subnet (this can take some time)...
The subnet 172.16.0.0/255.255.255.0 appears to be unused.
The following host-only networks have been defined:
. vmnet1 is a host-only network on private subnet 172.16.0.0.
Do you wish to configure another host-only network? (yes/no) [no]
Extracting the sources of the vmnet module.
Building the vmnet module.
Using 2.6.x kernel build system.
make: ディレクトリ `/tmp/vmware-config0/vmnet-only' に入ります
make -C /lib/modules/2.6.18-194.11.1.el5/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: ディレクトリ `/usr/src/kernels/2.6.18-194.11.1.el5-i686' に入ります
CC [M] /tmp/vmware-config0/vmnet-only/driver.o
CC [M] /tmp/vmware-config0/vmnet-only/hub.o
CC [M] /tmp/vmware-config0/vmnet-only/userif.o
CC [M] /tmp/vmware-config0/vmnet-only/netif.o
CC [M] /tmp/vmware-config0/vmnet-only/bridge.o
CC [M] /tmp/vmware-config0/vmnet-only/procfs.o
CC [M] /tmp/vmware-config0/vmnet-only/smac_compat.o
SHIPPED /tmp/vmware-config0/vmnet-only/smac_linux.x386.o
LD [M] /tmp/vmware-config0/vmnet-only/vmnet.o
Building modules, stage 2.
MODPOST
WARNING: could not find /tmp/vmware-config0/vmnet-only/.smac_linux.x386.o.cmd for /tmp/vmware-config0/vmnet-only/smac_linux.x386.o
CC /tmp/vmware-config0/vmnet-only/vmnet.mod.o
LD [M] /tmp/vmware-config0/vmnet-only/vmnet.ko
make[1]: ディレクトリ `/usr/src/kernels/2.6.18-194.11.1.el5-i686' から出ます
cp -f vmnet.ko ./../vmnet.o
make: ディレクトリ `/tmp/vmware-config0/vmnet-only' から出ます
The module loads perfectly in the running kernel.
The default port : 902 is not free. We have selected a suitable alternative
port for VMware Server use. You may override this value now.
Remember to use this port when connecting to this server.
Please specify a port for remote console connections to use [904]
※ポートの設定
------------------------------------------------------------------------
WARNING: VMware Server has been configured to run on a port different from the
default port. Remember to use this port when connecting to this server.
xinetd を停止中: [ OK ]
xinetd を起動中: [ OK ]
Configuring the VMware VmPerl Scripting API.
Building the VMware VmPerl Scripting API.
Using compiler "/usr/bin/gcc". Use environment variable CC to override.
Installing the VMware VmPerl Scripting API.
The installation of the VMware VmPerl Scripting API succeeded.
Generating SSL Server Certificate
In which directory do you want to keep your virtual machine files?
[/var/lib/vmware/Virtual Machines] /work/vmware/
※仮想HDDで数ギガ以上必要なのでHDDと相談で。
/usr/lib/vmware/bin/vmware-vmx: error while loading shared libraries: libXtst.so.6: cannot open shared object file: No such file or directory
Please enter your 20-character serial number.
Type XXXXX-XXXXX-XXXXX-XXXXX or 'Enter' to cancel: ABCDE-FGHIJ-KLMNO-OPRST
Starting VMware services:
Virtual machine monitor [ OK ]
Virtual ethernet [ OK ]
Bridged networking on /dev/vmnet0 [ OK ]
Host-only networking on /dev/vmnet1 (background) [ OK ]
Host-only networking on /dev/vmnet8 (background) [ OK ]
NAT service on /dev/vmnet8 [ OK ]
The configuration of VMware Server 1.0.8 build-126538 for Linux for this
running kernel completed successfully.
------------------------------------------------------------------------
・vmwareの起動・停止
/etc/init.d/vmware start
/etc/init.d/vmware stop
/etc/init.d/vmware restart
・他のPCからvmwareへ接続するときの接続先例
[IP Address]:[port]
192.168.xxx.xxx:904

[xorg.conf - TWINVIEW]

とりあえずデュアルヘッドの表示ができるxorg.conf
ビデオカード:Quadro4 980 XGL
モニタ1:MITSUBISHI RDT1712S
モニタ2:HYUNDAI X93W

Section "ServerLayout"
Identifier "Multihead layout"
Screen 0 "Screen0" 0 0
Screen 1 "Screen1" LeftOf "Screen0"
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
Option "Xinerama" "true"
Option "Clone" "on"
EndSection

Section "Module"
Load "glx"
Load "extmod"
EndSection

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/input/mice"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
Option "XkbModel" "jp106"
Option "XkbLayout" "jp"
EndSection

Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "1280x1024"
HorizSync 31.5 - 81.0
VertRefresh 50.0 - 75.0
Option "DPMS"
EndSection
Section "Monitor"
Identifier "Monitor1"
VendorName "Monitor Vendor"
ModelName "Monitor 1440x900"
HorizSync 31.5 - 56.0
VertRefresh 56.0 - 65.0
Option "dpms"
EndSection

Section "Device"
Identifier "Videocard0"
Driver "nvidia"
EndSection

Section "Device"
Identifier "Videocard1"
Driver "nvidia"
BusID "PCI:1:0:0"
Screen 1
EndSection

Section "Screen"
Identifier "Screen0"
Device "Videocard0"
Monitor "Monitor0"
DefaultDepth 24
Option "AddARGBGLXVisuals" "True"
Option "DisableGLXRootClipping" "True"
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1280x1024"
EndSubSection
EndSection

Section "Screen"
Identifier "Screen1"
Device "Videocard1"
Monitor "Monitor1"
DefaultDepth 24
Option "AddARGBGLXVisuals" "True"
Option "DisableGLXRootClipping" "True"
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1440x900"
EndSubSection
EndSection

[CentOS5 Install(Compiler etc.)]

※CentOSのインストールは最小セットアップにした場合
yum install yum
yum update

yum install gcc gcc-c++ flex readline-devel zlib-devel autoconf automake curl curl-devel libxml2-devel dbus-devel db4-devel dbh-devel yum-utils gtk2-devel audit-libs-devel nss-devel libX11-devel pam-devel ntpd inetd
yum install kernel kernel-devel

2010/08/09

[Fedora10 Kernel]

# yum install rpmdevtools yum-utils
# su - username
$ rpmdev-setuptree
$ ls ~/rpmbuild/
BUILD RPMS SOURCES SPECS SRPMS
$ yumdownloader --source kernel
$ ls
kernel-2.6.27.41-170.2.117.fc10.src.rpm
$ su
# yum-builddep kernel-2.6.27.41-170.2.117.fc10.src.rpm
# exit
$ rpm -Uhv kernel-2.6.27.41-170.2.117.fc10.src.rpm
$ cd ~/rpmbuild/SPECS
$ rpmbuild -bp --target=`uname -m` kernel.spec
$ ls ~/rpmbuild/BUILD/kernel-2.6.27/linux-2.6.27.i686/
$ cd ~/rpmbuild/BUILD/kernel-2.6.27/linux-2.6.27.i686
$ cp configs/kernel-2.6.27.41-i686.config .config
$ make oldconfig
$ make menuconfig

$ cd ~/rpmbuild/SPECS
$ vi kernel.spec
#% define buildid .local

%define buildid .r20100809
$ rpmbuild -bb --target=`uname -m` kernel.spec
$ cd ~/rpmbuild/RPMS/i686
$ ls
$ su
# rpm -ivh kernel-2.6.27.41-170.2.117.r20100809.fc10.i686.rpm
エラー: 依存性の欠如:
kernel-firmware >= 2.6.27.41-170.2.117.r20100809.fc10 は kernel-2.6.27.41-170.2.117.r20100809.fc10.i686 に必要とされています

最後にエラー。ちゃんと理解はしていないのでよく分からず(ノ・)
また今度チャレンジ。

2010/07/23

[ffmpeg-php Compilation]

ffmpeg-php-0.6.0をコンパイルしたらエラーがでたのでめもめも

ウェブで調べてたらRGBA32をRGBAに変更するとコンパイルが通ると
出てたのでやってみたが、いざサムネイル用に画像を出力すると
色がどうもおかしい…

いろいろ試した結果、RGBA32をRGB32に変更すると問題なくできる。

2010/07/22

[ChrootDirectory is used by the Match directive]

目的は、sftpでファイルのアップロード、ユーザーのSSH接続は制限

Matchディレクティブでユーザー又はグループを指定して
ChrootDirectoryを設定すればできるとの事ですが、
CentOS5ではOpenSSHのバージョンが古くて
対応してなかったのでOpenSSHの更新から。

# wget http://mirror.proserve.nl/repo/centos/SRPMS/openssh-5.1p1-1.lpk.src.rpm
# yum install gtk2-devel audit-libs-devel nss-devel libX11-devel pam-devel zlib-devel openldap-devel openssl-devel
# rpmbuild --rebuild openssh-5.1p1-1.lpk.src.rpm
# cd /usr/src/redhat/RPMS/i386/
# rpm -Uvh openssh-*5*.rpm


これでインストールまでできたはずなのであとはルート設定
# vi /etc/ssh/sshd_congig
Subsystem sftp internal-sftp
Match User username
ChrootDirectory /home/%u


ユーザーのホーム設定の末尾に「./」をつけないといけないらしい
# vi /etc/passwd
username:x:500:500::/home/username/:/bin/bash

username:x:500:500::/home/username/./:/bin/bash


ルートディレクトリに設定するためには所有者をrootにしないとだめとの事
# chown root:root /home/username
# chmod 750 /home/username

このままだとusernameでは書き込みができないので
書き込みが可能なディレクトリを作成
# mkdir /home/username/upload
# chown username:username /home/username/upload
# chmod 700 /home/username/upload

SSHD再起動
# /etc/init.d/sshd restart