Thursday, July 18, 2013

One minute Windows 7 boot delay

I was recently upgrading my primary boot disk in my desktop PC (upgrading from an OCZ Vertex2 to a Samsung 840 Pro SSD) and after the usual exercise, I found an odd problem.

During bootup, the system would hang on the "Starting Windows" screen (the throbbing windows logo) and pause for about one minute. After this delay elapsed, my KB would then initialize normally, and the boot splash screen would disappear and normal bootup would take place.

After a lot of trouble I discovered the following were not the source of the problem:
  • Rolling back recent Windows Updates
  • My new SSD disk (vs. the old one)
  • SSD settings in WIndows
  • SSD drive firmware
  • AHCI settings in BIOS/Windows
  • MS AHCI drivers vs. AMD AHCI drivers
  • BIOS disk boot sequence
  • Removal of my SATA DVD-RW drive
  • Hibernation and Pagefile settings and systems

I list these here because they include most of the usual suspects to investigate when trying to solve boot delays.

In the end, the solution was simple. I had to unplug my external Thermaltake BlackX eSATA disk dock.

I had plugged it in as part of my boot disk cloning (I use TrueImage) and hadn't removed it. When it was connected but with no disk in it, it caused the system boot hang.

I don't know for sure, but I'm guessing it was causing some 60-second AHCI disk command/discovery to timeout during boot.

Thursday, July 4, 2013

Sventon 2.5.1 with SVN server 1.7+ to view/download files

The Sventon tool is a useful web interface to allow browser access to Subversion/SVN data repositories.

It is particularly useful when your repositories are not hosted with Apache, and you want to give some level of read/view access to data in your repository without requiring the installation of a tool like TortoiseSVN.

While useful, Sventon v2.5.1 hasn't changed in a few years, and unfortunately is not fully compatible with Subversion servers running engine 1.7 or later. In particular, while most aspects work, viewing the actual contents of a file in the repository causes an error "Cannot get contents of file".

The problem is that Sventon includes a copy of the SVNKit library 1.3.4, and this version unfortunately has a bug uin it, which means certain types of requests to the SVN server no longer work (for security reasons, server 1.7 adds additional checks and verifications and rejects the slightly erroneous requests from Sventon/SVNKit 1.3.4.)

Luckily, the solution is quite simple. While Sventon hasn't been updated, it's relatively simple to manually upgrade SVNKit from 1.3.4 to verison 1.3.8, which corrects the bug and works fully with SVN server 1.7 and 1.8.

So to solve the problem:

  1. Back up your working Sventon deployment, configuration, and cache, just so you can revert if needed.
  2. Download SVNKit 1.3.8 (I avoided and have not tested SVNKit 1.7.9)
  3. Shut down your application server (Tomcat6, etc) or at least stop the /svn application.
  4. Copy all files from the 1.3.8 /lib directory, into the lib directory for your Sventon deployment (e.g. webapps/svn/WEB-INF/lib)
  5. Remove all duplicate prior versions of JAR files from that Sventon deployment that were replaced with newer equivalents from SVNKit 1.3.8 vs. 1.3.4:
    • svnkit-1.3.4.jar (replaced by 1.3.8)

    • antlr-runtime-3.1.3.jar (replaced by 3.4)
    • jna-3.2.2.jar (replaced with 3.4.0)
    • sequence-library-1.0.0.jar (replaced by 1.0.2)
    • sqljet-1.0.3.jar (replaced by 1.1.2)
    • trilead-ssh2-build213-svnkit-1.3-patch.jar (replaced with 1.0.0)
  1. Create an equivalent svn.war that includes the same changes as above.
  2. Restart Tomcat/Sventon and verify functionality.

Using this approach, you should be able to fully use Sventon 2.5.1 on newer Subversion servers based on SVN 1.7 and 1.8!

Important Note: it may be possible to just upgrade WEB-INF/lib/svnkit-1.3.4.jar to svnkit-1.3.8.jar, but I haven't tested that. I chose to update all the libraries that SVNKit ships with, and have not seen any problems in doing so.



Friday, November 16, 2012

A shortcut to launch a recent download

When download files in a browser, I prefer to save all the files to a specific location instead of allowing the browser to "open" the file. This means that to invoke the download I have to go to an Explorer window or command prompt and manually select/run the file.

So I chose to create a shortcut on my Quick Launch (yes I still use it in Windows 7) to automatically launch my "most recent download".

This isn't a particularly complex task or hard to figure out, but I thought I'd document it here anyway. There are probably better ways to do it too, but I'm most familiar with Windows Batch approaches to automation.

Step 1: Write a Batch File

I created a NEW_DOWNLOAD.BAT file and placed it on my system somewhere. The contents are:

@echo off

call :latest e:\download\*.exe ^
             e:\download\*.rar ^
             e:\download\*.zip ^
             e:\download\*.pdf

if "%LATEST%"=="" goto :eof
echo E:\DOWNLOAD\%LATEST%

if "%1"=="" "E:\DOWNLOAD\%LATEST%"
if not "%1"=="" copy /y "E:\DOWNLOAD\%LATEST%" "%1"
goto :eof


:latest
FOR /F "delims=" %%I IN ('DIR %* /B /O:-D') DO (
   SET "LATEST=%%I"& goto :eof
)
goto :eof



Basically what this does, is search my E:\DOWNLOAD folder for all .EXE, .ZIP and .RAR files, and launches the most recent one. You could add additional file types here if you wanted to.

Step 2: Add a Shortcut

I added a shortcut to NEW_DOWNLOAD.BAT and placed it on my Quick Launch bar. I configured it to launch Minimized, and gave it a custom icon from SHELL32.DLL to distinguish it. I also added a keyboard hotkey for the shortcut (CTRL-SHIFT-L.)


Step 3: Set it and Forget it

Now, when I download something, I just click on the Quick Launch shortcut or press my keyboard hotkey, and automatically my most recent download starts running.


For reference, I use a similar script now to "Display the most recent PDF file" in another folder, in combination with CreatePDF as my default print driver, to print/save and verify document output.

Tuesday, September 4, 2012

Linux "Welcome to GRUB" hang on IBM x3200 Server

I recently had to migrate a working linux/debian server image over to a "new" machine, an IBM x-Series M3 x3200 (machine type m/t 4362-PAT.)

Normally server installations of Linux are decent about body transplants across the same architectures, so I was surprised to find that the disk wouldn't boot on the new system.

The symptom was a very slow display of "GRUB" then "GRUB loading" then finally a hang on the "Welcome to GRUB" screen.

The first thing I did was boot on the Debian netinst CD for my install and choose the rescue option, and re-install GRUB onto the boot partition, but this did not fix the problem.

After further research, I cam across this post which suggested the cure to my problem: I needed to disable the graphical mode for GRUB and only use the traditional console mode boot. On my system, this was done by editing the file /etc/default/grub, and enabling the following setting:

# Uncomment to disable graphical terminal (grub-pc only)
GRUB_TERMINAL=console                               

After making this change, the system boots like a champ!

Monday, August 13, 2012

A canonical list of Windows service names for antivirus and antimalware tools

I had a need to modify some code to check for the presence of a range of anti-virus and anti-malware tools running as a service on a Windows system.

As a background, my purpose was to find different AV services and, if multiple AV tools are starting up and running, to delay an operation until the services had finished initialising (ie, in the RUNNING state.)

As part of this exercise, I could not find a list of Windows services names for the common anti-virus tools available [let me know if you know where one is!] So while the information is not too hard to dig up for each tool, I decided to document this list here for future reference.

  • symantec antivirus:: Symantec Endpoint Protection
  • mcshield:: McAfee Security
  • windefend:: Windows Defender
  • msmpsvc:: Microsoft Security Essentials
  • msmpeng:: Microsoft Security Essentials
  • savservice:: Sophos Antivirus
  • aveservice:: Avast!
  • avast! antivirus:: Avast!
  • immunetprotect:: Immunet Protect
  • fsma:: F-Secure
  • antivirservice:: AntiVir
  • avguard:: Avira
  • fpavserver:: F-Protect
  • pshost:: Panda Security
  • pavsrv:: Panda AntiVirus
  • bdss:: BitDefender
  • abmainsv:: ArcaBit/ArcaVir
  • ikarus-guardx:: IKARUS
  • ekrn:: ESET Smart Security
  • avkproxy:: G Data Antivirus
  • klblmain:: Kaspersky Lab Antivirus
  • vbservprof:: Symantec VirusBlast
  • clamav:: ClamAV
New additions:
  • SBAMSvc:: Vipre / GFI managed AV
  • navapsvc:: Norton
  • AVP:: Kaspersky

Note that this is a reference to the Windows "Service name" value for the tool, as opposed to the Display name or Executable/Process name.

Many of these are based on web searches and information found online and have not been verified personally. Certainly, this list is by no means complete or guaranteed accurate!

If I receive corrections or additions to this list or need to extend it, I will edit this post!


Thursday, July 12, 2012

Windows does not use my VPN connection DNS!

I have  problem on one of my systems where I frequently use my VPN connection to link to the office. The problem is that the DNS resolution always seemed to go through the main WAN connection system, and never defer to the VPN connection DNS servers.

It may be related to newer WAN DNS that return results and do web redirection for "unknown" connections, instead of returning no match.

After some basic searching, I cam across this post that had a solution:

Force Windows to Use a VPN's DNS Server

Going through these instructions solved my problem. I am running Windows 7 x64 and the solution took effect immediately upon restarting my VPN client.

For reference, this is what I did:

  1. Open Regedit.
  2. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Linkage
  3. In the right pane, double-click Bind
  4. In the value text box, select the "\Device\NdisWanIp" item, press CTRL+X, click the top of the list of devices, and then press CTRL+V.
  5. Click OK, and then quit Registry Editor.
  6. Restart your VPN connection.

Friday, March 16, 2012

New iexplore.exe processes exit immediately and the page loads in a different process!

As part of some process management software that handles multiple web pages and web-based applications, I recently encountered some problems with Internet Explorer.

The symptoms of my problem:

  1. Attempt to launch a new page/web-app in a separate iexplore.exe process for Internet Explorer
  2. The process launches successfully but very quickly exits with rc=0.
  3. A new iexplore.exe is created that is not a child of the process I created, but of another existing Internet Explorer session.
  4. The requested content appears successfully under that other process
  5. My process/handle management logic is confused since it thinks something is broken!

After a brief amount of research, it turns out this is due to a change in Internet Explorer 8 (IE8) regarding how UI components, frames, tabs, and plug-ins are isolated into different processes. This is called "loosely-coupled Internet Explorer" or LCIE, and this is documented in two MSDN IE blog posts from Microsoft:

  • http://blogs.msdn.com/b/ie/archive/2008/03/11/ie8-and-loosely-coupled-ie-lcie.aspx
  • http://blogs.msdn.com/b/askie/archive/2009/03/20/how-to-i-determine-which-ie-tabs-go-to-which-iexplore-exe-process-when-using-internet-explorer-8.aspx

While these changes are very useful from an end user point of view, for security and robustness reasons, they aren't what I need. Thankfully, Microsoft included a way of avoiding some aspects of this change in IE8 to mimic the process behaviour of previous versions:


The simple solution:

When manually launching an iexplore.exe process, add the following "-nomerge" command line option as part of the request.

"iexplore.exe -k -nomerge C:\path\app\index.html"

Once I modified my process manager to use this option, my existing logic that worked fine under IE6 and IE7 also works with IE8!