Wednesday, October 31, 2007

slackware 12 - on macbook

I install VMware fusion to my mac book, thus I can install other OS to my macbook, I am choosing slackware 12, the installation of slackware is quite simple. But to install VMWare tool is a little tricky, I never make it work before, because I don't know what to do when I see the menu item change to "cancell vmtool installation" and it hangs there forever. Now I know is just mount /dev/cdrom to /mnt/cdrom to run the install package from 'virtual' cdrom.

And to make vmtool install successfull, I have to install pam first, here is the build script:

./configure --prefix=/usr/local --sysconfdir=/etc
make
make install
ldconfig


also mkdir /etc/pam.d used by vmware tool,

cat << EOF > /etc/pam.d/vmware-authd
#%PAM-1.0
auth required /usr/local/lib/security/pam_unix.so shadow nullok
auth required /usr/local/lib/security/pam_nologin.so
account required /usr/local/lib/security/pam_unix.so
EOF


In case there are some problems, here is the way on use vmxnet driver


cp /etc/rc.d/rc.inet1 /etc/init.d/network
cp /etc/rc.d/rc.inet1 /etc/init.d/networking
/usr/bin/vmware-config.pl

/etc/init.d/network stop
rmmod pcnet32
rmmod vmxnet
modprobe vmxnet
/etc/init.d/network start


Now it is time to enjoy vmware-toolbox!

Monday, October 29, 2007

tftp - on marvell device

My marvell device(PXA300) seems only work on static ip. I use HyperTerminal as emulator on Windows, with ifconfig, I got "192.168.1.101", while my workstation ip is 192.168.10.130, and my vmware Fedora Core 5 is 192.168.100.129. I don't know how to connect the device to my linux host, but here is how it works on my workstation.

- I change my workstation ip to "192.168.1.102", gateway to "192.168.1.100"
- Then on HyperTerminal, I can "ping 192.168.1.102", and on workstation I can "ping 192.168.1.101"
- On workstation(XP), I download and install tftp server. (Let google help to find one)
- Setup tftp, that is, start or stop tftp server, I would say my tftp server is local.

- on HyperTerminal:

tftp -p -r blah 192.168.1.102 (send blah to workstation)
tftp -g -r clock.txt 192.168.1.102 (get clock.txt from workstation)

Friday, October 26, 2007

cscope - setup

Here is the setting in my .emacs

(require 'xcscope)
(setq cscope-do-not-update-database t)
(setq cscope-initial-directory "/path/of/src")

(define-key global-map [(ctrl f3)] 'cscope-set-initial-directory)
(define-key global-map [(ctrl f4)] 'cscope-unset-initial-directory)
(define-key global-map [(ctrl f5)] 'cscope-find-this-symbol)
(define-key global-map [(ctrl f6)] 'cscope-find-global-definition)
(define-key global-map [(ctrl f7)]
'cscope-find-global-definition-no-prompting)
(define-key global-map [(ctrl f8)] 'cscope-pop-mark)
(define-key global-map [(ctrl f9)] 'cscope-next-symbol)
(define-key global-map [(ctrl f10)] 'cscope-next-file)
(define-key global-map [(ctrl f11)] 'cscope-prev-symbol)
(define-key global-map [(ctrl f12)] 'cscope-prev-file)
(define-key global-map [(meta f9)] 'cscope-display-buffer)
(define-key global-map [(meta f10)] 'cscope-display-buffer-toggle)


Common Lisp - startup

1 Pick up a Lisp implementation.

- sbcl (my current choice)
- OpenMCL, but I am not sure OpenMCL is dieing or NOT (I would like to give it a try on my MacBook.)

2 Setup development

- slime (always using the cvs version, from Marco's slime movie.
- Emacs (I would choose carbon Emacs instead of aquamacs, build Emacs from cvs is also an option, but I got a failure, is that a bug in current development version)

3 Tutorial

- slime movie, rich on coding and debugging with slime, also with Emacs tricks I never know!
- Practial Common Lisp (suggest by David Steuber)
- ANSI Common Lisp by Paul Graham (I own this book)

4 Community

- usenet comp.lang.lisp
- #lisp on irc.freenode.net

5 Where to start next

- time (1 or 2 hours quite time on MacBook)
- starter project (programming on lisp - algorithm first Red black tree)

Wednesday, October 24, 2007

VMWare - allocate disk space

Today I need to add another free disk for my new project, and my previous blog still works. Here is the steps, I am writing to create a new scsi virtual disk.


1. use vmware workstation to create a new disk 8G, and allocate spaces as well.

2. Start Fedora Core 5, run a terminal.

3. "fdisk -l /dev/sdc" to list the hard disk information, here there is no sdc1 sdc2 etc.

4. "fdisk /dev/sdc" to create a new primary disk with "n", use the all space for sdc1.

5. "mkfs.ext3 /dev/sdc1" to format the disk to ext3 format.

6. edit /etc/fstab, add a line "/dev/sdc1 /opt/marvell ext3 defaults 0 2".

7. Then I can mount /dev/sdc1 by "mount /dev/sdc1", but make sure the empty directory /opt/marvell is created first.

8. use "df" to check.

Saturday, October 20, 2007

New MacBook


I don't want to wait 6 days for Leopard release, so last night I head to futureshop to buy a new MacBook which is 2.16GHz Due Core and 1G Memory. The new one is great, its LCD is the best compared to my previous used laptops, my first ibook's LCD is a tragedy I think.
I have installed and played a lot on my MacBook, Firefox, LaunchBar, MacPorts, Emacs. Now I am maily working on to make Common Lisp on Mac OSX.

Friday, October 19, 2007

date

I found my time is wrong on my FC5. I run "date" and get the following result while I am in October.

Sat Sep 29 07:19:00 EDT 2007


Also I find EDT is incorrect which stand for East Daylight Time. So the first thing for me is to change time zone. I use "timeconfig" to select "America|Edmenton" for Mount Daylight time.

Then is change date, the second command save the time to hardware.

date 10190953
hwclock --utc --systohc

Tuesday, October 16, 2007

Mac OS X Leopard on Oct 26

Yesterday I make up my mind to wait for Leopard, today I check the apple's online web store, and find that it is updated, the great news is Oct 26 it will be released, in about 2 weeks! Originally I thought it would be Oct 31, because of a mac guy's point -- it is said to released at October, but doesn't mean Oct 1 or Oct 2, most likely it could be on Oct 31. Now the question to me is how long I can see it with a new MacBook on a store of FutureShop or BestBuy. At Oct 27?

Monday, October 15, 2007

mac os X - Leopard

I am a huge fan of Mac laptops, and I am so missed my ibook. The only thing I can do is to buy a new one, a 13 inches MacBook should fit my need. I almost bought one from Staple yesterday, it sells the 2.16GHz white laptop only for 1254 Bucks, the same prize as the 2.0GHz one, maybe it is a mistake. But I checked with the sales, there are only demo left in Calgary, no stocks for this city:-( Then today I found mac os X - Leopard will be unveil in this month - October, so I think I should wait to the end of the month or the early of next month, to buy a MacBook with Leopard. So be patient, just wait.

Thursday, October 11, 2007

Zamzar

I find Zamzar, a online PDF converter, today. And tried it with my PDF file, for PDF can not be modified by my co-worker, so I convert it to word doc format, it is good. Better than another trialed version converter I download to my PC. The only problem is I have to wait a little while (30-minutes) to let Zamzar inform me by email. I suggest Zamzar for its great quality.

Tuesday, October 9, 2007

Trolltech

Trolltech is an amazing company which produces a lot of interesting staff, Qt, KDE, Qtopia, Greenphone etc. It did contribution to the Free Software world, but it also make profits by commercial license fees. I don't know the opinion of RMS to Trolltech, but I know he is against Lessor GPL. I have a mixing feeling to Trolltech. I'm stand on GNU side in spirit, but make a living on GNU's opposite side.

Can you agree "Keep Linux free, use KDE!"? Myself does not use KDE. KDE is the default x window manager by Slackware, and I just find there are many LGPL packages with KDElibs, here is a reference.

I noticed a news related to Trolltech today, that is, it will make Qtopia Phone Free. Is that true? and When? Because when I worked on Qtopia Phone several month ago, I was with a commercial version.

Friday, October 5, 2007

-ck


Con Kolivas, or known as -ck which is his kernel patch's identity. He is a Linux kernel patcher for sure. Visit here for his home page on kernel patches. But he is quit what he has been doing. Why? Here is an interview that you must read.

As a Linux user, I know there are a lot of code monkey, they love programming, so Linux is just a perfect platform for them, there are always new devices in the market, new software that brings solutions on specific area, and new bugs that are found to be fixed, ..., so all the code monkey can do is coding, coding and coding, and thus what I am doing is install, install and install. Some times I make my own customized change on my thinkpad because the software I installed is still not very good on my slackware. iMac makes life easier for me, but Linux brings challenge to me -- that is what I thought. I seems choose the later in my life.

CPU performance is now not a big problem since the hardware has been upgrading for decades. To me, on audio area, it still could be causing problems on mobile devices, because the processor on mobile device is not as powerful as on PC, and sound is special time restrict, for instance, you have to fill 1764 bytes buffer in 20ms for sound rate 22050, stereo audio. CPU usage is important measurements, so if you use 10ms to fill the buffer, the usage of CPU is 50%.

I like to get in deep, to know audio, to know kernel... I read books on operating systems, on learning the Linux source code, on configure, build and install the kernel, but I never be a patcher. I may know how to write a module, and get it run in the kernel mode, but usually I don't have to build a device driver from scratch, so I am not "certain". There are a lot that need to be learn.

Although it is pity to see "-ck" gone,
To be or not to be, that's a question. (Shakespeare)
but it is good to see what he brings to us.

Monday, October 1, 2007

cweb - the way to coding


I found Knuth's image here.

I think I learned 3 things from Knuth. One, life is too short; Second, code can be beautiful; Third, math is for God?

CWEB is developed by Knuth & Levy. I am using CWEB again in my job. Basically I don't have a design for what I am doing, and I am using C language to solve my problems, then I can use CWEB. The good for using CWEB is -- code is always followed by my thoughts, so the Tex part of CWEB is my thoughts, and Code part is what I would sent to the compiler. What amazing me is my current work is mixing the channel of sound in a mixer, while in coding CWEB acts as a mixer on code and thoughts.

There are two other things I would mention with CWEB. One is doxygen, I didn't use it for my design. Doxygen is a wonderful tool good at on showing source code design. I use it a lot in my work. But with CWEB I can see the progress on the design and solving my problems, just with C language.

The second thing I want to mention is Wiki, I use wiki a lot, because I want to document what I learned. Wiki is a fast way to take notes. I think CWEB, Doxygen and Wiki make sense to me, because my way of coding is more like documenting it well. Documenting gives me the sense of solving problems, and also for reference.