Saturday, October 17, 2009

Manage port/firewall


  1. http://msdn.microsoft.com/en-us/library/cc646023.aspx

  2. netstat –n –a

  3. PortQry tool

  4. WF.msc (firewall rule)

  5. netsh firewall set portopening protocol = TCP port = 1433 name = SQLPort mode = ENABLE scope = SUBNET profile = CURRENT

  6. firewall.cpl

Tools


  1. Performent analysis

  2. DTCPing Tool to troubleshoot DTC firewall problem.

  3. Windows XP small tools

  4. Anti-virus Portable ClamWin

  5. Portable Free Download Manager

  6. Video converter - Format Factory Portable

  7. FFmpeg - record, convert and stream audio and video

  8. VLC Media Player – A Multi-platform Multimedia Player

  9. PhotoFiltre – A Complete Image Retouching Program

  10. CDBurnerXP - Disc burning app for your USB flash drive

  11. InfraRecorder Portable to burn DVD

WCF SAP Adapter Error: Incorrect Action

An error occurred during calling an RFC / TRfc / BAPI to SAP

Incorrect Action http://Microsoft.LobServices.Sap/2007/03/blablabla . Correct the specified Action, or refer to the documentation on the allowed formats for the Actions.
This problem occur for only two reason:

The WCF SAP Adapter using WCF Custom adapter, the important thing is the SOAP Action Header under General Tab in Configuration.

this is a sample of SOAP Header:

<BtsActionMapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Operation Name="Z_BAPI_PIP3B2_INBOUND" Action="http://Microsoft.LobServices.Sap/2007/03/Rfc/Z_BAPI_PIP3B2_INBOUND" />
</BtsActionMapping>

Name parameter correspond to the Operation of the logical orchestration port and Action usually correspond to MessageType without #.
This is default using from adapter wizard.
To be sure to do all correctly you can do that:

Import schema from SAP, after you'll find a Bindinginfo file to create a physical port on BizTalk from admin console.
Open this file and use the value of action paramenter to rename the operation of orchestration logical port.
Deploy all, create physical port with binding file and configure your orchestration.

You could use a your custom action, to do that write WCF.Action context property:

myMessage(WCF.Action)="http://myAction/asd.asd.asd"
This is a grate thing to use multiple operation on a single port

BizTalk troubleshooting


  1. Open IE and navigate to the BAM Portal for example like this: http://localhost/bam/BamManagementService/BamManagementService.asmx
    If it works, your web service is working.

  2. Click: GetViewSummaryForCurrentUser

  3. Press the Invoke button, displayed in the upper left corner

    1. If it works, your web service is able to talk to the database

    2. If it does not work, check the web.config file under for example
      C:\Program Files (x86)\Microsoft BizTalk Server 2006\BAMPortal\BAMManagementService
Now look for the following entry:

<appSettings>
<add key="BamServer" value="SKLAB5026" />
<add key="BamDatabase" value="BAMPrimaryImport" />
</appSettings>


Make sure the correct database server and name is entered. Also check the web.config file of the BAMQueryService as well.

Chrome - I’m feeling lucky

Sometime, I used Chrome just for looking up new words, like a dictionary. I want the first result will be displayed when I submit "define:[something]" on Chrome smart address bar. But the browser always shows a list of many items and I have to click the item on result list again. I wish there is a way that I can view the first result after hitting Enter. Then, I discovered that there is one way to do that... "I'm feeling lucky"

If you want to set "I'm feeling lucky" as a default search on Chrome, follow below steps.


  1. Click the Wrench icon, select Options

  2. On the Basics tab at Default Search, click Manage

  3. Click Add

  4. On Name: let's label it as "I'm Feeling Lucky"

  5. On URL: right-click on the link below and select Copy Link Address and paste it.

  6. where, btnl=745 acts as I'm Feeling Lucky in Google's search engine

  7. Click OK to confirm

  8. Select your "I'm Feeling Lucky" and Make Default

  9. Close

SharePoint - How to edit a document template

SharePoint - Delete Library List



  1. Click to go to the item to be deleted

  2. Select Form Library Settings in Settings menu

  3. Click “Delete this form library”







Wednesday, October 14, 2009

My top ten computer favourites - Oct 2009


  1. Picasa

  2. Window Commander

  3. Linux

  4. Chrome/Firefox

  5. Visual Studio/Eclipse

  6. blogger

  7. gmail

  8. VNC

  9. ZoomIt

  10. ThunderBird

My favourite web sites


  1. NirSoft - freeware utilities: password recovery, system utilities, desktop utilities

  2. Sysinternal - Advance utilities for windows

  3. Apache

  4. Open source projects

  5. Java blog

  6. Photo collections



  7. http://lifehacker.biz/

  8. Bittorrent sites


  9. Vietnamese Unicode link

How to turn off firewall in Windows 7


  1. Download and install process hacker (which can be found in here)

  2. Open Process Hacker --> Service tab

  3. Kill all processes which have description contains firewall

Process hacker - a tool to replace TaskManager


Please download it here

ZoomIt - simple utility for zooming and drawing on the screen

It can be downloaded from here
How to use
- It's looked like this when you first open

- Shortcut keys
+ Ctrl + 1: Toggle zoom mode
+ Ctrl + 2: Toggle draw mode (not zoom)
+ Ctrl + 3: Toggle break mode
+ Ctrl + 4: Toggle livezoom mode
+ ESC: escape current mode
+ Right mouse: escape current mode
+ Wheel: zoom in and out
+ Up: Zoom out
+ Down: Zoom in
+ Ctrl + Up: Zoom out
+ Ctrl + Down: Zoom in
+ Left mouse: enter drawing mode (when zooming)
+ Ctrl + Z: Undo
+ e: undo all
+ SpaceSpace: Center screen
+ Left Ctrl + Mouse wheel/UpDown: Change pen width
+ Change color: r(red), b(blue), o(orange), y(yellow), p(pink)
+ Shift: straight line
+ Ctrl: rectangle
+ Tab: ellipse
+ Shift + Ctrl: Arrow
+ Clear screen: w(while), k(black)
+ Ctrl+C: Copy screen
+ Ctrl+S: Save
+ t: typoing mode
+ Mouse wheel/ updown: change font size

Tuesday, October 13, 2009

Install BizTalk MQSC Adapter on 64-bit Windows


  • The MQSC Adapter only supports 32-bit versions of Microsoft Windows that are supported by BizTalk Server 2006. WebSphere MQ on Windows is not supported on 64-bit versions of Windows. Therefore, the MQSC Adapter is not supported on a 64-bit version of Windows or on a 32-bit BizTalk host instance that is running in a 64-bit version of Windows.

  • An update is available that enables you to install the client-based BizTalk Adapter for WebSphere MQ on 64-bit versions of Windows: http://support.microsoft.com/kb/939202

  • To obtain this feature immediately, you need to contact Microsoft Customer Support Services to get the file.

  • I've updated the update to internet. If you want to try, can get it from here

Useful sysinternal tools.

The Sysinternals is a set of advanced system utilities and technical tools. Whether you’re an IT Pro or a developer, you’ll find Sysinternals utilities to help you manage, troubleshoot and diagnose your Windows systems and applications.

Can be downloaded from here
File and Disk Utilities


  1. Disk2vhd: simplifies the migration of physical systems into virtual machines (p2v).

  2. Diskmon: captures all hard disk activity or acts like a software disk activity light in your system tray.

  3. ntfsinfo: Use NTFSInfo to see detailed information about NTFS volumes, including the size and location of the Master File Table (MFT) and MFT-zone, as well as the sizes of the NTFS meta-data files.

  4. Pendmove: See what files are scheduled for delete or rename the next time the system boots.

  5. Process Monitor: Monitor file system, Registry, process, thread and DLL activity in real-time.

  6. psfile: See what files are opened remotely.

  7. pstool: The PsTools suite includes command-line utilities for listing the processes running on local or remote computers, running processes remotely, rebooting computers, dumping event logs, and more.

  8. PsExec - execute processes remotely

  9. PsFile - shows files opened remotely

  10. PsGetSid - display the SID of a computer or a user

  11. PsInfo - list information about a system

  12. PsKill - kill processes by name or process ID

  13. PsList - list detailed information about processes

  14. PsLoggedOn - see who's logged on locally and via resource sharing (full source is included)

  15. PsLogList - dump event log records

  16. PsPasswd - changes account passwords

  17. PsService - view and control services

  18. PsShutdown - shuts down and optionally reboots a computer

  19. PsSuspend - suspends processes

  20. SDelete: Securely overwrite your sensitive files and cleanse your free space of previously deleted files using this DoD-compliant secure delete program.

  21. sigcheck: Dump file version information and verify that images on your system are digitally signed.

  22. Sync: Flush cached data to disk. This tool can be used before removing your thump drive


Networking Utilities


  1. TCPView Active socket command-line viewer.

  2. Whois See who owns an Internet address.


Process Utilities


  1. Autoruns: See what programs are configured to startup automatically when your system boots and you login.

  2. Handle: This handy command-line utility will show you what files are open by which processes, and much more. Use Process Expolorer for the UI version.

  3. ListDll: List all the DLLs that are currently loaded, including where they are loaded and their version numbers. Version 2.0 prints the full path names of loaded modules.

  4. Process Explorer: Find out what files, registry keys and other objects processes have open, which DLLs they have loaded, and more. This uniquely powerful utility will even show you who owns each process.

  5. Process Monitor: Monitor file system, Registry, process, thread and DLL activity in real-time.

  6. ShellRunas: Launch programs as a different user via a convenient shell context-menu entry

  7. VMMap: See a breakdown of a process's committed virtual memory types as well as the amount of physical memory (working set) assigned by the operating system to those types. Identify the sources of process memory usage and the memory cost of application features.

Monday, October 12, 2009

Format SQL statement


1. Open Aqua Data Studio which is can be downloaded here.
2. Open Query Analyzer (Ctrl + Q)
3. Paste the query which is needed to format
4. Go to Menu --> Automate --> Format Script (Ctrl + Shift + B)


Monday, October 5, 2009

Eclipse shortcut keys


  • How to view/modify shortcuts in eclipse (version 3.4.2): Windows --> Preferences --> General --> Keys

  • Delete a line: Ctrl + D

  • Active editor: F12

  • Find and replace: Ctrl + F

  • Incremental find: Ctrl + J

  • Duplicate lines: Ctrl + Alt + Down

Wednesday, September 30, 2009

Connect Oracle using ODBC

1. Go to control panel and Create a ODBC provider




2. Create a C# console project and insert the code below

Tuesday, September 29, 2009

Oracle installation














Tuesday, July 28, 2009

Key blogger

1. http://www.codeproject.com/KB/DLL/Keyboardhook
2. http://www.codeguru.com/code/legacy/system/KBHookDemo.zip
(source: http://www.codeguru.com/code/legacy/system/KBHookSrc.zip)

Saturday, July 25, 2009

Disable Additional plugins are required in Firefox

Disabling popups from plugins should be enough to also get rid of the dialog. Enter about:config in the location bar, add (right-click and select New) the Integer setting privacy.popups.disable_from_plugins, then set the value to 2. Possible values for this setting are:
privacy.popups.disable_from_plugins
0 Allow popups from plugins
1 Limit popups to dom.popup_maximum
2 Block popups from plugins
3 Block popups from all plugins (even on whitelisted sites)

Tuesday, July 21, 2009

Serialize object to a string instead of stream


StringBuilder sb = new StringBuilder();
XmlSerializer s = new XmlSerializer(typeof(TradeInfoArray));
StringWriter stringWriter = new StringWriter();
s.Serialize(stringWriter, arrTrade);
result = stringWriter.ToString();

log on locally permission

You can configure this security setting by opening the appropriate policy and expanding the console tree as such: Computer Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment\

Log on as a service account

  1. Click Start, point to Run, type mmc, and then click OK.

  2. On the File menu, click Add/Remove Snap-in.

  3. In Add/Remove Snap-in, click Add, and then, in Add Standalone Snap-in, double-click Group Policy Object Editor.

  4. In Select Group Policy Object, click Browse, browse to the Group Policy object (GPO) that you want to modify, click OK, and then click Finish.

  5. Click Close, and then click OK.

  6. In the console tree, click User Rights Assignment.

    Where?

    • GroupPolicyObject [ComputerName] Policy
    • Computer Configuration
    • Windows Settings
    • Security Settings
    • Local Policies
    • User Rights Assignment
  7. In the details pane, double-click Log on as a service.

  8. If the security setting has not yet been defined, select the Define these policy settings check box.

  9. Click Add User or Group, and then add the appropriate account to the list of accounts that possess the Log on as a service right.

Mail server on windows server 2008

1. Tool name: ArGoSoft Mail Server
2 Config
Firstly, stop all services using port 25 and 110
a. DNS (detect)
b. domain (add)
c. Port (change two default ports)

Option in Expresso



Sunday, July 19, 2009

Create a new thread


Thread trd;
private void btnRun_Click(object sender, EventArgs e)
{
trd = new Thread(new ThreadStart(this.ThreadTask));
trd.IsBackground = true;
trd.Start();
}

[STAThread]
private void ThreadTask()
{
//Do something here
}

private void btnStop_Click(object sender, EventArgs e)
{
if (trd != null)
{
trd.Abort();
trd = null;
}
}
private void btmExit_Click(object sender, EventArgs e)
{
Application.Exit();
}

copy and paste data to and from Clipboard

Push: System.Windows.Forms.Clipboard.SetDataObject("hello", true);
Get: System.Windows.Forms.Clipboard.GetText();

Wednesday, July 15, 2009

Mouse class


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows.Forms;
namespace FFSAutoTrade
{
class Mouse
{
#region System constants
const uint MOUSEEVENTF_MOVE = 0x0001; /* mouse move */
const uint MOUSEEVENTF_LEFTDOWN = 0x0002; /* left button down */
const uint MOUSEEVENTF_LEFTUP = 0x0004; /* left button up */
const uint MOUSEEVENTF_RIGHTDOWN = 0x0008; /* right button down */
const uint MOUSEEVENTF_RIGHTUP = 0x0010; /* right button up */
const uint MOUSEEVENTF_MIDDLEDOWN = 0x0020; /* middle button down */
const uint MOUSEEVENTF_MIDDLEUP = 0x0040; /* middle button up */
const uint MOUSEEVENTF_XDOWN = 0x0080; /* x button down */
const uint MOUSEEVENTF_XUP = 0x0100; /* x button down */
const uint MOUSEEVENTF_WHEEL = 0x0800; /* wheel button rolled */
const uint MOUSEEVENTF_ABSOLUTE = 0x8000; /* absolute move */
const int SM_CXSCREEN = 0;
const int SM_CYSCREEN = 1;
#endregion
#region Base routines
[DllImport("user32.dll", EntryPoint = "mouse_event")]
static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint dwData, uint dwExtraInfo);
[DllImport("user32.dll", EntryPoint = "GetSystemMetrics")]
static extern int GetSystemMetrics(int index);
private static void DoEvent(uint eventType, int globalX, int globalY)
{
globalX = globalX > 0 ? globalX : 0;
globalY = globalY > 0 ? globalY : 0;
uint x = Convert.ToUInt32((float)globalX * 65536 / GetSystemMetrics(SM_CXSCREEN));
uint y = Convert.ToUInt32((float)globalY * 65536 / GetSystemMetrics(SM_CYSCREEN));
mouse_event(MOUSEEVENTF_ABSOLUTE | eventType, x, y, 0, 0);
Thread.Sleep(Delay);
Application.DoEvents();
}
#endregion
public static int Delay = 0;
/// <summary>
/// Press down left mouse button
/// </summary>
/// <param name="globalX">Global X coordinate</param>
/// <param name="globalY">Global Y coordinate</param>
public static void LeftDown(int globalX, int globalY)
{
DoEvent(MOUSEEVENTF_MOVE, globalX, globalY);
DoEvent(MOUSEEVENTF_LEFTDOWN, globalX, globalY);
}
/// <summary>
/// Release left mouse button
/// </summary>
/// <param name="globalX">Global X coordinate</param>
/// <param name="globalY">Global Y coordinate</param>
public static void LeftUp(int globalX, int globalY)
{
DoEvent(MOUSEEVENTF_MOVE, globalX, globalY);
DoEvent(MOUSEEVENTF_LEFTUP, globalX, globalY);
}
/// <summary>
/// Press down right mouse button
/// </summary>
/// <param name="globalX">Global X coordinate</param>
/// <param name="globalY">Global Y coordinate</param>
public static void RightDown(int globalX, int globalY)
{
DoEvent(MOUSEEVENTF_MOVE, globalX, globalY);
DoEvent(MOUSEEVENTF_RIGHTDOWN, globalX, globalY);
}
/// <summary>
/// Release right mouse button
/// </summary>
/// <param name="globalX">Global X coordinate</param>
/// <param name="globalY">Global Y coordinate</param>
public static void RightUp(int globalX, int globalY)
{
DoEvent(MOUSEEVENTF_MOVE, globalX, globalY);
DoEvent(MOUSEEVENTF_RIGHTUP, globalX, globalY);
}
/// <summary>
/// Move Mouse with emulated speed
/// </summary>
/// <param name="globalX">Global X coordinate</param>
/// <param name="globalY">Global Y coordinate</param>
/// <param name="speed">Speed in pixels per move</param>
public static void MoveTo(int globalX, int globalY, int speed)
{
int temp = Delay;
Delay = 50;
if (speed != 0)
{
int cursorX = Cursor.Position.X;
int cursorY = Cursor.Position.Y;
int dX = globalX - cursorX;
int dY = globalY - cursorY;
int steps = Math.Max(Math.Abs(dX / speed), Math.Abs(dY / speed));
if (steps != 0)
{
int stepX = dX / steps;
int stepY = dY / steps;
for (int i = 0; i < steps; i++)
{
cursorX += stepX;
cursorY += stepY;
DoEvent(MOUSEEVENTF_MOVE, cursorX, cursorY);
}
}
}
DoEvent(MOUSEEVENTF_MOVE, globalX, globalY);
Delay = temp;
}
/// <summary>
/// Move mouse
/// </summary>
/// <param name="globalX">Global X coordinate</param>
/// <param name="globalY">Global Y coordinate</param>
public static void MoveTo(int globalX, int globalY)
{
MoveTo(globalX, globalY, 0);
}
public static void DragAndDrop(int startX, int startY, int finishX, int finishY)
{
LeftDown(startX, startY);
MoveTo(finishX, finishY, 10);
LeftUp(finishX, finishY);
}
public static void MoveToAndClick(int globalX, int globalY, int delay)
{
Delay = delay;
MoveTo(globalX, globalY, 10);
Mouse.LeftDown(globalX, globalY);
Mouse.LeftUp(globalX, globalY);
}
public static void ClickAround(int x, int y, int delx, int dely, int step, int DelayTime)
{
int newx, newy;
for (int i = 0; i < delx; i++)
for (int j = 0; j < dely; j++)
{
newx = x + delx * i;
newy = y + dely * j;
Mouse.MoveTo(newx, newy, 10);
if (i + j == 0)
Mouse.Delay = DelayTime;
Mouse.LeftDown(newx, newy);
Mouse.LeftUp(newx, newy);
}
}
}
}

View mouse position on screen

1. Tool: Visual Studio, Spy++
2. Menu --> Messages --> Logging Option:
3. Windows: All Windows In System
4. Messages: WM_NCHITTEST
5. Output: 100 line
Start

Sharepoint Receive Port

Tuesday, July 14, 2009

Open infopath by browser in Sharepoint


  1. Open Sharepoint Administration

  2. Open http:///_admin/ManageFormsServiceProxy.aspx

  3. Check both checkboxes

  4. Try to public again.

Monday, July 13, 2009

Modidify the condition for how the workflow be started

1. Open the *.??proj.user file
2. Modify value of following elements:
<ManualStart>true</ManualStart>
<StartOnCreate>false</StartOnCreate>
<StartOnChange>false</StartOnChange>

Sunday, July 12, 2009

Get field name from schemas

1. Remove unnessesary lines
Find: ^(~(name\=)~(\).)+\n
Rep:
2 Remove unnessessary words
Find: ^(~(name).)+name\=\"{[^"]+}\".+\n.+documentation\>{[^<]+}\<.+
Rep: \1#\2
3. Manually check and clean-up

Thursday, July 9, 2009

Want to insert html code into blogger

1. Go here: http://www.reconn.us/component/option,com_wrapper/Itemid,62/
2. Uncheck 2 check-boxes and paste your html code in
3. Copy result and paste into blogger windows (tab Edit Html).
4. Click review to see the result.

Can't open .svc file

1. Open: C:\Windows\System32\inetsrv\config\applicationHost.config
2. Find "location path" which appropriate path value and insert below handlers section as below


<location path="Default Web Site/PersonnelBiz">
<system.webServer>
<handlers accessPolicy="Execute, Script">
<add name="svc-Integrated" path="*.svc" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="integratedMode" />
<add name="svc-ISAPI-2.0" path="*.svc" verb="*" modules="IsapiModule" scriptProcessor="%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
</handlers>