Thursday, May 26, 2011

Linux - nm Command

When you want to list the symbol in a shared object (.so) file, you can use nm command to list them.

Some examples are

1. List all symbol


2. List symbol that are external and de-mangled.

nm -gC

3. List all undefined symbol

nm -u

Monday, May 23, 2011

iTunes - Move And Organize File From iPod

This topic may be old but rather useful when your music file at iPod is your only copy. By default, iPod scramble your music files into random name. Although the file names are randomized, the ID3Tag are retained.

Follow these steps to move your iPod music files to local disk in organized folder for Windows 7

1. At your file explorer, click on Organized -> Folder and search option

2. Go to view tab and enable view for hidden files

3. Plug in your iPod and you should see a iPod drive at your file explorer

4. Navigate at your iPod drive, go to iPod_Control\Music folder. This is where all music files are stored in scrambled manner

5. Copy this folder to a place in local harddisk

6. Open iTunes. Make sure your music library is empty

7. At iTunes, go to Edit -> Preference. Go to Advance tab and check "Keep iTunes Media folder organized" check box. Then, click Ok.

8. Then, go to File -> Add Folder To Library. Select the folder where you have copied your iPod music files. If library added successfully, your music files will be loaded at iTunes Music Library

9. After iTunes had loaded your library, select the files which you want to unscramble. Then, right click -> Consolidate Files.

10. After consolidation, your music files will be unscrambled/consolidated at the default iTunes Music folder. Normally, it will be located at C:\Users\[YOUR_USER_NAME]\Music\iTunes\iTunes Media\

Thursday, May 12, 2011

Visual Studio 2010 - How to create a new target platform

VS2010 allows you to create different target platform for different CPU build.

1. Open your_solution.sln

2. Click on Configure Manager

3. At Active solution platform, select New…

4. Select your desire platform and click ok

5. Now, you can change your target platform at Configuration Manager

Visual Studio 2010 - Setting different set of reference libraries for different target platforms

If you are playing with x86 and x64 with Visual Studio 2010, you may soon realize that it does not provide a way for developers to add specific reference libraries for specific target platform.

If you add at VS2010 IDE, you will end up adding all x86 and x64 references to the single Reference tree. Even if you switch to your desire target platform before adding the reference, it will not work.

VS2010 treats all references are required for every target platforms, however, x86 and x64 requires different set of dll for respective build.

Here is a step by step guild for provide different set of reference library for different target platform.

1. Put your library/reference (mainly dll) to your/path/to/lib/x86 or your/path/to//lib/x64 for x86 and x64 library/reference respectively

2. Open your_master.sln

3. At solution explorer, look for your_proj-> reference

4. For consistency, make sure you had switch your project target platform to Debug | x86

5. Add your desired reference. We added C1.Common.dll in this example. After adding, you should see the following

6. Close your solution and save it if required

7. Open your_proj.csproj in a XML or Text editor. You may want to create a backup (ie, your_proj.csproj.bak) before opening it for modification

8. You will see something like the following

9. Make sure you have the following in the your_proj.csproj xml file. They are your platform target in the your_proj.csproj. If they does not exist, please create them at Visual Studio 2010 (See how to create addition target platform)

10. Next, make sure each of the above Property Group have the following tag. They are the Reference Path for each target platform. Please add if it does not exist
a. your\path\to\target\platform\library

11. Next, make sure you have the followings elements. They are the place holder for your reference libraries for each target platform

12. Now, you are ready to add a new reference library

13. Look for the following in the xml. This is the default ItemGroup for all target platform

14. As you can see, C1.Common is within a Reference tag. This is the reference library you have added. Now, copy the whole Reference tag and paste to all ItemGroup stated in point 11. Below is an example

15. Note the following when you perform point 14

a. The essential tag for Reference are

i. Include – This allow you to define a common name for the library. As you can see, I declare C1.Common for all target platforms.

ii. HintPath – The allow you to set absolute or relative path to the dll. As you can see, I use $(ReferencesPath) as a common variable to locate the dll. Setting ReferencesPath is shown in point 10.

16. Save the your_proj.csproj file

17. To verify your setting. Open the your_master.sln, at Solution Explorer -> Reference and double click on the newly added library. The object browser will open up

18. By switching to different target platform, the object browser will update respectively.

19. Note the following

a. If you want to remove a library, remove it at the xml. If you remove the library at Visual Studio Solution Explorer, it will change the xml and remove your Debug|x86 ItemGroup

b. Give a common Include name at point 14 will cause the Reference at Solution Explorer to display a single reference. Otherwise, it will display all references (one for each target platform). Also, depend on your reference path for the selected target platform, it may show some of them as missing reference.

c. If you are familiarized with the csproj xml, you should add the reference directly at the xml.

Monday, May 9, 2011

VPN - Error 741 The local computer does not support the required encryption type

If you see this error

Error 741 - The local computer does not support the required encryption type

Do the following

1. Go to Control Panel\Network and Internet\Network Connection

2. Locate your VPN adaptor and right click properties. Go to security tab

Then, you can try the following fixes

The error may due to

1. Encryption not strong enough

At Data encryption, changes to Maximum strength encryption

2. Wrong type of VPN

At Type of VPN, do not use Automatic. Change to a specific VPN type, for example, Point to Point Tunneling Protocol

3. Wrong Authentication

At Authentication, use the specific authentication method supply by your VPN administrator

4. VPN server is not using encryption at all

This is an irony but it does happens. To fix it:

1. At Data encryption, change to either No encryption allowed or Optional encryption

2. At Authentication, Check Unencrypted Password

VPN - Windows 7 64 bits VPN

If you have been using Cisco AnyWhere Client for your Window 32 bits machine. You may have encountered problem on installing it at 64 bits Windows Machine. That is because Cisco AnyWhere Client does not work in 64 bits Windows.
Windows 7 provide a way for VPN connection. Do the following
1. Go to Control Panel\Network and Internet\Network and Sharing Center, click on Set up a new connection or network
2. Select Connect to a workplace
3. Then, select No, create a new connection
4. Then, select Use my internet connection (VPN)
5. Then, just follow the wizard and fill up the VPN information
6. The last step will ask you to connect.
You can also customize your VPN security setting
1. Go to Control Panel\Network and Internet\Network Connection.
2. Locate your VPN adaptor and right click properties. Go to security tab
3. Change your setting and save it.

Tomcat - removing server info

Below are the steps to remove Tomcat Server Information 1. Make sure Tomcat is not running 2. Navigate to "Tomcat Installation"...