Kroko Just another WordPress weblog

August 19, 2009

Total Commander: how to use the ssl/tls feature for secure ftp

Filed under: fuck windows — Tags: , , — admin @ 3:24 am

This is from:

Here is some information on how to use the ssl/tls feature. Because of the Swiss crypto export laws, I cannot include the openssl dlls in the install package.

1. Get the compiled OpenSSL package from the LibCurl library:
Please scroll down to the section named “Win32 – Generic”
and download the following package (or a newer one):
Win32 2000/XP 7.19.0 libcurl SSL enabled Günter Knauf 1.54 MB

2. Copy the two dlls libssl32.dll and libeay32.dll from the “bin” subdir of the archive to the Total Commander directory.
3. Now you can make connections with prefix ftps:// and https://

There will appear a red open locker for connections because the root certificates are missing. To get the root certificates of Verisign, Thawte etc, do the following:
1. Start Internet Explorer and open its configuration dialog
2. Go to the page “Content”
3. Click on “Certificates”
4. Go to the last page “Trusted root certificate authorities”
5. Select all certificates
6. Click on”Export”
7. As name, enter: rootcerts
8. Confirm with Next/OK. This creates a file rootcerts.p7b
9. Issue the following two commands to convert to openssl format:

openssl pkcs7 -inform DER -in rootcerts.p7b -print_certs -out unfiltered.pem
openssl x509 -in unfiltered.pem -out rootcert.pem

10. Put the file rootcert.pem in the Total Commander directory

July 29, 2009

XP Automatic Update Nagging

Filed under: fuck windows — admin @ 3:08 am

Windows XP’s automatic update facility is clearly a good thing. Except when an update is installed that requires a reboot and you’re working on the computer at the time. Then you get this lovely dialog:

Updating your computer is almost complete. You must restart your computer for the updates to take effect. Do you want to restart your computer now?

As if I needed another reason to hate dialog boxes. This is perhaps the Naggiest. Dialog. Box. Ever. It can’t be dismissed. You get two choices– Restart Now, or Restart Later.If you click Restart Later, it pops up again ten minutes later, like clockwork. It belongs to wuauclt.exe, part of the Microsoft automatic update provider. I tried killing wuauclt.exe, and like a bad zombie movie, it keeps coming back.

I want automatic updates, but I also want to restart my computer when I feel like it. Is there any way to turn off this incredibly annoying nag dialog? UPDATE: Thanks to the many commenters, we now have at least two ways to disable Mister Naggy McNaggerson:

1. Stop the “Automatic Updates” service.

Navigate to Control Panel | Administrative Tools | Services:Automatic Updates service screenshot

Right click the Automatic Updates service and stop it. You can also do the same thing at the command line by typing:

net stop wuauserv

or you can type this, which does the same thing, and is a little easier to remember:

net stop "automatic updates"

After the service is stopped, the nag message stops, too. Then you can reboot when you have time. The service will restart when you reboot.

2. Modify Group Policy settings.

Start, Run “gpedit.msc” to bring up the group policy editor. Then navigate to the folder

Local Computer Policy
  Computer Configuration
    Administrative Templates
      Windows Components
        Windows Update

There are two settings and both will work, so it’s your choice. Either enable No auto-restart for schedule Automatic Updates installations or set Re-prompt for restart with scheduled installations to a long time interval, like 1440 minutes.

February 8, 2009

Script to Monitor Your Internet Connection

Filed under: fuck windows — admin @ 5:00 am

this text is from:

Have you ever had a situation where your Internet connection drops for a few seconds, then comes back, then drops again, then comes back, and repeats randomly with no rhyme or reason? Getting your ISP to see the problem can be a real hassle as Murphy’s Law dictates that the problem will ALWAYS go away once you finally get them on the phone. You’ll usually get the standard “looks good on our end” with no actual resolution of the problem. Well, this script will allow you to monitor the line for hours, days, even weeks, and provide you with a timestamped activity log of exactly what was happening over that period. Armed with this type of information, you can usually get your ISP to take notice.

I actually wrote this script a few years ago when one of my clients was having these very problems. Using the log it generates, I was able to provide the ISP with meaningful numbers and exact times, and eventually they were able to correct the problem. Since then, I’ve used it many times to check the stability of a connection. Anyway, today on one of the tech forums, somebody asked how to monitor a flakey line. It got me thinking about this script, so I dusted it off and posted it to the forum. I figured while I was at it, I’d post it here as well.


I wrote it in VBScript, and it utilizes the WMI Ping object. Basically it sends a single ping to a host you specify, logs the outcome with a time-stamp, then waits a predetermined delay time and repeats itself indefinitely. If you let this script run for a full day or more, pinging every few seconds, it will give you a really good idea what might be happening with your Internet connection.

The script contains four values that you’ll need to edit:

strHost = “” – This is the host you want to ping. It can be a web server, a router, a DNS server, etc. You can specify a DNS name or an IP address.
nDelay = 15 – This is how many seconds the script will wait between pings. I find that pinging every 15 seconds is usually sufficient, although you may want to ping as often as every second in some cases.
strLogFile = “C:\Comcastpinglog.txt” – This is the full path to the log you want to create.
nThreshold = 75 – This is the response threshold (in milliseconds). Any ping response which is greater than this will be flagged as “SLOW” and marked as such in the log. This makes it easy to filter these log entries later. 75ms is rather high for most broadband connections at idle. What you’ll want to do is to let the script run for a bit and establish a baseline for what “normal” is. For instance, my Comcast cable connection (3-6Mbit speed) usually pings at about 19-32ms.

What should I ping?
If you’re having trouble with your Internet connection, a good host to ping will be the default gateway provided by your ISP. This would represent the first physical device on the “other side” of your connection. You can get this by checking your router’s “Connection Status” or “WAN Status” screen and noting the IP address for default gateway. Another good one would be one of your ISP’s DNS servers. This is also available in your router. With either of these, you’re pinging something fairly local to your ISP, eliminating additional hops.

If you’re having trouble with your hosted web site or server, you’ll want to ping that server or the IP assigned to you by your provider. Just keep in mind that you will be traversing many hops to get there, so it isn’t uncommon for your provider to pass the blame. If you notice periods of high latency, try to back them up with a tracert output so you can show your provider where slowdown is.

* Note: Please be advised that some ISP’s or network admins may not appreciate you performing continuous pings to their servers. I am not responsible for any nasty emails you might receive. Make sure you know what you’re doing before you go pinging somebody’s else’s servers.

Logfile Output
The script continuously appends to a log file with the following output:

1/26/2008 1:42:16 PM: PINGING HOST: []
1/26/2008 1:42:16 PM: Reply from bytes=32 time=19ms TTL=51
1/26/2008 1:42:21 PM: Reply from bytes=32 time=20ms TTL=52
1/26/2008 1:42:26 PM: Ping Failed
1/26/2008 1:42:31 PM: Ping Failed
1/26/2008 1:42:36 PM: Ping Failed
1/26/2008 1:42:41 PM: Reply from bytes=32 time=39ms TTL=51 SLOW
1/26/2008 1:42:46 PM: Reply from bytes=32 time=23ms TTL=51
1/26/2008 1:42:51 PM: Reply from bytes=32 time=31ms TTL=51 SLOW

The log is appended infinitely, so you’ll eventually want to purge the log or copy it off to avoid it growing to an unmanageable size.

You may later filter specific lines from the log using the following DOS commands:

type logfile.txt | find /I "Failed" > failed.txt
type logfile.txt | find /I "SLOW" > slow.txt

Running the Script
Copy the VBScript code below and paste into a VBS file in your scripts directory. Call it PingTest.vbs. To run the script, launch it with the command “cscript PingTest.vbs”. To kill the script, just press CTRL-C. Note: Do NOT just double-click the script to run it! That will cause it to launch with the wscript engine. Since this script outputs to the console it needs to run with the cscript engine.

To make things easier, and ensure you always launch it with cscript, just write a simple 2-line batch file to launch the script. (Put it in the same directory as the vbs script):


@echo off
cscript %~dp0PingTest.vbs


Dim strHost, nDelay, strLogFile, nThreshold

strHost = "" ' What do you want to ping
nDelay = 15  ' How many seconds to pause between pings
strLogFile = "C:\Comcastpinglog.txt" ' Full Name and Path of logfile
nThreshold = 75 ' Anything response over this (in ms) will be flagged as "Slow"

Dim txtLogLine, objPing, objRetStatus, rc

rc = LogLine(strLogFile,"================================================================================")
rc = LogLine(strLogFile,FormatDateTime(Now(),0) & ": PINGING HOST: [" & strHost & "]")
rc = LogLine(strLogFile,"================================================================================")

Do While True
   txtLogLine = ""

   txtLogLine = txtLogLine & FormatDateTime(Now(),0) & ": "
   Set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery _
       ("select * from Win32_PingStatus where address = '" & strHost & "'")

   For each objRetStatus in objPing
       If IsNull(objRetStatus.StatusCode) or objRetStatus.StatusCode<>0 then
          Ping = False
          txtLogLine = txtLogLine & "Ping Failed"
          Ping = True
	  txtLogLine = txtLogLine & "Reply from " & objRetStatus.ProtocolAddress & ": "
	  txtLogLine = txtLogLine & "bytes=" & objRetStatus.BufferSize & " "
          txtLogLine = txtLogLine & "time=" & objRetStatus.ResponseTime & "ms "
          txtLogLine = txtLogLine & "TTL=" & objRetStatus.ResponseTimeToLive
	  If objRetStatus.ResponseTime >= nThreshold Then
	     txtLogLine = txtLogLine & " SLOW"
	  End If
       End If
   WScript.Echo txtLogLine
   rc = LogLine(strLogFile, txtLogLine)
   WScript.Sleep nDelay * 1000

Function LogLine(strFile, strLine)
   Dim objFSO, objFile
   Set objFSO = CreateObject("Scripting.FileSystemObject")
   Set objFile = objFSO.OpenTextFile(strFile,8,True)
End Function

While this isn’t necessarily the most advanced method of detecting a slow connection, it’s surprisingly accurate in exposing periods of high latency or dropped connection. Try it out and let me know what you think.

Older Posts »

Powered by WordPress