Educating the world

Our blog has over 10,000 readers a month

Repairing other people's computers

February 24th, 2011

Another thing that happens when you tell people you’re in I.T. is repairing their computer. Most people haven’t realised that computers are disposable consumer electronics. Wasteful though this is, if your computer breaks after 5 years then throw it in a skip and buy a new one!

Half of the trouble is that most people use a computer for a bit of email and a bit of web surfing and so having spent £400 5 years ago makes them reluctant to discard it. If they bought the same computer at today’s prices they would firstly be lucky to find one and if they did the person on eBay would be practically giving it away because it has no value.

The government lets you write-off a computer against tax in just 3 years, so any business should be buying new computers for its workers every couple of years! but they don’t, they just struggle along on outdated hardware. There is an issue with training that you get to avoid if you stick with the same machines, but then who wants staff that only knows how to use out-of-date technology?

One of the problems with Computer Repair is that of acquiring the parts. If your motherboard blows up then you may find that your motherboard specification is no longer available because it has been superseded by a better version. So now you need different memory as well and sometimes if you are really lucky your old power supply plug won’t fit your new motherboard, and so now you need a new case. In almost all cases it is the motherboard that blows up because novice users don’t hoover inside their PC’s and so over time the dust builds up, with constant heating up and cooling down creates a kind of glue which eventually causes a short on the motherboard and if you’re really lucky a fire! Dust builds up over heat sinks causing their efficiency to reduce considerably which also contributes to component failure.

All those components bought separately can work out more expensive then buying a new computer because don’t forget you are not only having to buy the new parts but also paying some guy in his bedroom to look for the suitable replacements and fit them which can actually take the most time and money.

Computer repairing does have several advantages. There is a case at one of my clients where their server has blown up after a power spike. We really needed to get the data off the server and because it is a Mac we have the security that we can just swap out the power supply without having to replace everything.

One thing worth mentioning is that when you send your computer in for repair the person doing the repair will probably rifle through all your files. For some reason they don’t see it as a personal private history of you they will be nosy and curious of what you have been up to. Unlike being under anaesthetic at a hospital where you can be pretty sure the doctor and his staff won’t bum you, your computer will be handed over to literally anyone with no checks or balances and if they see anything they don’t like then they could steal it or just call the police. The only way you can prevent this is if you watch them repair it. For some reason they are less inclined to rifle through your personal files while you are watching over them.

If you are worried about sensitive material you could take the hard drive out and explain to them that they can fix a hardware problem without it. The repairer will have to put one of their own hard drives in to boot it, but if they are a proper repairer outlet they will understand and will have everything they need. They may charge you a bit extra because it will be more hassle for them and it will take a bit longer to fix your PC …but it beats egg on your face when government secrets end up with the press, your company is exposed for poor customer security or you have to go to prison!

Recursive directory check-in using Clearcase

February 10th, 2011

It’s one of those fiddly things to recursively check-in an entire directory structure under Clearcase, and each time I do it I have to remember how. So I’m putting it into my long term memory here!

  1. Move to the parent directory of the directory you would like to check-in.

    cd c:\my\local\folder
    c:\my\local\folder> dir

    10/02/2011 14:58 &lt&#59;DIR> .
    10/02/2011 14:58 &lt&#59;DIR> ..
    10/02/2011 14:51 &lt&#59;DIR> dir_i_want_to_check_in
    19/01/2011 15:35 97 file_i_want_to_check_in.txt

  2. Pick a location to check-in to.
  3. Ensure that the folder you are checking-in to is itself checked-in.
  4. The following will check-in all files in the current directory:

    clearfsimport -rec -nset * Z:\path\to\dir

  5. The following will check-in the single specified directory in the current directory:

    clearfsimport -rec -nset dir_i_want_to_check_in Z:\path\to\dir

The -rec stands for recursive, so directories with all their contents will be checked-in.

The -nset stands for no set modification time. If this option is not set then only the Clearcase Administrator can check in the files because after the check in it modifies the time of the checked-in file to that of the original file. Changing the modification time of a Clearcase element requires Clearcase administration rights. To be honest I can’t think of a time when you are that bothered about the modification time of the file, so we nicknamed this flag the “make it work flag” :)

After you have checked everything in, you may want to update the permissions so that any executables can be run from a clearcase drive.

cleartool protect -rec -chmod 777 Z:\path\to\dir\dir_i_want_to_check_in

Windows 7 Growing Pains

February 2nd, 2011

I haven’t even got my own copy of Windows 7 yet. The I.T. department is rolling it out across the company and already my colleagues are complaining about its idiosyncrasies. Phrases like “What the hell is that green bar doing again?", “it keeps doing a different thing each time” and “there so much GUI I can’t actually see *my* stuff".

So I have started this article as blogglue to join together all the blogs, articles and links I will discover or write that tell you how to switch off or work around all the new “features” of Windows 7. God help us all - I am more seriously thinking of switching over to MacOS than ever before. Think I might start with a laptop (they are kind of sexy) and after all it is Unix underneath (queue coy smile).

A lot of these “features” exist in Windows Vista as well and may work there too.

Anyway here’s one I know I will need because it has made its way from Vista which is on one of my home computers :(

Remove Favorites, Libraries, and Homegroup from Navigation Pane
This is a real pane (get it?). Favorites and Libraries occupy quite a large proportion of the navigation panel in File Explorer. This means that when ever you load it in you always have to scroll down to the place you want. You can rarely get the whole thing in one panel without scrollbars. As soon as the scrollbars appear you need to make the panel wider because the ends of the folders are now hidden behind the scrollbars and the thing keeps shifting from left to right whenever you move around.

Where is Quick Launch on Windows 7

Automatically Expand Navigation Pane Tree to Current Folder in Windows 7
I’ve been trying to use the new Windows Explorer style of navigating around the directory structure but it makes it really difficult to compare directories. The biggest pain is that if you cut and paste a directory into the navigation bar at the top then the directory tree structure doesn’t expand out to display where you are in the file system. If you are comparing folders or have folders that are similar then you never know which one you are looking at. You also can’t hop between different folders in a random-access way, you either have to go forwards/backwards or think about where those folders live to expand them. I spent most of my explorer time synchronising the tree view with the file view.

How To Toggle the Navigation Pane with a Button in Windows Explorer

Update your SendTo list
Start -> Run, enter shell:sendto to open the SendTo folder; then just drag the applications you want into it.

Windows removes context menu entries when more than 15 files are selected
Strange one this! To stop us doing stupid things when large numbers of files are selected, Windows removes most of the “add-on” entries from the context menu. Nice idea in principle, but if you’re trying to add a load of source files to a source controller then you can’t.

Folder view is different even, though you have set them to be the same
Under Windows XP you would configure a folder just the way you like it and then go to Tools->Folder Options…, select the View tab then click the Apply to Folders button. From that point on your lovely settings would be used across all folders. This is not the same under Windows 7. If you read the Folder views title it says viewS and the blurb says “You can apply the view (such as Details or Icon) that you are using for this folder to all folders of this type“.
Windows 7 decides what class of folder it is and lets you create a viewing profile for how to view the contents of that folder. We are not sure how it decides, probably Microsoft Voodoo, or how you can find out what classes of folder you have. The up shot of this, is that if you have a all folders of pictures will show thumbnails and all folders of Word documents to show full details.
To make this work you must go to a folder and set it up the way you want and click through to the Apply to Folders button. You’ll have to do this for each of the folder classes individually.

Windows Explorer expands folders inappropriately, jumping the folder you expand to the bottom of the navigation pane
This is by far and away the most annoying bug I’ve found in Windows 7 so far. If you use the left hand directory tree to navigate your way around the filing system then you will definitely have noticed this bug. As you expand each of the tree branches the branch you have just expanded jumps to the bottom of the screen. So to navigate down a directory you have to expand, scroll the newly expanded directory back to the mouse pointer, expand the next folder down, scroll the newly expanded directory back to the mouse pointer. If you keep the folder at the bottom where it has moved itself you still have to scroll upwards because you can’t see the next folder to expand.
Just to show how much Microsoft listens to its customers there are 23 pages of requests to fix this on the Microsoft answers site spanning 2 years, with no official answer.
There is also an issue on Microsoft’s Connect site with a hundred people asking for this issue to be addressed.
There is however a list of work-a-rounds, one of which is to install ClassicShell which is a SourceForge project that, amongst other things fixes explorer and replaces the crappy new start menu with the old style one. Give it a go!

If you can’t find what you are looking for here, then try these pages:

Building Python 2.7.1 from sources with OpenSSL support under Windows win32 and x64

February 1st, 2011

With all projects we must create an area to place our sources so that we both have a frame of reference.

mkdir c:\python-modules

Next we must download the sources we need. First up is Python itself. Navigate to: Download the bzipped source tarball and uncompress it into c:\python-modules\Python-2.7.1 using 7-zip.

Next up we are going to download the pre-compiled OpenSSL development libraries (containing the headers, DLLs and libs) for the win32 and x64 platforms. So navigate to: Click Downloads at the top of the page and download the latest _WIN32 and _X64 which in my case is and Unzip them to C:\python-modules\openssl-0.9.8k_WIN32 and C:\python-modules\openssl-0.9.8k_X64 respectively.

The Python project has a funny directory structure so we need to merge the OpenSSL folders to keep it happy. Create a new folder just containing the openssl-ver i.e. without the platform name. Which in my case would be:

mkdir C:\python-modules\openssl-0.9.8k

Now we must copy the lib and include folders from the platform specific folders into the combined folder as a different name which incorporates the platform number. Windows batch copying commands are a joke (you seem to have to know in advance what the directory structure looks like before you can copy files into it) but here you go:

cd C:\python-modules
set OPENSSL_DIR=openssl-0.9.8k
mkdir %OPENSSL_DIR%\inc32\openssl
mkdir %OPENSSL_DIR%\inc64\openssl
mkdir %OPENSSL_DIR%\out32
mkdir %OPENSSL_DIR%\out64

xcopy /e %OPENSSL_DIR%_WIN32\include %OPENSSL_DIR%\inc32
xcopy /e %OPENSSL_DIR%_X64\include %OPENSSL_DIR%\inc64
xcopy /e %OPENSSL_DIR%_WIN32\lib %OPENSSL_DIR%\out32
xcopy /e %OPENSSL_DIR%_X64\lib %OPENSSL_DIR%\out64

Copying under Windows is so good, it’s easier to use explorer! Unless there isn’t anyone there because you’re running in a batch file. I digress.

Now that we have the directory structure that the Python builder desires we must change the Visual Studio project properties file to update the opensslDir property. The creator of the project files was using openssl-0.9.8l which wasn’t available in a pre-built binary for both our platforms. Load C:\python-modules\Python-2.7.1-win32\PCbuild\pyproject.vsprops into your favourite text editor and change the macro opensslDir to be the same name as your OpenSSL directory.

The Python Visual Studio solution tries to build OpenSSL from sources which is a bit bizarre so it has to use a combination of ms-dos batch files, python scripts and perl scripts in order to determine how to build OpenSSL. This creates a dependency on you having pre-installed python and pre-installed Perl. Why give yourself more work? OpenSSL comes in pre-built releases for win32/x64.

Now that we have got the ssl folders in the right places we can get rid of the pre-build option that requires Perl to be installed. I really do wonder what the project architects where thinking when they set it up this way.

“Let’s double the amount of work we must make everyone do by forcing them to build all the dependencies from source". “Ace and while we’re at it let’s add loads of dependencies so they have to install all kinds of extra stuff they are never going to use for anything else” ….what really?????? NO, No, No let’s use the other project’s pre-built development libraries so we can just compile against their stable versions. Sorry feeling a bit ranty today.

Now that we have re-organised the OpenSSL to use pre-compiled libraries we can remove all the dependencies in the Visual Studio solution that try and use Perl and build OpenSSL from source. Change to the C:\python-modules\Python-2.7.1\PCbuild directory and load _hashlib.vcproj and _ssl.vcproj into your favourite text editor. Remove all the VCPreBuildEventTool configuration Tool commands which refer to for all configurations (Win32|Debug etc).

In true windows fashion, you must shutdown Visual Studio and restart it by running the pcbuild.sln. This will pick up the new settings from the updated property files.

Set the Solution Configuration to Debug or Release and set the Solution Platform to Win32 or x64 for the desired build. From the menu select Build->Build Solution.

I selected win32 debug and ran the build. The build process creates all the intermediate files in Python-2.7.1\PCbuild\Win32-temp-Debug and placed all end product files into Python-2.7.1\PCbuild. I needed to build all the combinations of releases for our in house development and production releases on each of our supported platforms. So I need to run the build 4 times with Win32/Debug, Win32/Release, x64/Debug and x64/Release. After each build I need to copy the output files out of the PCBuild folder into somewhere else.

The win32 platform build, places intermediary build files into PCbuild/Win32-temp-[Debug|Release]/<proj> whereas x64 places everything on one level at PCBuild/amd64, presumably because their definitions where created by different people. Each build type however saves the deliverables into the same location, presumerably because this is where the installer creator picks them up from.

In order to build our product we need the python27.dll, python27.lib and python27.pdb for the Release versions and python27_d.dll, python27_d.lib and python27_d.pdb for the Debug versions for both win32 and x64. The easiest way to find them is by right-clicking on PCBuild selecting Search and entering


then you don’t need to hunt around for them &amp;#58;&amp;#40;

Between each build make sure you do a Build->Clean Solution to clean up any artefacts that may interfere with the build.

Well that’s 2 days I’ll never get back. Windows programmers should *really* take a leaf out of the Unix programmers book.

Text searching files with known extensions

January 25th, 2011

A while ago I wrote a blog article about Searching file contents under Windows XP. I was wondering why my searches of Visual Studio Project files with the extensions .vsproj, .vsprops and .sln files were coming back with no results. I read my previous article and noticed that it said “Index files with unknown extensions” and these files were known extensions. So this is another candidate for the Switching off Windows XP “features”.

There is a Microsoft Knowledge base article about this but both the solutions are inadequate. According to them you have to set a PersistentHandler for each known file extension that you want to search. A bit of playing and I figured out that if you set the PersistentHandler of the extension “*” then it becomes the default searcher.

So here is what you do:

  1. From the start menu, select Run and type regedit
  2. Navigate to: HKEY_CLASSES_ROOT\*
  3. Right click on the “*” folder and select New->Key
  4. When the folder appears set the name to PersistentHandler.
  5. In the right hand pane edit the (Default) data to {5e941d80-bf96-11cd-b579-08002b30bfeb}
  6. Click Ok

The GUID {5e941d80-bf96-11cd-b579-08002b30bfeb} points to the Plain Text persistent handler which in turn points to an InproServer32 which contains the query.dll.