Black screen when playing all video in Windows

September 4, 2008 on 4:00 pm | In Windows | No Comments

So, the other night I decided to clean up my PC and install XP Service pack 3, update my ATI drivers etc etc.

After the reboot, went to play some of my videos, only to find the video display to be black. Audio was fine, everything looked dandy. VLC, Media Player, Nero all refused to show the video.

Doubling checking the codecs, everything looked fine.

The solution - in the back of my head I remembered settings in the Catalyst Control Center. Look under VIDEO and then BASIC color. For some reason, USE APPLICATION SETTINGS was unchecked, and the brightness turned down to zero. I still can’t set it back up higher, but checking the USE APPLICATION SETTING box fixes the issue.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Google] [StumbleUpon]

IP reported as 0.0.0.0 in Apache access log

October 30, 2007 on 8:33 pm | In Windows | No Comments

If you are running Apache on a Windows 2000 server, and notice your access logs are coming up with 0.0.0.0 IP addresses

0.0.0.0 - - [30/Oct/2007:19:29:11 -0400] “GET /ad_images/siam.gif HTTP/1.1″ 304 -

or similar, in your WordPress install posts are coming from a 0.0.0.0 IP, check your httpd.conf, and add the following line:

Win32DisableAcceptEx

at the top of the file. Restart Apache and your should be ok!

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Google] [StumbleUpon]

Reseting your disks from PIO to DMA

October 26, 2007 on 2:32 pm | In Windows | No Comments

If you are having issues with your PC, noticeable by your Media player crapping out whenever your Hard Disk or CD/DVD is accessed or by your mouse sticking, check this piece of VBscript that resets your devices from PIO ( software ) mode to DMA ( hardware ). Sometimes windows will switch over to software mode without even telling you ( thats nice ) and this will detect and reset those settings.

For the original script check it out here

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
' Visual Basic Script program to reset the DMA status of all ATA drives
 
' Copyright © 2006 Hans-Georg Michna
 
' Version 2007-04-04
 
' Works in Windows XP, probably also in Windows 2000 and NT.
' Does no harm if Windows version is incompatible.
 
If MsgBox("This program will now reset the DMA"_
  & " status of all ATA drives with Windows drivers." _
  & vbNewline & "Windows will redetect the status after "_
  & "the next reboot, therefore this procedure" _
  & vbNewline & "should be harmless.", _
    vbOkCancel, "Program start message") _
  = vbOk Then
 
RegPath = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\"_
  & "Control\Class\{4D36E96A-E325-11CE-BFC1-08002BE10318}\"
ValueName1Master = "MasterIdDataChecksum"
ValueName1Slave = "SlaveIdDataChecksum"
ValueName2Master = "UserMasterDeviceTimingModeAllowed"
ValueName2Slave = "UserSlaveDeviceTimingModeAllowed"
ValueName3 = "ResetErrorCountersOnSuccess"
MessageText = "The following ATA channels have been reset:"
MessageTextLen0 = Len(MessageText)
ConsecutiveMisses = 0
Set WshShell = WScript.CreateObject("WScript.Shell")
 
For i = 0 to 999
  RegSubPath = Right("000" & i, 4) & "\"
 
  ' Master
 
  Err.Clear
  On Error Resume Next
  WshShell.RegRead RegPath & RegSubPath & ValueName1Master
  errMaster = Err.Number
  On Error Goto 0
  If errMaster = 0 Then
    On Error Resume Next
    WshShell.RegDelete RegPath & RegSubPath & ValueName1Master
    WshShell.RegDelete RegPath & RegSubPath & ValueName2Master
    On Error Goto 0
    MessageText = MessageText & vbNewLine & "Master"
  End If
 
  ' Slave
 
  Err.Clear
  On Error Resume Next
  WshShell.RegRead RegPath & RegSubPath & ValueName1Slave
  errSlave = Err.Number
  On Error Goto 0
  If errSlave = 0 Then
    On Error Resume Next
    WshShell.RegDelete RegPath & RegSubPath & ValueName1Slave
    WshShell.RegDelete RegPath & RegSubPath & ValueName2Slave
    On Error Goto 0
    If errMaster = 0 Then
      MessageText = MessageText & " and "
    Else
      MessageText = MessageText & vbNewLine
    End If
    MessageText = MessageText & "Slave"
  End If
 
  If errMaster = 0 Or errSlave = 0 Then
    On Error Resume Next
    WshShell.RegWrite RegPath & RegSubPath & ValueName3, 1, "REG_DWORD"
    On Error Goto 0
    ChannelName = "unnamed channel " & Left(RegSubPath, 4)
    On Error Resume Next
    ChannelName = WshShell.RegRead(RegPath & RegSubPath & "DriverDesc")
    On Error Goto 0
    MessageText = MessageText & " of " & ChannelName & ";"
    ConsecutiveMisses = 0
  Else
    ConsecutiveMisses = ConsecutiveMisses + 1
    If ConsecutiveMisses >= 32 Then Exit For ' Don't search unnecessarily long.
  End If
Next ' i
 
If Len(MessageText) <= MessageTextLen0 Then
  MessageText = "No resettable ATA channels with "_
     & "Windows drivers found. Nothing changed."
Else
  MessageText = MessageText & vbNewline _
    & "Please reboot now to reset and redetect the DMA status."
End If
 
MsgBox MessageText, vbOkOnly, "Program finished normally"
 
End If ' MsgBox(...) = vbOk
 
' End of Visual Basic Script program
[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Google] [StumbleUpon]

Windows Process Monitor

October 16, 2007 on 12:09 pm | In Windows | No Comments

Haven’t seen much of this, but this can be really handy for detecting vermin and seeing what the hell is going on with your windows machine

http://www.microsoft.com/technet/sysinternals/utilities/processmonitor.mspx

Wanna see why your harddrive is getting trashed? Need to see what Netbeans is upto? This shows all file and I/O access on your machine, think of it as Etheral for processes. Great tool, and free.

The only caveat, tends to reboot your machine if you have a lot of stuff going on.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Google] [StumbleUpon]

Capturing websites to an image

September 21, 2007 on 7:08 pm | In PHP, Windows | No Comments

This is a “thinking outside the box” way to automatically snap a website and save it to a JPG. It uses webswoon, a great little app, a little buggy here and there but it does the job.

You will need:
Webswoon
Apache + PHP ( Note: Apache MUST be running as a standalone, not as a service )
A Windows Machine to run it on ( oh stop crying ) - I use an old PIII with Windows 2000 installed.

Right, I’m gonna assume everything is installed. Are you asking me why Apache must be running standalone? Because webswoon is actually a wrapper for the IE ActiveX object ( or something like that ). For IE to run it need a desktop to run on with color depth and all those funky things. Services don’t have a desktop, so IE can’t run. There may be a way around it, frankly I haven’t the time to make it work.

Now configure webswoon:

openbrowserwindow=0
thumbnailwidth=150
thumbnailheight=110
browserwidth=850
browserheight=640
waitdelay=2
updatecaptures=0
updatedays=60
updatehours=0
updatemins=0
exportfolder=C:\Program Files\Apache Group\Apache2\htdocs\captures
capturefilenameformat=%z.%e
ignoreurl=
imageformat=JPG
timeoutdelay=13
deletecaptures=0
removeborder=1
loopmode=0
loopdelay=60
jpegcompression=80
automode=0
showbrowsererror=0
language=en
disablejavascript=1
resizecapture=1
cropmethod=1
keepmargins=1
blankmargin=20
canvawidth=1200
canvaheight=6000

“exportfolder” does not really matter as we override that later. You can play with the other settings, have at them.

Now, we create a batch file, somewhere that Apache can get hold of it:

cd "{path to webswoon}"
"{path to webswoon}\webswoon_console" -f %1 -o "{where ur captures are going}"

Fill out the curly brackets with your own paths, and save as capture.bat

Now the PHP file thusly:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
error_reporting(0);
 
// Use ur frickin imagination here ...
$path = "C:/Program Files/WebSwoon";
 
$url = $HTTP_GET_VARS["URL"];
if(empty($url))return;
$filename = "/lists/".getmicrotime().".txt";
$file = fopen($path.$filename,"w+");
fputs($file,"http://".$url."\r\n");
fclose($file);
 
// Add the absolute path to your batch file
// I just coded it here a c:\
$exec = "c:\capture.bat $filename";
$WshShell = new COM("WScript.Shell");
$WshShell->Run("$exec", 0, true);
unlink($path.$filename);

This allows you to pass the URL ( without HTTP in this case ) as a parameter (”URL”) but you can do this many other ways, this is just the way I do it.

So, PHP comes along, creates a file, named with the current time in milliseconds and sets the contents to the URL we want to capture. This file normally has to be in the webswoon directory ( I put it in the “lists” subdirectory ). We then call our batch file to launch webswoon in command line mode, which will read the list of URLs and capture them to our output directory, with a filename of {MD5 filename}.jpg

Another note is that the PHP exec() function doesn’t work in this instance ( at least, it didn’t when I wrote the original code ), so we use a windows shell object ( essentially use Explorer to run the batch file )

$WshShell = new COM("WScript.Shell");
$WshShell->Run("$exec", 0, true);

Webswoon will sometimes get stuck under it’s own feet. It is set to timeout after 15 seconds, but some pages will screw that up. So I have a scheduled job that runs a windows version of the unix KILL command thusly:

kill -f webswoon*

It runs every so often just to tidy things up.

Want to see a working example of all this stuff?

http://convert.springheadmedia.com/webshot/index.php

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Google] [StumbleUpon]
Next Page »

Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds. Valid XHTML and CSS. ^Top^