Showing posts with label Computer. Show all posts
Showing posts with label Computer. Show all posts

Windows XP Security Update KB951748

Be very aware that Windows XP Security Update KB951748 can freeze wireless connection on the laptop with ZoneAlarm. I had this problem for about half a month and was able to solve it only from removing all recent security updates including KB951748. I guess it is not that late to turn off the annoying windows automatic updates now.

Parallel computing with CUDA.net

Parallel computing of Monte Carlo simulation can easily achieve 40 to 160 speedup with CUDA.net and NVidia Tesla C1060 GPU card. Here is my setup:

1. Machine: Intel® Core2 Quad CPU Q9450 @ 2.66 GHz 2.66GHz, 3.00 GB of RAM













2. GPU card: NVIDIA® Tesla™ C1060












3. Compiler: Microsoft Visual Studio Team System 2008













4. GPU library: GASS CUDA.net








5. Program: Distribution of Correlated Random Variables

Create Repository with Subversion, Ankhsvn, and Visual Studio 2008

1. Install Subversion

I used the certified version from Collab.Net. I removed the Apache option during installation for I only want to share projects on local network. The repository directory required by installation is used as the parent folder for a number of project repositories.

Next, I created a temporary folder called "temp" under that parent repository directory and then sub-folders "branches", "tags", and "trunck" under "temp".

Next, in the DOD command windows, I CD into the parent repository folder and type "svnadmin create --fs-type fsfs myproject"to create a project repository called "myproject". I also modified "svnserve.conf" and "passwd" (find how to online) under "myproject" to accommodate authentication.

Further, I started subversion server using command "net start CSVNsvnserve" and imported the project directory layout from "temp" into "myproject" using "svn import -m "initial project layout" svn://localhost/myproject/". The import asks for the Windows User and Password and then the project repository User and Password for validation.

2. Install AnkhSvn

AnkhSvn is also from Collab.Net. Now, it's time to upload the project files to the myproject repository.

In Visual Studio, I right click "mysolution" and choose to "add solution to subversion" and supplied the svn url as "svn://localhost/myproject/trunk". This will create another folder called "mysolution" under "trunk" (all files get a blue plus icon).

Next, I right click "mysolution" again and choose to "subversion -> add" and put all the solution files to the queue adding to repository (all files get a green plus icon).

Further, I right click "mysolution" again and choose to "subversion -> commit" and then all the solution files will be actually uploaded to the "myproject" repository (all files get a blue tick icon).


3. References:

Ankhsvn Documentation

LNK2001: unresolved external symbol _gsl_rng_default

The solution to the error LNK2001: unresolved external symbol _gsl_rng_default from using GSL library with MS Visual Studio is simple. It lies inside the project settings (compiler and linker) used for compiling the GSL library and all the test examples. The error disappears when those settings are applied to the work project. Better to do this by looking at the command line options other than browsing the setting dialogs one after one.

Build files for GSL 1.12 for Microsoft Visual Studio 2008
http://gladman.plushost.co.uk/oldsite/computing/gnu_scientific_library.php
(Note: This build has a bug that is not difficult to find out :-))

Attach Database to MS SQL Server 2005

1. Make sure the database file is not "read-only".

2. Change the path to the databasefile when operating system error is "system cannot find the file specified".

学习 Screen (Day 2)

Some good materials from
http://www.pixelbeat.org/lkdb/screen.html

Key Action Notes
============================
Ctrl+a c new window
Ctrl+a n next window I bind F12 to this
Ctrl+a p previous window I bind F11 to this
Ctrl+a " select window from list I have window list in the status line
Ctrl+a Ctrl+a previous window viewed

Ctrl+a S split terminal horizontally into regions Ctrl+a c to create new window there
Ctrl+a :resize resize region
Ctrl+a :fit fit screen size to new terminal size Ctrl+a F is the same. Do after resizing xterm
Ctrl+a :remove remove region Ctrl+a X is the same
Ctrl+a tab Move to next region

Ctrl+a d detach screen from terminal Start screen with -r option to reattach
Ctrl+a A set window title
Ctrl+a x lock session Enter user password to unlock
Ctrl+a [ enter scrollback/copy mode Enter to start and end copy region. Ctrl+a ] to leave this mode
Ctrl+a ] paste buffer Supports pasting between windows
Ctrl+a > write paste buffer to file useful for copying between screens
Ctrl+a < read paste buffer from file useful for pasting between screens

Ctrl+a ? show key bindings/command names Note unbound commands only in man page
Ctrl+a : goto screen command prompt up shows last command entered

Version Control with VisualSVN Server and TortoiseSVN

Version control is for keeping track all the changes made to the source codes. It is of great convenience for a group of people to work together on the same project as well as a for a student to do his own programming homework. Frankly, I don't know much details of the version control system. It would be crazy for people like me to read its whole manual word by word and to pause frequently to search for all the computer jargon on the internet. So, I managed to learn how to use it quickly for my work.

1. Preparation
You may hear about CVS, an old version control system, but I am using Subversion, which is the new system that becomes more and more popular today.

Subversion manages all the repositories. Repository is the folder where the source codes or project files are stored for version control on the computer. In order to make the repository accessible through internet the Apache HTTP server, which can turn the computer into a web server, need to be installed along with the Subversion system. Since it is not an easy configuration task for them to work happily together I chosen to install VisualSVN Server, which is a package bundle of Subversion, Apache and a management console for Windows platforms.

A client tool is also necessary to communicate with repositories, e.g. download a copy of codes from the repository to local computer ("check out" in jargon) or send modified codes into the repository from local computer ("commit" in jargon). I chosen to use TortoiseSVN, which integrates nicely into the Windows Explorer on the Windows platforms.

2. New Repository Creation
After installing both VisualSVN Server and TortoiseSVN it is then the time to create a repository with an initial copy of your codes. You can read through the tutorial of "Practical guide to subversion on Windows with tortoiseSVN" or follow my simplified steps for doing that.

(1) Open VisualSVN, right click "repositories" in the left frame, choose "create New Repository ..." and uncheck the box of "Create default structure (trunk, branches, tags)".
(2) On your computer, create a folder "tmp", a folder "new" inside "tmp", and three folders named "trunk", "branches", and "tags" inside "new".
(3) Place your codes into the recently created folder "trunk".
(4) Right click the folder "new", choose "TortoiseSVN" and then "Import", choose the right path for your newly created repository, write in the version control message, e.g. "Initial import", and then click "OK".

Note that (1) has to be done on the server computer while (2), (3), and (4) can be done either locally or remotely.

3. Communication with Repository
Please refer to this short TortoiseSVN Tutorial on how to communicate with repositories. It is simple enough to download old codes from and upload modified codes into repositories. All that can be done with TortoiseSVN functions from right clicking your working folders. It should be aware that renaming, deleting, and adding files of codes should all be done with TortoiseSVN, other than through normal file operations in the Windows Explorer, as explained in the TortoiseSVN Tutorial.

So...happy version control!

My Dual-Boot Notebook

===========================
Thinkpad X61
===========================
I got my second notebook, Thinkpad X61, a few days ago. With a 12.1 inch screen and no CDROM attached it weighs only 2.2 lbs, which is great for traveling. I chose it because I was really not happy with the weight of my old HP notebook: 7.25 lbs without battery. Before I made the oder I also looked into most popular 9 inch netbooks, such as Asus EEE PC, Acer Aspire One, and Dell E netbook. But they all have some unsolved performance issues with their ATOM cpus and onboard hard drives. I didn't go for Mac Air as well because a notebook that expensive means the same as robbery to me and it also restricts the fun you can find from trying all kinds of software.

As my Thinkpad X61 arrived I found everything to be great except the notorious Windows Vista operating system. My dislike of Vista is not lone but shared by all my friends, by news reports, and even by Bill Gates. So my immediate decision was to reinstall the operating system from scratch for the new notebook. This blog then records all the steps I took for that purpose, most of which were dug out deep from the internet using Google.

I have to mention that Thinkpad X61 has an over-heating issue with its wifi card under the right palm. The issue is most severe with Linux because the system just can't manage the wifi card that well. It is even worse on my notebook since the madwifi wireless driver doesn't have support for power management for the Atheros chip. But the issue is not obvious under Windows XP and becomes zilch after turning off the wifi card in the BIOS.

MACHINE: Thinkpad X61 7675CTO
(Intel Core2 Duo CPU T8100 @ 2.1GHz x 2, 2G RAM, 100G 7200RPM Hard Drive)


===========================
Dual-Boot Systems
===========================
The reinstallation was then planned for a dual-boot system with Windows XP Professional and 64-bit Ubuntu Hardy Heron. The Windows system was setup first and the Ubuntu second. The original hard drive partition and the unseen Windows vista recovery partition were all deleted at installing the Windows system. About 85 GB hard drive space was allocated to the Windows system and was divided into three NTFS primary partitions of 25 GB, 30GB, and 30GB, respectively. The remaining 15 GB was late formatted as a 12 GB ext3 root system and a 2 GB swap space for the Linux system. This allocation seemed too stingy for the Linux system, but I didn't realize this after completed all the work and tried out the new systems for a couple of days. Now I have learned that at least 30 GB hard drive space is necessary for carrying out some basic computational work on the Linux system. What a pity!


(TO BE CONTINUED...)

WINDOWS SYSTEM: Microsoft Windows XP Professional SP3


LINUX SYSTEM: Ubuntu 8.04.1 Hardy Heron
(Kernel 2.6.24-19-generic, Gnome 2.22.3, I386x64)


===========================
Windows XP Setup
===========================



===========================
Ubuntu Hardy Setup
===========================
# powertop:
1. echo 1500 > /proc/sys/vm/dirty_writeback_centisecs

2. sysfutils->ships sysfs.conf which allows to conveniently set sysfs attributes change
cpu frequency scaling to ondemand

# wlan power management:
no power management on madwifi driver for atheros


# chinese
1. language support -> chinese
2. scim setup

# Wpa2
1. /etc/ssl/certs/ca-certificates.crt
2. not done

# LaTex
1. texlive
2. texmaker

# Terminal
1. devils pie
2. setup

# intel compilers
0. fix errors when you try an initial install
1. cce
2. fce
3. mkl

# wireless
remove network-manager
install wicd
remove wicd
intall network-manager
wireless not working
install latest madwifi by replacing its ath_hal with latest hal from people.freebsd.org/~sam
restart and stop wireless roaming
start wireless roaming and works.

# syslog-ng
replace klogd and sysklogd
send network-manager messages to /dev/null with permission change.

# hug log files
solved by deleting network profiles for wpa2

Terminal, Console, and Shell

After searching the internet for quite some time I finally had some sense of the relationship among terminal, console and shell.

1. Terminal

Real text terminal: Includes only a screen (NOT TO BE CALLED "MONITOR" AS FOR TODAY'S COMPUTER), keyboard, and a small memory to store a screenfull text (ONLY A FEW KILOBYTES). Keyboard is plugged to screen, which is further wired to the serial port of computer with a long cable.

Terminal emulation: An emulated real text terminal created by computer software and classfied as virtual terminal and pseudo terminal.

Virtual terminal or console: The command line interface seen after the boot of Linux system. By default, seven virtual terminals are available and can be switched using [CTRL]+[Fn] (n: 1-7). The 7th virtual terminal is reserved for X-windows system and the rest are for textual Shells.

Pseudo terminal: A pseudo-device pair that provides a text terminal interface without associated virtual console, computer terminal or serial port hardware. Its applications include terminal emulator and remote login handler.

Terminal emulator: Xterm, Konsole and alike on X windows systems, which serve as master device (/dev/ptmx) while Shell serves as slave device(/dev/pts/N)

Remote login handler: SSH and Telnet, which serve as master device (/dev/ptmx) while Shell serves as slave device(/dev/pts/N).

2. Console: The monitor and keyboard on today's computers or the real text terminal on old time computers.

3. Shell: A utility program resides on hard disk, by default the first program to start after a user log onto the system, and classfied as login shell, interactive shell and conventional shell.

Interactive, login shell: The shell reads these files in sequence: (system wide) /etc/profile; (per user) ~/.bash_profile; ~/.bash_login; ~/.profile; (when logout) ~/.bash_logout.

Interactive, non-login shell: The shell reads these files in sequence: (per user) ~/.bashrc; (when exit) ~/.bash_logout.

Non-interactive, login shell: The shell reads these files in sequence: (system wide) /etc/profile; (per user) ~/.profile; (when logout) ~/.bash_logout.

Non-interactive, non-login shell: The shell starts by executing $BASH_ENV and exits with reading ~/.bash_logout.

4. Login Process: For wired connection, init-> getty -> login-> first program to run, usually Shell; for network connections, init -> sshd, telnetd, or rlogind -> login -> first program to run, usually Shell.

References:

1. Text Terminal HOW-TO
2. Pseudo Terminal Master/Slave
3. What is Unix Shell?
4. How Environment Variables Really Work?

When you install printer drivers

When you install printer drivers please don't forget to log on as administrator. Otherwise, you probably would see warning messages such as "Error Tag = AddPrinterDriver(0)", "The Specified Module Can't Be Found", "Operation Not Allowed" and so on and most likely can't find a solution through Google and Yahoo.

Linux Commands (Day 1)

(1) Change file permissions

chmod 644 filename ## assign the file read/write by the owner and only read by everyone else (-rw-r--r--).

chmod -R 644 foldername ## assign all the files in the folder read/write by the owner and only read by everyone else (-rw-r--r--).

r:
400 read by owner
040 read by group
004 read by anybody (other)

w:
200 write by owner
020 write by group
002 write by anybody

x:
100 execute by owner
010 execute by group
001 execute by anybody

(2) Secure copy files between Linux hosts

scp user@remote-computer:/remote-path/remote-file /local-path/local-file ## copy a file from a remote computer to the computer you are working at.

scp -r user@remote-computer:/remote-path/remote-directory /local-path/local-directory ## copy a folder from a remote computer to the computer you are working at.

scp /local-path/local-file user@remote-computer:/remote-path/remote-file ## copy a file from the computer you are working at to a remote computer.

scp -r /local-path/local-directory user@remote-computer:/remote-path/remote-directory ## copy a file from the computer you are working at to a remote computer.

(3) Control jobs

jobs ## list jobs.
%1 ## resume the first stopped job.
fg %1 ## resume the first stopped job.
%1 & ## put the first stopped job into background.
bg %1 ## put the first stopped job into background.
kill %1 ## terminate the first stopped job.
nohup myjob.sh & ## run myjob.sh in the background as a process detached from the console and send output to nohup.out by default.
script...exit ## start a new shell and log all the output into the file called typescript.

(4) Capture outputs

(((./cmd | tee stdout.txt) 3>&1 1>&2 2>&3 | tee stderr.txt) 3>&1 1>&2 2>&3) 1>out.txt 2>err.txt ## see explanation at http://www.cpqlinux.com/redirect.html.

(5) Emacs tutorial

移动硬盘的科普

如果在选购移动硬盘时被店员问及需要的是串口还是并口?请跟他好好说,谢谢,我只是看看,然后掉头就走,不要浪费时间!以下是为什么:

移动硬盘就是外置硬盘,不是接在电脑机箱内部的那种。请记住:移动硬盘 = 硬盘 + 硬盘盒,硬盘通过电源线和数据线连接在硬盘盒内,装有硬盘的硬盘盒再通过电源线和数据线连接在电脑上。所以,选购移动硬盘要考虑硬盘盒内有是否有对应硬盘接口的数据线,以及硬盘盒外和电脑上是否是否有相对应的接口。

(0)数据线及其接口的不同反映了数据传输速度的不同。

(1)硬盘盒内的数据线对应于硬盘的数据接口,硬盘的数据接口有分IDE,SCSI,和SATA,相应的硬盘也叫做IDE,SCSI,和SATA硬盘。

IDE又叫做Parallel ATA,SATA则是Serial ATA的简写,中文翻译过来前者叫并行ATA,后者叫串行ATA,这和什么“串口”和“并口”完全是两码事!“串口”和“并口”英文翻译过来叫Serial PortParallel Port,他们的数据传输速度非常的低,是绝对不会用在硬盘上的!

如果选购Serial ATA硬盘,请注意它的价格要贵一点!如果选购IDE硬盘,记得区分下面几种规格。由上而下,它们代表了传输速率的增加!
ATA-1
ATA-2
ATA-3
ATA-4
Ultra ATA/33
Ultra ATA/66
Ultra ATA/100
Ultra ATA/133

此外还得区分硬盘转速的不同,转速高当然就好些:
5400rpm
7200rpm

以及硬盘的尺寸,3.5“是台式机使用的那种硬盘,2.5"是笔记本电脑使用的那种硬盘:
5.25 inches
3.5 inches
2.5 inches

(2) 硬盘盒外的数据接口可以是USB、IEEE1394、eSATA,最常用的是USB 2.0,其他的应用都比较受限制。

(3)硬盘盒的尺寸是根据所装东西的大小来定义的,5.25”是用来装光驱的,2.5“是用来装笔记本那种硬盘的,3.5“是用来装台式机的那种硬盘。硬盘盒有分铝或者金属外壳和塑料外壳,前者散热比较好,如果还有个小风扇就更好了。当然,要试试看外置盒运转起来是否噪音比较小!

现在应该明白为什么那个店员值得鄙视了吧,别总以为老百姓可以糊弄,考古挖坑是个人都会!这次你可找到他直接明白的说:

我想买一个移动硬盘,要7200转的IDE Ultra ATA/133或者Serial ATA硬盘,外置盒是USB 2.0接口,3.5 inches大,散热好,噪音小,请问有什么选择没有?

他要是听不明白,请跟他说,你去旁边帮我问问,别串口并口的,呵呵!

下面是考古的帖子:

硬盘传输接口

硬盘盒

The official external ENCLOSURE thread

学习 Screen (Day 1)

这些同标题的一系列帖子是用来记录我对Screen(一个有趣并且非常有用的Linux软件)的理解和使用。

Screen是用来在linux机器上同时进行多任务操作的program,这看来和在Windows上一边放mp3一边看网页一边跑程序没什么区别,但是Screen的重要性在于她可以使跑在Linux服务器上的程序持续保持运行,不受用户退出或者关闭与Linux服务器链接的影响。

这对成天跑程序做计算的我们实在是太有帮助了!举个实际操作的小例子:我先用SSH远程登录到Linux服务器,在bash下运行Screen,然后在Screen上运行我的计算程序,接着脱离这个Screen(注意,是脱离,不是退出),再退出Linux帐户并关闭SSH;几天以后,当我再次SSH远程登录到Linux服务器,运行Screen,可以发现原来的计算程序一直还在运行;但是如果我在上次离开的时候选择关闭Screen,那么我的计算程序也会即时被终止。

Screen可以生成很多session,每个session又可以生成很多window,每个window都可以看成是一个独立的shell,每个shell都可以做独立的事情。下面是她一些常用的Linux命令,$代表当前shell的提示符,##代表对命令的解释,Ctrl代表Ctrl键。

$ Screen -S mywork ## 创建Screen下以mywork为名的一个session和这个session下的第1个window。

Ctrl-a A ## 为当前window添加名字。

Ctrl-a c ## 在当前session下创建新的window。

Ctrl-a A ## 为当前window改变名字。

Ctrl-a “ ## 浏览当前session下的所有window并转换window。

Ctrl-a d ## 脱离当前window当前session,回到用户的bash下。

$ Screen -ls ## 浏览Screen下所有的session以及他们的状态。

$ Screen -r mywork ## 再次链接到Screen下以mywork为名字的那个session的上次脱离的window。

$ exit ## 退出当前window并转移到这个session下的上一个window(当退出这个session下最后一个window时,这个session也就自动退出)。

一些references:

[how-to] GNU Screen

GNU Screen -- MITBBS Linux版镇版之宝

Complete Screen Manual