Sunday, September 23, 2007

Samba share access control

Recently I found a problem with my existing settings of Samba share: every time after I edit and save a file in the share from Windows client, the UNIX file permission will also be changed in Samba server. And that's not desired.

After I read this article about Samba share access control, I found the solution is on the "security mask" setting, which controls UNIX permission bits modified when a Windows NT client is manipulating the UNIX permissions on a file. Another userful setting is "force create mode", which specifies a set of UNIX-mode bit permissions that will always be set on a file created by Samba.

So I added security mask = 0000 and force create mode = 0774 (rwxrwxr--) into my smb.conf configuration file under the the Share definitions section. Now Windows will no longer be able to change the UNIX permissions on a file. And the new share definition looks like below:

[homes]
comment = Home Directories
browseable = no
writable = yes
inherit permissions=no
security mask = 0000
force create mode = 0774

Specify force user= for better sharing a folder
[sysbak]
valid users=@admin
force user = apache
force group = admin

Set the following in the global section if MS Office often saves/writes to the samba shares:
strict sync = Yes
sync always = Yes
oplocks = No
level2 oplocks = No

Monday, August 20, 2007

Settings for my Linksys PAP2

I have been using a Linksys VOIP adaptor PAP2 for 2 yearts. It has two phone ports and supports two phone lines. So far I've been using Voipbuster for outgoing calls and Stanaphone for incoming calls. There's a lengthy discussion thread on Fatwallet about PAP2 and its setup.

I don't use STUN for either lines so I need to forward the SIP ports on my router to PAP2 (with a IP address of 192.168.0.106) as suggested in the user guide of PAP2. The router is a D-Link DI-614+, which I have been using reliably for more than 4 years. The settings are shown here:


Some usefule informations about PAP2:
  • Dial plan for Voipbuster:
  • (<:001919>[2-9]xxxxxx|<:00>1[2-9]xx[2-9]xxxxxxS0|<:001>[2-9]xx[2-9]xxxxxxS0|<011:00>xx.)
  • Dial Plan for Stanaphone:
    (<:1>[2-9]xx[2-9]xxxxxxS0|<:1919>[2-9]xxxxxx|1[2-9]xx[2-9]xxxxxxS0|08xxxxxxS0)
  • Protect RESET# in IVR with password
  • GPP_K value: it is located in the "Provisioning" tab of the adapter's web-interface (i.e login as "admin," switch to "advanced" mode and click on the "Provisioning" tab). Attributes of the FACTORY FRESH GPP_K value:
    • 44 characters long
    • Comprised of alpha (A-Z, a-z), numeric (0-9), and symbols
    • Ends with an EQUAL SIGN (=)
    • Example: Q7CeXsESr8Q3qfaFympWUXJpXlWeohe8V2OxzdgzpX8=

Saturday, August 18, 2007

Getting back my DVD drive after missing in XP

I found two related MS KB articles on how to get my DVD drive back after it disappeared in my computer.
According to the above, I located the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\
{4D36E980-E325-11CE-BFC1-08002BE10318} and delete the UpperFilters registry value and the LowerFilters registry value. The problem is resolved after restarting the computer and my DVD drive is back.

Fix the boot sector problem of partitions

Yesterday when I ran mkbt program from BartPE, it accidentlly modified the boot sector of my data partition D on hard disk-- a NTFS partition of about 40GB size. Today after I reboot the computer, the file system of partition D is displayed as 'RAW'. And every time when I click on it, Windows ask if I want to format the drive. I click NO absolutely.

The partition's first sector is also known as the boot sector. When the MBR is for entire drive, the boot sector is for an individual partition: like the MBR, the boot sector contains information that the system needs to locate the materials that are necessary to access the partition. A corrupt or missing boot sector is a serious problem. Without it the partition can not be accessed.

However, since mkbt only wrote stuffs to the first sector of partition D, all other sectors are intact. I guess there must be a way to fix the boot sector. Actually I found a couple ways:
  • Fixboot command of the Windows XP Recovery Console: Use it to write the new Windows boot sector code on the system partition. This command fixes damage in the Windows boot sector. The fixboot command is supported only on x86-based computers. I tried using "fixboot d:" in recovery console.
  • Commercial softwares sucn as PTDD Parition table doctor. It also has a fixboot command in parition operation menu.
After the new boot sector is written to partition D by fixboot, the partition can be recognized by windows again as a NTFS volume.

Wednesday, August 15, 2007

Make CA 2GB flash drive bootable

I got a 2GB Flash Drive with CA Internet Security Suite 2007. But I was not able to boot BartPE from it.
  • I tried "PE2USB -f" to format the drive and install the PE to it. The boot sector appears OK to mkbt but I always get "Missing Operating System" error when I try to boot from it.
  • I searched about the error and found this thread: the error might be due to bad partitioning scheme on the flash drive.
  • I downloaded a MCNLive CD iso and burned it to a DVD. MCNLive is a Mandriva Linux based distribution designed to run from a USB Flash Drive or a CD.
  • After booting into MCNLive DVD (NOT using the copy2ram bootcode), I check the drive with "fdisk -l /dev/sda"and there's something abnormal about the drive, saying "Partition 1 has different physical/logical beginnings" etc
  • So I deleted the partion in fdisk and created a new partition. Then I went to mcc and formated the partition with FAT16 file system.
  • Finally I can create MCNLive USB. Now I relax and enjoy booting the system from the CA 2GB flash drive with "livecd copy2ram" bootcode.

Monday, August 6, 2007

Stop annoying IMAP error message in Outlook

I am using Outlook 2007 as my email client. But I periodically get an annoying dialog box when using it. The dialog box says: "Your IMAP server has closed the connection. This may occur if you have left the connection idle for too long. Details: LOGOUT received ..."

I have one IMAP email account and a few POP3 accounts but I never got such an error when using outlook express as my email client. After I did a search I found that
Outlook was trying to periodically retrieve mail headers from the IMAP server but that's not really necessary since its a 'live' connection. The mail appears in my IMAP account when I view its Inbox folder with no need for Outlook to do automatic send/receives.

The solution is to change a setting in Outlook 2007 using the following steps:
  • Navigate to Tools->Send/Receive->Send/Receive settings->Define send/receive groups or simply press the hot key Ctrl+Alt+S
  • Exclude the IMAP account from any group that has a automatic send/receive scheduled (e.g. "All accounts" group)
After the change is saved, outlook would no longer do scheduled send/receive on my IMAP account and not generate any more annoying dialog boxes. I found I had similar setting in outlook express:
  • Navigate to Tools->Accounts..., click "Properties" for my IMAP account
  • Under "General" tab, uncheck "Include this account when receiving mail or synchronizing".

Running Mozilla::Mechanize

  • Mozilla::Mechanize tries to be a sort of drop-in replacement for WWW::Mechanize. It uses Mozilla's Gecko HTML-rendering engine via the modules Mozilla::DOM and Gtk2::MozEmbed.
  • In my Mandriva system, I need to install package libmozilla-firefox2.0.0.6-devel by running
    #urpmi
    libmozilla-firefox2.0.0.6-devel
    This package provides both
    pkgconfig(firefox-gtkmozembed) and pkgconfig(firefox-xpcom).
  • Later I found I also needed to symbolicly link some libraries in package libmozilla-firefox2.0.0.6 from /usr/lib/firefox-2.0.0.6 to path /usr/lib. Otherwise the tests on Mozilla::Mechanize would fail bizarrely with lots of core dumps. I pinpointed the cause of core dumps through strace.

Sunday, August 5, 2007

How to turn NUM LOCK off for the logon screen

When I use a laptop running windows XP, I really want to turn the NUM LOCK off for the logon sreen. To turn NUM LOCK off before a user logs on, I use the steps below:
1.Run Registry Editor (Regedit.exe).
2.Navigate to HKEY_USERS\.Default\Control Panel\Keyboard.
3.Change the value for InitialKeyboardIndicators from 2 to 0.

If a desktop keyboard or a numeric keypad is present, I will try to keep the value 2. The method is borrowed from MS KB154529.

Web interface of my cable modem Motorola SB5100

I am able to connect to my Motorola SB5100 cable modem's web interface by typing in 192.168.100.1 into my web browser. The signal level I saw is shown below:

Recently I bought a new SB5101 modem to replace the SB5100. Its web interface is still accessed by by typing in 192.168.100.1 into my web browser. The new signal level I saw is shown below:

Sunday, July 29, 2007

Running Windows XP on my Everex VA4300M

I got a Everex VA4300M laptop this weekend and it came with Windows Vista® Home Basic and 512MB memory installed. With the hard disk doing IO all the time, this VA4300M appeared to be even slower than my 3-year old Thinkpad running windows XP. I purchased a 1GB memory stick but I heard that Vista needs at least 2GB memory. So I decided to give Windows XP a shot. But the process turned out to be more complicated than I had expected.

  1. Below is the Vista32 driver information of the VA4300M from the Readme.txt found in the "drivers" folder of the "VA Series" recovery DVD shipped with it (only Vista drivers are provided in the DVD Rev.VP):
    • [Chipset]--[VIA VN896]--Driver Version: Use build-in driver
    • [VGA]--[VIA VN896]--Driver Version: 7.14.10.0058 (15.31.09.01)(logo'd)
    • [Audio]--[VIA Azalia VT1708A]--Driver Version: 6.0.01.1210 (logo'd)
    • [LAN]--[VIA VT6103L]--Driver version: 3.66.0.451 (logo'd)
    • [Modem]--[Castlenet,(Motorolla chip)]--Driver Version: 6.12.5.0 (logo'd)
    • [TouchPad]--[ALPS]--Driver Version: 7.0.1402.1 (logo'd)
    • [WLAN]--[AzureWave AW-GM100]-- Use build-in driver
    After I enable the "Boot-time diagnostic screen" in the "Advanced" tab of the BIOS setup, I found more information such as the south bridge is VT8237A and the make of the hard drive is WD and Optiarc for DVD burner. This VT8237A has both a SATA (VEN_1106&DEV_0591&CC_0101) and a PATA (VEN_1106&DEV_0571) controller as shown in the device manager, so service pack 2 may be necessary to install XP on it. Here I found a wonderful guide on creating a bootable XP installation CD with integrated service pack 2. And the device drivers for these ATA controllers can be found on VIAarena.

  2. The device drivers for windows XP found on the Everex website are incomplete. After I examined the links, I found all the downloads on the MODEL VA4300M page are copied from those for VA4101M. For e.g., I copied the file location for VA4300M WLAN XP driver here: wlan.exe. Nevertheless, I still downloaded all the files found on that page in case they might work and most of them (including audio, chipset, LAN, touchpad and VGA) did work. The ones didn't work:
    • Modem: Downloaded driver was not for the Motorola chip as shown above on the HD audio bus. But the Vista driver found on the DVD worked for XP.
    • Wireless LAN (big headache): Downloaded driver was not for the AzureWave AW-GM100 card as shown above and Vista has built-in driver support for it. So no driver is found on the DVD. And technical support of Everex didn't have a release date for its XP driver yet.

  3. The fact that Vista has native support for the wireless card made me think it may be using a very popular chip and other vendors may have released the XP drivers for it.
  • Device ID found on device manager: PCI\VEN_11AB&DEV_1FAA.
  • I searched the ID on internet and found the vendor_11Ab refers to Marvell Semiconductor, Inc. But I cound't find the XP drivers for the chip DEV_1FAA I need on its website.
  • Finally I found the name of the chip is Marvell Libertas 802.11b/g Wireless (8335) from PCIdatabase.com. I also found that TEW-421PC/423PI(Version B1.1R) made by TrendNet has identical PCI device ID and its XP driver can be downloaded from the website. All I need are the files under the folder "Drivers\windows XP" in the archive. No need to run the setup.exe.
  • The version of the driver found in the driver file mrv8335.inf is: Ver=08/22/2005, 3.2.1.3 and it worked well with my wireless card in XP. After I push Fn+F2 to turn on the power of wireless radio, all wireless networks around are detected and I could connect to one at my home with excellent signal.



Monday, June 25, 2007

Solution to stabilize my BEFW11S4 V4 wireless router

Updated July 2009: I upgraded the firmware of this router back to 1.52.02, and it's now working stably with WPA-PSK (TKIP) enabled.

  1. I have been had a headache with my Linksys BEFW11S4 V4 wireless router. It couldn't work reliably when the wireless function is enabled and I'm not alone with its problem. Click here for others' experience of the problem.
  2. The symptom of the problem is: Router locks up (doesn't respond to ping and web interface inaccessible) in a few hours after the wireless function is turned on. The only way to reset it is to unplug its power.
  3. First I tried to disable UPNP in the router as suggested by some at the above link. But the problem is still there. I didn't disable UPNP on my networked computers though.
  4. Solution: I downgraded the firmware of my BEFW11S4 V4 to 1.45.3 and since then everything worked fine. I think the only thing lost is WPA but I don't use it anyway. The 1.45.3 firmware can be downloaded at this address.

Sunday, June 24, 2007

SPDIF passthrough with my Turtle Beach Riviera

  1. Setup: Optical S/PDIF output of my Turtle Beach Riviera is connected to the input of my AV receiver

  2. Motivation: I tried to route digital audio stream to my home theater but I could only get PCM 48kHz on my AV receiver

  3. Useful reference for S/PDIF out on Riviera: Riviera - Frequently Asked Questions

  4. Previous problems: AC3Filter showed "SPDIF output is not supported" and SPDIF passthrough is disabled. Therefore only PCM output is obtained while input is AC3 or DTS. SPDIF input is NOT supported by the default directsound renderer of Riviera? More about Audio Renderer.

  5. SPDIF passthrough while playing back AC3/DTS encoded media files
    • Download and install the latest K-Lite Mega Codec Pack

    • I installed K-Lite Mega Codec Pack 2.20 which includes AC3Filter version 1.45b and Media player classic version 6.4.9.0

    • Important: Set the Directshow Audio renderer of Media player classic in Options->Playback->Output to Turtle Beach Riviera Wave as shown in the following picture (click to enlarge)

    • Modify the SPDIF tab of AC3Filter properties as shown in the following picture (click to enlarge)


    • In the above case the auido stream is encoded by DTS and passed to my AV receiver without changes via SPDIF. My AV receiver confirmed it's decoding DTS not PCM stream during play back.

  6. SPDIF passthrough while watching live TV with MediaPortal on my WinTV-HVR-1600
  7. Test SPDIF passthrough with GraphEdit on my WinTV-HVR-1600
    • Download DirectX 9 GraphEdit and register proppage.dll by running "regsvr32 proppage.dll" under CMD.

    • Build a directshow filter graph in GraphEdit as shown in one of the following pictures. Click here for a guide to GraphEdit.
      a) The simplest but working filter graph
      b) The remote graph obtained by GraphEdit while running MediaPortal My TV

    • Right click "Microsoft ATSC Network Provider" and click "Filter properties". Under "Tune Request" tab, enter the channel info on the right (WRAL HD as shown in the following picture). Then validate and submit.

    • Play the graph and test live HDTV with SPDIF passthrough

Wednesday, June 20, 2007

Color coding for power cord (AC wiring)

Color coding for power cord (one phase)

Service US Europe UK
Line 115v/240v Black Brown Brown
Neutral/Common White Blue Blue
Ground Green Green/Yellow Green/Yellow

Sunday, June 10, 2007

Cingular GPRS settings for my Motorola phone

  1. Web session setting: (case sensitive)
    Name: Cingular

    Homepage: http://device.home
    Service Type 1: WAP
    Gateway IP 1: 66.209.11.61
    Port 1: 9201
    (or 9203=secure)
    Domain 1:
    Service Type 2: WAP
    Gateway IP 2: 66.209.11.32
    Port 2: 9201
    Domain 2:
    DNS 1:
    DNS 2:
    Timeout: 15 minutes
    CSD No.1:
    User Name 1:
    Password 1:
    Speed (Bps): 9600
    Line Type 1: Modem
    CSD No. 2:
    User Name 2:
    Password 2:
    Speed (Bps) 2: 9600
    Line Type 2: ISDN
    GPRS APN: wap.cingular
    User Name: WAP@CINGULARGPRS.COM
    Password: CINGULAR1

  2. Server Info for MMS message
    Server Name: http://mmsc.cingular.com

  3. Other settings
    Access point: ISP.CINGULAR
    User name: ISPDA@CINGULARGPRS.COM
    Password: CINGULAR1

  4. Cingular messaging email address
    • number@txt.att.net (SMS)
    • number@mms.mycingular.com (MMS)
    • Here's a link to a list of messaging gateways for other wireless carriers (such as Sprint and Verizon): SMS gateways - Wikipedia,...

  5. Where's Server Info (MMS)
    • Press the Menu Key
    • Scroll to and select Messages
    • Press the Menu Key
    • Scroll to and select Message Setup
    • Scroll to and select MMS Message Setup
    • Scroll to and select Server Info

  6. Where's web session
    On the phone:
    • Press the Menu Key
    • Scroll to and select WebAccess
    • Scroll to and select Web Sessions
    • Scroll to new entry and press select
    • Name this entry Cingular
    • Scroll to and select Edit
    On P2K Advanced Editor:
    • Phone Services->Web Sessions