Thursday, August 6, 2009

Access Permission of the Underlying Directory BEFORE mount

In AIX 5.2, the du, find and tar command will sometimes fail in some directories. But, they can be run successfully in some other directories. Why this happens ? It is all because of the filesystem mounting.

It is very natural to mount numerous filesystems in AIX. Usually, a filesystem is mounted onto a directory of the same name in another filesystem. For example, under the ROOT filesystem, there are numerous other filesystems mounted onto many directories. When you ls these directories, you are actually getting the access permission of the AFTER-MOUNTED image. However, in AIX 5.2, the technical aspect of some commands such as find and tar will check the access permission of the BEFORE-MOUNTED directory. As a result, even the ls command reports a permission of 777 for the directory, the access permission of the BEFORE-MOUNTED underlying directory may have a permissoin of 700. Then, the find or tar command will certainly fail.

Since the ls command (and many other commands) will only reports the access permission of the AFTER-MONUTED image, how to know about the access permission of the before image ? The answer is to check the inode information. But, how to do so ?

First of all, you have to know the inode number. Supposed that your filesystem is mounted onto the directory /usr/your/directory. To search for the inode number of the underlying directory /usr/your/directory, issue this command:
ncheck | grep -e ':$' /usr/your/directory

The output may look like this:
: : /dev/hd1: 1996 /usr/God/directory 1997 /usr/your/directory 1998 /usr/others/directory : :

Then, use this command to check the access permission of the inode of the underlying directory:
istat 1997 /dev/hd1

You will certainly get the access perssions which is very different to that got from the ls command. This is the access permission of the underlying directory.



Monday, August 3, 2009

The Square in Subtitle of VLC

Sometimes when watching videos using VLC 1.0.1 with subtitle srt file, there are squares instead of readable characters in the substitle. Usually, each square is a Chinese character. When opening the srt file using a word processor with appropriate encoding (Big5, GB2312, GB18030 or Unicode), the Chinese character can be read. However, VLC 1.0.1 simply cannot display the Chinese character correctly. You can only see squares. How to handle this situation ?

First of all, convert the srt file to Unicode.

Then config the VLC 1.0.1 as follows:
  1. Open VLC 1.0.1
  2. In the main menu, click Tools
  3. Click Preferences
  4. On the LHS, click Subtitles & OSD
  5. In Subtitles Language > Default encoding, choose Universal, Chinese (GB18030)
  6. In Display Settings > Font, input the fullpath filename of the font : Font Arial Unicode MS
How to find out the fullpath filename of a font ? All fonts should be inside the directory %SystemRoot%\Fonts. Simply open this directory using details view. The filename (XXXXXXXX.TTF) should be displayed next to the column Font Name

By the way, using this method, the srt file must be in unicode and should be stored using UTF-8 format. Using UTF-16 LE format will make VLC displaying one or two question marks at the end of subtitle lines.


Duplicate Open Current Folder in a New Window

Sometimes after I opened a folder in Win7, I would like to duplicate open the same folder again in another explorer window. Then, I can ope...