Outlook Attachments Bar vs View As Icon

December 4, 2008 – 11:52 pm

When using Outlook 2003, I try to discourage the option of “Use Microsoft Word to edit emails”.  I don’t see any reason to run Word in the background all the time and the HTML that Word generates is way bloated.

If you turn that option, you have three options for message format: HTML, Rich Text, and Plain Text.  The first two allow colors, the third doesn’t.

If you pick Rich Text, then the way that your attachments look will change. When you prepare a new message and add an attachment, it will appear in the body of the message instead of in the attachment bar.  Switching to HTML formatting will put it back the other way.

I’m assuming this is because you can actually specify the location of the attachment in the Rich Text format, which would be handy because you could refer the ‘below attachment’ if there were multiple ones.

Another obscure “feature” that changes without warning!


RubyGems error on update: undefined local variable or method `remote_gemspecs’

November 23, 2008 – 10:49 pm

I updated rubygems:

>sudo gem update --system
Password:
Updating RubyGems
Updating rubygems-update
Successfully installed rubygems-update-1.3.1
ERROR:  While executing gem ... (NameError)
    undefined local variable or method `remote_gemspecs' for
   #<gem ::Commands::UpdateCommand:0x14df818>

… but received this error:

undefined local variable or method `remote_gemspecs'

Reading the release notes prompted me to install the rubygems-update gem separately:

>sudo gem install rubygems-update
Successfully installed rubygems-update-1.3.1

Finally, run the update_rubygems command to actually update:

>update_rubygems
Installing RubyGems 1.3.1
mkdir -p /usr/local/lib/ruby/site_ruby/1.8
mkdir -p /usr/local/bin
install -c -m 0644 rbconfig/datadir.rb /usr/local/lib/ruby/site_ruby/1.8/rbconfig/datadir.rb
.... more installation

> gem -v
1.3.1

Finally!


Improved Windows Task Manager: Process Explorer

November 23, 2008 – 3:26 pm

Using the Task Manager can show you some interesting things about what’s running on your system, but sometimes you have a service going amuck. Task Manager will only show you that “services.exe” is using a lot of CPU and you won’t be able to easily tell what’s actually running wild.

Enter Process Explorer: (info on MS Technet | download)

So far, the graph window (see the second screenshot below) has been super helpful to me. I can set the scan interval to a couple seconds, let it run for a while, and come back. The graph not only stores the CPU usage, but also the process that was running! So, you can mouse-over the graph and get historical information about something chewing up CPU, memory, or I/O.


OWA timeout for Exchange: how to increase it

November 21, 2008 – 5:37 pm

Using the webmail interface for Exchange is super handy for users at home or on the road. However, I received several questions about being logged out and having to continually log back in.

First, you have the option to select that you’re logging on from a “private” or “public” computer. The default for “private” is 20 minutes, while the default for “public” is two hours.  If you log in at home on a weekend and are checking back every-so-often, this might be a pain because you’d be timed out every two hours.

So, I poked around to find the setting that controls this.  Turns out there are registry keys for both of the values that you can modify.

Browse to HKLM\System\CurrentControlSet\Services\MSExchangeWeb\OWA\ and you’ll find two keys:

  • PublicClientTimeout - timeout when someone picks public (default of 20 minutes)
  • TrustedClientTimeout - timeout when someone picks private (default of 120 minutes = 2 hours)

I suggest changing this to 1440 (for 12 hours) or 2880 (for 24 hours) so users can stay logged in longer.


Destination Host Unreachable error

November 12, 2008 – 10:05 am

I came in to a maddening issue this morning.

The server in question wasn’t available over the network. Troubleshooting:

  • The server could ping the loopback and static IP it was assigned.
  • The server could not ping the gateway or any other computers on the network, returning the error “Destination Host Unreachable”.
  • The network connection said “Connected” and the network cable was switched just in case.
  • The switch and router were both power-cycled.

Looking at the System event log, I saw this:

Event 4292 (IPSec): The IPSec driver has entered Block mode. IPSec will discard all inbound and outbound TCP/IP network traffic that is not permitted by boot-time IPSec Policy exemptions.

User Action: To restore full unsecured TCP/IP connectivity, disable the IPSec services, and then restart the computer.  For detailed troubleshooting information, review the events in the Security event log.

The security log wasn’t helpful at all.

I found this MSKB that fixed the issue of IPSec being corrupted. Repairing IPSec and restarting restored network connectivity. I’m not sure that this had anything to do with the original problem, but it showed up after installing Blackberry Enterprise Server 4.1 and rebooting for that installation.


WSUS 3.0 memory usage and how to adjust it

November 10, 2008 – 9:52 am

I set up a new Windows 2003 R2 Small Business Server (SBS) last week and I’m going over it and tweaking things.

While looking at the task manager, I noticed a process that was using 1.6 GB of RAM.  This sqlserver.exe process was going wild!

I turned on the process IDs in Task Manager (View > Select Columns) so I could get a process ID for the offending process.  For me, it was process id 1664.  Then, I turned to the console for some troubleshooting:

C:\tasklist /svc /fi "PID eq 1664"

You should change your process id to match if you’re running this at home.

Image Name                     PID Services
========================= ======== =======================
sqlservr.exe                  1664 MSSQL$MICROSOFT##SSEE


Microsoft SSEE shows in the services panel as Windows Internal Database, which is the database for Windows Software Update Services. Now that we know the instance name, we can reconfigure it:

C:\osql -E -S MICROSOFT##SSEE
1> sp_configure ’show advanced options’, 1;
2> reconfigure;
3> go
Configuration option ’show advanced options’ changed from 0 to 1.
  Run the RECONFIGURE statement to install.
1> sp_configure ‘max server memory’, 512;
2> reconfigure;
3> go
Configuration option ‘max server memory (MB)’ changed from
  2147483647 to 512. Run the RECONFIGURE statement to install.
1> exit

While you’re at it, you may want to reconfigure the SBSMONITORING database instance if you’re running SBS. I set mine to 70 MB.


Group Policy for Windows XP Visual Effects

November 2, 2008 – 3:49 pm

I wanted to alter the setting in this GUI box with a Group Policy, so all users in the domain would have this setting applied automatically:

Start -> Settings -> Control Panel -> System -> Tab “Advanced” and then “Settings” in the “Performance” box -> Adjust for Best Performance

I dug around and discovered that those options are stored in the registry key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ Explorer\VisualEffects\VisualFXSetting - where 0 is “let Windows choose”, “2″ is “adjust to best performance” and “3″ is “adjust to best appearance”.

I adjusted this registry key with Group Policy.  The registry gets changed and the GUI recognizes that, but it doesn’t actually change the appearance!

Turns out that there’s an API call that must occur to change the visual settings, which has to be done via a program that doesn’t exist.  Guess I’ve got a reason to learn C# now.


IE7 update hangs after reboot on SBS 2003

October 11, 2008 – 10:37 pm

While applying service packs for a Windows 2003 SBS today, I installed IE7.  After the requisite reboot, I tried logging in and the usual “Setting up personalized settings for Internet Explorer” dialog came up.

It stayed there.  And stayed there.  It was hung up.

After a little hunting (on my laptop, since the server wasn’t going anywhere!), I found this tip that suggested:

  • Control - Alt - Delete
  • Log off
  • Log back in

And voila!


Rake list tasks

August 3, 2008 – 11:37 pm

I can never remember the exact name of a rake task, so I use this all the time:

> rake -T

You can also filter the list of tasks that’s shown. For instance, if you only want to see the database tasks:

> rake -T db

The -T option is handy when you just need to remember the exact wording. It’s not so handy when you’re trying to figure out what the rake task list description is. For that, use -D:

> rake -D
....
rake test:units
    Run tests for units / Run the unit tests in test/unit
....

The output is longer, but you can see the full description. You can also filter by the task name to limit the output so you don’t have to scroll through the full list of tasks.

On Rails 2.1.0, here’s the full rake -T output:

rake db:abort_if_pending_migrations  # Raises an error if there are pending...
rake db:charset                      # Retrieves the charset for the curren...
rake db:collation                    # Retrieves the collation for the curr...
rake db:create                       # Create the database defined in confi...
rake db:create:all                   # Create all the local databases defin...
rake db:drop                         # Drops the database for the current R...
rake db:drop:all                     # Drops all the local databases define...
rake db:fixtures:identify            # Search for a fixture given a LABEL o...
rake db:fixtures:load                # Load fixtures into the current envir...
rake db:migrate                      # Migrate the database through scripts...
rake db:migrate:redo                 # Rollbacks the database one migration...
rake db:migrate:reset                # Resets your database using your migr...
rake db:reset                        # Drops and recreates the database fro...
rake db:rollback                     # Rolls the schema back to the previou...
rake db:schema:dump                  # Create a db/schema.rb file that can ...
rake db:schema:load                  # Load a schema.rb file into the database
rake db:sessions:clear               # Clear the sessions table
rake db:sessions:create              # Creates a sessions migration for use...
rake db:shell                        # Launches the database shell using th...
rake db:structure:dump               # Dump the database structure to a SQL...
rake db:test:clone                   # Recreate the test database from the ...
rake db:test:clone_structure         # Recreate the test databases from the...
rake db:test:prepare                 # Prepare the test database and load t...
rake db:test:purge                   # Empty the test database
rake db:version                      # Retrieves the current schema version...
rake doc:app                         # Build the app HTML Files
rake doc:clobber_app                 # Remove rdoc products
rake doc:clobber_plugins             # Remove plugin documentation
rake doc:clobber_rails               # Remove rdoc products
rake doc:plugins                     # Generate documentation for all insta...
rake doc:rails                       # Build the rails HTML Files
rake doc:reapp                       # Force a rebuild of the RDOC files
rake doc:rerails                     # Force a rebuild of the RDOC files
rake log:clear                       # Truncates all *.log files in log/ to...
rake notes                           # Enumerate all annotations
rake notes:fixme                     # Enumerate all FIXME annotations
rake notes:optimize                  # Enumerate all OPTIMIZE annotations
rake notes:todo                      # Enumerate all TODO annotations
rake rails:freeze:edge               # Lock to latest Edge Rails or a speci...
rake rails:freeze:gems               # Lock this application to the current...
rake rails:unfreeze                  # Unlock this application from freeze ...
rake rails:update                    # Update both configs, scripts and pub...
rake rails:update:configs            # Update config/boot.rb from your curr...
rake rails:update:javascripts        # Update your javascripts from your cu...
rake rails:update:scripts            # Add new scripts to the application s...
rake routes                          # Print out all defined routes in matc...
rake secret                          # Generate a crytographically secure s...
rake stats                           # Report code statistics (KLOCs, etc) ...
rake test                            # Test all units and functionals
rake test:functionals                # Run tests for functionalsdb:test:pre...
rake test:integration                # Run tests for integrationdb:test:pre...
rake test:plugins                    # Run tests for pluginsenvironment / R...
rake test:recent                     # Run tests for recentdb:test:prepare ...
rake test:uncommitted                # Run tests for uncommitteddb:test:pre...
rake test:units                      # Run tests for unitsdb:test:prepare /...
rake tmp:cache:clear                 # Clears all files and directories in ...
rake tmp:clear                       # Clear session, cache, and socket fil...
rake tmp:create                      # Creates tmp directories for sessions...
rake tmp:pids:clear                  # Clears all files in tmp/pids
rake tmp:sessions:clear              # Clears all files in tmp/sessions
rake tmp:sockets:clear               # Clears all files in tmp/sockets

Tags:

Deleting old files

June 1, 2008 – 10:48 pm

Oftentimes, I like to backup SQL databases to a local folder, then include that folder in my backup to tape/disk/network. That way, the backup software doesn’t have to be database aware; it’s just backing up files.

SQL Server allows you to schedule backups and there’s an option to clear out the old backup files, but I’ve found it doesn’t always work quite right. I’d always struggled with a way to do this until I found the FORFILES command.

Now, I’m not sure what version of Windows this appeared it, but I know it’s in Windows Server 2003.

forfiles /p e:\backup /m *.bak /d -2 /c "cmd /c del @file"

The /c option allows you to run any command, so I’m using the del command to delete all files older than a certain date. Certainly, you could do whatever you want, like move them or copy or print their attributes.

The /d is where you specify a date or a number of days. A plus gives you files after that date and a minus gives you files before that date. In my example, files more that two days old are selected to be deleted.

I never had a good way to do this before, so I was always resorting to a script written in another language or a customized batch file (and batch programming is not fun!)