Tuesday, November 11, 2008

[ubuntu] samba + ldap pdc and file server

I installed another samba + ldap pdc, follow the tutorial :
http://www.howtoforge.com/openldap-samba-domain-controller-ubuntu7.10

I had to "su bash", then run everything under root. otherwise, "sudo smldap-populate" will fail and generate a "root doesn't exist" error. weird problem. Jingwei and I both guessed there is a call to set the password in the smbldap-populate script, causing the problem. it's just a guess, not very sure.

The tutorial is pretty good. Learned a lot from it.

Sunday, October 26, 2008

[RoR] Emacs with Rails

I'm tired of the fancy Eclipse or Aptana or some other IDEs. So, I moved to emacs, which is flexible enough to handle the programming job.

First, install ruby1.8-elisp package
sudo apt-get install ruby1.8-elisp
It will install ruby mode, inf-ruby, ruby-electic, and etc. (http://packages.ubuntu.com/hardy/all/ruby1.8-elisp/filelist)

then, follow the instruction:
http://dima-exe.ru/rails-on-emacs

done

Wednesday, October 22, 2008

[Xubuntu] install

I did a fresh install of Xubuntu 8.04 on my toshiba laptop(Centrino solo 1.8G, 1G ram, 80G HD).
Overview: have to choose safe graphic mode and the rest of the installation runs smoothly.
more details:
the Chinese support. I downloaded the LiHei font from the following site. Despite WQY font is provided by xubuntu8.04. I personally prefer the LiHei font.
http://www.weiphone.com/thread-104025-1-1.html

unpack the font archive.

sudo cp -r ./Lihei /usr/share/fonts/truetype/

then go to system -> language support, install Chinese support. The install wizard will update the font cache.

reboot

To enable Chinese input method under English session,
edit /etc/X11/xinit/xinput.d/default,

XIM=SCIM
XIM_PROGRAM=/usr/bin/scim
XIM_ARGS="-d"
XIM_PROGRAM_XTRA=
# Set following variable to non-zero string if program set itself as deamon
XIM_PROGRAM_SETS_ITSELF_AS_DAEMON=yes
#
# Define GTK and QT IM module
# They may or may not be using xim as the IM.
#
GTK_IM_MODULE=xim
QT_IM_MODULE=xim

#
# Define lists of packages neded for above IM to function
#
DEPENDS="scim,scim-anthy|scim-canna|scim-chewing|scim-pinyin|scim-hangle|scim-prime|scim-skk|scim-tables-additional|scim-m17n|scim-uim|scim-tables-ja|scim-tables-ko|scim-tables-zh"


One weird thing is the sound driver. After a fresh install of xubuntu, the sound works "fine" but the volume control applet doesn't work. Installing pulse audio server and alsa driver will fix the problem, follow the instruction of ubuntu wiki:
https://wiki.ubuntu.com/PulseAudio
One more thing is to added: edit /etc/default/pulseaudio, to enable pulseaudio server at startup.
Or follow the instruction in that file.

add gnome-screensaver to auto start application list in settings.

add one line in /etc/fstab, to mount windows partition at start:

/dev/sda1 /media/windows ntfs-3g defaults,locale=en_US.utf8 0 0

sudo nano ~/.gtk-bookmarks, add one line, so that the windows partition can be accessed easily via "places":
file:///media/windows

I prefer to use pyneighborhood to browse shared folder on local network
sudo apt-get install smbfs pyneighborhood

keep it simple

I don't know when the blogger.com is off the blacklist. When I realized the blogger.com can be accessed here, it was last week. So I typed in this very very old url: zelin.blogspot.com. BOOM! Thank myself, I gave a straightforward name so that I can still remember it after four years. The latest post on this blog was published on Oct 19. 2005. October is the end as well as the beginning.

The main reason I moved to blogger.com is the simplicity and clean design. I was going to write all IT related stuff here. Nothing changes. It's still my purpose today. An IT related blog.

But things do change. From the old posts here, I was focusing on three areas: ASP.NET, Linux(Debian, Ubuntu) and some java. Today, I'm focusing on Linux(Ubuntu, Debian), Ruby On Rails and other open source related.

Ubuntu is a rising star. from 5.04 Hoary to 8.04 Hardy, it's been 3 years. Inspired by one of my colleagues, I uninstalled Ubuntu and switch to Xubuntu. It's good for me and also for my laptop.

I'll post my installation step by step later.

Wednesday, October 19, 2005

[Debian] DBDesigner4 the libborqt problem

I am running debian unstable and after doing all the above, I still got

libborqt-6.9-qt2.3.so: cannot open shared object file: No such file or directory

Finally fixed everything when I got an rpm and converted it to deb with the program alien

libborqt-6.9.0-2.i386.rpm can be downloaded from :

http://sourceforge.net/project/showfiles.php?group_id=64092&package_id=68416

Convert to deb file with alien and then install it.

#> alien libborqt-6.9.0-2.i386.rpm
#> dpkg -i libborqt_6.9.0-3_i386.deb

Sarge does work with the libborqt_6.9.0-3_i386.deb from http://sourceforge.net/project/showfiles.php?group_id=64092&package_id=68416

The rpm seems to be working for Mandrakelinux 10.x too.

Same problem under Ubuntu 5.04 too. I downloaded libborqt_6.9.0-3_i386.deb from http://sourceforge.net/project/showfiles.php?group_id=64092&package_id=68416, installed, and it worked :)

On Debian unstable (sid), I had to install the following package and libborqt-6.9.0-2: http://packages.debian.org/unstable/libs/libstdc++2.10-glibc2.2

Download the package from the URL above and install it with dpkg.

Tuesday, October 04, 2005

[Debian] Firefox print issue

In Ubuntu, can easily install printer(network or local) and using cups to manage. The printer works fine(testing print without problem) but can not print in Firefox. Installing gtklp package can resolve this issue.

apt-get install gtklp

Then, in the firefox print popup window, click propertis, using "gtklp" instead of "lpr". Done.

[debian] Chinese font

A better font than the font installed default on Ubuntu 5.04
http://www.ubuntu.org.cn/support/documentation/zhfaq/verasansyuanti
First, download the VeraSansYuanTi font package; then extract to font directory, refresh font cache, backup old fonts.conf, cp new fonts.conf


tar -xzvf VeraSansYuanTi.tar.gz
 sudo mv VeraSansYuanTi /usr/share/fonts/
 sudo fc-cache -f
 sudo cp /etc/fonts/fonts.conf /etc/fonts/fonts.conf.old
 sudo cp /usr/share/fonts/VeraSansYuanTi/fonts.conf /etc/fonts/
Restart X.

Wednesday, September 28, 2005

[Debian] Ubuntu Chinese Setup

Install Ubuntu in English. The default locale is en_US.UTF8. And the 4 ttfarph fonts are installed by defalt also. What I need is input method only. Scim is a good choice.
A good tutorial can be found here: http://www.mrbass.org/linux/ubuntu/scim/
Below are quoted from that tutorial, I modified the code since I don't need Japaese and Korean IM:

Ubuntu 5.04 Hoary SCIM Chinese, Japanese, and Korean Input Guide
You can install CJK input via ubuntuaddon or do it via internet.
Ubuntu already comes with Chinese, Japanese and Korean fonts preinstalled.

To install via internet (universe repositories must be enabled)
sudo apt-get install scim-gtk2-immodule scim-chinese scim-tables-zh

Add SCIM to startup for X11
sudo touch /etc/X11/Xsession.d/74custom-scim_startup
sudo chmod 646 /etc/X11/Xsession.d/74custom-scim_startup
echo 'export XMODIFIERS="@im=SCIM"' >> /etc/X11/Xsession.d/74custom-scim_startup
echo 'export GTK_IM_MODULE="scim"' >> /etc/X11/Xsession.d/74custom-scim_startup
echo 'export XIM_PROGRAM="scim -d"' >> /etc/X11/Xsession.d/74custom-scim_startup
echo 'export QT_IM_MODULE="scim"' >> /etc/X11/Xsession.d/74custom-scim_startup
sudo chmod 644 /etc/X11/Xsession.d/74custom-scim_startup



Next two steps are OPTIONAL (scim KDE startup and input KDE apps while in GNOME)

If you installed kubuntu-desktop (KDE) and plan on logging into KDE session do this in terminal
sudo touch ~/.kde/Autostart/startscim
echo '"#!/bin/sh"' >> ~/.kde/Autostart/startscim
echo "scim -d" >> ~/.kde/Autostart/startscim
sudo chmod 745 ~/.kde/Autostart/startscim


While using GNOME:
you can input into GNOME, GTK apps but NOT KDE apps.

While using KDE you can input GNOME, GTK and KDE apps.
So if you want to also input in KDE apps while using GNOME do the following:
sudo touch ~/.gnome2/session-manual
echo "[Default]" >> ~/.gnome2/session-manual
echo "num_clients=1" >> ~/.gnome2/session-manual
echo "0,RestartStyleHint=3" >> ~/.gnome2/session-manual
echo "0,Priority=50" >> ~/.gnome2/session-manual
echo "0,RestartCommand=scim -d" >> ~/.gnome2/session-manual
echo "0,Program=scim" >> ~/.gnome2/session-manual


This will create two SCIM keyboards under GNOME though but allows you to input in KDE apps while in GNOME.

OpenOffice go to Options | Language Settings | Languages
- Default languages for documents
Asian choose Japanese,Chinese or Korean
- check Asian languages support to Enabled.

Close out of options first otherwise you won't see Asian Layout in the options menu.
Go to Options | Language Settings | Asian Layout
Kerning choose Western text and Asian punctuation
Character spacing choose Compress punctuation and Japanese Kana (if not using Chinese or Korean)
First and last characters choose Japanese,Chinese or Korean

Tuesday, August 23, 2005

MySQL database connector/J

To use JDBC to connect to MySQL, should do the following:

1. insatll connector(JDBC driver). On debian, there is a libmysql-java package, or we can download from Mysql.com. Then, the fast and dirty way is copy the mysql-connector-java-[version]-bin.jar file to the $JAVA_HOME/jre/lib/ext. After that, in Eclipse--> preference --> build path, we can see this jar file.

2. the following sample code should work fine:

import java.net.*;
import java.sql.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class HelloJdbc extends Frame{

Choice s;
Connection con;
Statement st;

public HelloJdbc(){
s = new Choice();
String url = "jdbc:mysql://localhost:3306/trilBlog";
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection(url,"username","password");
st = con.createStatement();
String SQL = "SELECT * FROM Users";
ResultSet rs = st.executeQuery(SQL);
while(rs.next()){
s.addItem(rs.getString(3));
}
}catch(Exception e){
System.out.println("hey, cannot connect to database");
}
add(s);
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Frame f = new HelloJdbc();
f.setSize(300,300);
f.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent evt){
System.exit(0);
}
});
f.show();
}
}