2007/04/25

[HTML] Conditional Comments

When dealing with HTML and CSS, the most difficult part is to get everything work in different browsers.

Some hack tips:
In CSS, the way I use to code for different browsers (usually IE and FF) is '!important'.
However, it seems that IE 7 understands this magic command while IE 6 doesn't. It makes more difficult to recognize IE 7 and FF.

Here is the solution: Conditional Comments
simple way to check IE version
<!--[if IE 6]>

Using Internet Explorer 6.

<![endif]-->
or check the condition: [if !IE] => for FF

2007/01/30

[Linux] Remote MySQL

Recently, I'm trying to remote access MySQL database from different computer.
Finally I have it work!

Step 1: change setting info in /etc/mysql/my.cnf
  • comment out bind-address = 127.0.0.1 (it's for localhost only)
  • add safe-show-database (for security reason)
  • change server and client mysql default port 3306 to any other port number (e.g. 12345)
Step 2: save my.cnf file and restart MySQL
Step 3: open the specific port you just set
Step 4: test & done!

[Linux] Kubuntu hostname setup

I saw my kubuntu box displayed as "Unknown" server name in my router.
Here is the solution to fix unknown hostname problem:
sudo vi /etc/dhcp3/dhclient.conf
change send host-name "newHostName";

Learned from: Fix hostname unknown in router

2007/01/09

[Linux] Kubuntu Printer Setup

Kubuntu 6.06 Printer Setup

Maybe your system can setup printer correctly, if not, here is the solution:

sudo foomatic-cleanupdrivers
sudo adduser cupsys shadow
sudo dpkg-reconfigure cupsys


Open your browser and type the url:
http://localhost:631/

Step by step to setup your printer:
  1. click "Administraion" Tab
  2. from the listing printers, click to add the correct one
  3. change to "Printers" Tab, click "Set as Default"
  4. Done

2006/11/28

[HTML] favicon 使用

Site icon
<link rel="icon" type="image/ico" href="favicon.ico" /> (*.ico)
<link rel="icon" type="image/gif" href="icon.gif" /> (*.gif)

WebPage shortcut
<link rel="shortcut icon" href="http://domain/favicon.ico" />

WebPage bookmark
<link rel="bookmark icon" href="http://domain/favicon.ico" />

2006/11/05

[Linux] Fix opening RealPlayer from menu

In Firefox register rtsp portocol:
about:config

Create a new name:
network.protocol-andler.external.rtsp
value set to 'true'

network.protocol-handler.app.rtsp
value set to the location of your realplayer (e.g. /usr/bin/realplay)

Install realplayer:
sudo apt-get install realplayer

If you cannot open RealPlayer from the start menu, it is conflicted with Scim.

To fix the problem:
Modify the file: /usr/bin/realplay

Find:
#!/bin/sh

after ADD:
GTK_IM_MODULE=xim ; export GTK_IM_MODULE