Home » Archive by category "Windows" (Page 8)

HP DV7-1210ed boot from 2nd HDD

Yesterday I installed a SSD drive in the 2nd HDD bay of my HP Pavilion DV7-1210ed laptop. Installation of Windows 7 went fine and after I had moved all important data from the original HDD I decided to format that disk so I could use all of its storage space. But as soon as I did that I was unable to boot into Windows that was installed on my SSD (2nd HDD bay).

I was getting errors about winload.exe and something about an incorrect digital signature for the file. Turns out it was loading the bootloader from the recovery partition from the HDD in bay 1, which was actually for the old Windows installation.

Looking into the BIOS of this laptop I couldn’t tell it from which disk to boot first. With Acronis Disk Director I was able to make the SSD bootable by setting the active-flag on it. When booting the laptop I could press F2 and then F9 to select from which HDD to boot. It would boot into Windows 7 again. This still wasn’t a solution, as it requires you to interrupt the boot sequence every single time you fire up the machine.

Again with Acronis Disk Director I decided to flag the recovery partition on the HDD in bay 1 as active. Then I booted into the Windows 7 recovery console using the installation disc and ran the following command.

bcdboot d:\windows /s c:

In this example d:\windows is the location of the installed Windows 7 on the SSD in bay 2. The flag /s c: tells it to install the boot files into the c: partition, which was the recovery partition on the 1st HDD.

Just to be sure everything will boot again also execute the following commands.

bootsect /nt60 ALL /force
bootsect /nt60 ALL /force /mbr

Hopefully this helps you out when removing Windows from the HDD in bay 1 as it’s impossible to change the HDD boot order in the BIOS of the HP Pavilion DV7-1210ed. I later found out about EasyBCD which seems to make this a lot easier to do.

Sharing my mouse and keyboard on multiple machines

Whenever I want to do some paid work I have to do this on my laptop. I have a nice (well, sometimes we argue) 17″ laptop with a screen resolution of 1440*900 which is fast enough to run all the software I need (although Vim does play up at times…). The reason I have to use my laptop for this is because it has a VPN client configured, network drive mappings and some other stuff related to my job.

I unfortunately only have 1 decent workplace at home to comfortably work at and it’s occupied by my desktop PC, its keyboard, mouse and a Full-HD 24″ monitor. Sure, I can get work done from the couch and there’s also a small table in the living room, but both aren’t really comfortable spots to work for a longer time. Besides, working at a Full-HD resolution gives me more space to work with than when I’m on a 1440*900 resolution. So my aim was to find a solution on how to share my mouse and keyboard on multiple machines.

Since my 24″ monitor had a spare HDMI input and my laptop has a HDMI output I wanted to connect my laptop to the 24″ monitor through HDMI. VGA and DVI weren’t an option for me since those were already occupied (VGA by my Xbox 360, DVI by my desktop PC). The added benefit from using HDMI would be having the sound from my laptop through the speakers of my 24″ monitor.

After searching for a couple of hours I couldn’t find any nice hardware solution. Sure, KVM cables with 2 USB connectors for your mouse and keyboard are available, but also come with VGA connections which, as far as I’ve been told, have to be used for it to function. Other dedicated hardware for sharing 1 USB device with 2 or 4 computers also exist, but meant I had to buy 2 of them.

Having wasted a couple of hours I finally gave up on it. A couple of days later I remembered a software solution existed as well. Within a couple of minutes on Google I found what I was searching for: a project called Synergy. Synergy is a very nice piece of software, which you can get for free, is open-source (GPL) and runs on Windows, Linux and Mac OSX.

Basically you’ll install Synergy on all systems you want to use your keyboard and mouse on (yes, systems, it supports multiple systems!). You run a server instance on the system which has the keyboard and mouse connected you want to use. The other systems simply run a client instance. When connected you can move from one computer to the other by simply moving the mouse to the other computer. Added benefit is that if you copy something to your clipboard on PC 1 and move the mouse to PC 2 the clipboard its content is available on that system as well!

My only complaint with it is that the initial setup was a bit confusing. It does have a graphical user interface but if you’re not used to the software it’s hard to figure out how to configure it. Another more annoying issue I’ve run into was that at some time Synergy (or my OS) switched keyboard language which couldn’t be changed. Only solution for that was to reconnect the client.

Aside from that I’m very happy with this solution. I can now do my paid work behind my 24″ monitor using the keyboard and mouse that are connected to my desktop PC. So all I have to do now is connect my laptop to my monitor through HDMI, start the Synergy server and client and change the display input on my monitor to see my laptop’s desktop.

Using Perl-Tidy with Notepad++

I was looking for a way to use Perl::Tidy with Notepad++ so I can format my Perl code from within Notepad++. Luckily for me someone else already figured out how to do this properly. I just had to modify a few small things to make this work for my needs.

My environment is a Windows Vista SP2 system with Strawberry Perl 5.12.1. Thanks to Strawberry modifying the system PATH I don’t need to configure this myself. After installing Perl::Tidy I can just call the perltidy command from the command-line. But for some reason calling the perltidy directly from within NppExec doesn’t work.

First, you need a .perltidyrc, or rather on Windows a perltidy.ini. I don’t really know why this has to be different, probably because it sometimes can be a pain to create a nameless file (meaning, a file with only a extension). Here’s my perltidy.ini file which I installed under C:\Users\<USERNAME>\perltidy.ini. I’ve actually shamelessly stolen this configuration from Mojo.

So following the earlier mentioned blog post this is what I changed to make it work for me.

  1. Change the command-line in NppExec to the following:
    perl -x -S perltidy "$(FULL_CURRENT_PATH)"
  2. Do the Advanced Options part
  3. Now create a Macro: for some reason this doesn’t work?

    1. Start recording
    2. Go to Macro > Execute your newly added perltidy macro
    3. Go to File > Reload from Disk
    4. Stop recording
    5. Save Macro and assign a shortcut to it

Now I wanted to be able to fire this off with a key shortcut, but I can’t add those to macro’s created with NppExec. So instead I tried to create a macro that executes the perltidy macro and then reloads the file from disk. But when executing this macro nothing happens. So if anyone has an idea to why this is I’d be glad to hear it.

For now this manual execution will work just fine. It’s just annoying that I’ll have to reload the file from disk manually.

Excellent collection of Ubuntu 10.04 server guides

Wanted to share that Rackspace has an excellent collection of configuration guides for Ubuntu 10.04 server. Aside from Ubuntu they’ve got guides for every other big Linux distribution as well, such as Fedora, Red Hat, Debian and CentOS. I don’t use those distributions myself but thought it would be nice to mention it. Check their List of Articles for a complete list of Linux distributions. Aside from Linux they’ve also covered Windows Server 2003 and 2008.

Serving files with Apache on Windows from a network drive

After I installed Zend Server CE today I had to configure Apache to serve files from a shared network drive. Although these have been given a drive name serving files from it with Apache fails to work.

By default Apache under Windows (or generally any service) is being executed as a local user. This user doesn’t have network rights, and normally shouldn’t have any. But in my case it should. So to get this all working I opened the Windows administration tool for services and modified the Apache service to be run as some other user, in my case DOMAIN\username.

After having done that I configured my Apache configuration to serve files from a shared network drive. To my surprise it still didn’t work and my path was correct… For Windows that is. Windows use the backward slash, for example, \\MYSERVER\Projects\example.com. But for this to work with Apache you have to substitute the backward slashes with forward slashes, like this: //MYSERVER/Projects/example.com.

If you do this all should be well and you can serve files from your network through your locally installed Apache.