Windows – Johan Känngård http://johankanngard.net Running, coding and mind dumps Thu, 01 Dec 2016 18:23:26 +0000 sv-SE hourly 1 Log File Roller For Microsoft Windows http://johankanngard.net/2008/12/11/log-file-roller-for-microsoft-windows/ http://johankanngard.net/2008/12/11/log-file-roller-for-microsoft-windows/#comments Thu, 11 Dec 2008 13:50:43 +0000 http://johankanngard.net/?p=330 […]]]> A simple log file roller, that rolls/rotates a file from FILENAME.0, to FILENAME.1, onwards to FILENAME.9. If FILENAME.9 exists, it is deleted. Can be used to keep log files small and managable, and delete old ones. The code is not pretty, I could not get it work with loops. If anyone has a better way of doing this, please let me know! :-)

Usage:

rollLog LOGDIRECTORY LOGFILENAME

For instance, if you have a log at c:logat.log, you can run:

rollLog c:logs at.log

Afterwards, you have one file named c:logsat.log.0. The next time you run it (and there has been something written to at.log) you get two files, at.log.0 and at.log.1.

The rollLog.cmd file is here!

]]>
http://johankanngard.net/2008/12/11/log-file-roller-for-microsoft-windows/feed/ 1
Mozilla Firefox 1.5.0.1 is out! http://johankanngard.net/2006/02/02/mozilla-firefox-1501-out/ http://johankanngard.net/2006/02/02/mozilla-firefox-1501-out/#comments Thu, 02 Feb 2006 10:13:52 +0000 http://johankanngard.net/2006/02/02/mozilla-firefox-1501-out/ Mozilla Firefox 1.5.0.1 About Dialog
It’s now released, and not only pre-released 😀 The release notes and the detailed list contains a bunch of bug and security fixes. So go and grab it! Note that the about dialog is the same as in the pre release.

[tags]Mozilla, Firefox[/tags]

]]>
http://johankanngard.net/2006/02/02/mozilla-firefox-1501-out/feed/ 3
VNC with encryption and file transfer http://johankanngard.net/2006/01/31/vnc-with-encryption-and-file-transfer/ http://johankanngard.net/2006/01/31/vnc-with-encryption-and-file-transfer/#comments Tue, 31 Jan 2006 16:36:42 +0000 http://johankanngard.net/2006/01/31/vnc-with-encryption-and-file-transfer/
I have used the free edition of RealVNC until I did some research about how to get the connection encrypted. I have tried RealVNC Personal Edition with encryption, but it doesn’t have built in file transfer capability. Meet UltraVNC! It is GPL‘ed, has encryption and built in file transfer!

[tags]VNC[/tags]

]]>
http://johankanngard.net/2006/01/31/vnc-with-encryption-and-file-transfer/feed/ 2
Mozilla Firefox 1.5.0.1 http://johankanngard.net/2006/01/21/mozilla-firefox-1501/ http://johankanngard.net/2006/01/21/mozilla-firefox-1501/#comments Fri, 20 Jan 2006 22:29:01 +0000 http://johankanngard.net/2006/01/21/mozilla-firefox-1501/ Mozilla Firefox 1.5.0.1 About Dialog

I got it via the automatic update system, but it doesn’t mention it on the official website. I found a release candidate of 1.5.0.1 on the FTP site though. Strange…

Not so strange after all, it’s all explained in the ”What the heck is with this 1.5.0.1 update?” article at developer.mozilla.org.

]]>
http://johankanngard.net/2006/01/21/mozilla-firefox-1501/feed/ 1
Applications and tools I use (almost) daily http://johankanngard.net/2005/11/19/applications-and-tools-i-use-almost-daily/ Fri, 18 Nov 2005 23:59:31 +0000 http://johankanngard.net/?p=26 […]]]> I’ve done this before, but it’s time for a new list with a selection of the tools and applications I’m using:

  • jEdit, text editor written in Java with BeanShell execution support, edit modes, syntax highlightning, seearch and replace with regular expressions
  • xplorer2 Pro, The Windows Explorer replacement, with a multitude of shortcuts and features
  • Process Explorer, a better Task Manager, that shows processes in a hierarchy
  • Firefox, of course
  • Thunderbird, of course
  • GIMP, I’ve not launched my old Photoshop since I discovered this magnificent application!
  • Exifer, great when renaming photos from the digital camera
  • Gaim, superb IM client with support for multiple accounts
  • CapsUnlock
  • UltraVNC
  • Cygwin, the Linux-like environment for Windows
  • 7-zip, LGPL:ed compressing/uncompressing software, that makes really small archives
  • Filezilla
  • Winamp, big, clumsy, but it works. I’m looking for a better alternative though
  • MusicBrainz Tagger, to tag my ripped MP3:s so it can be recognized by last.fm when I play them
]]>
Mark has moved the mountain! http://johankanngard.net/2005/11/16/mark-has-moved-the-mountain/ Wed, 16 Nov 2005 20:58:05 +0000 http://johankanngard.net/?p=24 Well done, Mark! Your deep digging has been rewarded at last!

]]>
WinHTTPRequest COM object options constants http://johankanngard.net/2005/11/11/winhttprequest-com-object-options-constants/ http://johankanngard.net/2005/11/11/winhttprequest-com-object-options-constants/#comments Fri, 11 Nov 2005 11:45:26 +0000 http://johankanngard.net/?p=20 WinHTTP that handles SSL server certificates errors. In my case I have a development server that has a certificate with the wrong name in it, and I want to ignore the usual "The host name in the certificate is invalid or does not match" error. At last, I find the values to use!]]> I have tried to search for the literal values of some of the options to WinHTTP that handles SSL server certificates errors. In my case I have a development server that has a certificate with the wrong name in it, and I want to ignore the usual ”The host name in the certificate is invalid or does not match” error. Since I am using LotusScript to access the COM class WinHTTP.WinHTTPRequest, I can’t simply use:

Dim http As Variant
Set http = CreateObject("WinHTTP.WinHTTPRequest.5.1")
http.Option(WinHttpRequestOption_SslErrorIgnoreFlags) = 13056

This of course generates an error, since the WinHttpRequestOption_SslErrorIgnoreFlags constant can not be found in LotusScript.
The answer couldn’t be found anywhere on MSDN, but some searching on Google led me to a page at fastbugtrack.com with some code that contains the constant I needed! So here they are for future reference:

' WinHTTPRequest options:
Const WinHttpRequestOption_UserAgentString = 0
Const WinHttpRequestOption_URL = 1
Const WinHttpRequestOption_URLCodePage = 2
Const WinHttpRequestOption_EscapePercentInURL = 3
Const WinHttpRequestOption_SslErrorIgnoreFlags = 4
Const WinHttpRequestOption_SelectCertificate = 5
Const WinHttpRequestOption_EnableRedirects = 6
Const WinHttpRequestOption_UrlEscapeDisable = 7
Const WinHttpRequestOption_UrlEscapeDisableQuery = 8
Const WinHttpRequestOption_SecureProtocols = 9
Const WinHttpRequestOption_EnableTracing = 10

The actual value for http.Option(WinHttpRequestOption_SslErrorIgnoreFlags) that I have set to 13056 (hexadecimal 0x3300) is an addition of all switches found at the WinHttpRequestOption documentation at WinHttpRequestOption_SslErrorIgnoreFlags.

]]>
http://johankanngard.net/2005/11/11/winhttprequest-com-object-options-constants/feed/ 4
Prevent Windows from stealing focus http://johankanngard.net/2005/11/11/prevent-windows-from-stealing-focus/ http://johankanngard.net/2005/11/11/prevent-windows-from-stealing-focus/#comments Fri, 11 Nov 2005 09:17:41 +0000 http://johankanngard.net/2005/11/11/prevent-windows-from-stealing-focus/ I want to be able to work in the program I have open at the moment, and not being interrupted by other applications that want automatic focus. So I have used TweakUI quite a while. The problem is that some applications tend to overwrite the crucial registry settings with their own (read: steal focus ON).
To get around this, I now have a BAT file that is run whenever I log in:

@echo off
reg ADD "HKEY_CURRENT_USERControl PanelDesktop" /v
ForegroundFlashCount /t REG_DWORD /d 0x00000000 /f > nul
reg ADD "HKEY_CURRENT_USERControl PanelDesktop" /v
ForegroundLockTimeout /t REG_DWORD /d 0x00030d40 /f > nul

Note that there shouldn’t be a newline after the /v’s…
Put a shortcut to the BAT file in your Startup folder in the Start menu, and it will silently run whenever you login.
Thanks to Adrian that made me (and others?) aware of the reg command. This way, I don’t have to use a .REG file.

]]>
http://johankanngard.net/2005/11/11/prevent-windows-from-stealing-focus/feed/ 7
Varför just 19.00? http://johankanngard.net/2005/10/12/varfor-just-1900/ http://johankanngard.net/2005/10/12/varfor-just-1900/#comments Wed, 12 Oct 2005 11:49:07 +0000 http://johankanngard.net/wordpress/2005/10/12/varfor-just-1900/ DN skriver att man måste uppdatera sina Windows-system innan kl. 19.00 idag, annars blir man attackerad av hackers. Vad sjutton menar de med det??? Varför just 19.00?
Microsoft har lagt upp en sida om det hela.

]]>
http://johankanngard.net/2005/10/12/varfor-just-1900/feed/ 3