f-log

just another web log

25 Oct 2007 13:17
UPS saves the day (again), we had yet another random power cut that only lasted two minutes and my cheap UPS made sure the machine never lost power !
24 Oct 2007 21:55
the LUG home page needs to show the correct date unfortunately this has been affected by human error so I knocked up a javascript fix.
Has the small problem that if the date on the users machine is wrong then it is calculated wrong, still could be basis for either another program perl etc or for someone to check their human interpretation.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
         <title></title>
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
         <script>
     function update() {
         var dat = new Date();
         var secondWednesday =getSecondWednesday(dat);
         var result="";
         if (secondWednesday<dat.getDate()) {
             // add a month
         dat.setMonth(dat.getMonth()+1);
         secondWednesday = getSecondWednesday(dat);
         result="its happening on the " + secondWednesday + nice(secondWednesday) + " of next month";
         } else if (secondWednesday==dat.getDate()) {
                 // aghh its today !!
             result="AGHhhhh...! its today! the " + secondWednesday + nice(secondWednesday);
         } else {
             // its later this month
             result="its happening on the " + secondWednesday + nice(secondWednesday) + " of this month";
         }
             document.getElementById("dat").innerHTML = result;
         }
            
         // get the second Wednesday for the month in the date supplied
         function getSecondWednesday(dat) {
             var wednesdays = new Array();
             var tryDate;
             for (var d=1;d<=31;d++) {
                 tryDate = new Date(dat);
         tryDate.setDate(d);
         if (tryDate.getDay()==3) {
             wednesdays[wednesdays.length]=d;
             d+=6; // add 6 as for will add 1 making one week
         }
         }
         return(wednesdays[1]);
     }
        
        // return st nd rd th for month day 'niceness'
        function nice(md) {
            switch(md) {
                case 1:
                case 21:
                case 31: return("st");
                case 2:
                case 22: return("nd");
                case 3:
                case 23: return("rd");
                default : return("th");
            }
        }
        </script>
    </head>
    <body onload="update();">
     begin <br />
     <div id='dat'>Javascript is disabled, please guess date yourself.</div>
     end
    </body>
</html>

http://www.jumpstation.co.uk/misc/jsdat.html
24 Oct 2007 21:31
http://en.wikipedia.org/wiki/Duff%27s_device

screaming monkey balls !
24 Oct 2007 21:23
so krum was not producing the correct results, leaving the device in rather an odd state. MY debug data matched the original capture data perfectly so what was going wrong?
I tried krum with the win32 version of libusb and it produced the same results, so Linux is not to blame, unfortunately that means the debug krum is producing is not accurate.
But snoopy pro in windows will not capture the krum data from win32 libusb unless I create driver .INF files for windows and I have a better idea anyway.
Simply setup the linux kernel to dump debug usb data, easy right ?
Hmmm. First off I am not going to change my kernel and reboot unnecessarily, so I used virtualbox[1] and installed ubuntu[2].
Even better ubuntu was noted to have the usbmon kernel debug setup by default (cannot find link) copied in krum ran and started looking for usb data in /var/log/...
Nothing, hmmm, ah, seems I need to rebuild kernel with usbmon, make sense, took a few tries but rebooted into my new kernel (had to edit /boot/grub/menu.lst to allow me to select the new kernel).
Repeated krum still no usb data anywhere ...
Found a great tutorial[3] that included how to rebuild kernel in ubuntu [4], seems I had missed the debug file system.
Right, an number of resources noted the that wireshark[5] had support to read this debug file system USB data, so install wireshark.
No option in wireshark for USB, download latest source code and build, still no option for USB, install ubuntu's libpcap-dev rebuild wireshark, still no option for USB, build libpcap from source remove ubuntu's libpcap-dev package and try and rebuild wireshark.
Error libpcap not found, rebuild libpcap after specifying
./configure --prefix=/usr
Rebuild wireshark and all the computer gods be praised it build and ran and USB was an option, started cpature started krum wireshark complained no packets captured !
Ran krum and then started capture, and it captured something but not much and then errored out saying something about unable to handle USB packet '
'
and just to make this extra fun one of the cats decide to pee on my desk ...
In conclusion I now have a capture from usbmon from krum and it is ugly, will take time to reformat and then compare ...
[1] http://www.virtualbox.org/
[2] http://www.ubuntu.com/
[3] http://www.quietearth.us/articles/2006/10/16/USB-Snoop-in-linux
[4] http://www.quietearth.us/articles/2006/09/15/Ubuntu-Compiling-a-custom-kernel
[5] http://www.wireshark.org/
10 Oct 2007 23:06
It has been the day from hell, well hellish.
Started this morning being so tired I could not get up and then having to run for the train and also having to rush to get a ticket. All this while getting soaked.
Get into London and I have to go directly to the head office, rush rush rush. Then find the meeting was not until tomorrow, doh!
As I am there, login to a spare machine but its not long before someone else needs the machine, so leave for my normal office. Decide to take a short trip to PC World to get a w2k3 compatible wireless mouse (can not see on on amazon . I was 90% sure I knew how to get there unfortunately it was the other 10% and I was left lost in London getting wetter by the minute.
Finally get back to the office and find I am wearing odd socks, bump into the door frame at least twice and find blisters from all the walking.
On the train home rip my palm open on my jeans studs/rivets, rush home to eat before the LUG Shove food down my throat and as there is one minute before I am picked up say to Sarah "I am going to check my email, knowing my luck there will be one to say the lift is late". Guess what ...
Still the LUG meeting was a blast, loads of new and old people lots of different problems, questions, discussions. Was serious talk about the LUG site and its future and plans for coming events, very productive.
So not really a bad day after all, of course there is always tomorrow ...

06 Oct 2007 20:20
I wanted to confirm that my krum usb program was performing the same as the original windows driver.
Krum has extensive loggin and from that it appeared that all was fine but I was still getting a device that was not in a complete state.
So I though I could use win32-libusb. Installed cygwin and added libusb support and gcc from the install options. From the new cygwin shell I could just
gcc krum.c -o krum -lusb
Then I needed to install the filter driver for win32-libusb and krum worked exactly the same way as in Linux.
So I just ran snoopypro, restarted the device and immediately saw the URBs for enumeration being captured, so I ran krum in the cygwin shell and it ran but snoopypro record NO FURTHER URBs.
Gutted... but I have a sneaky plan ...
loading results, please wait loading animateloading animateloading animate
[Less tags]
rss feed

email

root

flog archives


Disclaimer:
This page is by me for me, if you are not me then please be aware of the following
I am not responsible for anything that works or does not work including files and pages made available at www.jumpstation.co.uk I am also not responsible for any information(or what you or others do with it) available at www.jumpstation.co.uk
In fact I'm not responsible for anything ever, so there!

[Pay4Foss banner long]