Tuesday, December 23, 2008

OS X - Repair disk errors like invalid node structure

If you're an OS X user you may have run into a problem like this before. When you power on the machine it just sits on the Apple logo screen but won't get any further. Other boot up problems may be fixed by this as well. If you try to boot from the install CD and run disk utility to repair permissions or repair the disk, you may get an error such as invalid node structure or something similar that will cause the repair to fail. One solution to this is to reformat the hard drive, reinstall the OS, and then reinstall all the programs. This is time consuming, and you'll lose all of your data if it hasn't been backed up. Instead, there's something else to try that could solve the problem and you won't have to worry about reinstalling anything. You can manually run the Apple file system consistency check (fsck) and have it repair errors it finds. To do this you'll need an OS X install disk, which you should have gotten with the computer.

1. Put the install disk in the computers CD/DVD drive
2. Restart the computer
3. When it comes back on, hold down the C key on the keyboard to force it to boot from the CD
4. Once it gets to the point where the Apple logo is on the screen and the progress spinner has appeared and is moving underneath the logo, you can release the C key.
5. It will ask you which language you want to use, so select your language choice and continue
6. Don't continue with the installation from this point on. Instead, on the menu at the top I believe there is an entry for "Utilities" (or something like that). Click on it and go to Disk Utility. If that's not where it is, check the other menu options until you can find it
7. When Disk Utility opens, click on the hard drive partition that has the operating system installed, then click on Unmount at the top
8. Close Disk Utility
9. Go back into the "Utilities" menu (or wherever you had found Disk Utility) and open up the Terminal application
10. Enter the command diskutil list and press Enter. This will list all the partitions on the computer. You're looking for the name of the partition that contains the operating system files, which will most likely be disk0s2 or disk0s3. I think the defaults may be disk0s2 for Intel Macs, and disk0s3 for PPC Macs, but I'm not sure if that's correct which is why you should use the diskutil program to find it
11. Once you know the partition name, enter the command /sbin/fsck_hfs -yprd /dev/partitionName where you substitute the partition name that you found in step 10 for partitionName. This will run the HFS+ version of the file system consistency check on the partition you specified, and will repair and "normal" errors it finds while outputting what it's doing. You could use -ypr instead if you don't want to know what it's doing, but if you're like me you'll be curious to see what it finds. This step may take a while to run
12. After the fsck_hfs command is done running, you can close Terminal
13. Go back into Disk Utility
14. Click on the hard drive partition you unmounted in step 7, then click on Mount at the top
15. Now you could try running the Repair Permissions and Repair Disk within Disk Utility to see if you have any better luck
16. Close Disk Utility and restart the computer.

At this point your problem should be gone and the system should act normally. If not, then there is probably something much deeper wrong with the disk/partition and you may want to turn to professional help. There is always DiskWarrior too if you'd rather try another utility, but since that's not a free tool I'll leave it up to you. The only other thing I can think of is going into Startup Disk before restarting in step 16 and making sure that the computer is set to startup from the partition that you just fixed. Hopefully you'll never need this, but I actually used it this afternoon on a OS X 10.4 machine that Disk Utility wouldn't fix, and afterwards everything was fine. If you want to see the original article where I found this, click here. It's down in the comments because the original poster has something about cloning drives which you can hopefully avoid with this other solution. Good luck!

UPDATE: 6/30/14

It's been over 5 1/2 years since I published this article, and it still is the most popular for comments. I'm glad it has helped so many people and hope it continues to.

A lot has changed in that time though, and it would be even better to avoid the problem by having backups of your data. It is usually such a pain to keep up with backups. Plugging in a USB drive, waiting for the backup to finish, blah blah blah. I have problems with it on my personal machines because it ends up taking too much time and is a hassle. When you run into an issue like this though you realize just how important it is to have those backups.

The reason I'm adding this to the article is because I've started using an application called CrashPlan for offsite backups for business and am very happy with it. So much so that I may just bite the bullet and start using it for my personal machines too. I'm not affiliated with them in any way and am just a happy customer willing to promote their product of my own accord because I have this article and web traffic. There are other similar paid services out there (Mozy, Carbonite, etc), and some free options with a set amount of storage (e.g. Dropbox). If you're reading this article it's most likely because you've experienced some sort of failure with data loss and are probably in a mild panic if you didn't have a backup. These cloud-based services are good options that run all the time without the typical hassle, and will help you avoid that feeling of panic thinking you lost all your photos, work, or whatever else it was on your hard drive. Definitely do your own due diligence on them to find the right one for you.

The much wider adoption of cloud-based services over the past 5+ years and a severe reduction in the cost to utilize those services make them a very viable option for you and I to protect our ever important data.

Thursday, December 18, 2008

Move Blackberry Enterprise Server to a new server

It took a little while for me to dig this up, so I thought I'd post the link here. I needed to know how to migrate our BES server to a new server within a virtualized environment. Blackberry's instructions for performing the server migration weren't too difficult, and I even did it in the middle of the day without any Blackberry users even noticing. You can find the instructions here. In the instructions there is a step to backup and/or restore your BES data too, just in case you were wondering how to do that.

Tuesday, December 16, 2008

Outlook attachment removal macro

You can remove attachments in Outlook simply by opening the message, right-clicking the attachment, and choosing remove. This won't work in the preview pane, but will when the message is open. Another option is to setup and use this macro, which will remove all attachments (including embedded ones) and leave their file names so you can more easily find them later. You can add it as a button to your Outlook toolbar, and just click on it whenever you need it. I use it quite a bit to keep from having attachments all over, and originally found the information here. You can even remove attachments from multiple messages with a single press of the button. Here are instructions and the code for doing this in Outlook 2003. I use it in Outlook 2007, but the setup steps may be slightly different:

1. Go to Start->All Programs->Microsoft Office->Microsoft Office Tools->Digital Certificates for VBA Projects
2. You will be asked to name your certificate. This name can be whatever you choose, as long as you remember what you pick. Something such as “remove” or “attachment” are two options that will make it easier to find when you need it. You should get a notification that the certificate was created successfully.
3.  Now open Outlook. Go to Tools->Macros->Visual Basic Editor.
4. In the top left, in the Project area, expand “Project1”, then expand “Microsoft Office Outlook Objects”. This should give you “ThisOutlookSession”. Double-clicking on “ThisOutlookSession” should open a text input window to the right.
5. Now, copy the text from the bottom of this post, starting with "Public Sub Strip()" to the "EndSub" at the very bottom.
6. Go back to “ThisOutlookSession”, click in the input box, then press Ctrl+V (paste the text you copied into this box). This will fill the input box with the text that had been in outlook.txt.
7. Now go to Tools->Digital Signature… In the “Sign as” section, select Choose. Here you should see the certificate you created in step #2. Select it and click OK. Now it should appear in the “Certificate Name:” area. If it does, press OK.
8. Go to Debug->Compile Project1. This will make your macro into a working program. You won’t notice it doing anything, but it is. After clicking Compile, go ahead and exit the Visual Basic editor. This will bring you back to Outlook. If asked to save changes, choose yes.
9. Now you need to add the button to your Outlook window. To do this, go to View->Toolbars->Customize. Choose the Commands tab, then go to the Macros category. Here you should see your macro. Click on it and drag it to an active toolbar.
10. That’s it. Now when you have an attachment you no longer need, but you’d like to retain the email simply go to that email and click the button you just added. It will ask if you’re sure that you want to delete the attachment. Click OK and there you go.

Public Sub Strip()
    Dim objOL As Outlook.Application
    Dim objMsg As Object
    Dim objAttachments As Outlook.Attachments
    Dim objSelection As Outlook.Selection
    Dim i As Long
    Dim lngCount As Long
    Dim strFile As String
    Dim strFolder As String

    Dim result

    On Error Resume Next
    result = MsgBox("Do you want to remove attachments from selected email(s)?", vbYesNo + vbQuestion)
    If result = vbNo Then
        Exit Sub
    End If
    ' Instantiate an Outlook Application object.
    ' Set objOL = CreateObject("Outlook.Application")
    Set objOL = Application
    ' Get the collection of selected objects.
    Set objSelection = objOL.ActiveExplorer.Selection
    ' Check each selected item for attachments.
    ' If attachments exist, save them to the Temp
    ' folder and strip them from the item.
    For Each objMsg In objSelection
        ' This code only strips attachments from mail items.
        If objMsg.Class = olMail Then
        ' Get the Attachments collection of the item.
            Set objAttachments = objMsg.Attachments
            lngCount = objAttachments.Count
            If lngCount > 0 Then
            ' We need to use a count down loop for
            ' removing items from a collection. Otherwise,
            ' the loop counter gets confused and only every
            ' other item is removed.
                strFile = ""
                For i = lngCount To 1 Step -1
                ' Save attachment before deleting from item.
                ' Get the file name.
                    strFile = strFile & objAttachments.Item(i).FileName & " - " & vbCrLf
                    ' Save the attachment as a file.
                    objAttachments.Item(i).SaveAsFile strFile
                    ' Delete the attachment.
                Next i
                  strFile = strFile & " - ATTACH REMOVED - " & vbCrLf & vbCrLf
                Dim objDoc As Object
                Dim objInsp As Outlook.Inspector
                Set objInsp = objMsg.GetInspector
                Set objDoc = objInsp.WordEditor
                objDoc.Characters(1).InsertBefore strFile
                ' objDoc.Save
                objMsg.HTMLBody = strFile + objMsg.HTMLBody
            End If
            strFile = strFile & vbCrLf & vbCrLf
        End If
    Set objAttachments = Nothing
    Set objMsg = Nothing
    Set objSelection = Nothing
    Set objOL = Nothing
End Sub

Monday, December 15, 2008

Resize a hard disk within VMware Server

If you use VMware at all, and are like me and try too hard to save disk space, you've probably run into this before. You create a virtual machine with a small hard drive, and sooner than later you realize that you need more space available. It's a good thing that there is a pretty simple fix to that problem using some command line utilities that come with VMware server.

1. Stop your virtual machine. It can't be running while you do this.
2. Commit or remove any snapshots you may have
3.  Open a Windows command prompt
4. Use the command cd "C:\Program Files\VMWare\VMWare Server" and press Enter
5. Use the command vmware-vdiskmanager -x 12GB "My harddisk.vmdk"

That will expand the disk to however many GB you specify. Also, be sure to replace "My harddisk.vmdk" with the full path and name of your virtual disk.

Now that your disk is extended you'll have to use something like Partition Magic, or just diskpart.exe that comes with Windows. However, to use diskpart, you'll have to mount your newly expanded drive in a second virtual machine since it won't allow you to extend a boot volume directly. For more info on how to use diskpart.exe, see my earlier post here.

The original post that I found that contained most of this info can be found here

Update: If you're using VMWare Infrastructure Client and ESXi, there's a different method for resizing. The trick is to make sure your disk is set to Independent mode, with the Persistent option selected. Then you can the Shrink tab in your VMWare tools within your VM to resize the disk. One thing to note is that you can not use this method if there are any snapshots saved. You'll have to delete them before shrinking the disk, but that's all detailed in the VMWare article.

Anyone else's browser freezing a lot lately?

In recent weeks I've noticed that Internet Explorer and Firefox both have been freezing or crashing a lot. Has anyone else been running into the same issue? Before you jump to conclusions and blame it on spyware or a virus, this problem is happening on 3 different computer. Internet Explorer 7 has been freezing randomly, and Firefox has been crashing randomly. I haven't seen as many problems using Google Chrome, but it's also not fully compatible with all webpages that I view either (works for most though). For the most part they'll work fine, but the pages that seems to be causing the most problems for IE and Firefox are Hotmail, MSN, and Yahoo! I'm not overly worried about it yet, but in case I'm not the only one out there having these problems I thought I'd try a post to see if I get any other feedback.

For any of you who run across this post looking for help removing an actual virus or spyware, check out my earlier post about spyware here and viruses here

Sunday, December 14, 2008

Hibernate option disappears in Windows Vista

I've been having some problems where the Hibernate option disappears from my Start menu, and I tend to use it a lot. It's actually a pretty simple fix, but it's still annoying to have to do.

1. Run the Command Prompt as the administrator. To do that, right-click the program icon and choose "Run as administrator"
2. In the command prompt, type the command "powercfg /hibernate on" and press Enter

That's all you should need to do. Check MS KB929658 for more info

Thursday, December 11, 2008

Allow meeting time options in Outlook

I'll start off by saying that this functionality is not built into Outlook, so it's more of a workaround than anything. You can create an appointment, export it to a file, then attach it to an email. If you do this for all the possible times you want to allow for the appointment, then attach them to an email, it will allow the users to select their desired meeting time from the attachments as if it was a meeting request. To do this

1. Create the appointment and invite required attendees, resources or yourself
2. Send the request. This way you'll be able to keep track of it, and will also have an appointment to export
3. Open the appointment from your calendar, then go to File->Save As
4. Save the appointment as an .ics file. It's a good idea to somehow incorporate the meeting time and/or date into the file name to make it easier to keep track of it.
5. Repeat steps 1-4 for each additional meeting time you want to allow users to choose from
6. Compose an email to those you want to give the meeting time options to and attach all of the .ics files you created for the meeting.
7. Send the message

When the recipients accept the meeting request, you'll receive a response like usual and the meeting will be added to their calendar. The appointment will also be updated in your calendar to show anyone who has accepted as an "Optional" attendee.

Like I said, this is a workaround. If you must allow time or date options for Outlook meetings, at least this will let you. If you want to see the original post where I found this, it is here

Wednesday, December 10, 2008

Windows Vista virtualized folder location

After having problems finding this in a search, I thought I'd create a post for it. If you've downloaded something in Vista, and then couldn't find it aftewards, it's likely stuck in the virtualized desktop folder. This is in place for security reasons, but I'm not going to get into them here. The only way I've found to access this location is to manually type the full path into either the Run command, or put it in the Explorer address bar. The full path is:

C:\Users\ADMIN\AppData\Local\Microsoft\Windows\Temporary Internet Files\Virtualized

But you'll want to replace "ADMIN" with your username. If you do use the Run command for this, be sure to put it in quotes. The spaces in the path will cause an error otherwise.

The original post that provided the answer can be found on TechNet.

Tuesday, December 9, 2008

Free Microsoft Accounting 2009 software

Microsoft is giving away its Office Accounting Express 2009 software for free. I haven't used it yet, but I'll probably give it a try. I'm guessing it's an alternative to Quicken and other types of financial management software. If you want to download it, or just want more information, you can find the website at http://www.ideawins.com/downloads1.aspx. I wasn't so sure it was actually legit when I first came across it because of the ideawins.com name, but it is. If you want to double-check, go to the actual Microsoft Office page for Accounting Express, then click on "Download Accounting Express 2009 for free". It asks for a valid email address, but that appears to be it. Give it a shot and let me know how it works, and perhaps how it compares to other financial software you've used in the past.

Sunday, December 7, 2008

VPN connection problems in Windows Vista, error 609

I have a PPTP VPN connection set up on a Fortigate 60 firewall, and it had worked fine when everyone was using Windows XP. Then I got a laptop that had Windows Vista installed. Things were fine in the beginning, and then all of a sudden the VPN didn't work anymore. I would try to dial in, but it would fail right away saying a connection couldn't be established. I knew it was working though because other users were still using it, and I was able to connect with the Windows XP install I had running through Microsoft Virtual PC. I deleted and recreated the VPN connections with no luck. I checked the firewall configuration and couldn't find anything out of the ordinary. Searching the Internet didn't do much good for a while either. I finally found the answer tonight when I got an error 609 "A device type that was specified does not exist". It gave me something to search on, and sure enough it led me to something that fixed it right away. Apparently it can be caused by L2TP or PPTP not being installed, or else it's corrupt. There are foud small commands you can use from the command prompt to fix this. Open the command prompt, then enter and run these four commands in order:

netcfg -u MS_L2TP
netcfg -u MS_PPTP
netcfg -l %windir%\inf\netrast.inf -c p -i MS_PPTP
netcfg -l %windir%\inf\netrast.inf -c p -i MS_L2TP

This will reinstall PPTP and L2TP support on your Vista computer, which will then allow you to use those protocols. For more information, or to see the original source, check out Microsoft KB 953795.

Tuesday, December 2, 2008

Redirect folders in my documents for personal Windows computers

This can be done using Group Policy in an Active Directory environment, but if you just want to redirect the folders found in your user profile, you can do that to by modifying the registry. The registry is a very important software piece of the computer, so be careful when changing it. Or use the TweakUI for XP power toy provided by Microsoft, which is a little more GUI/user friendly for those who aren't as experienced with the registry.

1. Go to Start->Run, type regedit, and click OK. This will start the registry editor
2. The registry keys you're looking for are located under HKEY_CURRENT_USER->Software->Microsoft->Windows->CurrentVersion->Explorer->User Shell Folders (just "Shell Folders" in Vista)
3. Find the folder(s) you want to change and double-click on it
4. Paste the full folder path to the new location where you want the folder to be redirected to
5. Click Ok

Depending on your version of Windows, you'll have different options. I'm running Windows Vista right now and there are ~20 different folder locations I could change, ranging from the Fonts and Cookies, to My Music. 

I don't mess around with this much, so redirect at your own risk. If you want more info from Microsoft, check out KB 242557

Move iTunes music folder

You may have come across the problem of running out of space on the hard drive your iTunes are stored on, maybe you have it installed on a work computer and your files are actually on a network drive, or maybe you want to move your music to a completely new computer. Whatever the reason, sometimes it would be nice to be able to move where your iTunes are located. There used to be a registry hack to do this, but it appears that in newer versions of iTunes (at least since v7, maybe even in v6) they've made it much simpler. One thing to note up front is that you shouldn't mess with moving the actual library files, just the music files. I'm not saying it can't be done, but it's listed as something to read more about in the Apple how-to articles below.

For Windows

1. Open iTunes.
2. Go to Edit->Preferences.
3. Go to the Advanced tab, then the General tab within it
4. Make sure the "Keep iTunes Music folder organized" checkbox is checked
5. Click the Change button to the right of the iTunes Music folder pane
6. In the window that appears, navigate to the location where you would like your new folder to be created, or where your previous folder already exists. Select it and Click OK
7. Click Ok to exit the preferences
8. Go to File-> Library->Consolidate Library iTunes 8 or choose Advanced-> Consolidate Library for iTunes 7
9. You'll see a warning message, which you can ignore. Click the Consolidate button
10. That's it. You can go trash the original iTunes music folder if you'd like, but remember to be careful about removing the iTunes library files as stated above

For Mac

1. From the iTunes menu, go to Preferences
2. Go to Advanced
3. Check the "Keep iTunes Music folder organized" box
4. Click Ok
5. Repeat step #1 and #2
6. Click on the Change button to the right
7. Navigate to the new iTunes music folder location you want to use
8. Click Open
9. Click Ok
10. Go to File-> Library->Consolidate Library...
11. You'll see a warning message, which you can ignore. Click the Consolidate button
12. Just like #10 for Windows, that's it. You can go trash the original iTunes music folder if you'd like, but remember to be careful about deleting the iTunes library files as stated above