Archive for August, 2008

eeePC

No Comments

Protected: 傻妹妹

This content is password protected. To view it please enter your password below:

1 Comment

眼訓

前幾日唔知點解無喇喇勁頭痛

星期四頂唔住喇 , 成日痛… 咁大個仔都未試過 =   =

攞左半日假睇醫生 , 訓……

florence 又係sick leave, 咁多人病 ……

祝大家身體健康喇~~~

btw, thanks fiona…

No Comments

Auto Logon to Windows XP

Auto Logon to Windows XP

Published: March 18, 2002

Submitted by Doug Knox, Microsoft MVP, Tewksbury, Massachusetts

You can configure Windows XP to automate the logon process if your computer is not part of a domain.

1. Click Start, click Run, and type control userpasswords2.
2. Clear the Users must enter a username and password to use this computer check box.
3. Click Apply.
4. Enter the user name and password you wish to automatically log on with, and then click OK.
5. Click OK again and you’re all done.

This feature allows other users to start your computer and use the account that you establish to automatically log on. Enabling auto logon makes your computer more convenient to use, but can pose a security risk.

No Comments

Tune Windows XP on eeePC 900A

1) Install nLited XP
Get rid of Windows junk before even installing it. Follow guides here or here

2) Disable paging file*
Right click on My Computer and go to:
Properties->Advanced->Performance:Settings->Advanced->Virtual Memory:Change
Select “No Paging File” and click Set.

3) Disable indexing
Go to into My Computer and right click->Properties on C: drive.
Deselect “Allow Indexing Service to index…”
Select “Apply changes to subfolders and files”(this might take a while)

4) Disable the NTFS Last Access Time Stamp*
Go to Start->Run and type in “regedit”. Hit enter.
Browse to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
Right click and New->DWORD Value and name it “NtfsDisableLastAccessUpdate”
Double-click on it and set the value to “1”.

5) System cache*

Cacheset
Download Cacheset
For Cacheset performance explanation, see post #33:

How to restart with your desired Cacheset settings
-Right click on cacheset.exe and “Create Shortcut”.
-Right click on the shortcut and select “Properties”.
-In Target, AFTER the closing quotation, write your min and max desired limits separated by spaces (same you would have set in Cacheset. Should look something like this:
“path/to/cacheset.exe” 4500 100000
– Click “OK” and drag shortcut into Start->Programs->Startup

Memory Usage
Right click on My Computer and go to:
Properties->Advanced->Performance:Settings->Advanced->Memory Usage
Select “System cache”

6) Install a Ramdisk
Download it here. It’s free and has a gui.
Set it to about 192-384mb depending how much you plan to use for firefox/ie caching (steps 7 and 8).
Make sure Media Type is “Fixed Media”.
This will be used for some of the following steps.

7) Redirect TMP/TEMP directories to Ramdisk
Right click on My Computer and go to:
Properties->Advanced->Environment Variables
In User Variables, set TMP and TEMP to “R:\Temp”. Do the same for TMP/TEMP in System variables.

note: “R:” is the default letter for the Ramdisk in previous step. If you set it to a different letter, change accordingly.

8) eeectl
Download it here.
Replace text in eeectl.ini with code in first post of this thread.
The 100mhz fsb gives a noticeable boost to the 16gb drive. Read thread for details.

9) Improve Startup speed
There is a free Microsoft utility that analyzes your entire startup process up until everything is load into Windows. It’s called Bootvis. Download it here.

-Install and run Bootvis

-Go to the Trace menu and select “Next Boot” or “Next Boot + Driver Delays”(if you want to check driver load speed, for now the first option should be fine)

-It’ll show a “Trace Repetitions” window, leave it as it is (set to only reboot once) and click OK. Upon pressing OK, it’ll immediately go into a reboot process, so close/save anything you were doing beforehand.

-Don’t do anything until Bootvis opens again. Make sure the “Process Creates” option is checked on the left side. The “Process Creates” window shows you exactly what applications run at startup and when. If there’s any applications you see starting up that you don’t want, remove it from your startup using either the Registry or MSConfig methods. If there are any applications you’re unfamiliar with, please google it before changing anything as it might be a system application (ie- explorer.exe, svchost.exe, ctfmon.exe).

note- You can just skip the whole Bootvis part and remove startup programs using registry/msconfig methods, but bootvis is helpful in telling you which applications take longer to load, including the ones you might want.

10) Firefox
Type “about:config” in the address bar and hit enter.

cache
You have 2 choices:

a) redirect cache to Ramdisk:
Set “browser.cache.disk.parent_directory” and change value to “R:\cache” (R: is your ramdisk drive).
Set “browser.cache.disk.capacity” to about 50000 (50mb).

if “browser.cache.disk.parent_directory” does exist: right click->new->string->”browser.cache.disk.parent_directory”->”R:\cache”

or

b) disable cache altogether:
doube click on browser.cache.disk.enable. It should turn bold and value = false.

precache
Explanation here(at the very bottom of the page)

Set “browser.sessionhistory.max_total_viewers” to 0

11) Internet Explorer
Redirect cache to ramdisk
Go to: Tools->Internet Options->Browsing History->Move Folder
Select your ramdisk drive.
Set disc space to about 50mb.

note: IE7 will log you off automatically after this step.

No Comments

How to: Create custom asp.net page in SharePoint

custom-develop-sharepoint-page

No Comments

How to: create custom field in SharePoint 2007

This is a detail guide to show you how to create custom field in SharePoint 2007

v3-creating-custom-field-types

create-custom-field-types-for-sharepoint

No Comments

Connecting SharePoint Site

// IN WEB PARTS AND COMPONENTS THAT RUN ON A SHAREPOINT PAGE, THE HTTP
// CONTEXT CAN BE USED TO RETURN THE SITE/WEB:
// Open current Application Level Site (no UI):
SPSite CurrAppLvlSite = SPControl.GetContextSite(Context);
SPSite CurrAppLvlSite = new SPSite(ServerContext.Current);
// Open the current Site (web):
SPWeb CurrTopLvlSite = SPControl.GetContextWeb(Context);
//
// ACCESS VIA APPLICATION DOES NOT HAVE CONTEXT, MUST
// USE URL:
// Open the Application Site (no UI):
SPSite AppLvlSite = new SPSite("http://mossspsdev:14584");
// Open the top level web for the site:
SPWeb TopLvlSite = AppLvlSite.OpenWeb();
//
// SITES CAN BE ACCESSED FROM EITHER SPSite OR SPWeb objects:
//
// Open a site by URL:
SPWeb SubLvlSiteByUrl =
AppLvlSite.OpenWeb("http://mossspsdev:14584/Sites/Subsite", false);
// Open a site by Name:
SPWeb SubLvlSiteByName = TopLvlSite.Webs["Sub site Name"];
// Open a site by GUID:
SPWeb SubLvlSiteByGUID = TopLvlSite.Webs["7707A2FD-9B72-45b2-A0A6-08EC087C1EAC"];
// Get the entire collection of sites:
SPWebCollection AllSiteCollection = TopLvlSite.Webs;

No Comments

SharePoint Compare SPItem Date with C# DateTime

DateTime dtPTOEndDate = DateTime.Parse(workflowProperties.Item[Date”].ToString());

No Comments

Generate Self-signed Certificate

Overview

The following is an extremely simplified view of how SSL is implemented and what part the certificate plays in the entire process.

Normal web traffic is sent unencrypted over the Internet. That is, anyone with access to the right tools can snoop all of that traffic. Obviously, this can lead to problems, especially where security and privacy is necessary, such as in credit card data and bank transactions. The Secure Socket Layer is used to encrypt the data stream between the web server and the web client (the browser).

SSL makes use of what is known as asymmetric cryptography, commonly referred to as public key cryptography (PKI). With public key cryptography, two keys are created, one public, one private. Anything encrypted with either key can only be decrypted with its corresponding key. Thus if a message or data stream were encrypted with the server’s private key, it can be decrypted only using its corresponding public key, ensuring that the data only could have come from the server.

If SSL utilizes public key cryptography to encrypt the data stream traveling over the Internet, why is a certificate necessary? The technical answer to that question is that a certificate is not really necessarythe data is secure and cannot easily be decrypted by a third party. However, certificates do serve a crucial role in the communication process. The certificate, signed by a trusted Certificate Authority (CA), ensures that the certificate holder is really who he claims to be. Without a trusted signed certificate, your data may be encrypted, however, the party you are communicating with may not be whom you think. Without certificates, impersonation attacks would be much more common.

Step 1: Generate a Private Key

The openssl toolkit is used to generate an RSA Private Key and CSR (Certificate Signing Request). It can also be used to generate self-signed certificates which can be used for testing purposes or internal usage.

The first step is to create your RSA Private Key. This key is a 1024 bit RSA key which is encrypted using Triple-DES and stored in a PEM format so that it is readable as ASCII text.

openssl genrsa -des3 -out server.key 1024

Generating RSA private key, 1024 bit long modulus
…………………………………………………++++++
……..++++++
e is 65537 (0x10001)
Enter PEM pass phrase:
Verifying password – Enter PEM pass phrase:

Step 2: Generate a CSR (Certificate Signing Request)

Once the private key is generated a Certificate Signing Request can be generated. The CSR is then used in one of two ways. Ideally, the CSR will be sent to a Certificate Authority, such as Thawte or Verisign who will verify the identity of the requestor and issue a signed certificate. The second option is to self-sign the CSR, which will be demonstrated in the next section.

During the generation of the CSR, you will be prompted for several pieces of information. These are the X.509 attributes of the certificate. One of the prompts will be for “Common Name (e.g., YOUR name)”. It is important that this field be filled in with the fully qualified domain name of the server to be protected by SSL. If the website to be protected will be https://public.akadia.com, then enter public.akadia.com at this prompt. The command to generate the CSR is as follows:

openssl req -new -key server.key -out server.csr

Country Name (2 letter code) [GB]:CH
State or Province Name (full name) [Berkshire]:Bern
Locality Name (eg, city) [Newbury]:Oberdiessbach
Organization Name (eg, company) [My Company Ltd]:Akadia AG
Organizational Unit Name (eg, section) []:Information Technology
Common Name (eg, your name or your server’s hostname) []:public.akadia.com
Email Address []:martin.zahn@akadia.com
Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

Step 3: Remove Passphrase from Key

One unfortunate side-effect of the pass-phrased private key is that Apache will ask for the pass-phrase each time the web server is started. Obviously this is not necessarily convenient as someone will not always be around to type in the pass-phrase, such as after a reboot or crash. mod_ssl includes the ability to use an external program in place of the built-in pass-phrase dialog, however, this is not necessarily the most secure option either. It is possible to remove the Triple-DES encryption from the key, thereby no longer needing to type in a pass-phrase. If the private key is no longer encrypted, it is critical that this file only be readable by the root user! If your system is ever compromised and a third party obtains your unencrypted private key, the corresponding certificate will need to be revoked. With that being said, use the following command to remove the pass-phrase from the key:

cp server.key server.key.org
openssl rsa -in server.key.org -out server.key

The newly created server.key file has no more passphrase in it.

-rw-r–r– 1 root root 745 Jun 29 12:19 server.csr
-rw-r–r– 1 root root 891 Jun 29 13:22 server.key
-rw-r–r– 1 root root 963 Jun 29 13:22 server.key.org

Step 4: Generating a Self-Signed Certificate

At this point you will need to generate a self-signed certificate because you either don’t plan on having your certificate signed by a CA, or you wish to test your new SSL implementation while the CA is signing your certificate. This temporary certificate will generate an error in the client browser to the effect that the signing certificate authority is unknown and not trusted.

To generate a temporary certificate which is good for 365 days, issue the following command:

openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
Signature ok
subject=/C=CH/ST=Bern/L=Oberdiessbach/O=Akadia AG/OU=Information
Technology/CN=public.akadia.com/Email=martin.zahn@akadia.com
Getting Private key

Step 5: Installing the Private Key and Certificate

When Apache with mod_ssl is installed, it creates several directories in the Apache config directory. The location of this directory will differ depending on how Apache was compiled.

cp server.crt /usr/local/apache/conf/ssl.crt
cp server.key /usr/local/apache/conf/ssl.key

Step 6: Configuring SSL Enabled Virtual Hosts

SSLEngine on
SSLCertificateFile /usr/local/apache/conf/ssl.crt/server.crt
SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/server.key
SetEnvIf User-Agent “.*MSIE.*” nokeepalive ssl-unclean-shutdown
CustomLog logs/ssl_request_log \
“%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \”%r\” %b”

Step 7: Restart Apache and Test

/etc/init.d/httpd stop
/etc/init.d/httpd stop

https://public.akadia.com

No Comments