28 september 2009

Checkpoint NGX Firewall

H.323 connections timeout after 60 minutes no matter if there is traffic.

In Checkpoint's Smartdefense module there is a setting that changes the timeout for H.323. This is independent of the global timeout.

23 september 2009

ZENworks agent not registering

Agent wont register during PreAgent installation.

See TID 7002122

27 april 2009

Obtain IPAddress in C# .NET 2.0

public static String getIPAddress()
{
foreach (IPAddress testIP in Dns.GetHostEntry(getComputername()).AddressList) {
return testIP.ToString();
}
}

Check for bit in byte

bool inByte(byte a, byte b) {
if ((a | b) == b) {
return true;
}
return false;
}

Read windows registry in c++

DWORD readReg(HKEY myKey, char* path, char* value) {
struct HKEY__* reghandle;
DWORD readValue;
DWORD size = 8192;
if (RegOpenKeyEx(myKey,path,0,KEY_READ,&reghandle) != ERROR_SUCCESS)
{
printf("Couldn't read key.");
}
DWORD ret;
ret = RegQueryValueEx(reghandle, value, NULL, NULL, (LPBYTE)&readValue, &size);
if (ret != ERROR_SUCCESS)
{
printf("Couldn't get value.");
}
RegCloseKey(reghandle);
return readValue;
}