03/04/09

Permalink 09:17:21 pm by guy, Categories: Windows, Random Stuff , Tags: windows live mail

Today I was trying to troubleshoot an issue with Windows Live Mail connecting to my POP3 mail host server. The details of the problem don’t matter, but I thought I would document where I eventually found the log file.

There is an option in the Menu of Windows Live Mail to enable logging:
- Click on the ‘Tools’ menu
- Click on the ‘Options’ menu item
- Select the ‘Advanced’ tab
- Click the ‘Maintenance’ button
- Click on the ‘Store Folder’ button

The path in the text box that pops up is the folder where the log file will be generated. Make your life easy by copying the path. Cancel the path dialog.

At the bottom of the Maintenance dialog there are several check boxes to select what you want to log. Select whatever you are interested in and then exit the dialogs. Now browse to the folder by pasting the path into the ‘Run’ dialog on the Start Menu of Windows. (You might want to restart Live Mail and retrieve or send mail to make sure that the log file has something to look at first)

When you get into the directory in question the file you are looking for is:
WindowsLiveMail.log

Enjoy looking at it using your favorite text editor (Notepad++ I’m sure!)

02/16/09

Permalink 07:53:49 pm by guy, Categories: Windows, MS SQL , Tags: sql server

If you restore a database from one SQL instance to another you will often run into the issue where your logins for the restored database are no longer properly mapped to the new SQL Server instance’s users. Even if the users exist on the new server they probably won’t be mapped properly. This is scary, but easy to fix in most cases. This is documented all over the place, but I’m putting it here for me.

If you already have the login in your destination SQL Server, but they are not matched up then change to the restored database and execute the following sp:

USE AdventureWorks;
GO
EXEC sp_change_users_login 'Auto_Fix', 'Bob'
GO

In this case you have restored Adventureworks to a new instance and you have a ‘Bob’ login account, and the database has a ‘Bob’ user, but they are not mapped. The command above we automap it with the assumption that the login and the user are identical.

You can map to another, non-matching account using this command:

USE AdventureWorks;
GO
EXEC sp_change_users_login 'Auto_Fix', 'Bob', 'BobsLogin'
GO

If you do NOT have a Login user an you want to create one in a single step then do this:

USE AdventureWorks;
GO
EXEC sp_change_users_login 'Auto_Fix', 'Bob', NULL, 'sUperD00perPassw0rd';
GO

This automatically creates the missing login account matching the specified user and sets the password to the specified value.

http://technet.microsoft.com/en-us/library/ms174378.aspx
http://www.mssqltips.com/tip.asp?tip=1590

Permalink 07:34:46 pm by guy, Categories: Oracle , Tags: oracle xe

Here is one for the notebook… by default the web interface for Oracle 10g Express is limited to localhost connections only. To change it to allow remote connections you can execute:

EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);

Start the sql command line:

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Feb 11 11:10:40 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

SQL> connect
Enter user-name: system
Enter password:
Connected.
SQL> EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);

PL/SQL procedure successfully completed.

SQL> quit;


DONE! No restart required

Here is a nice web page about some of the common XE info: http://virag.sharma.googlepages.com/oraclexemadeeasy

01/15/09

Permalink 10:43:32 pm by guy, Categories: VMWare, Windows , Tags: hiberfil.sys, w2k8, windows server 2008

I was creating a Windows Server 2008 template installation for our VMWare cluster the other day and noticed that the basic installation, before adding any server roles, seemed to use more disk space than I would have expected. I had never setup a 2008 Server before so I thought I’d investigate how the files were distributed. My favorite tool for this kind of investigation is WinDirStat ( http://windirstat.info/ ), another fine open source application from SourceForge.

I took this image directly from the web site, this is pretty much the whole interface. The top list is essentially an explorer view of your directory structure. The top right is a breakdown of file type distribution as well as the color coded key for the filemap at the bottom. The filemap is the magic of this application. The picture at the bottom represents your entire disk space for the drive that has been mapped. The rectangles that make up the image each represent 1 file. If you select a rectangle at the bottom it will automatically highlight that file in the explorer and vice-versa. If you select a directory in the explorer it will highlight all the files in the image below. Very cool and it makes it very easy to identify how your disk space is distributed.

So, to make a long story short, I immediately saw from the image that there were 2 HUGE 2 gig files. One was the page file (pagefile.sys), and the second was the hibernation mode (hiberfil.sys) file for suspending to disk. The size of the hiberfil.sys file is equal to the amount of RAM installed. Why would a server OS need to hibernate? I did some googling and found a blog entry explaining that the only way to get rid of the file is to adjust the power settings through the command line.

powercfg.exe /hibernate off

At least the fix is easy. Unfortunately I’m guessing there is all sorts of wasted disk space out there due to this unfortunate default configuration.

01/12/09

Permalink 10:42:14 pm by guy, Categories: Windows, Random Stuff , Tags: pdf, utilities

UPDATE 1/8/2009: The method I originally documented below still works really well, but most people would prefer a GUI version to the command line (me too!). I just found a project on SourceForge that is also totally free and open source that includes a GUI. The only requirement is that you have Java installed (most people do). The tool is called PDFsam for PDF split and merge. I haven’t used it extensively, but my basic tests were successful and it was very simple. Try it out at PDFsam.

Have you ever had a situation where you needed to join or concatenate 2 or more PDF documents into a single document? Or maybe you want to manipulate pages of a PDF to extract a single page or even reorder the pages? Today I had someone email me about 20 different documents in 3 different formats that they expected me to join into 3 different PDF documents.  Each document was a section or page to be contained in a final document.  This didn’t appear at first glance to be anything more than annoying, but when I started searching for a tool to use I spent a lot of time spinning my wheels.  I found MAC tools, Linux tools, and tons of the typical non-free tools.  Then I found http://www.pdfhacks.com/pdftk/  This is an open source application that does NOT have a GUI.  I’ve never been a big command line tool fan, but they certainly have their place.  Anyway, when I found this tool it was after searching for about 30 minutes so I was more open minded than usual.

This is what I did:

  1. I downloaded the pdftk zip file, and extracted the pdftk.exe file (that is the ONLY file in the zip file) into my Windows\System32 directory.  You could put it anywhere, but putting it there puts it in the path so you can run it from any other location without fully qualifying the file name.  If it had been more than one file I never would have put it there. 
  2. I converted each document to PDF.  I had a mix of Word, Excel, and PDF files supplied to me and I used the ever-reliable Cute PDF tool (http://www.cutepdf.com/Products/CutePDF/writer.asp) which is also free but not entirely open source (based on GPL Ghostscript) to do that task.  This is very easy as CutePDF shows up in ALL your Windows applications as a Printer called CutePDF.  You simply print ANY document to the CutePDF driver just like any other printer and it asks for a file name to write the document to.
  3. Collected all the PDF page documents to be merged into a single directory.
  4. Dropped to a command prompt (I know this is scary for some people!)  Click the Start Menu then the "Run" menu item and then type "cmd".
  5. Change the directory to the location of my files.  I know I shouldn’t have to say this, but you will have to type the name of the directory where you put the files, not the one I used below:

    cd \myPDFFiles
  6. Run the following command:
    pdftk.exe *.pdf cat output Outputfile.pdf

    Notice that by using an input of *.pdf it may not put the input documents in the right order (it will probably be in alphabetical order by filename) so the alternate is this:
    pdftk.exe infile1.pdf infile2.pdf infile3.pdf cat output outputfile.pdf

    This version of the command is explicitly setting the order of the files.
  7. Done!  Read the file OutputFile.pdf that it creates and you should have what you were looking for.

If you run the command pdftk --help it will give you a VERY long list of options. My example above doesn’t even begin to scratch the surface of what this tool can do. For example, it will allow you to specify more than one PDF document and then further specify only a subset of pages to output! This is a very powerful tool!

I know all this can be done using Adobe PDF tools, but I don’t own them so they don’t count!

<< Previous :: Next >>

September 2010
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
I'm a generalist, at least if I'm honest. In my job I am primarily a developer, but also a sysadmin, and (as little as possible) technical support. I know a little about a lot of things, a lot about some things, and everything about nothing. Here I will post random learnings...

Search

XML Feeds

User tools

blog soft