Entries Tagged as ''

How to Check Directory Disk Usage in Linux or Mac OS

Yes, we have GNOME or KDE that can help us to check disk usage. Mac OS also provides GUI utility for disk management. However, when we do something in terminal and want to know one direcotry and its sub-directories disk usage, “du” command will be most helpful. Plus “-h” option will return human readable number. The following screen shot is the command “du -h”.

Mac OS Terminal

P.S. The reason that I am interesting in this command is because “du” is my last name. :)

Fedora 7 Xen Preview

Virtual Machine has been a hot topic for a long time, especially after VMWare acquied by EMC and IPO-ed in stock markets. There are several choices in the markets.

Xen, as an important feature in Redhat Enterprise 5, is optional when you install Fedora 7. If you think your local machine is big enough. I mean, you have high performance CPU, larger memory and large capacity of hard drive. Then you can think about to install Xen. If you have already installed Fedora 7, you can add this good feature by:

yum install kernel-xen xen virt-manager

Additionally, Xen provides GUI for user to easily configure. The following are the steps and screen shots of installing Windows XP vitrual machine.

Step 1: Go menu “Applications” — “System Tools” — “Virtual Machine Manager”, you will see the dialog box prompt.

Create a virtual machine

Step 2: Naming your virtual machine

02_xen_naming.png

Step 3: Choosing Virtualization Method

Choosing Virtualization Method

Step 4: Locating Installation Media. Here I used ISO file to import.

Locationg Installation Media

Step 5: Assigning Storage Space. Here I used one 20G file as virtual machine space.

Assigning Storate Space

Step 6: Connect to Host Network. Here is not as good as VMWare since I don’t know how virtual machine connect to my physical network interface. In VMWare, you can setup network either by bridge or by NAT. Now, I can only choose default.

Connect to Host Network

Step 7: Allocate Memory Space and CPU. See, my memory is too small. But it works.

Allocate Memory Space and CPU

Step 8: Ready to Installation

Ready  to Install

Step 10: My Lovely Installation Screen for 15 Years :)

Setup

Step 11: Monitor Your Virtual Machine

Monitor Status

Summary

Pros:

  1. Friendly graphic user interface, easy to use.
  2. Binding with Fedora distribution, easy to install.

Cons:

  1. Not as matured as VMWare
  2. Cannot assign more hard disk to virtual machine, unlike VMWare.
  3. Cannot configure network at the beginning, unlike VMWare.

However, I still like Xen since it is simple and easy to use.

zdump Your Local Daylight Saving Time

I recently raised an issue that real time monitor, which can draw a graph of network device status, cannot handle daylight saving time (DST). The graph will be overlapped for one hour on March when changing to summer time and will be broken for one hour on November when changing back. Then, I am interesting in how to know DST for certain area in the world.

That’s actually very simple by using “zdump”, the tool provided by most UNIX boxes, including Linux and Mac OS. According to the following, I can know easily that Mar 9th, 2008 is the date to change to summer time in my area.

[root@henrydu ~]# zdump -v /etc/localtime
/etc/localtime Sun Mar 9 09:59:59 2008 UTC = Sun Mar 9 01:59:59 2008 PST isdst=0 gmtoff=-28800
/etc/localtime Sun Mar 9 10:00:00 2008 UTC = Sun Mar 9 03:00:00 2008 PDT isdst=1 gmtoff=-25200
/etc/localtime Sun Nov 2 08:59:59 2008 UTC = Sun Nov 2 01:59:59 2008 PDT isdst=1 gmtoff=-25200
/etc/localtime Sun Nov 2 09:00:00 2008 UTC = Sun Nov 2 01:00:00 2008 PST isdst=0 gmtoff=-28800
/etc/localtime Sun Mar 8 09:59:59 2009 UTC = Sun Mar 8 01:59:59 2009 PST isdst=0 gmtoff=-28800
/etc/localtime Sun Mar 8 10:00:00 2009 UTC = Sun Mar 8 03:00:00 2009 PDT isdst=1 gmtoff=-25200
/etc/localtime Sun Nov 1 08:59:59 2009 UTC = Sun Nov 1 01:59:59 2009 PDT isdst=1 gmtoff=-25200
/etc/localtime Sun Nov 1 09:00:00 2009 UTC = Sun Nov 1 01:00:00 2009 PST isdst=0 gmtoff=-28800

Additionally, you can looking for other time zone in the world by going to /usr/share/zoneinfo/. The directory includes all area time zone in the world, especially your hometown. So, I tried my hometown. Sadly, I noticed that there are just two cities available in my hometown, one is Chongqing and the other is Shanghai. (Where is Beijing?) Even sadly, I noticed that it has been no DST since 1991 in my hometown. Speechless. :(

/usr/share/zoneinfo/Asia/Shanghai Sat Apr 14 15:59:59 1990 UTC = Sat Apr 14 23:59:59 1990 CST isdst=0 gmtoff=28800
/usr/share/zoneinfo/Asia/Shanghai Sat Apr 14 16:00:00 1990 UTC = Sun Apr 15 01:00:00 1990 CDT isdst=1 gmtoff=32400
/usr/share/zoneinfo/Asia/Shanghai Sat Sep 15 14:59:59 1990 UTC = Sat Sep 15 23:59:59 1990 CDT isdst=1 gmtoff=32400
/usr/share/zoneinfo/Asia/Shanghai Sat Sep 15 15:00:00 1990 UTC = Sat Sep 15 23:00:00 1990 CST isdst=0 gmtoff=28800
/usr/share/zoneinfo/Asia/Shanghai Sat Apr 13 15:59:59 1991 UTC = Sat Apr 13 23:59:59 1991 CST isdst=0 gmtoff=28800
/usr/share/zoneinfo/Asia/Shanghai Sat Apr 13 16:00:00 1991 UTC = Sun Apr 14 01:00:00 1991 CDT isdst=1 gmtoff=32400
/usr/share/zoneinfo/Asia/Shanghai Sat Sep 14 14:59:59 1991 UTC = Sat Sep 14 23:59:59 1991 CDT isdst=1 gmtoff=32400
/usr/share/zoneinfo/Asia/Shanghai Sat Sep 14 15:00:00 1991 UTC = Sat Sep 14 23:00:00 1991 CST isdst=0 gmtoff=28800
/usr/share/zoneinfo/Asia/Shanghai Mon Jan 18 03:14:07 2038 UTC = Mon Jan 18 11:14:07 2038 CST isdst=0 gmtoff=28800
/usr/share/zoneinfo/Asia/Shanghai Tue Jan 19 03:14:07 2038 UTC = Tue Jan 19 11:14:07 2038 CST isdst=0 gmtoff=28800

Enscript: One Line Printing

Instead of opening text editor, selecting “File” menu followed choosing “Print”, we can print out or transfer text file by using one line. Assuming that the printer name is “printer”. Try this out,

enscript -2rGE -P printer some_script.txt

which will give us more reason to embrace CLI.

How to Remote Login Your Desktops

This is an era of information. You doubt? Well, for me, even my parents have two computers in home. I believe most of people have more than one computers, no matter if it’s laptop or desktop. You may hope to manage them visually and try to login one or more desktops simultaneously. The industry provides several solution for us. I just list three of them which I usually use. They are Remote Desktop, VNC and VMWare Server Console.

The first one is Microsoft Windows Remote Desktop. Needless to say, due to over 79.32% OS market share, most of people know how to use it and love to use it. Compared to VNC, it has nice feature that you can copy from remote desktop and paste to your local machine. In my test bed, Remote Desktop transferring graphs is faster than VNC and VMWare Server Console. So, from the usability point of view, Remote Desktop is the best. However, you have to stick on Windows OS.

The second one is VNC (Vitrual Network Computing). If you try to manage several Linux boxes as well as Windows and Mac boxes, VNC is a good choice since (1) it’s light weight open source software, (2) it’s compatible with most of OS and (3) it supports KVM (Keyboard, Video and Mouse) over IP. However, there still some drawbacks.

  1. You have to install VNC Server on each boxes you try to login.
  2. You still need to install VNC Viewer on your managing machine.
  3. You cannot copy and paste between machines. (At lease for Personal Edition, never tried Enterprise Edition before.)
  4. Transferring graphs is slower than Remote Desktop, especially when watching videos.

VNC Viewer for Fedora 4 Desktop

vnc_fc4.jpg

The third one is VMWare Server Console. Actually, this one is for remote accessing virtual machine. Normally, I am running at least four platforms in one local machine. I can login VMWare Server and use console to access each virtual machine.

After VMWare was aquried by EMC, I believe VMWare will change our ways to setup computer, since CPU will be more powerful, Memory will achieve more capacity and Hard Drive will promote to network level.

Microsoft Office Live: Better late than never

I have heard that Microsoft headed to Web Office for a long time. However, they don’t really want to do that since they got huge profit from their off-line Office packages. Until recently, when Google announced Presentation as the enhancement of Google Docs on the web, Microsoft realized they have to pay more attention on Web Office markets. The market has not been blue ocean. There were quite a lot sharks there.

Google is the biggest one in my opinion. Google has already combined Google Docs to Google Apps package, which includes Gmail, Calendar, Docs&Spreadsheet and Presentation. This type of web application attracted many small businesses, enterprises and institutions. For me, I’d like to discuss small project with people on Google Docs. Why not, it’s more visualized than MSN or other Instant Messenger. The most attractive thing in here is, everyone can participate composing document and save a lot of time to transfer revision files.

Google Presentation Screen Shot

google_presentation.jpg

Google SpreadSheet Screen Shot

google_spreadsheet.jpg

ZOHO is another one and actually, ZOHO provide more sophisticated web application to their customers. People still concern about several issues when they really work online. The question will be such as

  • where is the web application host server, intranet or the Internet?
  • How to protect our business data?
  • How to enhance web security?

ZOHO Main Page Screen Shot
zoho.jpg

Now, here comes Microsoft Office Live. I don’t even doubt their products. Only thing I really concern is, What the strategies of marketing for promoting Office Live and Office 2007 at the same time. Until now, unlike Google, Microsoft did not put Office Live link onto Windows Live. What does Microsoft expect too much for Office Live? We’ll see.

office-live.jpg

Since Web Office give people chances to easy collaboration and communication, more people will adopt this kind of web application sooner or later. Therefore, entering this market will be, better late than never.