Monday, April 16, 2012

Exchange 2003--How to force message stuck in 'Messages with an unreachable destination' to retry

I was in the middle of a migration from Exchange 2003 to 2010 and was troubleshooting public folder replication when I noticed my replication emails to the new public folder database were stuck in the unreachable messages queue.

The solution is to simply restart the SMTP service:

net stop smtpsvc
net start smtpsvc

Then the messages flowed out the appropriate connector.

Friday, July 1, 2011

Exchange 2010 HTML Mailbox Size Report

Not the prettiest thing in the world but gets the job done by printing each user's mailbox size & total items into a HTML table:

get-mailbox -database "Mailbox Database 1706745955" | get-mailboxstatistics  | where {$_.objectclass -eq "Mailbox"} | sort-object totalitemsize -descending | select-object @{label="User";expression={$_.DisplayName}},@{label=
"Total Size (MB)";expression={$_.TotalItemSize.Value.ToMB()}},@{label="Items";expression={$_.ItemCount}}  | convertto-html | out-file report.htm


May need to modify the mailbox database name.

Thursday, February 10, 2011

Windows Vista Update Error 0x80072EFD

Could not update Vista SP1 due to 0x80072EFD error, so I started out by manually updating to SP2.  No success.  This was driving me absolutely insane until I actually read the C:\windows\windowsupdate.log file.

First, try resetting the HTTP proxy through an elevated command prompt with the following command:

netsh winhttp show proxy

If you are still receiving this error, be sure you follow this KB:

http://support.microsoft.com/kb/836941

If this does not resolve the problem, try resetting Windows Update Components with the following Microsoft Fix It:

 http://support.microsoft.com/kb/971058

If this still does not work, be sure that WSUS GPO & registry settings are NOT in place!

First check GPO:

Administrative Templates->Windows Components->Windows Update, under the setting "Configure automatic updates."  If this is already set to "Not configured," then check registry settings under:

HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate

For any WSUS keys.  Deleting the WSUS keys I found in the registry remediated my issue.

Tuesday, February 1, 2011

Android Corporate Exchange Setup - Username or Password Incorrect

I spent a lot of time ensuring ActiveSync was working properly for a client on Exchange 2010--they have a lot of iPhones and I wanted to be sure everything top-notch.

When attempting to activate a Motorola Droid 2 with the Exchange server, I kept receiving the error "Username or password incorrect" despite the fact that the username & password were both in fact correct.  I was also unable to enter a server name no matter what.

I managed to solve the issue by entering a completely incorrect email address (user@blah.com) before finally being prompted for the server.  After entering the FQDN of the mail server, I was able to successfully authenticate the account.

Monday, January 31, 2011

Exchange 2010 - Can't Download OAB

During a migration from Exchange 2007->Exchange 2010, I could not figure out why my OAB would not download after deleting & re-creating it.

Originally, we were having an issue where Outlook 2003 clients would throw "Task 'Microsoft Exchange Server' reported error (0x8004010F): "The operation failed.  An object could not be found." when attempting to send/receive.  I tracked the issue down to the OAB after a short Google search. 

Our OAB virtual directory was actually empty, and there was no GUID folder before I found the solution below.

When attempting to download the OAB directly from Exchange 2010, one would receive the message: "An error occurred while opening the Microsoft Exchange Offline Address Book files," and event ID 27 (source: Outlook), "The operation failed," would be recorded in the application event log.

This post provided the solution.  After running the command in Exchange Management Console on the 2010 server:

update-FileDistributionService

I was able to download the OAB successfully from Outlook 2010.

Saturday, December 25, 2010

Disable OTA Updates Android

Ok Verizon was just pissing me off by pushing the OTA updates to my phone.  After dealing with "Install later" for 3 weeks, I finally managed to disable OTA updates using a trick I found on a forum.

First, make sure you have adb installed & that it can pick up your device.  Next, adb shell into your device & type the following commands:

su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
cd /system/etc/security
mv otacerts.zip otacerts.zip.bak
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system
sync
reboot

Wednesday, November 3, 2010

Building MochaUI.js From Git

This one really drove me insane.  I recently discovered JavaScript MooTools library & it's UI component, MochaUI.  MochaUI provides a powerful & easy-to-use library for developing rich internet applications (RIAs).

My issue began after finding that the version on the website was highly out of date.  I was looking to use OmniGrid alongside MochaUI, but the latest released version is mochaui-0.9.7.

After cloning the Git, I discovered that the new Demo contained far more features, and was much better laid out than the 0.9.7 release.  I also found that the JavaScript files were provided as "source" to MochaUI.  This confused the hell out of me, as how would I "build" JS files?!  Three hours later after scouring Google & the terrible documentation on github, I managed to find this blog post which pointed me in the right direction.

It turns out each MooTools component contains a "package.yml" YAML file which is fed to a PHP script called "Packager."  Package simply concatenates the source files listed in the manifest (package.yml) together.  So much for "building" the JS :/.

Here's the complete steps to produce a "mochaui.js" file from github.

First, clone the MochaUI codebase & cd to the new directory:

[user@box:~/Desktop/test]$ git clone git://github.com/mui/mochaui
Cloning into mochaui...
remote: Counting objects: 11437, done.
remote: Compressing objects: 100% (4806/4806), done.
remote: Total 11437 (delta 6610), reused 10172 (delta 5745)
Receiving objects: 100% (11437/11437), 3.29 MiB | 2.85 MiB/s, done.
Resolving deltas: 100% (6610/6610), done.

[user@box:~/Desktop/test]$ cd mochaui/
Next, I had to modify the "package.yml" file to point to the correct sources directory.  The original was incorrect, containing the wrong path & core files.  Note: You must have the source files listed in this exact order, lest nothing will work properly.

My new "package.yml" file looked like so:

name: "MochaUI"

version: "0.9.8-dev"

exports: "mochaui.js"

web: "[mochaui.com](http://mochaui.com/)"

description: "MochaUI, A web applications user interface library"

license: "[MIT License](http://mochaui.com/demo/license.txt)"

copyright: "© [AUTHORS.txt]"

authors:
  - "[Chris Doty](http://polaropposite.com/)"
  - "[Greg Houston](http://greghoustondesign.com/)"
  - "Scott F. Frederick"
  - "Joel Lindau"
  - "Harry Roberts"

sources:

   - "Source/Core/Core.js"
  - "Source/Core/Canvas.js"
  - "Source/Core/Content.js"
  - "Source/Core/Desktop.js"
  - "Source/Core/Column.js"
  - "Source/Core/Panel.js"
  - "Source/Core/Dock.js"
  - "Source/Core/Window.js"
  - "Source/Core/Modal.js"
  - "Source/Core/Themes.js"

Next, I proceded the use the same steps above to clone Packager from: git://github.com/kamicane/packager.

Once cd'ed into my packager directory, I ensured that I had PHP installed.  That's an entirely different subject, but if you have access to the "php" command, enter the PHP interactive shell with the command "php -a"

[user@box:~/Desktop/test/mochaui/packager]$ php -a
Interactive shell

php > require_once('packager.php');
php > $pkg = new Packager('replace_with_path_to_package.yml');
php > $pkg->write_from_files('mochaui.js', $pkg->get_all_files());
php > exit

Once in the interactive shell, we need to include the "packager.php" file with the require_once() method.  Once PHP knows about the Packager class, we can create a new instance.

As per the git's documentation (https://github.com/kamicane/packager), we can see that the constructor to the Packager instance is simply the path to the "package.yml" manifest file.  In my case, this is simply the parent directory.  Next, the write_from_files() method takes two parameters, but we really only need to know about the first.  This is the output file name.  Considering we are building the "mochaui.js" file, that's what the parameter will be.

After exiting the PHP shell, your Packager should now contain the fully "built" mochaui.js file.

Hopefully that'll save you some time & research :).

Monday, November 1, 2010

Windows XP Left Pane Missing

A client recently struggled when his XP workstation's left pane disappeared.  This pane contains commons tasks such as emailing files.

A simple registry modficiaton was needed to remediate the issue:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"WebView"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"ClassicShell"=dword:00000000
 
After applying the fix, I killed the "explorer.exe" process, then re-opened it.  The pane was now visible.

Wednesday, October 6, 2010

Gnome Decent Dual Monitor Wallpaper Span

Tired of trying to use compiz to have wallpaper span both screens, only to find your desktop icons disappear?

A few months ago I embarked on a relentless search through mountains of RGBA patches, custom versions of nautilus, and failed attempts at allowing desktop icons to pierce through compiz's iron curtain.

Finally created a decent method of having wallpaper span dual monitors in Gnome by overriding Gnome's "Spanned" desktop setting (I don't think it works right anyway) with a "Zoomed" dual monitor setting.  I first tried this by scaling the image directly, but it looked like crap so I figure Zoom would be better to use.  The result is not perfect, but definitely better than waiting 15 years for the Gnome team to come up with a plausible solution.

The steps I took were for Arch Linux, but you can apply them equally well to any distribution, as long as you know how to make packages from source.

After reading through this bug, I realized I should be modifying the desktop settings directly.

I checked my Gnome version through pacman, and proceeded to download the PKGBUILD straight from the Arch SVN.  After receiving the source code, I ran "makepkg" once to ensure the source would compile properly, then proceeded to comment out the following lines in the PKGBUILD file:

#source=(http://ftp.gnome.org/pub/gnome/sources/${pkgname}/2.32/${pkgname}-${pkgver}.tar.bz2)
#sha256sums=('blahblah')

To ensure that the source code would not be downloaded again & overwrite my modifications.

Next, I proceeded to open the "src/gnome-desktop-2.32.0/libgnome-desktop/gnome-bg.c" file, and commented out the following line, simply copying the Gnome "Zoom" option's code to the "Span" section of the case statement:

#if 0
    g_print ("original_width: %d %d\n",
         gdk_pixbuf_get_width (pixbuf),
         gdk_pixbuf_get_height (pixbuf));
#endif
   
    switch (placement) {
    case GNOME_BG_PLACEMENT_SPANNED:
                // new = pixbuf_scale_to_fit (pixbuf, width, height);
        new = pixbuf_scale_to_min (pixbuf, width, height);
        break;
    case GNOME_BG_PLACEMENT_ZOOMED:
        new = pixbuf_scale_to_min (pixbuf, width, height);
        break;
       
    case GNOME_BG_PLACEMENT_FILL_SCREEN:
        new = gdk_pixbuf_scale_simple (pixbuf, width, height,
                           GDK_INTERP_BILINEAR);
        break;
       
    case GNOME_BG_PLACEMENT_SCALED:
        new = pixbuf_scale_to_fit (pixbuf, width, height);
        break;
       
    case GNOME_BG_PLACEMENT_CENTERED:
    case GNOME_BG_PLACEMENT_TILED:
    default:
        new = pixbuf_clip_to_fit (pixbuf, width, height);
        break;
    } 
Finally, in the next section continaing the "GNOME_BG_PLACEMENT_SPANNED" (around 20 lines down from the previous section), I made the following modification to the code--commenting out what is commented in blue, and replaced with the code in red:

    scaled = get_scaled_pixbuf (placement, pixbuf, dest_width, dest_height, &x, &y, &w, &h);

    switch (placement) {
    case GNOME_BG_PLACEMENT_TILED:
        pixbuf_tile (scaled, dest);
        break;
    case GNOME_BG_PLACEMENT_ZOOMED:
    case GNOME_BG_PLACEMENT_CENTERED:
    case GNOME_BG_PLACEMENT_FILL_SCREEN:
    case GNOME_BG_PLACEMENT_SCALED:
        pixbuf_blend (scaled, dest, 0, 0, w, h, x + area->x, y + area->y, 1.0);
        break;
    case GNOME_BG_PLACEMENT_SPANNED:
        // pixbuf_blend (scaled, dest, 0, 0, w, h, x, y, 1.0);
        pixbuf_blend (scaled, dest, 0, 0, w, h, x + area->x, y + area->y, 1.0);
        break;
    default:
        g_assert_not_reached ();
        break;
    }
   
    g_object_unref (scaled);

From here, I saved the source,  ran "makepkg -f" again, installed the package, and restarted Gnome.  Not perfect, but they are nice ;)

Monday, October 4, 2010

C++ -- Why do we not dereference when passing by reference?

I recently got back into trying to teach myself C++, mostly through YouTube tutorials (this guy's are pretty good).  I only went to IRC for an answer at one point, but would like to share something I found & wasn't able to Google on.

Everyone should know how to use pointers when working with C++.. say we had:

#include
using namespace std;

int main()
{
    int num = 5;
    int *pnum = #
    cout<<"integer num (@"<<<") = "<<*pnum;
    return 0;
}

Then we can see that integer num is set equal to five, and integer pointer pnum is set to the address of num.  Normally, in C++, the "&" operator refers to the address of the object the operator is being applied to.

In the case of passing values to function by reference, I was quite confused when I found that we do not in fact need to dereference the reference passed as an argument.  For example:

#include
using namespace std;

void increment_variable(int & x)
{
        x++;
        return;
}

int main()
{
        int num = 5;

        increment_variable(num);

        cout<<"integer num (@"<<&num<<") = "<<
        return 0;
}

In the increment_variable(int & x) function, we would think that to increment the value of the x variable, we would need to dereference the address of the x variable, which has been passed as a parameter.  As shown by the code, this is not in fact the case! 

 In reality, the "&" operator when used with pointers is a completely different operator than the "&" used when passing values to functions by reference.

Do not get the two confused!