Saturday, October 27, 2007
Icon wireless strength
Alt-F2, tpye: nm-applet
and see result
Tuesday, October 23, 2007
Install Skype Ubuntu Gutsy
- dd the Skype repository (If you don't know how to add repositories please see: Repositories/Ubuntu) deb http://download.skype.com/linux/repos/debian/ stable non-free
- Reloaded or updated the package information
- Install Skype:
# sudo apt-get install skype
Tuesday, October 9, 2007
Config Tomcat on Ubuntu
sudo gedit /etc/profile
at the end of file, type
JAVA_HOME=/usr/lib/jvm/jdk1.6.0
JRE_HOME=/usr/lib/jvm/jdk1.6.0/jre
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib/tools.jar
MANPATH=$MANPATH:$JAVA_HOME/man
CATALINA_HOME=/home/misa/soft/apache-tomcat-6.0.14
export JAVA_HOME PATH CLASSPATH MANPATH CATALINA_HOME JRE_HOME
Thursday, October 4, 2007
install stardict unbuntu
sudo apt-get install stardict
Add new directories in: /usr/share/stardict/dic/
Wednesday, October 3, 2007
Kiba Dock OSX
sudo gedit /etc/apt/sources.list
1. Add the following lines to the end of the file:
deb http://download.tuxfamily.org/3v1deb feisty eyecandy
deb-src http://download.tuxfamily.org/3v1deb feisty eyecandy
1. Save and Exit Gedit.
2. Run from the terminal window:
# wget http://download.tuxfamily.org/3v1deb/DD800CD9.gpg -O- | sudo apt-key add -
# sudo apt-get update
# sudo apt-get install kiba-dock
# sudo apt-get install kiba-dock-dev
# sudo apt-get install kiba-plugins
hen press Alt + F2 and type kiba-dock and it should work
Saturday, August 25, 2007
Process XML with JDOM
JDOM makes use of standard Java coding patterns. Where possible, it uses the Java new operator instead of complex factory patterns, making object manipulation easy, even for the novice user. For example, let's look at how you would build a simple XML document from scratch using JDOM. The structure we are going to build is shown in Listing 1. (Download the complete code for this article from Resources.)
Listing 1. Sample XML document to build
Toyota
Celica
1997
green
1ABC234
Wednesday, August 22, 2007
Server Online
Từ trước tới giờ, đã bao nhiêu website được bạn gõ vào khung địa chỉ trình duyệt? Có bao giờ bạn nghĩ đến việc mình sẽ tự làm một website trên chính máy tính của mình chưa? Việc triển khai một web server như vậy khó không nhỉ, tốn kém nữa? Câu trả lời là bạn không tốn một đồng nào ngoài chi phí Internet để biến máy tính của mình thành một web server thực thụ, giống như những website mà bạn đã từng ghé thăm. Có thể bạn không tin, nhưng bạn sẽ thay đổi ý kiến đến khi đọc xong bài viết này. Điều kiện để bạn làm được điều này là phải có đường truyền kết nối Internet bằng dial-up, nhưng tốt nhất là ADSL (khó làm hơn, nhưng ít chi phí Internet hơn).
Qui trình làm một web server bao gồm những bước chính sau:
-Làm sao để máy tính của bạn hiện diện trên Internet
-Cài đặt các dịch vụ web lên máy tính của bạn
-Công bố website để mọi người trên Internet có thể truy cập
Khi bạn đã làm thành công web server, tôi sẽ hướng dẫn bạn triển khai thêm các dịch vụ:
-Triển khai dịch vụ FTP
-Làm mail server online
Phần 1: Qui trình làm một web server
- Làm sao để máy tính của bạn hiện diện trên Internet
Đến đây, bạn đã thấy việc hiện diện trên Internet chằng phức tạp phải không? Nhưng mục tiêu của chúng ta là phải có một cái tên như www.yahoo.com chẳng hạn, chứ không phải những con số khó nhớ và lại bị thay đổi sau mỗi lần mở lại kết nối Internet. Thật may là hiện nay có một số website cho phép bạn tạo một cái tên để đặt cho máy tính của mình, như www.dyndns.org, www.no-ip.com, và VNNIC cũng đã cung cấp dịch vụ này.
Sau đây là qui trình tạo một cái tên cho máy tính của bạn:
-Vào trang web www.no-ip.com và đăng ký một tài khoản (account) miễn phí bằng cách click vào “Sign-up now” (hình 1.1). Cách thức đăng ký giống như bạn tạo một tài khoản trên các diễn đàn, lưu ý là bạn phải cung cấp địa chỉ email của bạn chính xác, no-ip sẽ gởi email để bạn kích hoạt tài khoản vừa tạo (hình 1.2).

Hình 1.1: trang chủ của www.no-ip.com

Hình 1.2: bước đăng ký một account mới
-Sau khi tạo xong tài khoản, bạn kiểm tra email và kích hoạt tài khoản bằng cách click vào liên kết trong email. Sau đó quay lại trang web www.no-ip.com và login bằng account vừa tạo. Chú ý là login bằng cách gõ vào địa chỉ mail và mật khẩu.
-Khi đã đăng nhập thành công, bạn click vào link “Add” và chọn tên máy tính của bạn như hình 1.3, ở đây tôi đặt tên là TGACong.no-ip.info (Thế Giới @) bằng cách điền vào “Hostname” là “TGACong” và chọn combo box bên dưới là “no-ip.info”. Sau đó bạn nhấn nút Create Host (phía dưới trang web), và đừng quan tâm đến những ô khác ngay lúc này.


Hình 1.3: màn hình tạo tên máy tính
-Tiếp theo, bạn kiểm tra lại xem tên vừa tạo đã có trong danh sách chưa, bằng cách click chuột vào link “Manage” và xem kết quả như hình 1.4

Hình 1.4: kiểm tra tên máy (host) vừa tạo xong tgacong.no-ip.com
-Bước cuối cùng của giai đoạn này là bạn cần download phần mềm thông báo địa chỉ IP của bạn cho tên máy tính vừa tạo ra. Bạn hãy click vào tab “Downloads” và chọn hệ điều hành là Windows, rồi bắt đầu download phần mềm (hình 1.5). Sau khi download xong, bạn chạy file đó (tên file là ducsetup.exe) và cứ “Next” cứ “OK” đến khi hoàn thành. Bạn bắt đầu chạy vừa cài đặt, nó nằm ở ngay desktop, và xuất hiện cửa sổ No-IP DUC, bạn nhấn vào nút “Edit” để nhập địa chỉ email và password đã đăng ký, minh họa hình 1.6, sau đó nhấn OK. Khi quay về cửa sổ chính của chương trình, bạn hãy check vào các tên máy muốn sử dụng, nếu thấy biểu tượng khuôn mặt màu vàng thì tên đó đã được cập nhật đúng địa chỉ IP. Mặc định khi bạn bật máy tính, chương trình thông báo IP sẽ không chạy đến khi bạn kích hoạt nó. Nếu muốn chương trình tự động chạy, bạn click vào nút “Options” ở cửa sổ chính, trong cửa sổ Options bạn check vào ô “Run as a system service”. Đến đây bạn có thể thở phào được rồi, chúc mừng bạn đã tạo xong tên máy tính cho riêng mình.

Hình 1.5: download chương trình thông báo IP

Hình 1.6: màn hình đăng nhập account no-ip để gởi địa chỉ IP

Hình 1.7: màn hình cấu hình để chương trình thông báo IP tự động chạy
- Cài đặt các dịch vụ web lên máy tính của bạn
Bước 1: vào Control Panel của Windows (hình 2.1)
Bước 2: khi bạn đã vào được Control Panel, nhấp đúp chuột vào biểu tượng “Add or Remove Programs” (hình 2.2), sẽ xuất hiện cửa sổ “Add or Remove Programs”. Bạn nhấn vào nút ở bên trái có tên “Add/Remove Windows Components” sẽ xuất hiện cấu hình mới (hình 2.3). Bạn click chuột lên dòng chữ “Application Server”, lưu ý là không thay đổi trạng thái đã check của dòng này. Sau đó nhấn nút “Details”.
Bước 3: bạn check vào Internet Information Services (IIS) như hình 2.4
Bước 4: bạn tiếp tục nhấn OK và Next cho đến khi hoàn tất. Trong quá trình này, có thể máy tính sẽ yêu cầu bạn bỏ đĩa CD cài đặt Windows vào, vì vậy bạn cần chuẩn bị sẵn đĩa CD. Đến đây thì IIS đã được cài đặt lên máy của bạn.

Hình 2.1: vào Control Panel của Windows

Hình 2: trong Control Panel của Windows chọn Add or Remove Programs

Hình 2.3: cửa sổ Windows Components

Hình 2.4: chọn cài đặt dịch vụ Internet Information Services
Bước 5: Tự tạo trang web cho riêng mình. Nếu bạn muốn thử cho nhanh, hãy dùng Internet Explorer hoặc Firefox để truy cập một trang web nào đó, rồi lưu lại trên máy đã cài IIS để thử nghiệm (hình 2.5). Bạn nhớ đặt vị trí và tên trang web theo dạng sau: lưu ở thư mục C:\myweb\ và đặt tên là default.htm như hình 2.6. Nếu bạn biết cách tạo trang web bằng FrontPage hay DreamWaver, bạn cũng đặt tên như vậy và lưu đúng vị trí nhé.

Hình 2.5: lưu lại trang web www.no-ip.com

Hình 2.6: chọn vị trí và tên trang web để lưu lại
Bước 6: cấu hình IIS để chọn trang web vừa lưu là trang chủ. Đây là bước khá quan trọng, bạn cần làm cẩn thận để tránh sai xót. Đầu tiên bạn mở IIS Manager như hình 2.7. Tiếp theo bạn click chuột phải vào “Default Web Site” như trong hình 2.8 và chọn “Properties”. Sau khi cửa “Default Web Site Properties” xuất hiện, bạn chọn tab “Home Directory” như hình 2.9 và sửa ô “Local Path” thành C:\myweb\. Hẳn bạn còn nhớ ở bước 5 bạn đã lưu trang web thử nghiệm ở đây. Lúc này bạn nhấn OK để hoàn tất việc cấu hình IIS.

Hình 2.7: mở chương trình IIS

Hình 2.8: cửa sổ IIS Manager

Hình 2.9: cửa sổ cấu hình các thuộc tính của một website
Bước 7: thử nghiệm web server của bạn. Chà chà, đã đến lúc xem web server của bạn chạy thế nào. Bạn hãy lấy 1 máy tính nào đó trong mạng nội bộ, mở Internet Explorer hoặc Firefox và gõ địa chỉ IP của web server mà bạn vừa vất vả cài đặt. Nếu may mắn, bạn sẽ thấy trang web đã lưu hiện lên giống hình 2.10

Hình 2.10: thử nghiệm web server vừa tạo có địa chỉ IP 172.29.8.1
- Công bố website để mọi người trên Internet có thể truy cập

Hình 3.1: thử nghiệm truy cập web server của bạn bằng tên máy tính bạn đã tạo.
Nếu bạn sử dụng ADSL router, bạn phải làm thêm 1 số bước nữa để hoàn tất công việc. Đó là cấu hình chuyển hướng cổng 80 vào web server của bạn, và đổi cổng cấu hình router.
Hãy tưởng tượng router ADSL của bạn có địa chỉ IP hợp lệ (IP thật), khi một máy tính trên Internet mở kết nối đến bạn thì router ADSL sẽ nhận được kết nối này. Vì vậy bạn phải cấu hình để router chuyển hướng kết nối đến web server bên trong.
Tôi sẽ lấy ví dụ trên router ADSL của DrayTek, bạn cần làm hai động tác:
-Chuyển hướng cổng 80 vào địa chỉ IP của web server: bạn vào màn hình cấu hình router bằng web, rồi đến mục Advanced Setup> NAT Setup> Port Redirection, sau đó cấu hình giống như dòng số 3 của hình 3.2, và nhấn OK.

Hình 3.2: cấu hình chuyển cổng 80 về địa chỉ IP của web server 172.29.8.1
-Đổi cổng cấu hình router sang cổng khác, vì mặc định cổng này là 80. Bạn vào mục System Management> Management Setup và chỉ định HTTP port, ví dụ 8000, để tránh đụng độ với port 80 của web. Sau khi nhấn OK, bạn đã hoàn tất công việc.

Hình 3.3: cấu hình thay đổi cổng điều khiển router
Bạn hãy hưởng thụ thành quả của mình bằng cách mở trình duyệt và gõ vào tên máy tính bạn đã đặt.
Lưu ý:
Một số router ADSL không hỗ trợ định tuyến ngược như Zoom X5. Nếu bạn lấy một máy tính bên trong mạng để thử truy cập web server bằng tên host, có thể sẽ không thành công. Bạn hãy giờ một người ở ngoài Internet thử giúp bạn.
Monday, August 20, 2007
Install Thunderbird on Ubuntu
1. Download file Thunderbird http://www.mozilla.com/en-US/thunderbird/
2. Unzip
3. sudo cp -r -s /home/misa/soft/thunderbird /usr/lib
4. sudo ln -s /usr/lib/thunderbird/thunderbird /usr/bin/thunderbird
That's ok!
Create icon on Internet Menu:
1. sudo gedit /usr/share/applications/thunderbird.desktop
Type:
[Desktop Entry]
Encoding=UTF-8
Name=Thunderbird
Comment=Thunderbird Mail Client
Exec=thunderbird
Icon=/usr/bin/thunderbird/icons/mozicon16.xpm
StartupNotify=true
Terminal=false
Type=Application
Categories=Applications;Network
Wednesday, July 25, 2007
Fix bug Opera on Ubuntu
/usr/lib/opera/9.0-20060616.6/opera: error while loading shared libraries: libqt-mt.so.3: cannot open shared object file: No such file or directory
wget http://ubuntu.mirrors.tds.net/ubuntu/pool/main/q/qt-x11-free/libqt3-mt_3.3.6-1ubuntu3_i386.deb
sudo dpkg -x libqt3-mt_3.3.6-1ubuntu3_i386.deb .
sudo cp ./usr/lib/libqt* /usr/lib32/
Wednesday, July 4, 2007
Fix bug Tomcat 5.5.23 - Netbeans JSF - Database Driver
- Right-click on project, choose Propertises/Build/Packaging/Add File, then browse the database driver, set Path in WAR is WEB-INF/lib
- Copy driver into JAVA_HOME/jre/lib/ext
- Restart Tomcat and run project
Tuesday, July 3, 2007
Set Default Template
This one’s for those using an alternative to Microsoft Office–OpenOffice.org.
Tired of changing the default page size from A4 to Letter everytime you create a new Writer document? Do you wish adding a page number on each page of your more-than-a-page document were not an additional task amidst the rush?
Do you wish to change the default Writer document template?
Easy.
- Create a new document. (
File->New->Text Documentor press Ctrl+N if you’re in the Writer mode or start OpenOffice.org Writer from your desktop’s program menu.) - Change the way it looks on the screen and off the printer. The following may be your concern:
- Page setup. Choose
Format->Pagefrom the menu. Change the page setup as you wish, e.g., size, margins. - Footer or header. If you want to paginate your document, that is, put page number on each page say at the bottom, choose
Insert->Footer->Default. You are then brought to the footer area. Press Ctrl+R to put the cursor to the right margin. Then chooseInsert->Fields->Page Number. - Default font. Let’s say you hate Times New Roman and want to boast of the beauty of Deja Vu. Fire up the Styles and Formatting box by pressing F11 (note that pressing F11 with the box already open closes it). Right-click on the paragraph style called Default and a menu pops up. Select
Modify. With the Paragraph Style dialog box open, go to the Font tab. Then locate the font Deja Vu, click on it and then click on the OK command button.
- Page setup. Choose
- After finally deciding on the document setup, save it as your template by choosing from the menu
File->Templates->Save. With the Templates box open, enter the name for your default document and then click on the OK command button. Choose File->Templates->Organizefrom the menu. With the Template Management dialog box open, locate your saved default document template by double-clicking on theMy Templatesitem in the left side. Select the template. Then click on the Commands button at the right side, and click on theSet As Default Templateitem. And then close the dialog box.
You are now ready to create new documents using the template you customized yourself.
Monday, July 2, 2007
config java 6 ubuntu
$ chmod a+x jdk-6-linux-i586.bin$ sudo ./jdk-6-linux-i586.bin$ sudo mkdir /usr/lib/jvm$ sudo mv jdk1.6.0 /usr/lib/jvm/$ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0/bin/java" 1$ sudo update-alternatives --set java /usr/lib/jvm/jdk1.6.0/bin/java$ sudo gedit /etc/profile# Variáveis ambiente do JDK 6.0
JAVA_HOME=/usr/lib/jvm/jdk1.6.0
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib/tools.jar
MANPATH=$MANPATH:$JAVA_HOME/man
export JAVA_HOME PATH CLASSPATH MANPATH$ java -version$ javac -version
Thursday, June 28, 2007
Opera on Ubuntu
OperaBrowser
Instructions to install & configure Opera 9.20 in Ubuntu, based off
this Ubuntu Forum thread.
Introduction
There are two basic types of installations, static and shared:
Static version: Opera has the Qt library built in. It is a larger download, and it does not use anti aliased fonts on menus or the file chooser, and uses aliasing in the browser window and most other interface elements.
Shared version: Opera uses the Qt installation on your system. It integrates with the system, using whatever anti aliasing setting you have for other Qt applications.
Which is better? Probably the Shared version. Try the other one if you run into installation problems.
Installation
Method 1
Install deb package manually
Go to
Opera Download Site, choose your package, and pick a download mirror. This site does not offer a choice between Shared Qt and Static Qt, so if you have a preference, use
this directory (be sure to choose a .deb package). Save the file to somewhere you can find it, like the Desktop or your home directory.
Ubuntu 7.04 Feisty Fawn
Locate the .deb package and double click on it to start the Gdebi .deb installer.
Ubuntu 6.10 Edgy Eft
Locate the .deb package and double click on it to start the Gdebi .deb installer. The installer might warn you at the end of a conflict with an existing opera package installation. It seems that you can ignore the error, your package has been installed properly anyway. Just check in your Applications menu under Internet, you should see the Opera icon.
Ubuntu 6.06 Dapper Drake
Locate the .deb package and double click on it to start the Gdebi .deb installer.
Opera will take a minute to install.
If you get messages about unmet dependencies type:
sudo apt-get -f install
apt will then install the missing packages.
Method 2
Install via repository
Ubuntu 7.04 Feisty Fawn
The Opera browser is available from the Canonical commercial repository. To get it through Synaptic or apt, add the following line to your repository list (see Adding Other Repositories):
Add the following line to your repository list (see Adding Other Repositories):
deb http://archive.canonical.com/ubuntu feisty-commercial main
Alternatively, to use the opera.com repository add the following line instead:
deb http://deb.opera.com/opera/ stable non-free
After making these changes install the opera package (see InstallingSoftware).
If using the opera.com repository, it is advisable that you add the Opera GPG key. The installation steps are described
here.
Ubuntu 6.10 Edgy Eft
The Opera browser is available from the Canonical commercial repository. To get it through Synaptic or apt, add the following line to your repository list (see Adding Other Repositories):
deb http://archive.canonical.com/ubuntu edgy-commercial main
After making these changes install the opera package (see InstallingSoftware).
Ubuntu 6.06 Dapper Drake
The Opera browser is available from the Canonical commercial repository. To get it through Synaptic or apt, add the following line to your repository list (see Adding Other Repositories):
deb http://archive.canonical.com/ubuntu dapper-commercial main
However, as of 2007.05.05, only 9.10 is available. It is adviseable to install the latest version (9.20) for security reasons, so rather use Opera's own repositories by adding the following instead:
deb http://deb.opera.com/opera/ stable non-free
After making these changes install the opera package (see InstallingSoftware).
64-bit
Opera is, alas, closed source. That means that we will have a 64-bit version only when Opera Software gets around to making one. In the meantime, you can run still run 32-bit Opera in a 64-bit OS with a few extra steps.
I have had better luck with the static version of Opera. That way you don't have to worry about the 32-bit QT dependency. Install it with
sudo dpkg -i --force-architecture opera-static....deb
You will also want some compatibility-layers:
sudo aptitude install ia32-libs ia32-libs-gtk lib32asound2 linux32
Opera should work now. Now you need some plugins. There are other places to get better guides, but here is a quick run through.
To get Flash 9, get the "flashplugin-nonfree" package from packages.ubuntu.com, for i386. Install it with the same dpkg command as above.
To get Adobe acroread, get the packages "acroread", "acroread-escript", and "mozilla-acroread" from packages.ubunu.com. You will have to get the ones for Edgy or earlier because licensing changes prevent inclusion in Feisty and later. Install with the same dpkg command as above.
Making it more compatible with GNOME
Opera will now be accessible from Applications-->Internet-->Opera.
To get Opera to work better with GNOME, we're going to make sure it uses gnome-open for file-handling. Open a Terminal and type:
mkdir ~/.opera
cat >> ~/.opera/filehandler.ini
Select the following text and paste it into your terminal by pressing Shift+Ins:
Opera Preferences version 2.0
; Do not edit this file while Opera is running
; This file is stored in UTF-8 encoding
[Settings]
Default File Handler=gnome-open ,1
Default Directory Handler=gnome-open ,1
Then press Ctrl+d.
Skins for Opera
Press SHIFT+F12 and browse the available skins, pick any you like. Changing, adding, and removing them is very easy, and new ones are created very often. Below are some skins that might suit you.
The main page for Opera skins is
http://my.opera.com/community/customize/skins/.
GNOME Skins for Opera
You may preview the skins linked below:
In Opera, select "Download" to install the skin.
KDE Skin for Opera
You may preview the skins linked below:
In Opera, select "Download" to install the skin.
Integration with Gaim/Pidgin
In Tools->Preferences->Advanced->Programs, add a new protocol you want to add(eg. ymsgr for Yahoo) and select "Open with other application" and enter /usr/bin/gaim-url-handler(gaim) or /usr/bin/purple-url-handler(pidgin).
Protocol integration with KDE
In the Tools->Preferences->Advanced->Programs, add a new protocol you want to add(eg. ymsgr for Yahoo) and select "Open with other application". Then, if you want to use the default program you set in KDE, just set the handler to "kfmclient exec".
Setting Opera as default browser in GNOME
To set Opera as the system default browser and mailreader, follow these steps:
Go to System -> Preferences -> Preferred Applications
Under the Web Browser tab select "Opera" and select "Open link in new tab"
Under the Mail Reader tab select "Custom" and, in the Command box, enter:
opera -newmail "%s"
Troubleshooting
Missing package
If you have choosen the qt-shared version, you need the libqt-mt package. However, this trick does not work with Ubuntu 6.10 Edgy Eft.
Ubuntu 6.06 Dapper Drake
Download the package for your architecture and double click the .deb to install.
Rerun installation of Opera and the dependancy problems will be gone.
Install Java
If you start Opera from the console you may see the following error message if java doesn't work correctly:
ERROR: ld.so: object 'libjvm.so' from LD_PRELOAD cannot be preloaded: ignored.
ERROR: ld.so: object 'libawt.so' from LD_PRELOAD cannot be preloaded: ignored.
To fix this, correct the Java path under Tools -> Preferences -> Advanced Tab -> Content -> Java options. It should look similar to this:
/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/lib/i386/
Your actual java runtime version could be different from this one. Changes will not take effect until the browser is restarted. Use
http://www.java.com/en/download/help/testvm.xml to test your Java Virtual Machine (JVM). You need to have Java installed for this. See Java to find out how to do that.
General Plugin Problems
In order for Opera to see a plugin, the plugin must be in Opera's plugin path. You can add directories to the plugin path with Tools -> Preferences -> Advanced -> Content -> Plugin Options. Add the desired directories and click Find Plugins. You may have to restart Opera to enable the plugin.
Some common plugin .so files:
| Shockwave Flash | libflashplayer.so |
| Acroread | nppdf.so |
| GXine | gxineplugin.so |
| Mplayer | mplayerplug-in.so |
Flash problems
Just use the latest version of flash
RestrictedFormats/Flash.
Acroread Plugin Problems
The acroread plugin did work by default in Opera 8.x. It works for recent versions so you probably do nto need following:
You must edit the Opera startup script for it to work. Use your favorite editor to open the opera startup script:
gksudo gedit /usr/bin/opera
Replace the lines
OPERA_LD_PRELOAD="${LD_PRELOAD}"
export OPERA_LD_PRELOAD
with
LD_PRELOAD="libXm.so.2:${LD_PRELOAD}"
export LD_PRELOAD
OPERA_LD_PRELOAD="${LD_PRELOAD}"
export OPERA_LD_PRELOAD
Start Opera and open a pdf. When it asks you what to do, click the Change button next to the Opens With. A file type association dialog should popup; choose the plugin option at the bottom (nppdf.so should be an option).
Opera Segmentation Fault and Java crash with static version problem
If your Opera browser started to segfault, or you are using the static version and having problems with java, do the following:
1. Edit the ~/.opera/pluginpath.ini, and change the lines to this
[Paths]
/usr/lib/opera/plugins=1
/usr/lib/mozilla/plugins=0
/usr/lib/netscape/plugins-libc6=0
2. Create a symlink from /usr/lib/mozilla/plugins/libflashplayer.so to /usr/lib/opera/plugins/libflashplayer.so
3. Check your ~/.opera/javapath.txt, when using blackdown java, it should be /usr/lib/j2se/1.4/jre/lib/i386
Solution from rwf, based on
this forum thread.
Video plugins
As of now (May 2007), embedded video playback does not work well in opera. The probably best plugin, mozilla-mplayer, works only partialy and requires
manual compiling. You can try vlc, gxineplugin or totem, but it is probably adviseable to just use Firefox for sites as
http://www.apple.com/trailers
Install Weekly Build
These are developement unstable version, use on your own risk!
Download weekly build from
http://my.opera.com/desktopteam/ and follow instructions for installing snapshot release (see above). To locate libxpcom.so on your system and softlink it to /usr/lib
sudo ln -s /usr/lib/mozilla-firefox/libxpcom.so /usr/lib/libxpcom.so
Credits
Credits for the GNOME skin:
mneptok
Tuesday, June 26, 2007
Install PostgreSQL on Ubuntu
Introduction
PostgreSQL is a fully featured object-relational database management system. It supports a large part of the SQL standard and is designed to be extensible by users in many aspects. Some of the features are: ACID transactions, foreign keys, views, sequences, subqueries, triggers, user-defined types and functions, outer joins, multiversion concurrency control. Graphical user interfaces and bindings for many programming languages are available as well.Postgresql Database Installation in Debian
If you want to install the PostgreSQL base system as well as a textual clientrun the following command from your shell
#apt-get install postgresql postgresql-client
This will install a lot of package dependencies as well. The version of PostgreSQL installed should be 7.4 on a common Debian Sarge system. If you want to check the official documentation click here.
A few questions will be asked by the configuration script. Most of them can be simply agreed, but you might want to read them to know what configuration PostgreSQL will use.
Data directory All database data will be kept in /var/lib/postgres/data by default.
Data removal policy Also by default, a PostgreSQL system removal won't remove the data (database contents).
Locale The locale should be configured to accept the character encoding you are going to use with your database system. Choose something that suits you. The list of available locales comes from the system. If you need more locales, you need to install them on the system first.
Date Choose European or US as your preferred date format.
The install continues with several default parameters, and then creates /etc/postgresql/postgresql.conf, which will hold your configuration settings.
Creating Users for your Database
The only (default) way to log into your newly created database system is to log as root, then to log as user postgres, by issuing
#su
#su postgres
#psql template1
#template1=# \q
#exit
However, you would probably like to be able to login as your unix user, or any other user you choose. There are several ways to set up these accesses, so let's decomposeAlowing local users to login is done by editing the /etc/postgresql/pg_hba.conf file (a complete documentation of this file is available here). There, you have to retrieve a series of lines like the following ones
local all postgres ident sameuser
#
# All other connections by UNIX sockets
local all all ident sameuser
#
# All IPv4 connections from localhost
host all all 127.0.0.1 255.255.255.255 md5
# All IPv6 localhost connections
host all all ::1 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff ident sameuser
host all all ::ffff:127.0.0.1/128 ident sameuser
#
# reject all other connection attempts
host all all 0.0.0.0 0.0.0.0 reject
This file has limited accesses but we will come back here later.Now what we have told PostgreSQL is that all users on the local machine should be able to access all databases, using their UNIX login and passwords. You need to restart your database to take new changes effect
Restart postgresql using the following command
#/etc/init.d/postgresql-8.2 restart
Now the problem is that you have authorized users to log into the database, but they will only be able to log in if they also exist in the database. So you need to create accounts with their usernames. This is done by issuing the createuser command as user postgres as follows
#su postgres
#createuser firstuser
#exit
The createuser command will ask you if the user should be able to create databases or create new users. Answer truly.
Now you have a new user in the database, and you should be able to connect as this user (let's call him firstuser) like this:
#su - firstuser
#firstuser@localhost:~$ psql -W template1
#template1=# \q
#exit
The -W parameter is to ask for a password prompt. You should enter your system password when asked.
So that's it, we got the first part of this installation running. Now let's prepare this for the web.
If some of your web scripts are going to need a connection to the database, you will need to grant them some access via a new user, reserved for this web usage.
Let's first create this new user (as user postgres). Let's call him webuser.
#su postgres
#createuser webuser
#exit
Now you want to give him access to one or several databases (let's say you will let him access the databases which name is web). To do this, you need to edit once more the pg_hba.conf file. Retrieve the first line below and write the second one just beneath the first.
host all all 127.0.0.1 255.255.255.255 md5
host web webuser 127.0.0.1 255.255.255.255 md5
Would you like to give this user access from any computer on the sub-network 192.168.0.xxx, you would have to add the following line
host web webuser 192.168.0.1 255.255.255.0 md5
You have to grant him access to the host as it will probably use the TCP/IP protocol to get a connection to the database, and that's what host is for. But as you have given him an md5 authentication type, you need to give him a password as well. In order to do this, you need to connect to the database and issue a special command, all as postgres user:
#su postgres
#postgres@localhost:~$ psql template1
#template1=# alter user webuser password 'some_password';
#ALTER USER
#template1=# \q
#exit
Now the user should have a nice 'some_password' password that you can use after restarting PostgreSQL to make it remember your changes to pg_hba.conf.
Restart postgresql using the following command
#/etc/init.d/postgresql-8.2 restart
And you should be able to create his own database if you gave him the permission
#createdb -h localhost -U webuser -W web
And connect to this newly-created database using the following command
#psql -h localhost -U webuser -W web
As you might have noticed, we use -h localhost here. This is to force the PostgreSQL client to use TCP/IP instead of UNIX sockets. If you don't want is, you need to add a new line into the "local" category of pg_hba.conf for the user webuser to connect via sockets.The line would be something like
local web webuser md5
Using SQL
The first important command you might want to know is
#psql -h localhost -U webuser -W -l
This will give you a list of available databases.
Now connect to the PostgreSQL database using the psql client, and let's create a small table, just after a few tests
web=> SELECT version();
web=> SELECT current_date;
web=> SELECT 2+2;
web=> \h
web=> \d
web=> \dt
web=> CREATE TABLE weather(
web=> city varchar(80),
web=> temp_lo int, -- low temperature
web=> temp_hi int, -- high temperature
web=> prcp real, -- precipitation
web=> date date
web=> );
web=> INSERT INTO weather (city, temp_lo, temp_hi, prcp, date)
web=> VALUES ('San Francisco', 43, 57, 0.0, '1994-11-29');
web=> INSERT INTO weather (date, city, temp_hi, temp_lo)
web=> VALUES ('1994-11-29', 'Hayward', 54, 37);
web=> SELECT city, temp_lo as 'Lowest Temperature', temp_hi as 'Highest Temperature' FROM weather;
web=> SELECT city FROM weather WHERE temp_lo < 40;
web=> SELECT max(temp_lo) FROM weather;
web=> UPDATE weather SET temp_lo = 41 WHERE city = 'Hayward';
web=> SELECT * FROM weather;
web=> DELETE FROM weather WHERE prcp IS NULL;
web=> SELECT * FROM weather;
web=> \q
Now you've had a nice overview of several SQL statements and how to use them in PostgreSQL.
Later, you might want to create a table with a numerical sequence as an index. This link will help you get through this step which I find counter-intuitive and user-unfriendly at will. You might as well know of a shortcut. If you want to create a default auto-incremental key that will be used by your table, you need to define (for every table) a SEQUENCE. This id done, for the weather table above, like this (with the help of user comments here):
web=> CREATE SEQUENCE my_table_pk_sequence;
web=> CREATE TABLE weather(
web=> id int not null default nextval('my_table_pk_sequence') PRIMARY KEY,
web=> city varchar(80),
web=> temp_lo int, -- low temperature
web=> temp_hi int, -- high temperature
web=> prcp real, -- precipitation
web=> date date
web=> );
And then insert elements as before, ignoring the id field
web=> INSERT INTO weather (date, city, temp_hi, temp_lo)
web=> VALUES ('1994-11-29', 'Hayward', 54, 37);
web=> SELECT * FROM weather;
This should have inserted an auto-incremented id.
If you want to install ODBC Support follow this
First install ODBC support packages in debian
#apt-get install odbc-postgresql
This should need about 1 MB on your system's hard drive.This should be enough to form a DSN name in order to connect to your table. A good source of information on the topic can be found here.
Using the parameters we used here above, you should be able to connect with something like:
Server=localhost{ or the IP address of your PostgreSQL server};Database=web;Uid=webuser;Pwd=some_password"
Note that we use MD5 encryption, so you might need to specify that somewhere (and encrypt your password before you put it in the connection string).
If you don't want to do this through command line no problem you can use web interface tools for postgresql.If you want to use this click here
Sunday, June 24, 2007
Netbeans JSF!!!!
EntityManager em = getEntityManager();
try{
Query q = em.createQuery("select object(o) from Tbcompany as o ORDER BY o.id");
q.setMaxResults(batchSize);
q.setFirstResult(firstItem);
model = new ListDataModel(q.getResultList());
return model;
} finally {
em.close();
}
}
trong file Controller
Saturday, June 23, 2007
Multimedia
Ubuntu strives to make all software that meets the licensing terms in the
Ubuntu License Policy available. However patent and copyright restrictions complicate free operating systems distributing software to support proprietary formats.
Ubuntu's commitment to only include completely free software by default means that proprietary media formats are not configured 'out of the box'.
Ubuntu can play the most popular non-free media formats, including DVD, MP3, Quicktime, Windows Media, and more by following the instructions below. If this seems like unnecessary work, remember that Ubuntu is limited by patents and license restrictions in some countries, which make it illegal for Ubuntu to include them. Avoid formats suppressed by DRM (Digital Rights Management, or Digital Restrictions Management), as they are often unplayable.
See Ubuntu's
Free Software Philosophy and the Free Formats page for a more comprehensive discussion of these issues.
Legal Notice Patent and copyright laws operate differently depending on which country you are in. Please obtain legal advice if you are unsure whether a particular patent or restriction applies to a media format you wish to use in your country.
Playing Restricted Formats
Follow these steps to play most common multimedia formats, including MP3, DVD, Flash, Quicktime, WMA and WMV, including both standalone files and content embedded in web pages.
Ubuntu 7.04
Click Applications → Add/Remove. In the top right, change the setting to All available applications. Then select Other in the left panel and then select the Ubuntu restricted extras package. Click OK.
To play most DVDs you'll need the libdvdcss2 package. This package is available using Medibuntu. This is a third party package, and not supported by Canonical.
Note: If DVD playback fails, and you've never played any DVD before on your system, you may need the regionset package to initially set the drives region.
Some external codecs may be needed in order to play certain proprietary formats such as Apple Quicktime or RealVideo. These external codecs are available in the third-party repository of Medibuntu.
Ubuntu 6.06 and 6.10
Install the following packages to play most proprietary formats using the Totem and Rhythmbox applications, both of which are included in Ubuntu by default. Since the version of Totem that comes with Ubuntu does not yet play DVDs, the list below also includes packages for the GXine and Ogle players, which do.
Ensure the relevant repositories are enabled. Click System → Administration → Synaptic Package Manager → Settings → Repositories and then click Add. Check the Community maintained (Universe) and Non-free (Multiverse) boxes. When you close the window, click Reload.
Install the packages. While you could install packages individually using Synaptic, here is one case where any Ubuntu user can save a lot of time by using the command line. Quit out of Synaptic, then click Application → Accessories → Terminal and paste the following command:
To play most DVDs you'll need the libdvdcss2 package. This package is available using Medibuntu. This is a third party package, and not supported by Canonical.
Note: If DVD playback fails, and you've never played any DVD before on your system, you may need the regionset package to initially set the drives region.
Some external codecs may be needed in order to play certain proprietary formats such as Apple Quicktime or RealVideo. These external codecs are available in the third-party repository of Medibuntu.
Users of x86 systems may also install Adobe Flash Player.
Detailed Instructions and Troubleshooting
Audio
DVD
Web
Adobe Shockwave is not supported on Linux
Video
Other
The Ubuntu and Kubuntu Media Players
Ubuntu 6.06 LTS (Dapper Drake) comes with Totem (a movie player) and Rhythmbox (a music player)
Kubuntu 6.06 LTS and Kubuntu 6.10 include Kaffeine (a multimedia player) and AmaroK (a music player)
These media players support free formats (Ogg Vorbis, Ogg Theora, and similar formats) 'out of the box'. However, they can also play most non-free media formats if you install the additional gstreamer (for Ubuntu only) or libxine1 (for Kubuntu only) packages listed above.
Alternative Media Players
The best support for MPEG-1, MPEG-2, MPEG-4 (for example, encoded with DivX, XviD or FFmpeg MPEG-4), QuickTime and other proprietary or non-free media formats is currently provided by Totem-xine, Kaffeine, gxine, and MPlayer. Playing Windows Media Video (WMV) or RealVideo files requires a software library that Ubuntu cannot distribute due to licensing restrictions (see Medibuntu for more information).
Additional Ubuntu Players
Totem-xine or gxine are recommended for most users; MPlayer provides some of the most comprehensive Free Software support for free and non-free media formats and is highly recommended, but the setup and configuration are slightly more complicated, particularly for Ubuntu Breezy users.
The two default media players for Kubuntu (Amarok and Kaffeine) both use xine by default. There are other applications that uses xine as a backend. For any xine based players, some packages need to be installed to play most media formats (MP3, DVD, etc.). These packages are:
libxine1-ffmpeg (Support for playback of MPEG formats (i.e. MP3) and other formats.)
libdvdread3 (For DVD playback.)
libdvdcss2 (For encrypted DVD playback.)
libdvdcss2 is not in the Ubuntu repository for legal reasons. This package is available using Medibuntu. This is a third party package, and not supported by Canonical.
Additionally, there are some formats that do not have implementations in xine yet. Non-native codecs can be used to play such formats. These codecs are available using Medibuntu. These codecs are not supported by Canonical.
A good media player, who allows the great functionality available in AmaroK at Kubuntu / KDE, is provided in the Gnome media player BMPx. It is currently only available in Feisty, but has to this point the most functionality of all Gnome media players, especially for those who switch from Kubuntu.
Ubuntu 6.06 LTS (Dapper Drake)
Install the following packages
totem-xine
gxine
libxine-extracodecs
mplayer
Ubuntu 5.10 (Breezy Badger) and earlier
Install
totem-xine
gxine
Note for Ubuntu 5.10: See MPlayer/Breezy for details on how to install and configure MPlayer for your computer architecture.
Additional Kubuntu Players
See Multimedia Applications for an overview of the most popular media players for Ubuntu and Kubuntu.
Warning Regarding Alternative Installation Methods
Warning: EasyUbuntu and Automatix are third-party utilities for installing the most commonly requested applications in some Debian-based distributions. They are not supported or recommended by Ubuntu. While they work well for many users, they have also been known to corrupt systems and leave them in a state where they cannot be upgraded to a later Ubuntu release.
Wine Instructions!
Wine allows you to run many Windows programs on Linux. Its homepage can be found at
http://www.winehq.org. If you are running the latest release of Wine, you can get further assistance on the #winehq IRC channel.
Installing Wine
A moderately recent version of Wine is available from the Ubuntu universe software channel. It is always recommended that you only install software from the official channels, but you also have the option to install the latest version from WineHQ's unofficial repository.
Ubuntu versions of Wine (Recommended)
Add the Universe repository (see Repositories if you need help)
Update the package listing.
Install the wine package. (see InstallingSoftware if you need help).
Note: If you are looking for AMD64 wine packages, go to this page: WineForAMD64
Newer versions of Wine (Not Recommended)
WineHQ provides the newest versions of Wine packaged for Ubuntu. To use these, you need to add the WineHQ repository and then install Wine with Synaptic. For help on adding repositories, see the Repositories page.
Add the repository:
For Ubuntu 7.04 (Feisty Fawn): Add the following repository, deb http://wine.budgetdedicated.com/apt feisty main
For Ubuntu 6.10 (Edgy Eft): Add the following repository, deb http://wine.budgetdedicated.com/apt edgy main
For Ubuntu 6.06 LTS (Dapper Drake): Add the following repository, deb http://wine.budgetdedicated.com/apt dapper main
Note that these repositories are recommended on the
WineHQ website
Add the repository key by typing the following into a terminal:
wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -
Update the package cache using sudo apt-get update or by clicking 'Reload' in Synaptic
Install wine
Note: If a source repository is desired, simply add the repositories as above except, replace deb with deb-src or follow the instructions on
http://winehq.org/site/download-deb.
Installing Windows Applications Using Wine
To install Windows applications using Wine, follow these instructions:
Download the Windows application from any source (e.g. download.com). Download the .EXE (executable).
Place it in a convenient directory (e.g. the desktop, or home folder).
Open the terminal, and cd into the directory where the .EXE is located.
Type wine the-name-of-the-application.extension (e.g. wine realplayer.exe).
This will start the .EXE d using Wine. If it is an installer, it should then run as it would in Windows. If the application asks for a directory to install the application to, select put it under C:\Program Files. The fake C drive is createunder .wine after a user runs wine in the terminal for the first time. As a hidden folder, the .wine folder is hidden by default. To have it appear, go to the home directory, and press CTRL-H, or go to View > Show Hidden Files.
To start/run Windows programs using Wine
After installing an application using the directions above, those applications can be started and used by entering wine programname.exe (e.g. wine realplayer.exe). When done, close the application as one would normally. You must run the installed executable, which will by default be in the virtual Windows drive created by Wine, at ~/.wine/drive_c. Generally programs will install themselves somewhere under Program Files inside the virtual Windows drive, following Windows conventions.
You can also use the Wine file browser, by running winefile in a terminal. Clicking the C:\ button in the toolbar will open a window where you can browse the virtual Windows drive created in .wine. Doubleclicking an executable in the Wine file browser will run it in Wine.
Instead of having to always enter the terminal or use the Wine file browser, you may also create a, for example, desktop icon, and start a Wine application using that icon. To do this, right click on the desktop and select "Create a launcher." If you wish, select an icon from the list of available icons (or browse to an icon you would like to use), fill out other information that is requested (Name, generic name, etc.). For the command, type in wine the-location-of-the-program.exe (e.g. wine /home/john/.wine/realplayer.exe). The most important part of creating a launcher is the command, and a few other pieces of information are not necessary (e.g. generic name). Make sure not to select "Run in terminal." This completes the process.
If you desire to have an icon on a panel, create a launcher on the panel of choice. Do this by right-clicking the panel, selecting "Add to Panel," and selecting "Custom Application Launcher." This will ask you for the same information as before.
Uninstalling Wine Applications
Open up a terminal window and type "uninstaller" - this will open up a program similar to Windows' "add/remove programs" control panel, allowing you to uninstall applications from a Wine installation. Running uninstall programs directly via Wine should also work normally. Alternatively, you could also simply delete the folder of the application. However, as when done in Windows, this method will be "unclean" and will not remove the program's configuration from the Wine registry like using an uninstaller will.
Configuring Wine
On the command line or in Run Application, type winecfg.
Adding CD and DVD drives to Wine
Go to the drives tab in winecfg. Hit the Autodetect button.
If you find that this does not work correctly for you, then follow these instructions:
Run winecfg
Navigate to the drives tab
Click on Add...
In the path bar, type /media/cdrom
Click Show Advanced button below the Browse... button and set the Type to CD-ROM
Click OK
If you have more than one CD/DVD device you will need to identify each one differently. Use /media/cdrom0 for the first CD/DVD device, /media/cdrom1 for the second one, and so on. If in doubt, type ls -la ~/.wine/dosdevices/ in a terminal to check your CD/DVD device details after Wine is installed.
Adding applications to the menu
It is good procedure before setting up the menu entry to launch the new Windows program from the command line to make sure the program runs properly. To do this type wine "C:\PATHTOPROGRAM\Program.exe" in the command line. (eg. wine "C:\Program Files\World of Warcraft\WoW.exe" ) Once you are satisfied that you have the correct details, use the normal menu editing process to add a new entry. When you get to the Command field of the entry editor be sure to copy and paste the line you used to launch the program from the terminal. Finish and save the new entry. Test to make sure the new Windows program loads via the menu.
Changing application specific settings
Type winecfg at the command line
Click on Add Application...
Navigate to where the exe is and choose that program
The dropdown at the bottom allows you to choose which version of Windows Wine should emulate. Also, any changes to the Libraries and Graphics tabs will only affect the chosen application in the Applications tab.
Using Windows Themes/Skins In Wine
Color Scheme
You can change the wine color scheme to closely match the default ubuntu colors
gedit ~/.wine/user.reg
Replace the [Control Panel\\Colors] section with
[Control Panel\\Colors] 1176981676
"ActiveBorder"="239 235 231"
"ActiveTitle"="239 235 231"
"AppWorkSpace"="198 198 191"
"Background"="93 77 52"
"ButtonAlternativeFace"="200 0 0"
"ButtonDkShadow"="85 85 82"
"ButtonFace"="239 235 231"
"ButtonHilight"="255 255 255"
"ButtonLight"="255 255 255"
"ButtonShadow"="198 198 191"
"ButtonText"="0 0 0"
"GradientActiveTitle"="239 235 231"
"GradientInactiveTitle"="239 235 231"
"GrayText"="198 198 191"
"Hilight"="246 200 129"
"HilightText"="0 0 0"
"InactiveBorder"="239 235 231"
"InactiveTitle"="239 235 231"
"InactiveTitleText"="255 255 255"
"InfoText"="0 0 0"
"InfoWindow"="255 255 166"
"Menu"="239 235 231"
"MenuBar"="239 235 231"
"MenuHilight"="246 200 129"
"MenuText"="0 0 0"
"Scrollbar"="239 235 231"
"TitleText"="255 255 255"
"Window"="255 255 255"
"WindowFrame"="0 0 0"
"WindowText"="0 0 0"
Using Theme/Skins
Wine has basic handling for Windows theme/skin files in the "msstyles" format. There is a large number of these themes on
Deviant Art. To use these you must make a folder in Wine's virtual Windows drive, then tell Wine to use the theme.
Firstly go into Wine's virtual drive, which is usually ".wine/drive_c" in your Home folder (this is hidden, you may need to select View->Show Hidden Files in the file manager). Inside this folder go into the "windows" folder then make a new folder in there called "Resources". Enter this new folder and make a new folder called "Themes". Inside here you should make a folder for each theme you want, and put the files ending in ".msstyles" directly into them. For example, the full path to a theme file called sample.msstyles might be "/home/username/.wine/drive_c/windows/Resources/Themes/Sample/sample.msstyles".
Next you need to tell Wine to use your theme, so run winecfg. In the configuration window select the tab "Desktop Integration" and check out the "Theme:" box, which should now have your theme in it's menu. After selecting the theme click "Apply" at the bottom to see how it looks (they don't always display properly), then if you are happy click "OK" and you are done.
Fullscreen issues with overlapping Panel
Sometimes the Panel overlaps your fullscreen application you're running in wine. The solution I've used is to remove the panel prior starting the fullscreen app and restarting it afterwards. In Ubuntu the commands are gnome-session-remove gnome-panel and gnome-panel & respectively. In Xubuntu I understand they are killall xfce4-panel and xfce4-panel.
Instructions for specific Windows programs
Some Windows programs have been tested on Ubuntu. They are listed below:
Also, see Wine's Application Database at
http://appdb.winehq.org/
Creating file associations
If you want certain files to open in a windows application by clicking on them, the best way is to create a script. For example I want Adobe Flash project files (*.fla) to open in Adobe's Flash editor if I double click it.
You can for example create a file gedit ~/.wine/Flash\ 8. Now paste the example script in it, save and close gedit.
Example script:
#!/bin/sh
QUICKPARLOCATION="c:\\Program Files\\Macromedia\\Flash 8\\Flash.exe"
PARAM=`winepath -w "$*"`
wine "$QUICKPARLOCATION" "$PARAM"
exit 0
Make sure the file is executable chmod +x ~/.wine/Flash\ 8
After you completed this go to an *.fla file right click it, properties, go to the “open with” pane, click add, paste '/home/
Unhandled Page Fault
If you get the error message 'wine: Unhandled page fault on read access', try updating to wine 0.9.31, from
http://wine.budgetdedicated.com/archive/index.html (Download, then install with sudo dpkg -i ./wine_0.9.31~winehq0~ubuntu~6.10-1_i386.deb)
On my computers, at least, this fixes the problem. I'm using 32-bit P4 machines, running Edgy. Wine hasn't worked for me (with any application, even winecfg, or putty.exe) since about wine 0.9.20, but everything is great in 0.9.31