2008/04/28

Samba Setup on CentOS 5

I have an existing user "amy" on my new installation of CentOS v5.1. I want a directory located at "/home/fileServer" to be shared through samba as "fileServer", that can be mounted by amy in Windows XP and Vista.

Here's the steps:

1. Installed samba server
yum install samba

2. Created directory to be shared
# mkdir /home/fileServer
# chown root:root /home/fileServer
# chmod 770 /home/fileServer

3. Edit samba configuration file
# cd /etc/samba
# mv smb.conf smb.conf.sample
# vi smb.conf
[global]
workgroup = MYWORKGROUP

[fileServer]
comment = file server
path = /home/fileServer
writable = yes
create mask = 0770
directory mask = 0770

4. Edit samba user accounts
# smbpasswd -a root
# smbpasswd -a amy

5. Update smbusers file
# vi smbusers
root = administrator admin
amy = amy

6. Started smb daemon
# service smb restart

7. Test
In Windows XP, typed \\, and entered amy as user with the password. You should see the share defined in smb.conf.

2008/04/19

Tuning the Linux kernel for better network throughput

If your linux server needs to have better network throughput, try this out.
From /etc/sysctl.conf:
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
The first command enables TCP window scaling, which allows clients to download data at a higher rate by enabling extra bits in TCP packets that are used to increase the window size.
The second command enables TCP SYN cookies, which is often enabled by default and is extremely effective in preventing conditions such as SYN floods that can drain the server of resources used to process incoming connections.
The last four options increase the TCP send and receive buffers, which allow an application to move its data out faster so as to serve other requests. This also improves the client's ability to send data to the server when it gets busy.
To make the change immediately:
sysctl -p /etc/sysctl.conf
To see all of the currently configured sysctl parameters:
sysctl -a
You can also use sysctl to make the change:
sysctl -w net.ipv4.tcp_window_scaling=1
This can be useful for testing the effectiveness of certain settings without committing them to being defaults.

4GB RAM on Vista

All 32-bit Operating Systems can only physically address 4 GB of RAM, due to the math involved (232 = 4,294,967,296). Depending on your hardware, Vista may only see 3GB or 3.5GB of the total RAM installed, because there are some devices that are memory mapped. The most common hardware of this type of device is a video card, which can use up to 512MB of memory for mapping.

You can tweak Vista's core to add another 4-bits of addressing capability, but you must have a 64-bit capable CPU (pretty much any processor made within the past two years like Core 2 Duo or Athlon 64). Even though the math works out to address way more than 4GB (236 = 68,719,476,736), the operating system still has a cap (Windows Server can address anywhere from 8GB to 128GB depending on the flavor).

To force this new addressing method, you have to tell Vista to boot using this new parameter. Vista no longer uses a BOOT.INI file as previous versions of Windows did, so you must modify the boot file using a built-in Vista tool called BCDedit.

To turn on PAE, in Command prompt, type BCDedit /set PAE forceenable.

This PAE flag (Physical Address Extension) tells the Vista core to use an additional 4 bits of addressing, which in theory allows the OS to see all of the RAM you have available. We're not out of the woods yet, because once you reboot you may find that Vista still doesn't see all of your RAM.

Using PAE might make Vista to run slower. Vista runs slower with PAE because of the new page-translation system being used. By default Vista uses 2 cycles to address memory, and will use 3 when Physicall Address Extension is enabled. PAE also supports advanced procesor features such as Data Execution Prevention (no execute), Non-Uniform Memory Architecture (NUMA), and hot-add memory. PAE is automatically disabled when DEP (Data Execution Prevention) is disabled, so you must force PAE when DEP is disabled by running BCDedit:

To disable DEP: BCDedit /set nx AlwaysOff

PAE force on: BCDedit /set pae ForceEnable

You can turn PAE off again by typing BCDedit /set PAE forcedisable or BCDedit /set PAE default.


2008/04/17

Inspectd:用真實股市資料做的股票交易遊戲

Find this from Read for Joy's blog - Inspectd:用真實股市資料做的股票交易遊戲

在《蘋果橘子經濟學》(Freakonomics,簡體版:魔鬼經濟學)一書作者Steven D. Levitt、Stephen J.Dubner的部落格Place Your Stock Bets Here看到了Inspectd網站的簡介——與股市有關,又容易讓人欲罷不能的遊戲。(不知道這網站會不會成為技術分析信徒的修煉處或試劍石?)

根據Inspectd網站的介紹,所有的股價走勢圖都是真實的股票歷史資料,然後就像玩大富翁一樣,一開始提供一個(Account Value)十萬美金的帳戶讓你玩,如果想重新從十萬美金開始,按下reset就清除所有交易紀錄....

Learn from play is cool idea. Check it out yourself - Inspectd.com

2008/04/04

I love M5, the one and only E39

Sooner or later I will get this one back. In the mean time, check this out:



Also check out the BMW film, Star in our test channel

Mercury簡易改裝

有同好有一樣的困擾 - 如何使用自己的data logging軟體,因此寫了這篇來分享我的簡易改裝。 Background 雲豆子 MERCURY roaster 烘豆機的設計是使用自行開發的軟體,來:1. 操控風門/火力; 2. data logging/自動烘焙。 ...