Monday, December 25, 2006

A free online stock trading system

I used to go to Yahoo Finance for watching stocks. Yahoo Finance is 'just enough' and I would like to have a more flexible tools. Therefore, I chose the opensource EclipseTrader. It is a Java application so I can run it on my Ubuntu Desktop as well as my Windows laptop. It provides the following features:
  • Realtime Quotes (For US stocks only. Too bad for Hong Kong people)
  • Intraday Charts
  • History Charts
  • Technical Analisys Indicators
  • Price Patterns Detection
  • Financial News
  • Level II (Book) Market Data
  • Trading Accounts Management
  • Integrated Trading
Actually I am just interested in the charting parts because others such as trading accounts management can be done by Yahoo Finance or even e-banking, but a flexible charting system is necessary for people using technical analysis. The following screenshots are the charts of US Nasdaq index and a Hong Kong Stock HSBC. As you see, you can add some indicators such as RSI, Stoch, Bollinger Bands and more. You may argue that Yahoo Finance also provides such charts. However, it is possible to customize settings for the indicators. For example, you can just plot the moving average line with 5, 10, 20, 50, 100, 200 days while EclipseTrader let you have some special value such as 2 days, 9 days, 19 days, etc.

To conclude, if you are a technical analysis based stocks buyer, you can enjoy plot different charts with this free tool. If you are a fundamental analysis based buyers, then Yahoo Finance can provide enough information already (Of course, you should see the financial reports for the companies as well).

Ref: Official site - Eclipse Trader






Monday, December 18, 2006

Create a "Encrypted Drive" with Truecrypt

Everyone must have some information that is confidential and not want to be accessed by others. However, when you left your laptop behind, lose it or even just a portable hardisk, your information are exposed. So anything can be done such that people can't read the confidential data?

With Truecrypt, you can setup a "Encrypted Drive" in Windows, or a "Encrypted mountpoint" in Linux. But before started the Truecrypt, the drive or the mountpoint is just a single file, or even a partition. People cannot decrypt the data from the file or the partition without the pass key which can be a password or a file.

There is also a 'hidden volume' feature. Encrypted data can be stored in an existing Encrypted drive/mountpoint but with a different pass key. So when you are forced to tell the pass key, you can just tell the 'less confidential' pass key and your data in the 'hidden volume' is still safe.

Using Truecrypt can definitely protect your data. But please don't forget your pass key or you will never get back the data.

Ref:
Truecrypt website: http://www.truecrypt.org
Doucmentation: http://www.truecrypt.org/docs/

Wednesday, December 06, 2006

Second Life in Linux

In these days I am playing second life which is a 3D virtual community. Very impressive about the 'economic'. It's because the currency in second life can convert into US dollar! That means you can try to 'earn' in your second life and than enjoy the result in the first life.

The official system requirement only supports Windows and MacOS which made my life not easy. I had no choice but using my only Windows based notebook to play. But now just heard that there is an alpha Linux version and I immediately downloaded and had a try. Now I can play in the 17" LCD monitor which makes my second life easier and enjoyable. Although it's alpha, the stability is still acceptable. The only problem is that the requirement of the graphic card and memory size is harsh. I found my old Nvidia card with 512MB is just enough to run the game.

Ref:
Official page: http://secondlife.com
Linux alpha download: http://secondlife.com/community/linux-alpha.php

Friday, November 17, 2006

Using FON to access Internet around the world

Can you imagine there is a 'global ISP' which can provide service using wireless (WiFi) over the world? FON is now doing!

Actually FON is not really a ISP, but it asks the community to share their network connection with a special wireless router to FON's members such that the members can access Internet using the shared wireless access points. Please note that members can access Internet once they detect there is a FON access point nearby, no matter you are in Asia, America, Europe, Africa or even Antarctica (Only if there is really an access point)!

Is the service free? Yes and no, it depends on how you share your network. Please have a look at the official site and the plans. But what shocks me is that how this model will upset the traditional ISP. I can even imagine we can use a WiFi PDA or smartphone to access FON network, then use VoIP software such as Skype to make cheap call, instead of using IDD or roaming services when we go traveling.

Now the critical point is the number of people who are willing to share the network. If there are enough people, the FON will be a great success business model, make the people get closer and closer.

Ref: http://www.fon.com (official) http://hk.fon.com (Chinese)

Wednesday, November 15, 2006

Windows Vista is not really welcome

While Windows Vista will be released very soon, more than half of Europe Enterprise do not consider to upgrade to this latest version.

In my opinion, the enterprises do not think Vista will improve their efficiency. In fact, some of them even think Windows NT or Windows 2000 are 'good enough'. Another problem is that the upgrade of OS will also lead to the upgrade of hardware. Therefore, they have to find a way to handle the retired old machines (Perhaps install Linux on old machines is a good choice).

As the era of Web2.0 is coming, many software will change to web available. As you see the services Google provides, you can use mail, calendar, docs and spreadsheets, IM. It's not surprised that a 'browser only machine' is good enough for most users in the future. If what we need is only a browser, why should we to buy a powerful Vista for just open a IE or Firefox?

Ref: http://taiwan.cnet.com/news/software/0,2000064574,20111711,00.htm

Sunday, November 12, 2006

Use "screen" to run programs in a dedicated session

I'm so surprised that no many people know about this command. Suppose I run a long term command such as 'top' in my notebook, with a PuTTY session. Suddenly the notebook out of battery and standby automatically. After I reopen the notebook the session has already close.

It would not be a problem for this case, but imagine that I am running a backup job or evening some billing job and the session terminated unexpectedly. It would be a nightmare. Fortunately, using 'screen' command may make our life easier.

So when you need to run a command, don't run "top" but "screen top" instead. There're no different, right? How about type "Ctrl-A" and "d"? You'll see your console again, with a word "[detached]". This means you have detached a session which is running the command "top".

Can't get the idea? Type "screen -ls", you'll see the sessions in the system.

$ screen -ls
There are screens on:
2963.pts-0.server (Detached)

The 'top' is still running, but in a detached session. You can attach the session anytime at anywhere. Just run "screen -r " (pid is 2963 in this case). Then the "top screen" is back again.

So next time when you want to run a command that may take a certain of time and you're not sure you can maintain the
console session, you can consider use "screen" to run in a session, detach it and reattach it later.

Ref: http://www.rackaid.com/resources/tips/linux-screen.cfm

Thursday, November 09, 2006

Use rdiff-backup for incremental backup

I'm always looking for an easy solution for backup my Linux box. I tried tar, rsync but they 're just 'too simple'. They are good in mirroring or one time backup, but not incremental. "Dump" is better, but it doesn't support Reiserfs, which is my favorite filesystem. What about NetBackup or BrightStor? Just because it costs money. And Bacula? I would say it is a wonderful network backup solution, but implementation is a bit complicated. Finally I choose "rdiff-backup".

How easy it is? Let's say I want to backup a server to a directory /archive. I just have to run the following command:
rdiff-backup --exclude-special-files --exclude-filelist /exclude.lst / /archive

What is the exclude-filelist? It's just a file to mention that which file/directory should NOT be included:

/archive
/dev
/media
/proc
/srv
/sys
/tmp
/cdrom
/var/log
(... or other directories you like)

Just run the command once a day and then you will got an incremental backup everyday. If you want to decide a retention period, say 2 weeks, then you can run "rdiff-backup --force --remove-older-than 2W /archive". This can help to save spaces.

rdiff-backup can also backup via the network and support ACLs. Please refer to the official site or man page for more usages.

Thursday, November 02, 2006

Ubuntu Edgy Eft Evaluation

After spending a day the Ubuntu 6.10 is now ready. Because I am using some advanced features such as LVM, I chose to use the Alternative CD with text mode to install the system. The installation completed successfully, and I just skip the installation steps here.

After login to Gnome, I felt very good. I can say that general users should now be ready to enjoy the Linux world! However, if you are a Chinese or using non-Latin languages, something must be done further.

As a Chinese, Chinese character input and display are necessary, although I still prefer the English interface. Fortunately there is a perfect guide for the installation of input method of SCIM in ubuntuguid.org. I just followed the instructions and I can type Chinese now. After solving this issue, it's time to try other features.

The first one is a 'Post-it' like program Tomboy. Different things can be put on the "Notes", and there is a global search function to search text among the notes. Then I tried the F-Spot, a photo management software. It organizes the photos by time and tags, and the photos can be uploaded to some online albums such as Flickr. I found it is very useful, but as a beginner, it takes some time for me to get used to manage photos with time and tags, rather than using traditional directory categories one.

The default mail client is Evolution, but I like Mozilla Thunderbird more. It doesn't mean Evolution is bad, in fact its functions are too much. Its calendar and event management is not very useful for me. I'd rather use my smart phone or even Google Calendar because I can check my schedule in any machines. In addition, the platform independent feature makes me to migrate data from one machine to another easily. As Thunderbird is not the default program, I had to install it manually (Using either apt-get or Synaptic Software Manager).


There are programs I need to install, one of them is the GNUCash. I've been using this personal finance management program for several years. The latest version can fetch the stocks price outside US such that I can control my assets and cashflow easily. Although it is not related with IT directly, I still want to emphasize that, "recognize the finance is very important".

This last issue is the multimedia. Something went wrong? It's "Chinese" again! If I just listen to english songs, I can imagine the Rhythmbox is a wonderful player. Yet it cannot display the correct Chinese characters between the Big5 and UTF-8 codings(Yes, the world are still using big5, such as my MP3 player). Then I tried the Songbird, the the problem still exists. Finally I chose the KDE's Amarok. Actually it can't solve the problem either, but at least it can display the Chinese filename in the playlist correctly, and I know which song is player. Rhythmbox and Sondbird are 'too advanced', songs must be chosen by the artist and song name. But how can I choose from the error coded characters? So some KDE applications are still better (Such as player Chinese songs).

Perhaps there are still features haven't tested, I feel this version is very good. If I have to rate it, I will give it a 90. The 10 points deducted is just because the Chinese issue :>


Chinese version is ready at 君子居

Monday, October 30, 2006

Ubuntu 6.10(Edgy Eft), has been released

From the official site of Ubuntu, the latest version 6.10 has been released. The code named "Edgy Eft" version has the serveral new features, including:
  • Tomboy, an easy-to-use and efficient note-taking tool

  • F-Spot, a photo management tool that enables tagging, photo editing and automatic uploading to on-line web management sites such as Flickr

  • GNOME 2.16, which in addition to new features such as enhanced power management, makes the GNOME desktop more secure, faster and more stable

  • Upstart, a replacement start-up manager offering a cleaner design, eye-catching effects and a substantially faster boot time

  • The latest Firefox web browser, which offers inline spell check support in web forms, easy recovery of crashed sessions, built-in phishing detectors, enhanced search engine management with built in OpenSearch support, and better support for previewing and subscribing to web feeds

  • Proactive security features, preventing many common security vulnerabilities even before they are discovered

  • Evolution 2.8.0, which brings new features such as vertical message panes

Currently I'm using 6.06 Dapper Kubuntu. But there is a memory leakage problem when using Eclipse. Also the stability of some KDE application is out of my expectataion. Therefore, I'd better upgrade to 6.10 and swtich back to the Gnome world. In addition, I haven't tried the Tomboy and F-Spot before but it sounds very attractive.

I'm now downloading the ISO file and hope to share my experience very soon.

Thursday, October 26, 2006

Setup your own http proxy server

In this document, I will show you how to setup an http proxy server with content filter and virus scanner on Linux platform.

We will use following open-source software to achieve our goal,
Squid - a free and open-source web proxy server

Pre-installation
First of all, you have to create user accounts, which will be used to install the proxy server. Login to your linux machine, and type the following command, if you don't have these user accounts in your system.

command> useradd -M squid
command> groupadd clamav
command> useradd -g clamav -s /bin/false -c "Clam AntiVirus" clamav

Download all required packages

Please download all following packages to your Linux machine. I used to download them to my "/downloads" folder, so I will refer to this folder in the whole installation process.

Squid - the latest version when this doc. written is squid-2.6.STABLE4
Webmin - the latest version when this doc. written is webmin-1.3
Clamav - the latest version when this doc. written is clamav-0.90RC1.1
SARG - the latest version when this doc. written is sarg-2.2.2

Compile Squid Proxy Server
Now, we are going to start our proxy installation. First, compile your squid proxy server, if you are not advance linux user (like me), you can follow my settings which shown below. If you are advance user, and wanna custom your proxy installation setting, you can check the config parameters and use your own setting.

command> su squid
command> cd /downloads
command> tar -xzvf squid-2.6.STABLE4.tar.gz
command> cd squid-2.6.STABLE4
command> ./configure \
command> --enable-arp-acl \
command> --enable-ssl \
command> --enable-linux-netfilter \
command> --enable-underscores
command> make
command> exit

Notes: You must use the "squid" account to compile the proxy server

Install Squid Proxy Server
command> make install

Okay, we have installed our server and next we will configure it. As usual, I use vi to modify config file. You can use your famous editor to edit the config file.

command> vi /user/local/squid/etc/squid.conf

Search for tag "cache_effective_user" and add the line below after the tag.
"cache_effective_user squid"

Search for tag "visible_hostname" and add the line below after the tag.
"visible_hostname MYPROXYSERVER"
where MYPROXYSERVER is the machine hostname

Save your modification and then exit

Install Webmin
You will like to install webmin which will ease you to play with your proxy server, like add access rule, configure content filter, and generate access reports.

command> cd /downloads
command> tar -xzvf webmin-1.3.tar.gz
command> cd webmin-1.3
command> ./setup.sh /usr/local/webmin

During the installation, you will be ask several questions, where you can custom your installation, I used to answer the them with default values as follows,

1) /etc/webmin
2) /var/webmin
3) /usr/bin/perl
4) port:10000
5) username: admin
6) password:
7) start at boot time: y

After installed webmin, we will configure it, so that it can work with our installed proxy server.

Enable SSL for webmin
Go to "http://host-ipaddress:10000" and login with the username which entered while installation.
Click the tags "Webmin" >> "Webmin Configuration" >> "SSL Encryption"
Click the link "download and install"
After downloaded required packages, click "Continue With Install"
After installation, click the link "Return to webmin configuration"
Click "SSL Encryption" again, select "Yes" under "Enable SSL if availabe"
Select "Yes" under "SSL requests to SSL mode"
Click the "Save" button to confirm the settings

Configure Squid Proxy Server Webmin Module
Go to "http://host-ipaddress:10000" and login with the username which you entered while installation.
Click the tags "Servers" >> "Squid Proxy Server" >> "Module Config"
Edit following fields:
  • Full Path to squid config file: /usr/local/squid/etc/squid.conf
  • Command to start squid: /usr/local/squid/sbin/squid
  • Command to stop squid: /usr/local/squid/sbin/squid -k shutdown
  • Command to apply changes: /usr/local/squid/sbin/squid -k reconfigure
  • Squid Executable: /usr/local/squid/sbin/squid
  • Full path to PID file: /usr/local/squid/var/logs/squid.pid
  • Full path to squid cache directory: /usr/local/squid/var/cache
  • Squid cachemgr.cgi executable: /usr/local/squid/libexec/cachemgr.cgi
  • Full path to squid log directory: /usr/local/squid/var/logs
Press the "Save" button

Start Squid Proxy Server
For a simple web squid proxy server, it is nearly done. Let's start to initialize our server, and then go to next section to install anti-virus software.

Press the button "Initialize Cache"
Click the link "Return to squid index"
Press the button "Start Squid"

Install Clamav
We want our server able to decline all infected files downloading, so we need an anti-virus software to scan download files. Clamav is a free anti-virus tool, I think it is good enough for us as the purpose of filtering, you may try out any other commercial anti-virus software for the same purpose, and you are very welcome to comment it. Let's start to install it.

We install it with its default settings.

command> cd /downloads
command> tar -xzvf clamav-0.90rc1.1.tar.gz
command> cd clamav-0.90rc1.1
command> ./configure
command> make
command> make install
command> make clean

Intall DansGuardian
We need a tool to link up the squid proxy server and clamav anti-virus scanner, and it is where DansGuardian placed in, which is a content filter software.

To be Continue ...

Wednesday, October 25, 2006

Firefox 2.0 Released !

One of the new fucntion "Session memory" can "hold" the session when Firefox restarts, so that I can prevent the trouble of re-login to some website.

其中一個新功能「session memory」,令每次重啟火狐時,會自動載入上次關閉前使用者最後駐足的那些網頁。這樣可以避免因意外關掉火狐而再Login多一次的麻煩。

Tuesday, October 24, 2006

Apache Rewrite

A tricky situation. Support you have two webservers but there is only 1 public IP on your network. You want everybody browse the contents of the servers with different url (say server1.test.com for server1 and server2.test.com for server2).

If the content are in the same server, it would be easy to archieve this by using VirtualHost. So how about in this case? We can use the module "Rewrite".

Support the default webserver is server1 (all traffic from Internet will go to this server first). We add a virtual host and use rewrite to "redirect" request of server2:

...
<VirtualHost *:80>
ServerName :80
ServerAdmin admin@
ErrorLog logs/<hostname/IP>-error_log
CustomLog logs/<hostname/IP>-access_log combined

RewriteEngine on
RewriteRule ^/(.*) http://<hostname/IP>/$1 [L,P]
</VirtualHost>
...

Note:
hostname of server2 should be resolved by server1
you cannot have multitple SSL(443) connection with 1 IP

Reference: http://httpd.apache.org/docs/2.2/misc/rewriteguide.html