Technology

HOW TO : View Chat logs in Adium

Adium is a multi protocol instant messaging application for the Mac OS X. I have been using it on my MacBook for a while now and think it is a fantastic example of how powerful open source can be. I was trying to figure out how to look at the chat logs on Adium. Some Googling helped me figure it out.. :). To view the chat logs on Adium, you can type “Apple Button + l” or click on “Contact -> View Chat Transcripts” in the menu.

Blackberry : Administrator tip

If you ever wanted to find out how to confirm that a message you have sent to a blackberry device has been delivered, you can send a message to the blackberry with just < confirm> in the subject. You will get a confirmation e-mail as soon as the message has been delivered to the blackberry device. We usually use it to check latency and other issues on our blackberry server.

HOW TO : Cognos Installation

I tried setting up Cognos (Business Intelligence tool mainly used for reporting) on a test machine for Lakshmi to play around with. After going through the install, I can say with confidence that Cognos has some of the worst documentation :). Here are some quick tips that you won’t find in the official documentation for someone trying to configure Cognos BI 8.x on a Win2k3 server running MS SQL 2005 and IIS 6.0.

  1. After installing Cognos, run the “Cognos Configuration” tool and change the “Gateway URI” setting to “http://servername:portnumber/cognos8/cgi-bin/cognosisapi.dll” in the environment section.
  2. Edit the default.htm and index.htm file in the “< cognos install directory >\cognos\c8\webcontent” directory and replace cognos.cgi with cognosisapi.dll
  3. Open ISS manager and go to Web Service Extension. Add a new web service extension called isapi and add cognosisapi.dll as a required file. Make sure to set the extension status to Allowed.

This should enable you to launch cognos and log into the web interface.

HOW TO : Linksys SRX200 + Emule

Quick guide to configure your Linksys SRX200 router/switch to support emule.

  1. Assign a static IP address in the range assigned to you by the wireless router. In this case, Linksys assigns the 192.168.1.0/24 range. I will use 192.168.1.50 as an example.
  2. Open a browser window and go to http://192.168.1.1
  3. Log in with your admin credentials (it is admin/admin by default).
  4. Click on the “Application and Gaming” tab.
  5. Make sure that you are on the “Port Range Forward” page.
  6. Enter the following information
  7.    Application : Emule
       Start : 4660
       End : 4712
       Type : Both
       IP Address : 50
       Enable : Checked

  8. Click on “Save Settings”
  9. Launch Emule and you should be in business 🙂

Exchange 2003 : Logging

If you are trying to troubleshoot an issue with Microsoft Exchange 2003 and need more verbose logging, you can get additional logging by

1) Launch Exchange System Manager
2) Drill down to the server in the Administrative Groups
3) Right click on server and click on properties
4) Open the “Diagnostic Logging” tab and enable logging on any of the exchange modules

You can check the logs from the event viewer.

Programming : C#

I have been itching to program in C# for a long time now.. finally got a chance to try it out due to requirement at work. Here’s a small snippet of code that does a bunch of things
1) Opens a directory and get a list of files in it
2) Parses the file name into multiple variables
3) Connects to Active Directory and gets properties for a user
4) Creates an error file with list of errors.
5) Creat an output file in csv format.

For the programming gurus out there, this should be pretty easy :).. I am sure that there are tons of errors in the way, I wrote the code, but this is a beginning :).


using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.DirectoryServices;

namespace sortAssetData
{
class Program
{
static void Main(string[] args)
{
// Create a Log file and output file

System.IO.TextWriter infoLog = new System.IO.StreamWriter(“sortAssetDataLog.txt”);
System.IO.TextWriter outputLog = new System.IO.StreamWriter(“finalAssetData.csv”);

// Write the column headers into the output file
outputLog.WriteLine(“Last_Name, First_Name, Display_Name, Batt_Check_Version, Model_Type, Model_Number, Serial_Number, Batt_Manufacturer, Batt_Model, Batt_Serial_Number, Affected”);

// Define the folder where the data files are sitting
string fixDirectoy = “P:\\BatteryCheck_Results”;

// Change working directory to the folder with all the files
System.IO.Directory.SetCurrentDirectory(fixDirectoy);

// Create a directory object to get list of asset files
System.IO.DirectoryInfo tempDirObject = new System.IO.DirectoryInfo(fixDirectoy);

// Get list of *.csv files in the asset folder
System.IO.FileInfo[] listOfFiles = tempDirObject.GetFiles(“*.csv”);

// Process each file in the directory
foreach (System.IO.FileInfo tempFile in listOfFiles)
{
// Display the current file that is being processed
System.Console.WriteLine(“Processing : {0}”, tempFile.Name);
infoLog.WriteLine(“Processing : {0}”, tempFile.Name);
infoLog.Flush();

// Split the file name into Domain, Hostname, Username
string tempData = tempFile.Name;
// Removing the .csv at the end of the file name
tempData = tempData.Replace(“.csv”, “”);
string[] sortData = tempData.Split(new Char[] { ‘_’ });

// If file name doesn’t contain 3 records (Domain, ComputerName and UserName), we ignore it
if (sortData.Length != 3)
{
infoLog.WriteLine(“ERROR : Bad file format : {0}”, tempFile.Name);
infoLog.Flush();
continue;
}

// Display the userdata we got from the file name
System.Console.WriteLine(“\nDomain :\t {0}”, sortData[0]);
System.Console.WriteLine(“Computer Name :\t {0}”, sortData[1]);
System.Console.WriteLine(“User Name :\t {0}\n”, sortData[2]);

// Get the users full name from ActiveDirectory
System.DirectoryServices.DirectorySearcher searchUser = new System.DirectoryServices.DirectorySearcher();
searchUser.Filter = String.Format(“(SAMAccountName={0})”, sortData[2]);
searchUser.PropertiesToLoad.Add(“cn”);
searchUser.PropertiesToLoad.Add(“givenname”);
searchUser.PropertiesToLoad.Add(“sn”);
System.DirectoryServices.SearchResult resultFromAD = searchUser.FindOne();

// If the username doesn’t have a AD account, note and skip to the next file
if (resultFromAD == null)
{
System.Console.WriteLine(“ERROR : Bad User name : {0}”, sortData[2]);
infoLog.WriteLine(“ERROR : Bad User name : {0}”, sortData[2]);
infoLog.Flush();
continue;
}
else
{
//Parse the file and write data to the log file and also to the screen
System.IO.StreamReader tempSoureFile = new System.IO.StreamReader(tempFile.Name);
// Read the first line in the file and ignore it
string tempAssetData = tempSoureFile.ReadLine();
// Read the second line and store it to write to outputfile
tempAssetData = tempSoureFile.ReadLine();

string tempUserFirstName = resultFromAD.Properties[“sn”][0].ToString();
string tempUserLastName = resultFromAD.Properties[“givenname”][0].ToString();
string tempUserDisplayName = resultFromAD.Properties[“cn”][0].ToString();
outputLog.WriteLine(“{0},{1},{2},{3}”, tempUserFirstName, tempUserLastName, tempUserDisplayName, tempAssetData);
outputLog.Flush();
System.Console.WriteLine(“User First Name:\t {0}”, tempUserFirstName);
System.Console.WriteLine(“User Last Name:\t\t {0}”, tempUserLastName);
System.Console.WriteLine(“Display Name:\t\t {0}”, tempUserDisplayName);
}
}
System.Console.ReadKey();
infoLog.Close();
outputLog.Close();
}
}
}


Microsoft Excel : How to repair "Opening blank file when double clicking on an excel file"

Ran into an interesting problem with troubleshooting an Excel issue. Double clicking on an excel file opened a blank file on the affected machine. I thought it might be something related to the associations and checked them from “Tools -> Folder Options -> File Types” in the Windows Explorer menu. Everything was in order there. I then tried a reinstall of Office (note : would not do this in the future without additional troubleshooting 🙂 ). That didn’t help either. Finally, I gave up and did a Google search, which returned this URL

http://groups.google.com/group/microsoft.public.office.misc/browse_thread/thread/aa3da7b29cd55a93/3347ca4c2ea6673a%233347ca4c2ea6673a

Did the following according to the post and everything returned to default settings

1) Run Excel with “/safe” option.
2) Click on “help -> Detect and Repair” from the Excel menu
3) Close Excel for repair

Thx Google.