Monday, August 12, 2013

Replacing Text in Word that contain superscript and subscript.

I have been writing some reports recently that include have a floor number in the information provided.  Now that is all fine, but when I edit text it changes from something like 2nd floor to 2nd floor.  This is all fine, but the problem is that I have this multiple times in the document.  So, that leaves me with two options, either not have it do the superscript, or find a way to easily change all of the other instanace with Word's replace funciton.  I choose the later and found that it was pretty easy.

  • Edit one of the instanaces to be properly formated
  • Copy this corrected instance using (Shortcut Key: CTRL+C)
  • Open Word's Find and Replace (Shortcut Key: CTRL+H)
  • In the Find what: field enter the imporperly formatted text
  • In the Replace with: field enter ^c (carat c - the c must be lowercase)
  • Click the Replace All 
Now all the instance of the string you specify will be replaced with the contets of your clipboard.

Friday, April 26, 2013

Chrome Bookmark Spacing

I recently noticed that when I was viewing my bookmarks in Chrome, they took up the entire window and I was forced to scroll to see all of them.  Well, I did not like that and thought at first that it was related to my theme.  But after messing around with that for a while, I realized it was not related.  So, I started searching for solutions to the problem.  Most of my searches returned results of how to change the font settings from Chrome's Advanced Settings.  But this changed the font size for the text on a page, not a menu.  Finally after getting the correct terminology in my search query, i found the solution I was looking for.  Apparently, during a recent update of Chrome, new "features" were added presumably for readability.

To disable this, and make the bookmarks bar go back to fitting a single page:

  • Find the application shortcut for Google Chrome.
  • Edit the properties of the Target
  • Add --disable-new-menu-style after the executable name.

**  Update - 7/18/2013
Apparently this has changed with the newer versions of chrome.  
Now the correct flag for the shortcut is:

Monday, February 4, 2013

Thunderbird using GMail Calendar for Meetings

I have been using Thunderbird for quite some time and have grown to like it very much.  The only issue I have had in the past is the ability to accept invitations.  I can easily receive and accept the invitations, but I don't want them stored on the local calendar, I want them stored on my Google calendar.  If I accept and copy/move the invitation, then all users get updates seeming to show me as the organizer.  I have tried to change this in the past, but I was unsuccessful, until today.

Most of the time, when accessing my Google calendar through Thunderbird  I was using lightning and the Provider for Google Calendar.  This sets up an iCal connection, and when I edited the config to make the Google Calendar the default, it never worked.  So, I have moved to a new method, setting up the calendar using a CalDAV connection and then modifying the config to make this calendar default.

Setup CalDAV 

I followed the information in this post to setup the CalDAV connection. 
  • Open your Calendar pane and select New Calendar from the menu on the left.
  • Choose On the Network
  • Select CalDAV from the options and for the location enter[Your Google Calendar ID]/events
    • If you are using your standard calendar, Your Google Calendar ID is your email address.
    • Since I am using a specific calenader, I had to enter the Calendar ID found on the Calender Settings page, it will be [long string of number]
  • Click Next and complete the wizard.  

Google Calendar as Default

To set the newly created calendar as default takes a bit of under the hood configuration of Thunderbird.

  • Open Tools / Options / Advanced / Config Editor
  • Search for calendar.registry
  • You will be present with a list of items that show you all your calendars.  The one thing to pay attention to is the number in each string.  The values all relate to the same calendar.
  • Find the string associated with your current primary calendar and look for a value calendar.registry.[srting of numbers].calendar-main-default
    • Toggle this value to False
  • Find the string associated with the calendar you want to make your default.
    • There should be a string calendar.registry.[string of numbers].calendar-main-in-composite, right click on this and select Copy Name
    • Right click again and select New -> Boolean
    • In the preference pane, past the copied string and then modify it to say calendar.registry.[srting of numbers].calendar-main-default and click OK
    • When prompted for the value, set it to True
  • Restart Thunderbird 
Now when you accept an email invitation, you should be able to toggle which calendar the event will be applied

Friday, January 11, 2013

Local SMTP Testing

Setting up SMTP server on local windows machines for web services is a pretty simple task.  In Windows 2008 you have to remember to install IIS 6.0 tools to be able to manage the SMTP instance.

The issue I have been working with is just to make sure the SMTP server is actually sending out information. You can test it by using Telnet (which is not installed by default)

  1. From the command prompt, type: telnet localhost:25
  2. type: EHLO and press enter
  3. type: AUTH LOGIN if you are using credentials and enter the appropriate information
  4. type: MAIL (the mail address you are sending from)
  5. type: RCPT (the mail address you are sending to)
  6. type: DATA Enter the information you want to have in the body of the message.
  7. Press Enter and type a single period (.)
If mail is working properly you will get a 250 2.6.0 infomration message and an email in your inbox.

Friday, December 14, 2012

Windows Hung Service

Today I had an issue where a windows service was stuck in a "starting" state.  Since this was an email server and the service in question was IMAP, doing a reboot wasn't a good option.  So i searched around and found this useful piece of information:

You can force kill an service if you know the services PID.
To get the PID, you can run the following to query the service and output them to a text file to make it easier to search.

  • sc queryex > C:\Running_Services.txt
Once the command completes, use a text editor (Notepad++) to find the service you are looking for.  You will see the Service Name, Display Name, and the PID.  Now that you know the PID, you can issue the following to kill the process.  For our example, lets say the PID is 12345
  • taskkill /PID 12345 /F

Now the process should be terminated, and a restart can be attempted.

Friday, November 9, 2012

BGInfo Useful Custom Strings

Recently I have been using BGInfo a bit more to get a better handle on what servers I am currently working on. Most of the time the standard definitions work well enough, but there are the few occasions when I want to show additional details or to hide information.

One such case that has come up often is when a server has multiple NICs, but only one is in use. BGInfo by default show all, so you have to add custom WMI queries to show only the info you want. I found a site that listed several useful queries as follows:

  • Active DNS - WMI Query - SELECT DNSServerSearchOrder FROM Win32_NetworkAdapterConfiguration where IPEnabled = 'True'
  • Active IP - WMI Query - SELECT IPAddress FROM Win32_NetworkAdapterConfiguration where IPEnabled = 'True'
  • Active MAC Address - WMI Query - SELECT MACAddress FROM Win32_NetworkAdapterConfiguration where IPEnabled = 'True'
  • Active Subnet Mask - WMI Query - SELECT IPSubnet FROM Win32_NetworkAdapterConfiguration where IPEnabled = 'True'
  • Manufacturer - WMI Query - SELECT Manufacturer FROM Win32_ComputerSystem
  • Model - WMI Query - SELECT Model FROM Win32_ComputerSystem
  • OS and Edition - Registry Value - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName
  • OS Architecture - WMI Query - SELECT OSArchitecture FROM Win32_OperatingSystem
  • OS Architecture XP2K3 - Registry Value - HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE
  • Workgroup - WMI Query - SELECT Workgroup FROM Win32_ComputerSystem

I also added one of my own to show the IIS version on the desktop:
  • IIS Version - Registry Value - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp\SetupString
Using these in combination with the predefined queries has allowed me to display all relevant information that I want.  

Tuesday, September 4, 2012

Enabling/Disabling NIC via Command line

I recently found that I need for my system to be on multiple VLANs at different times.  Now, my NIC supports this and it is fairly easy to do in Windows 7, but I wanted to make it easier.  To accomplish this I wrote a little batch file that simply enables or disables the network interface card via wmic.

The NIC is configured with the following commands:

  • To determine the index value (##)
    • wmic nic get name, index
  • To Enable
    • wmic path win32_networkadapter where index=## call enable
  • To Disable
    • wmic path win32_networkadapter where index=## call disable

I then have the batch file with a choice statement that allows me to select the option I want.

I found the original information on how to accomplish this task here.