2011年12月21日 星期三

Finding the Unique Device ID in Windows Phone 7 (And Device Manufacturer And Anonymous Windows Live ID)


  • Device Manufacturer ID
    • DeviceExtendedProperties.TryGetValue(“DeviceManufacturer”, out someObject);
    • example: “HTC”
  • Device ID
    • DeviceExtendedProperties.TryGetValue(“DeviceUniqueId”, out someObject);
    • requires ID_CAP_IDENTITY_DEVICE in the app manifest which will trigger a warning to users when they install the app
    • a byte[], converter to a string will looks like
      “12345678901234567890123456789012345678901234567890123”
  • Anonymous Windows Live ID
    • A 32 character subset at offset 2  of the results of
      “UserExtendedProperties.TryGetValue(“ANID”, out someObject)
    • requires ID_CAP_IDENTITY_USER in the app manifest which will trigger a warning to users when they install the app
    • looks like “00FF00FF00FF00FF00FF00FF00FF00FF”
However, if you just need any unique identifier (not necessarily a device ID), you can always set and store a new global unique identifier using:
Guid.NewGuid();
which will return a 128-bit integer that will look something like this:
“e81644f1-46b6-4994-2903-1d1f1440c130″
This will not cause warnings to appear when the app is downloaded because it isn’t a constant identifier to that specific device.
Reference To:

SQLite on WP7


“C# Sqlite Port for Windows phone 7 and possibly Silverlight 3, 4. The core engine was slightly modified to be used with IsolatedStorage and SqliteClient were ported by using missing codes from Mono project in order to maximize usability and portability from desktop.”
Although sterling works great, it is essentially an object-based database (NoSql-like)… If you truly need a relational database or if your application currently uses SQLite and you want to port it to Windows Phone 7, this might just be the answer!
Let’s get started… As with traditional ADO.NET, we first need to create a connection:
using (SqliteConnection conn = 
 new SqliteConnection("Version=3,uri=file:Super14Database.db"))
{
    conn.Open();
    // Use the connection here...
}
And now we can start using the database with “normal” SQL statements… Let’s create a table.
using (SqliteCommand cmd = conn.CreateCommand())
{
    cmd.CommandText = "CREATE TABLE matches ( [id] INTEGER PRIMARY KEY, _
 [team1] TEXT, [score1] INTEGER, [team2] TEXT, [score2] TEXT, [date] TEXT)";
    cmd.ExecuteNonQuery();
}
And to insert data:
cmd.Transaction = conn.BeginTransaction();
cmd.CommandText = "INSERT INTO matches(score1, team1, 
 score2, team2, date) VALUES(@score1, @team1, @score2, @team2, @date);";

cmd.Parameters.Add("@score1",  null);
cmd.Parameters.Add("@team1", null);
cmd.Parameters.Add("@score2",  null);
cmd.Parameters.Add("@team2",  null);
cmd.Parameters.Add("@date",  null);

cmd.Parameters["@score1"].Value = 20;
cmd.Parameters["@team1"].Value =  "Blues";
cmd.Parameters["@score2"].Value =  34;
cmd.Parameters["@team2"].Value =  "Hurricanes";
cmd.Parameters["@date"].Value =  "12/02/10";
cmd.ExecuteNonQuery();


cmd.Parameters["@score1"].Value =  15;
cmd.Parameters["@team1"].Value =  "W Force";
cmd.Parameters["@score2"].Value =  24;
cmd.Parameters["@team2"].Value =  "Brumbies";
cmd.Parameters["@date"].Value =  "12/02/10";
cmd.ExecuteNonQuery();

cmd.Parameters["@score1"].Value =  34;
cmd.Parameters["@team1"].Value =  "Cheetahs";
cmd.Parameters["@score2"].Value =  51;
cmd.Parameters["@team2"].Value =  "Bulls";
cmd.Parameters["@date"].Value =  "12/02/10";
cmd.ExecuteNonQuery();

cmd.Parameters["@score1"].Value =  32;
cmd.Parameters["@team1"].Value =  "Crusaders";
cmd.Parameters["@score2"].Value =  17;
cmd.Parameters["@team2"].Value =  "highlanders";
cmd.Parameters["@date"].Value =  "12/02/10";
cmd.ExecuteNonQuery();

cmd.Parameters["@score1"].Value =  28;
cmd.Parameters["@team1"].Value =  "Reds";
cmd.Parameters["@score2"].Value =  30;
cmd.Parameters["@team2"].Value =  "Waratahs";
cmd.Parameters["@date"].Value =  "12/02/10";
cmd.ExecuteNonQuery();

cmd.Parameters["@score1"].Value =  13;
cmd.Parameters["@team1"].Value =  "Lions";
cmd.Parameters["@score1"].Value =  26;
cmd.Parameters["@team2"].Value =  "Stomers";
cmd.Parameters["@date"].Value =  "12/02/10";
cmd.ExecuteNonQuery();

cmd.Parameters["@score1"].Value =  18;
cmd.Parameters["@team1"].Value =  "Sharks";
cmd.Parameters["@score2"].Value =  19;
cmd.Parameters["@team2"].Value =  "Chiefs";
cmd.Parameters["@date"].Value =  "12/02/10";
cmd.ExecuteNonQuery();
                    
cmd.Transaction.Commit();
NOTE: Notice the transaction support build in!
To fetch data from the database:
cmd.CommandText = "SELECT * FROM matches";
using (SqliteDataReader reader = cmd.ExecuteReader())
{
    while (reader.Read())
    {
        var team1 = reader.GetValue(1);
        var score1 = reader.GetValue(2);
        var team2 = reader.GetValue(3);
        var score2 = reader.GetValue(4);
        var date = reader.GetValue(5);
    }
}
And that’s it! It is more verbose but it does work great and the translation from a normal desktop application that used SQLite should be simple!


Reference To:
http://www.codeproject.com/Articles/151179/SQLite-on-WP7

Windows Phone 7 Emulator Skin Switcher 1.0 Beta


In the last few weeks several people started creating their own skins for the Windows Phone 7 Emulator. Switching between different skins was a lot of work by copying files manually to the emulator directory every time you wanted to switch. From now on this is not needed anymore because you can use the Windows Phone 7 Emulator Skin Switcher application I’ve created.
wp7EmulatorSkinSwitcher
You can download the application here: Download
This version is the first beta release with my first set of skins. I added 2 skins from Georg Kalus: the Blue Nokia Lumia 800 and the White/Pink Nokia Lumia 710. I’ve also included the Black Nokia Lumia 800 skin from Pedro Lamas
The complete list of skins included in the application now are:
I’m planning on adding more skins in the near future but didn’t have time for it yet. If you have skins I can use please let me know by comment or on twitter
lumia710whitelumia800pinklumia710black

Hopefully this will make your Windows Phone 7 projects even more fun to test!

2011年12月19日 星期一

How To Change Your Windows Phone Emulator?


Today, I discovered that Pedro Lamas had released a skin for the Windows Phone emulator that allowed it to look like the Nokia Lumia 800.  (You can see it here.)
This inspired me to create another new skin for my current phone, the HTC Arrive.  (Click here to download the HTC Arrive Windows Phone Emulator skin.)  To use either of them, you simply need to copy the contents of the zip file to a specific folder on your computer (make sure to save a copy of the original files):

C:\Program Files (x86)\Microsoft XDE\1.0\

Once you’ve done that, your emulator can look like one of the images below!
Nokia-Lumia-800-skin-for-Windows-Phone-Emulator[1]                                  image
Reference To:http://www.jeffblankenburg.com/2011/12/17/want-to-change-your-windows-phone-emulator/

2011年11月29日 星期二

HowTo - 在 Windows 7 、Vista 忘記 Administrator 密碼


To reset a forgotten administrator password, follow these steps:

  1. Boot from Windows PE or Windows RE and access the command prompt.
  2. Find the drive letter of the partition where Windows is installed. In Vista and Windows XP, it is usually C:, in Windows 7, it is D: in most cases because the first partition contains Startup Repair. To find the drive letter, type C: (or D:, respectively) and search for the Windows folder. Note that Windows PE (RE) usually resides on X:.
  3. Type the following command (replace “c:” with the correct drive letter if Windows is not located on C:):
    copy c:\windows\system32\sethc.exe c:\
    This creates a copy of sethc.exe to restore later.
  4. Type this command to replace sethc.exe with cmd.exe:
    copy /y c:\windows\system32\cmd.exe c:\windows\system32\sethc.exeReboot your computer and start the Windows installation where you forgot the administrator password.
  5. After you see the logon screen, press the SHIFT key five times.
  6. You should see a command prompt where you can enter the following command to reset the Windows password (see screenshot above):
    net user your_user_name new_password
    If you don’t know your user name, just type net user to list the available user names.
  7. You can now log on with the new password.
I recommend that you replace sethc.exe with the copy you stored in the root folder of your system drive in step 3. For this, you have to boot up again with Windows PE or RE because you can’t replace system files while the Windows installation is online. Then you have to enter this command:
copy /y c:\sethc.exe c:\windows\system32\sethc.exe

2011年10月27日 星期四

把瀏覽器當虛擬平台?

每次要跑虛擬機時,都要有一個Hypervisor,不管是原生或寄居架構,但不管是哪一種架構,總要有一個硬體平台吧?總要分配CPU、記憶體或磁碟空間吧?下面這個Linux,卻是真正把VM的層次拉高到最上層:瀏覽器。這是一個用Javascript重寫的Linux核心,而Javascript的執行平台正是瀏覽器!曾經有人懷疑這只是一個模擬Linux的介面而已,但現在已證實是真正的Linux核心了。


Fabrice Bellard是誰應該不用介紹了,是ffmpeg、QEMU的原創人,高中時就開發出LZEXE這個壓縮軟體,不但是有名的電腦工程師,也是有名的數學家,這邊可以看到Fabrice Bellard的維基介紹。

這個用Javascript寫出來的Linux不但可以執行,更可以用來學習Linux的指令,如vi等。大家就到

http://bellard.org/

到這邊來玩玩吧!

Reference:
http://vaemon.com/article/1363.html
http://www.softwarequalityconnection.com/2011/03/fabrice-bellard-portrait-of-a-superproductive-programmer/

不得不說,WP7開發的資料真的是太少了,國內有句話叫「天下文章一大抄」,查Application.GetResourceStream的用法,找遍了整個網絡,無非就那一兩篇,而且寫得還不完整,包括微軟官方的例子。在花了近半天的時間後,終於解決問題。
我們可以預先把程序中用到的資源,如圖片,音樂等放入項目中,打包進XAP文檔,需要的時候再從中取用。下面就說說具體實現方法。

第一步,把資料存進項目。
1、右鍵點擊項目名稱-新增-新建資料夾,這裡文件夾名以 Images 為例,把需要的圖片拖進來,當然你也可以不建,直接把圖片拖到根目錄底下。
2、選中剛剛拖進去的圖片,看右下角的屬性標籤,如果沒有,右鍵點圖片,選屬性,確認圖片屬性中的建置動作為 Resource

第二步,程式呼叫。
1
System.IO.Stream src = Application.GetResourceStream(new Uri("/PhoneAppX;component/Images/abc.png", UriKind.Relative)).Stream;
關鍵在 Uri 的格式,PhoneAppX 是項目名稱,component 是固定路徑,Images/abc.jpg 才是圖片資源相對路徑,得到的是 Stream,在微軟官方的例子中,使用下面的方法來轉換成圖片:
1
2
3
4
            BitmapImage bi = new BitmapImage();
            bi.SetSource(src);
            Image img = new Image();
            img.Source = bi;
網路上的文章基本上都沒寫第一步,常常就卡在這裡,新增圖片還好,但是屬性的建置動作沒設好或改成其他屬性,導致程式在 Run 的時候常常丟出 Exception!


Reference To: http://www.pocketdigi.com/20110925/498.html

2011年9月12日 星期一

「sudo」 for Windows PowerShell

相信有許多 Unix-like 的愛用者,
對於 sudo 帶來的便利性及安全性,
都有很高的依賴性及倚靠性,
在 Windows 的世界,雖然有個「以系統管理員身分執行」的玩意兒,
但是在習慣使用文字介面如 cmd, vim, PowerShell 的人們來說,
倘若遇到需要系統管理員權限的設定檔或文字檔,
往往就是一句「XXX」之後,還要到開始功能表尋找到 cmd 或 PowerShell,
然後再用滑鼠點右鍵選擇「以系統管理員身分執行」,然後再 cd 到剛剛的資料夾,再用編輯器開啟、編輯、blah blah....

一來一往,往往費神又費時,
今天介紹在 PowerShell 使用時,
可以輸入 Unix-like 中的 sudo (或使用者自己取)
後面再帶 vim 或 notepad 指令,接著被修改的設定檔或文字檔,
便可以系統管理員權限開啟該設定檔或文字檔,以便進行編修!

一、首先「以系統管理員身分執行」開啟 PowerShell,
預設沒錯的話,您會在您的家目錄,如:C:\Users\XXXXXXX

二、輸入指令以便新增 scripts 資料夾:

New-Item -ItemType directory $HOME\Documents\Scripts


三、使用編輯器如 vim 或 notepad 開啟 PowerShell 之 Profile 檔:
(預設為 WindowsPowerShell\Microsoft.PowerShell_profile.ps1)

notepad.exe $PROFILE

四、新增如下文字於該檔中:

New-PSDrive -name script -PSProvider FileSystem -Root $HOME\Documents\Scripts


五、存檔並離開。

六、重啟你的 PowerShell ,你將發現上面所新增的資料夾被 mount 起來,可以繼續進行:

cd script:


七、進入 script 槽後,用慣用的編輯器開啟新增 sudo.ps1 script檔:

notepad.exe sudo.ps1


八、加入 sudo script 如下:

param(
        [switch]$ps,            # Switch for running args as powershell script
        [string]$file,             # Script/Program to run
        [string]$arguments = $args # Arguments to program/script
     )

# Find our powershell full path
$powershell = (get-command powershell).definition

# Get current directory
$dir = get-location

#If we're running this as a elevated powershell script
if ($ps){

        # Script verification
        if([System.IO.File]::Exists("$(get-location)\$file")) {

                # Set the $script to full path of the ps script
                $script = (get-childitem $file).fullname
        }

        # Create a powershell process
        $psi = new-object System.Diagnostics.ProcessStartInfo $powershell

        $psi.WorkingDirectory = Get-Location

        # Combine the script and its arguments
        $sArgs = $script + " " + $arguments

        # Set the arguments to be the ps script and it's arguments
        $psi.Arguments = "-noexit -command set-location $dir; $sArgs"

        # Magic to run as elevated
        $psi.Verb = "runas";
}

# We're running something other than a powershells script
else {

        # File verification
        if([System.IO.File]::Exists("$(get-location)\$file")) {

                # Get full path
                $file = (get-childitem $file).fullname
        }

        # Same as above, create proccess/working directory/arguments/runas
        $psi = new-object System.Diagnostics.ProcessStartInfo $file
        $psi.Arguments = $arguments
        $psi.Verb = "runas"
}

# Start the process
[System.Diagnostics.Process]::Start($psi)


九、存檔並離開!

十、再次開啟 PowerShell 的 Profile 設定檔:

notepad.exe $PROFILE


十一、新增關聯指令:

New-Alias -Name sudo 'script:\sudo.ps1'

注意這裡的紅色字 sudo 可以改成任何你想要的字,只要不跟內建指令撞名即可!

十二、重啟 PowerShell,你可以使用:

sudo notepad C:\Windows\System32\drivers\etc\hosts



sudo vim $PROFILE

就會以系統管理員權限開啟,當然 Windows 的 UAC 會開啟並問你是或否,此時按「是」,
便會開啟具有系統管理員權限的視窗了!

Reference To: http://techha.us/2010/05/sudo-for-powershell/
                      http://www.ainotenshi.org/710/%E2%80%98sudo%E2%80%99-for-powershell-sorta

2011年9月6日 星期二

Visual Studio 2010 授權修改


參見以下步驟:
32位的系統中,修改以下登錄表鍵值
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\Registration\UserName
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\
RegisteredOrganization
64位系統,修改以下登錄表鍵值
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\
VisualStudio\10.0\Registration\UserName
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\
Windows NT\CurrentVersion\RegisteredOrganization
改到此步,在 Visual Studio 的關於窗口中,授權給的信息已經更改,但是 Splash Screen的畫面還是沒有改,還需接下來操作
執行 devenv.exe /setup

2011年8月24日 星期三

Installing PostgreSQL 9.0 on Ubuntu (11.04) using PPA


The version of default PostgreSQL in the latest Ubuntu (11.04) is still 8.4.8.
So I decided to install 9.0 version when I found there is a PPA (Personal Package Archives) for it. (I have no previous version of PostgreSQL in this Ubuntu PC.)

1. Resources.
PostgreSQL PPA: https://launchpad.net/~pitti/+archive/postgresql

2. Add PPA repository to my Ubuntu.

$ sudo add-apt-repository ppa:pitti/postgresql


3. Install PostgreSQL 9.0

$ sudo apt-get update
$ sudo apt-get install postgresql


4. Check the installation [updated 2011-07-24]

$ locate postgresql # check the locations of postgresql files
...
/etc/init.d/postgresql # server daemon
/etc/logrotate.d/postgresql-common
/etc/postgresql/9.0
/etc/postgresql/9.0/main # directory for config files
/etc/postgresql/9.0/main/environment
/etc/postgresql/9.0/main/pg_ctl.conf
/etc/postgresql/9.0/main/pg_hba.conf
/etc/postgresql/9.0/main/pg_ident.conf
/etc/postgresql/9.0/main/postgresql.conf
/etc/postgresql/9.0/main/start.conf
...
/usr/lib/postgresql # server apps
/usr/lib/postgresql/9.0
/usr/lib/postgresql/9.0/bin
/usr/lib/postgresql/9.0/lib
...
/var/lib/postgresql # home directory for root user postgres
/var/lib/postgresql/9.0
/var/lib/postgresql/9.0/main # I will create error log directory (pg_log) here
/var/lib/update-rc.d/postgresql
/var/log/postgresql
/var/log/postgresql/postgresql-9.0-main.log
/var/log/postgresql/postgresql-9.0-main.log.1
...

$ psql -V # check psql version
psql (PostgreSQL) 9.0.4

$ finger postgres # check if user postgres is created
Login: postgres Name: PostgreSQL administrator
Directory: /var/lib/postgresql Shell: /bin/bash
Never logged in.
No mail.
No Plan.

$ su postgres # switch user to postgres
$ psql # launch psql as postgres and check the server version
psql (9.0.4)

postgres=# select version();
-----------------------------------------------------------------------------------------------------
PostgreSQL 9.0.4 on i686-pc-linux-gnu, compiled by GCC gcc-4.5.real (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2, 32-bit


5. Setup Root User 'posrgres'
The installer has created a unix user postgres without a password. So first I give a (unix) password to this special user. The user postgress is a root user (database administrator) of PostgreSQL Server but without a (PostgreSQL) password. So I give it one here as well.

$ sudo passwd postgres # give the postgres user a (unix) password
$ su postgres # switch to the user postgres
$ psql # launch psql to give postgres PostgreSQL passord
postgres=# alter user postgres with password 'secret'; # new password for postgres
ALTER ROLE
postgres=# \q # quit psql
$ exit # exit from user 'postgres'
exit


6.Configure PostgreSQL Server
I want to make some changes to server config.

Make backup copies of config files.

$ su postgres # switch to the user postgres
$ cd /etc/postgresql/9.0/main
$ ls -la
...
-rw-r----- 1 postgres postgres 4108 2011-07-02 19:54 pg_hba.conf
-rw-r--r-- 1 postgres postgres 18064 2011-07-02 19:54 postgresql.conf
...

postgres@ubuntu-pc:/etc/postgresql/9.0/main$ cp pg_hba.conf pg_hba.conf.bak.original
postgres@ubuntu-pc:/etc/postgresql/9.0/main$ cp postgresql.conf postgresql.conf.bak.original

postgres@ubuntu-pc:/etc/postgresql/9.0/main$ ls -la
...
-rw-r----- 1 postgres postgres 4108 2011-07-02 19:54 pg_hba.conf
-r-r----- 1 postgres postgres 4108 2011-07-03 18:33 pg_hba.conf.bak.original
-rw-r--r-- 1 postgres postgres 18064 2011-07-02 19:54 postgresql.conf
-rw-r--r-- 1 postgres postgres 18064 2011-07-03 18:33 postgresql.conf.bak.original
...


Make changes to pg_hba.config (authetification methods).
host all all 127.0.0.1/32 trust # md5 -> trust

Make changes to postgresql.conf for error log.

#------------------------------------------------------------------------------
# ERROR REPORTING AND LOGGING
#------------------------------------------------------------------------------
log_destination = 'stderr' # 2011.07.04 - enabled
logging_collector = on # 2011.07.04 - enabled and turned on
log_directory = 'pg_log' # 2011.07.04 - enabled. I will create this folder (see below).
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # 2011.07.04 - enabled
log_truncate_on_rotation = off # 2011.07.04 - enabled and keep it off
log_rotation_age = 1d # 2011.07.04 - enabled
log_rotation_size = 10MB # 2011.07.04 - enabled


Create a log directory as specified in the config above.[updated on 2011-07-24]

$ su postgres # switch to postgres user
$ cd ~/9.0/main/ # /var/postgresql/9.0/main
$ mkdir pg_log # create a new log directory as specified in the config file above
$ ls -F # confirm the new directory 'pg_log'
PG_VERSION pg_log/ ...
$ exit


7. Restart the server [new]
I have to restart the server to use new configurations.

$ sudo /etc/init.d/postgresql restart
* Restarting PostgreSQL 9.0 database server
$ sudo /etc/init.d/postgresql status
Running clusters: 9.0/main


8. Check the new log. [new]
Now I should have a new log generated.

$ sudo ls /var/lib/postgresql/9.0/main/pg_log
postgresql-2011-07-23_135126.log


9. Finally Install pgAdmin III (GUI tool for PostgreSQL) [new]
Since the same PPA repository (ppa:pitti/postgresql) also contains the latest pgAdmin III, I can install it with a simple apt-get command.

$ sudo apt-get install pgadmin3 # install the latest pgAdminIII
$ pgadmin3 # launch it


It is version 1.12.2.


Reference To:http://socrateos.blogspot.com/2011/07/installing-postgresql-90-on-ubuntu-1104.html

Install GUI in Ubuntu Server

If you are a new user and not familiar with command prompt you can install GUI for your ubuntu LAMP server using the 2 options

1) Install desktop Environment
2) Install Webmin

1) Install desktop Environment
First you nee to make sure you have enabled Universe and multiverse repositories in /etc/apt/sources.list file once you have enable you need to use the following command to install GUI
sudo apt-get update
sudo apt-get install ubuntu-desktop
The above command will install GNOME desktop
If you wan to install a graphical desktop manager without some of the desktop addons like Evolution and OpenOffice, but continue to use the server flavor kernel use the following command
sudo aptitude install --without-recommends ubuntu-desktop
If you want to install light weight desktop install xfce using the following command
sudo apt-get install xubuntu-desktop
If you want to install KDE desktop use the following command
sudo apt-get install kubuntu-desktop
2) Install Webmin in Ubuntu
Webmin is a web-based interface for system administration for Unix. Using any modern web browser, you can setup user accounts, Apache, DNS, file sharing and much more. Webmin removes the need to manually edit Unix configuration files like /etc/passwd, and lets you manage a system from the console or remotely.Currently There is no Webmin package in the Ubuntu repositories.This tutorial will explain how to Install Webmin in Ubuntu Jaunty
You can install webmin for your server web interface to configure apache2,mysql,FTp servers and many more.Now we will see how to install webmin in Ubuntu 9.04
Preparing your system
First you need to install the following packages
sudo aptitude install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl libmd5-perl
Now download the latest webmin using the following command or from here
wget http://prdownloads.sourceforge.net/webadmin/webmin_1.470_all.deb
Now we have webmin_1.470_all.deb package install this package using the following command
sudo dpkg -i webmin_1.470_all.deb
This will complete the installation.
Using the Webmin APT repository
If you like to install and update Webmin via APT, edit the /etc/apt/sources.list file on your system
sudo vi /etc/apt/sources.list
add the line
deb http://download.webmin.com/download/repository sarge contrib
Save and exit the file
You should also fetch and install my GPG key with which the repository is signed, with the commands : cd /root
wget http://www.webmin.com/jcameron-key.asc
sudo apt-key add jcameron-key.asc
You will now be able to install with the commands
sudo apt-get update
sudo apt-get install webmin
All dependencies should be resolved automatically.
Ubuntu in particular don’t allow logins by the root user by default. However, the user created at system installation time can use sudo to switch to root. Webmin will allow any user who has this sudo capability to login with full root privileges.
Now you need to open your web browser and enter the following
https://your-server-ip:10000/
Now you should see similar to the following Screen
After login if you want to configure Apache,Mysql server you need to click on Servers on your lefthand side you should many servers are ready to configure
This is very Easy to configure most of the servers and Enjoy your new Ubuntu Jaunty LAMP Server.
Reference To:http://www.ubuntugeek.com/install-gui-in-ubuntu-server.html