Home

Notebook Diary

2005-05-02

Someone create a hotlink to the images in my site. With google and good keywords I found a lot of solution.
One is to use .htaccess file to prevent the link such as

RewriteEngine on
RewriteCond %{http_referer}!^$
RewriteCond %{http_referer}!^http://(www.)?yoursite.com [NC]
rewriterule .(gif?jpe?g)$ - [NC,F] 

See this or this for more detail.

2005-01-05

Someone at the company ask me Can we send/read an SMS from the computer?
After search the google, the answer is :

It is possible, if your phone support Extended ETSI Hayes AT command parameters for SMS.

Most of new mobile-phone (which include my Nokia 6230) support it. To send SMS, just connect your mobie phone via serial connection and send the series of AT commands. This is the example for sending the SMS:
	/usr/local/bin/ircomm -d /dev/cuaa1 -y /dev/ptypv &  #Use IrDA to connect to the phone
	minicom -p /dev/ttypv
 	AT+CMGF=1
	AT+CMGS="destination-number"
	Your text message here.
	Can be multilines
	<ESC> #Press ESC key to end the text
	ATH
Warning: the pseudo device name for minicom is ttypv which is differ from the name (ptypv) you give to ircomm.

2004-12-01

Install qemu(ports/emulators/qemu) for WinXP. I need IE to test every web pages/applications I has been created because sometime page that look good on Mozilla look awful on IE. The lesson I learn from this installation is that

  1. XP need a lot of disk space (at lease 2.5G) to make it run smoothly.
  2. Free BSD can fool you about the largest file size you can create on your system. It will not allocate the diskspace for parts of file you create util you write something to those parts. So you can create a 3GB file on the hard disk that has only 1GB left.

2004-11-30

To day, I found a LinkSys Wireless-G PCMCIA lays unused in my office. I desire to try to make it works with my notebook (IBM T42).

  1. Make sure that your add PCMCIA support to your kernel.
        # PCCARD (PCMCIA) support
        device      cbb         # cardbus (yenta) bridge
        device      pccard      # PC Card (16-bit) bus
        device      cardbus     # CardBus (32-bit) bus
    
  2. Unfortuntely, this card has only Windows driver, so the second step is to create NDIS wrapper
        # cd /sys/modules/if_ndis
        # ndiscvt -i /cdrom/lsbcmnds.inf -s /cdrom/bcmwl5.sys -o ndis_driver_data.h -n ndis_lwg
        # make
        # cp if_ndis.ko /boot/if_ndis_lwg.ko
    
  3. If you run pccardd , edit /etc/pccard.conf to add new card entry
        # LinkSys Wireless-G
        card "The Linksys Group, Inc." "Wireless-G Notebook Adapter"
        config  auto "ndis_lwg" ?
        inset   /etc/pccard_ether $device start
        remove  /etc/pccard_ether $device stop
    
  4. Use ifconfig ndis_lwg0 ssid xyz wepkey 0xXXXXXXXXXXX to set SSID and WEP key. If you run pccardd,you should put this command on the file /etc/start_if.ndis_lwg0 to set these values atomatically.
  5. If you use DHCP for the wired network card, don't forget to kill dhclient and down that interface.
        killall dhclient
        ifconfig em0 down
        ifconfig em0 inet 0.0.0.0 netmask 255.255.255.0
        dhclient ndis_lwg0 &
  6. With luck, your wireless will up and run and sysctl dev.ndis_lwg will show you a lot of information.

2004-11-28

Write a small php script that show hyper text man page as the one on FreeBSD Hypertext Man Pages. The only major difference between my code and man.cgi is that my code is written in PHP while the FreeBSD one is a sh-shell script cgi.
You can download it here.

2004-11-06

Use vim/gvim on samba share and got this error "E212: Can't open file for writing".
The problem and solution cut from FreeBSD Question List are:

Vim tries to create a file called .FILENAME.swp when you edit FILENAME. The leading dot is probably what breaks the way vim works on Samba shares. You can force vim to write its swap files in another location, i.e. in `/var/tmp' with this the line set dir=/var/tmp in your .vimrc.

2004-10-28

Finally fix mozila error
mozilla-bin: Fatal IO error 78 (Function not implemented) on X server :0.0.
I found that nppdf.so was loaded 2 times in mozilla

  1. In /usr/X11R6/lib/browser_plugins/
  2. In /usr/X11R6/lib/mozilla/plugins/
Remove one of them fix the problem.

2004-10-20

After some problems with Satellite Pro6100. The company buy IBM ThinkPad T42 for me and move the Satellite Pro to another not so demand work. So , I add new page for setting up the IBM ThinkPad T42

2004-09-25

What is the gcc optimization flags should be used in building port in FreeBSD?. The standard FreeBSD optimization is "-O -pipe " but some suggest "-O2 -pipe -funroll-loops -ffast-math"
So, I try a non-statistically correct test by running lame (/usr/porst/audio/lame) to encode 40MB wav song. This is a result (I run each lame 3 times, remove the best and worst result )

CFLAGSTIMESPEED UP
none0:37.92N/A
-O -funroll-loop0:20.3546.33%
-O2 -funroll-loop -ffast-math0:20.2146.70%

So, does it worth to use -O2 instead of -O?
For me, the answer is no. Becase from these data, if I run lame 24 hours a day, I will gain only 10 minutes from -O2. It may not worth compare to the fact that -O2 is not support by FreeBSD developer and it breaks both kernel and world in FreeBSD 5.2.1

2004-08-21

Try to update NVIDIA driver to 6113 but I can not make it work in 1400x1050 mode on my Satellite Pro 6100. Anyways, this driver is better than 4365 becase it does not hang when I try to disable SoftEDID to run 1400x1050 but it give me a garbage screen (just as when you misconfig HSync and VSync) -- the best mode I got is 1372x1050. Therefore, I still use 3203 on this Satellite Pro 6100.

2004-08-18

I have just got the Satellite Pro 6100 back yesterday after 2 weeks of repare. This is the 3rd time for last 6 months of this 3 years machine.

  1. The first, hard disk was go bad -- Ok this is understandable
  2. The second time, the main board was go bad -- Maybe due to some water has found the way to the main board (Toshiba Thailand told me) --- Ok it stills understandable becase I usually take this notebook outdoor and work in my garden. It took a week for repair (include waiting for the spare part).
  3. But the third is not exceptable, The notebook can not boot and the Power LED blinks orange. Toshiba Thailand took 2 weeks to check and told me that the contact between CPU heatsink and CPU is not firmed. Apply the heat jell seems to make the machine boot. I understand the problem,but I don't undertstand why Toshiba Thailand took 2 weeks before they found the solution.

I was very happy of this notebook for the last 2 years (except for the baterry that can last only one and a half hours). It work greates with FreeBSD , but when it come to support (at least in Thailand) and durability (compare to its price tag) -- I may try another brand for the next one.

2004-07-28

Found tons of old games at www.the-underdogs.org.
Some are games which I had played in my under graduate years (I had a lot of free time in those year), such as Romance Of Three Kingdoms and King Bounty.
These games run in DOS VGA mode (some in CGA mode). Some games require expand memory.
The problem -- I don't want to boot to Windows 2000 just for run theses games
The solutiom -- /usr/ports/emulator/dosbox. This emulator also give me the virtual sound card !! which does not exist in Win2K dosbox.

2004-07-03

Install xplanet (astro/xplanet) and write a small perl script "xplanet-gnome.pl" to rotate the earth image every 30 minutes. To run the script, put it in gnome "Startup Programs". The setting can be accessed from the menu "Applications/Desktop Preferences/Advanced/Sessions" .
This is the sample image

2004-40-08

Try to install mozilla-1.6_3 from package (I normally use ports tree but due to the size of mozilla source, --- 10M package compare to 30M source --- I tried the package this time). Everything looked fine until I tried to load the flash and java plugin.
Both plugins could not load with the following error messages

For Java:
LoadPlugin: failed to initialize shared library /usr/local/jdk1.4.2/jre/plugin/i386/ns610/libjavaplugin_oji.so [/usr/local/jdk1.4.2/jre/plugin/i386/ns610/libjavaplugin_oji.so: Undefined symbol "_ZdlPv"]
For flash6:
/usr/libexec/ld-elf.so.1: /usr/lib/libstdc++.so.4: Undefined symbol "mbsrtowcs"

All the problems have gone after I have upgraded from gnome 2.4 to 2.6 because the gnome_upgrade.sh script force me to download and build mozilla from the port tree.

So, don't mix between packages and ports. If you use packages , never use ports and vice versa.

2004-04-03 (2)

Add new APOD 1400x1050 desktop background collection

2004-04-03 (1)

Fix build error when make FreeBSD documents (/usr/doc).

Today, when I try to update FreeBSD document in /usr/doc, I got this error

AFPL Ghostscript 8.14: Unrecoverable error, exit code 1 
pnmtopng: bad magic number - not a ppm, pgm, or pbm file
After investigation, the problem is caused by peps and AFPL Ghostscript (don't sure which one need to be fixed)
It seems that AFPL Ghostscript can not handle the command send by peps when peps is called with the eps that is not in the current directory i.e. (peps -p -r 100 -o network.png /tmp/networks.eps)
To fix this problem. I move /usr/local/bin/peps to /usr/local/bin/peps.real and write the small perl script , to replace the real peps.

2004-02-24

Finished a Win32 DICT client. For XFree86/gnome there is gdict (or kdict if you use KDE) but for Win32 the one that exists , Magical Jellybean Dictionary, does not full fill my need. So I write one myself and call it MiracleDict.

2004-10-18

Change gnome2 icon themes to Crytal from art.gnome.org

2004-02-14

Install FreeBSD 5.2 , see Setup Page for update information.

2004-02-10

Spend an hour find out why chown/chgrp/passwd give me a core dump after my machine hang and need a reboot (nVidia related)
The answer: There is a garbage appened to /etc/master.passwd.

2004-01-02

Ctrl-Alt-Fx does not switch to a text mode console in gnome2 !!
So, I write the small vtswitch.c to do this work.

  1. Allow vtswitch to run as root by (a) chmod u+s vtswitch or (b) use sudo
  2. Assign the short cut key to run the command. (assume metacity ,(b) option and start X in ttyv0)
    (a) Run gconf-editor (System Tools/Configuration Manager)
    (b) Set apps/metacity/keybinding_commands/command_1 to sudo /usr/local/sbin/vtswitch 2
    (c) Set apps/metacity/global_keybinding/run_command_1 to F1 (or any key you want)
Now you can use Ctrl+Alt+F1 to switch from graphic to text mode.

2003-07-18

Format the hard disk and reinstall everything :(

2003-07-10

Change gtk2 and metacity themes .
The gtk2 themes derived from Nuvola and gtk1 mozilla-modern-2. Just put it to /usr/X11/share/themes.
The Metacity theme derived from Nuvola(new) and sawfish Lunatic.To use, put the theme in /usr/X11/share/gnome/themes.

2003-05-17

Upgrate the to FreeBSD 4.8,gnome 2.2 and XFree 4.3. For details click here

2003-04-30

Change the notebook background to M17: A Hubble Close-Up from NASA Astronomy Picture of the Day.

2004-03-20

Add toshctl page

2003-02-11

Reinstall FreeBSD

...

Install FreeBSD Workstation on Toshiba Satellite Pro 6100



Home

The document theme copy from FreeBSD Handbook
For questions about this documentation, e-mail <cws_at_miraclenet_dot_co_dot_th>
Last update : $Id: index.html,v 1.29 2006/04/26 08:51:33 cws Exp $
Chatchawan Wongsiriprasert