28 December, 2010

Checking all properties of an outlook item

I was trying to figure out that where Outlook is storing the URL of the sharepoint sites that is is syncronizing to and during this investigation I run into the problem of retrieving all properties of a Outlook folder (I was suspecting that it is stored in a property of the folder).

[Edit:] After finishing this post I have found the following article: Get Sharepoint ULR and it has a hint on where is the information I was looking for and it references the OutlookSpy SW which is an easy to use tool for retrieving all propertis of any items in Outlook.

I quickly identified that the properties of a folder can be retrieved using the "PropertyAccessor" object, but unfortunately you can not retrieve all properties but only those you have the name for. So finally I have written a small VB program, that tests all the commonly know property sets for all string values and prints the results:
(unfortunately I did not find anything sharepoint related :-( )

Sub sharepoint()

Dim PropertySets(15) As String
PropertySets(0) = "{00020329-0000-0000-C000-000000000046}"
PropertySets(1) = "{00062008-0000-0000-C000-000000000046}"
PropertySets(2) = "{00062004-0000-0000-C000-000000000046}"
PropertySets(3) = "{00020386-0000-0000-C000-000000000046}"
PropertySets(4) = "{00062002-0000-0000-C000-000000000046}"
PropertySets(5) = "{6ED8DA90-450B-101B-98DA-00AA003F1305}"
PropertySets(6) = "{0006200A-0000-0000-C000-000000000046}"
PropertySets(7) = "{41F28F13-83F4-4114-A584-EEDB5A6B0BFF}"
PropertySets(8) = "{0006200E-0000-0000-C000-000000000046}"
PropertySets(9) = "{00062041-0000-0000-C000-000000000046}"
PropertySets(10) = "{00062003-0000-0000-C000-000000000046}"
PropertySets(11) = "{4442858E-A9E3-4E80-B900-317A210CC15B}"
PropertySets(12) = "{00020328-0000-0000-C000-000000000046}"
PropertySets(13) = "{71035549-0739-4DCB-9163-00F0580DBBDF}"
PropertySets(14) = "{00062040-0000-0000-C000-000000000046}"
Dim Fs As Folders
Dim F As folder
Dim SPF As folder
Set Fs = Application.GetNamespace("MAPI").Folders
Set Fs = Fs("Sharepoint Lists").Folders
'For Each F In Fs
' Debug.Print (F.name)
'Next F
Set SPF = Fs(1)
Dim p As Outlook.PropertyAccessor

Set p = SPF.PropertyAccessor
Dim i As Long
Dim j As Integer
Dim h8, h9 As String

For j = 0 To 14
Debug.Print PropertySets(j)
For i = 0 To 65535
Rem 001f - string 0040 - date 0005 - floating64 0003 - integer 1003 - multiple integer 000b - Boolean 0102 - Binary
h9 = "http://schemas.microsoft.com/mapi/id/" + PropertySets(j) + "/" + LCase(Right("000" + Hex(i), 4)) + "001f"
On Error Resume Next
Debug.Print ":<" + LCase(Right("000" + Hex(i), 4)) + "001f>:" + p.GetProperty(h9)
On Error GoTo 0
Next i
Next j
Debug.Print "Proptag"
For i = 0 To 65535
h9 = "http://schemas.microsoft.com/mapi/proptag/0x" + LCase(Right("000" + Hex(i), 4)) + "001f"
On Error Resume Next
Rem Debug.Print ":>:" + p.GetProperty(h8)
Debug.Print ":<" + LCase(Right("000" + Hex(i), 4)) + "001f>:" + p.GetProperty(h9)
On Error GoTo 0
Next i

Debug.Print "Done"
End Sub

26 November, 2010

Exporting messages and contact from Nokia Ovi Suite

With earlier Nokia PC suite versions it was easy to export your contacts or messages to an excel file, but this functionality was removed from recent Ovi Suite versions.

After some research I have found a way to export this information. I have tried it for the SMS messages, but did not do it for the contacts, that should work the same way.

First you have to syncronize the data you want to export with Ovi suite. When you do this Ovi suite is storing this data to MDataStore.db3 file which is stored in the Users\yourlogin\AppData\Local\Nokia\Nokia Data directory. This file is a SQLite 3 database and you can download a command line program from www.sqlite.org to handle it.

You start the program by sqlite3.exe nameOfYourDatabase and you get a sqlite> prompt.

The following commands will help you:

.tables - list the tables in the database
.schema tablename - list the fields in a database
.output filemane - to redirect results to a file in your computer
select * from MessageEX - to list your syncronized messages
select * from Contact - to list your syncronized contacts
.quit - to exit SQLite

After exporting the messages database, I have used Notepad++ with the HEX plugin to convert the 0d0a and 0d newlines in the messages to underscore _. Then I have imported it to Excel and deleted the not needed columns.

It requires some work to do, but it is faster and much more fun than typing in everything again.

Update: If you do not want to mess around with the command line sqlite handler, then you can use programs like SQLite Browser Portable which gives you a graphical representation of the database.

Update2: Since writing this article I was sucessfully exporting Contacts from one phone and importing into a Google account.

26 July, 2010

Installing Huawei E220 on Windows 7

I have an E220 Mobile Broadband modem and I had some probles getting it installed under Windows 7. After some experimenting I sucessfully managed to install it both under Windows 7 32 bit and 64 bit.

The main process is described here:


There are 2 additional tricks needed:

1) Before this procedure install MobileConnect or whichever connection manager program form the device (you have to do this before installing the latest driver, because this step replaces the drivers).

2) After this procedure I still had only the Huawei CD device recogized and no serial lines, so from the device manager I had to remove the CD device and immediately after that, the device was recognised as composite USB device and the serial devices were recognized.

Good luck.

27 April, 2010

Trying to reach the highest disk speed on home server

Last autumn, before installing my Ubuntu home server I had great plans to do network file speed benchmarks between different operating systems to select the best operating system for my home server. The plan was excellent, but after a bit more than one month of testing I realized, that if I ever want to have that server up and running I should cancel these tests and go strait to the installation. In this post I will write about the results in that month.

Original intention

The plan was simple, I had the new hardware for the server, I had installation disks for Windows Server 2008 R2, Ubuntu, OpenSuse and Solaris. On the client side I had a quad processor 2 gig memory computer with Windows 7 RC, Windows XP and OpenSuse 11.1 and had an older computer with and old Athlon processor running at 2 GHz and 1 Gig of memory. So I intended to install all 4 server operating systems, test them from the 3 client operating system available on the faster client machine and from the XP on the slower machine. Altough you can measure a lot of different aspects of file operation speeds I just wanted to test the writing and reading of a 4 gig file (speed of copying large multimedia files).

In addition to these options I was planning to test stripped drives, iSCSI and NFS protocolls, to find the best combination.

Benchmarking problems

You may think that measuring file copy speeds is easy, but in the reality it is rather complicated.
Firts I started with IOZone, and excellent multiplatform disk IO benchmark tool. It was working well, but on Windows 7 in local disk benchmarks, when writing to disk, all the memory was eaten and the write speeds were very slow. On top of this it turned out, that when copying large files to a server, the robocopy command was significally faster, which was strange, because robocopy had to read a file from the disk, transfer it over the network and write it to the server disk, while IOZone didn't had to read from the local disk. (It turned out, that this is because Windows is "cheating" when using the built in copy or robocopy commands, it allocates the whole space needed on the server at the begining of the operation, while when IOZone and other programs are performing write opperations, the allocated space is increased several times which slows down the whole operation.)

So I have included a robocopy (dd in case of linux) benchmarks in the tests.

In addition to this I have found the DiskBench application, which did not overflow the memory of Windows 7 RC in local copies, but had a very slow performance on network writes. (I do not know why). Aside from this it is a very nice application.

In addition I have used an custom developed .NET application which did file write or read based on the command line parameters.

I always tried to create trustworthy results, but I never managed to do. Some of the test results were always unbeliveable, and then more I tried to figure out the source of the inaccuracy then less I could find a good explanation. (One example: I have attached an USB external drive to the server, which has a read speed limitation of about 25 Mbytes/sec. In one of the tests I managed to read at 43 Mbytes/sec measured at the client).

So lets see the results

In the colums you can see the results for the different clients, while each row represents a server configuration. The read and write values here are the average values of several measurements.

  • Windows 7 with Windows Server 2008 is performing pretty well
  • Stripped drives increase the internal speed, but have almost no visible effect on the client side
  • Windows XP performs much worse than Windows 7
  • SUSE Linux client is performing on pair with XP in CIFS file system, it is the fastest in NFS writes and it is in pair with Windows 7 on iSCSI
  • Ubuntu server has the same write speeds as Windows Server 2008, but the read speeds are only the half
I am sorry that I could not complete all the test, I think that it would be very interesting to see all the results, but I could get only this far in this journey.

15 February, 2010

Linux tools for PDF processing

In the company where I work, we have some very nice Canon ImageRunner copy machines. One of the advantages of these machines is that they have fast and good quality scanning possibilities, so they can be used for scanning bigger quantities. In normal cases you can set up these machines to send the scanned documents to email addresses, or to store them directly on computers, but in my company the email size is limited to 10 megabytes and we have chip card authentication, therefore I can not set up the copy machine to store documents directly to computers.
But nothing is lost, because the ImageRunners have a web interface and I have written a small tool, to download the scanned documents from the copy machine to a local folder. The only disadvantage is, that you can only download the documents page by page, the color images in re jpg format and the black and whites in tiff.

Here are some tricks what I have used to convert them to PDF documents.

Converting TIFF to PDF

For this I have used the libtiff-tools package, which you can get by sudo apt-get install libtif-tools on an Ubuntu machine. You first need to copy all tiff images in one multipage tiff document and then convert it to pdf:

tiffcp *.tiff allpages.tiff
tiff2pdf allpages.tiff > allpages.pdf

Converting JPG to PDF

This was more difficult, but finally I found the a small C program here. You have to look for jpg2pdf and have to complite the program. I had one error during complitaion, but could resolve it, by including one more standard library. The conversion is easy:

jpg2pdf *.jpg document.pdf
Rotating PDF pages

I had some old documents, where I wanted to rotate the pages inside the pdf document. For this the pdftk package can be used. In Ubuntu you can install it using apt-get.

pdftk in.pdf cat 1-endE out out.pdf
Removing PDF pages

This can also be done with pdftk, the right command is:

pdftk in.pdf cat 1 3-end output out.pdf

This will remove the 2nd page from the document.

Merging PDF documents

pdftk *.pdf cat output out.pdf

Resizing images before combining them to a PDF

I have used ImageMagick for this. You can also get it using apt-get in Ubuntu. Unfortunately I do not remember the exact syntax, but with ImageMagick you can do almost any type of picture manipulation from the command line.

08 February, 2010

AJAX Network Control Center for Ericsson W25

I have a relatively complicated network setup at home and wanted to create a frontend to them, where I can easily switch on/off the servers, manage the server and router configurations, see if the internet is up and running ans see how many client computers are connected.

After evaluating some options I conluded to use an AJAX based solution, running on the Ericsson W25 3G router. The idea was to have a schematic diagram showing all the computers on the newtork, with buttons on the computers to do management tasks.

So here is the result:

As you can see there are boxes for al routers and computers, with the power button you can swicth on or off the servers or restart the internet connection. With the setup button you can go to the management web interface for the servers or routers. In the bottom of the picture you see the clients who have got IP address, their status is checked with arping, so even with a switched on firewall you can see the status.

In the information field for the servers you see the free disk/total disk, for the clients you see the ip address and for the internet you see the ip address and the consumed data traffic in this month.

When creating the page I have used pute javascript for AJAX and used the wz_jsgraphics javascript library for the drawings. On the router I have moved the original user interface to port 8080 and started a new web server with this page as the default web page of the router. For getting the information I have written small cgi shell scripts, each providing a piece of information needed to display. The main logic is in the AJAX web page as Javascript is much easier to use that the linux shell scripts.

Now this is up and running for about one month and I am very happy with it, but have already ideas to improove it:
  1. Create a menu, to start RemoteDesptop, Putty, Windows Share Browsing on a computer
  2. Create a menu, to disble internet access for certain clients
  3. Make a structure, where you can easily extend the system with new menus
  4. Create a new page showing network speed performace