Windows

Adding ^M characters in vi

November 25th, 2008

This is an obscure one. There are lots of Web pages out there to tell you how to get rid of ^M characters in text files (dos2unix is your friend) but occasionally you need to edit a settings file on UNIX server where the file is normally edited using a Windows client. If you don't add the ^M character at the end of each line, the lines will run together next time the file is viewed in Windows.

To add a ^M in vi enter Ctrl+V followed by Ctrl+M.

Leave a comment

 

Revealing Vista’s hidden Administrator account

November 25th, 2008    1 Comment

Windows always has an account called Administrator that is similar to root on a UNIX machine. Note: this special account has higher privileges than a normal administrator account (i.e. an account that belongs to the Administrators group) and sometimes you need to run programs as Administrator. Annoyingly, on Vista, the right-click menu option "Run as administrator" actually means "Run as an administrator" not "Run as the Administrator user". My colleague Colin Paterson has written a very useful application that allows you to actually run programs as Administrator. But first you've got to know Administrator's password.

By default you don't get to see the Administrator account in the Manage Accounts window, so you can't set the password for Administrator. So first up you've got to show this hidden account. Doing any of this assumes that you're logged on to the PC as a local administrator.

To show the hidden Administrator account:

  1. In the search box on the Start menu, enter:
    cmd
  2. Right-click cmd.exe in the list that is displayed.
  3. Choose Run as administrator.
  4. In the command console, enter:
    net user administrator /active:yes

That's it, your done. Refresh the Manage Accounts window and the Administrator account will show up. Now you can select it and set its password.

Leave a comment



Speeding up Windows Explorer in Vista

November 17th, 2008

I'm not particularly impressed by Vista, but on the other hand I've never been that bothered by it either. The way some people talk about it you'd think it was almost unusable. Of course it's not. The problem for Vista, I think, is that Microsoft made people wait and wait and wait for it and then when it finally came out it's (on the surface at least) not a whole lot different to Windows XP.

Windows 7 is getting some rave reviews after the recent PDC. Personally I'd just like Microsoft to fix Windows Explorer.

For me, the best thing in Vista is finding things from the Start menu. That's the way I start most applications now: Windows key, type the first few letters of the application you want, press Enter. The worst thing about Vista is that there are real problems with Windows Explorer. If you're on a network it can work like a dog. After pressing Windows key + E it can take over a minute before you can do anything in the Windows Explorer window. But I've discovered one way of speeding up Windows Explorer a little: remove your network drives.

Right-click on Network and choose Disconnect Network Drive and remove any drives that show up. This brought my start up time for Windows Explorer down to 18 seconds. Still an annoying delay, but just about bearable.

I should add that I suspect the problem I'm having has something to do with the fact that my work network runs on Windows NT, which is not supported for use with Vista. Because of this, my laptop is not part of the domain. If, like me, you update Windows as one of the first things you do with your new laptop, and you put SP1 on it, you won't be able to join an NT domain. If you're in this situation you should make sure you add your laptop to the domain before you add SP1.

Leave a comment



Ubuntu on Virtual PC

September 12th, 2008    4 Comments

I'm quite happy using Windows and don't see much appeal in Linux. I have not-so-fond memories of wasting lots of my free time in the past installing and configuring Linux. That was back in the days before graphical Linux installers, when getting a Linux distro to a usable state was a fiendishly complicated ordeal. So I don't have any particular love for Linux as an operating system.

However, it's occasionally useful to have a Linux machine available to test something out, and great way to do this is to use a virtual machine. VMware would be your first choice if you want a virtual Linux machine, but, with a little effort, you can also use Microsoft Virtual PC.

Here's how to get Ubuntu on Virtual PC:

  1. Download and install Virtual PC.
     
  2. Download an Ubuntu Desktop Edition ISO. I downloaded 8.04 ("Hardy Heron").
      
  3. Start Virtual PC, and create a new machine.

    (Video by Robert Cain: http://arcanecode.wordpress.com/)
      
    Note: Make sure to pick “Other” as the OS type.
    Give the machine 512 MB of RAM.
      
  4. Start the new virtual machine.
      
  5. When it starts up, go to the CD menu and choose Capture ISO image, pointing it at the desktop ISO you downloaded from Ubuntu. Capturing an image means the ISO file will show up like a CD in the virtual machine.
      
  6. Ubuntu will start running from the CD image. When it starts, choose your language and then, at the next screen, press F4 to select an alternate starting mode.
    ubuntu-install
      
  7. When the menu pops up, change to Safe graphics mode and press Enter.
    There is a problem with the mouse not working in Virtual PC and this takes a little fiddling about to fix it. There is also an issue with sound (see the link at the bottom of this post for details about how to fix that - personally I didn't need sound, so I didn't bother trying to fix that).
      
  8. Press F6.
     
  9. Edit the command that is displayed, using the arrow keys to move the cursor to the end of the line and adding a space followed by “noreplace-paravirt” (without the quote marks) to the end of the command, then press Enter.
      
  10. Leave the selected option as Try Ubuntu without any change to your computer.
    Note: do not choose the Install Ubuntu option.
      
  11. After Ubuntu loads (note that at this point it's just running from the CD image, it's not installed on the virtual machine) double-click Install on the desktop.
    This runs the Ubuntu installer.
      
  12. Follow through the installer. This part is very simple.
       
  13. Once the install is done, go back into the CD menu (right-hand Alt key gets the mouse pointer out of the virtual machine) and release the ISO, otherwise when you reboot you'll go back to the installation menu.
      
  14. Click the red button, top right of the Ubuntu desktop and shutdown the virtual machine.
    If it hangs at this point, don't worry about it.
      
  15. Close the Virtual PC window and choose to shut down the machine.
     
  16. Go into the Settings for the virtual machine.
    Robert Cain's video shows how to edit the Settings if you've never done this before:

     
  17. Make sure Networking is set to the network adaptor that your PC is currently using.
    Note: if you want to be able to connect to/from the Ubuntu VM and your host PC, you need to use the Microsoft Loopback Adaptor. If this doesn't show up in the list of network adaptors you'll have to install it first. This is really easy. See http://support.microsoft.com/kb/839013, or this video from http://veedee-eyes.com

      
  18. Save the Settings.
      
  19. Start up the virtual machine again.
      
  20. Once it gets to the "GRUB" line, press Esc.
    You should now see 3 entries to select from.
      
  21. Leave Ubuntu 8.04, kernel 2.6.24-16-generic selected and press e.
      
  22. On the next page, select the second entry that reads kernel /boot/vmlinuz… and press e again.
       
  23. You will see a command line that ends with “xforcevesa”. Edit this, as before, adding a space followed by “noreplace-paravirt” (without the quotes) at the end of this line, then press Enter.
       
    You are now back at the previous selection screen with the entry kernel /boot/vmlinuz… still selected.
      
  24. Press b and Ubuntu should boot correctly.
      
  25. Once Ubuntu has loaded, open a terminal window (Applications > Accessories > Terminal) and on the command line enter:
       
    sudu nano /boot/grub/menu.lst
     
  26. Enter your password and page down to near the bottom and locate “kernel /boot/vmlinuz…" in the “Ubuntu 8.04, kernel 2.6.24-16-generic” section.
      
  27. Move the cursor to the end of the line after xforcevesa and add a space followed by “noreplace-paravirt” (no quotes).
      
  28. Ctrl + O to write out.
      
  29. Enter to accept the name.
     
  30. Ctrl + X to close the file.
      
    Ubuntu should now be running inside Virtual PC.
      
  31. Click the network icon in the upper right side of the Ubuntu toolbar:
    ubuntu-network 
      
  32. Choose Wired Network.

That's it.

Now you can fire up an Ubuntu machine whenever you need it. And when you close it down, choose Save State and when you start it up again you'll be able to pick up exactly where you left off - for example, any programs that were running when you saved state will still be running when you start up the VM again in six months time.

I found the following site extremely helpful:

http://arcanecode.wordpress.com/2008/04/24/installing-ubuntu-804-under-microsoft-virtual-pc-2007/

If you get stuck, it's worth reading through all the comments on this page, which provide a lot of useful information.

Leave a comment



Task Manager shortcut

August 12th, 2008

Another useful keyboard shortcut:

Ctrl + Shift + Esc        Displays the Windows Task Manager

My morning routine when I'm working from home involves going into Task Manager and closing down everything I don't absolutely need to be running just to make working on a VPN ever so slightly more speedy.

Leave a comment



^ back to top ^

Page 3 of 1312345Older10OlderLast »