Category: Tech stuff

  • Windows 10 "Attempted Switch from DPC" Blue screen caused by Acronis Scanman

    I have spent some time diagnosing a sick PC which intermittent BSOD (Blue Screen of Death) and decided against the recommended “nuke from orbit” approach to it, instead deciding stubbornly that the machine was in fact recoverable with all user settings and files intact.
    I updated the latest BIOS and AMD chipset drivers, even though Asus had long since given up keeping the driver library refreshed for this old motherboard.

    That didn’t work. So next thing was to install something to help diagnose the BSOD events. Event Viewer isn’t a lot of use, but Windows tends to drop “dump” files when it crashes and if you know what you are looking at, they can help identify the culprit. If not, use a tool that makes it easier. I recommend “WhoCrashed” for this sort of thing:

    In my case, the culprit seemed to be SCANMAN.SYS, a driver by Acronis which does a great job of shifting disk chunks around for replication or backup operations. In my case though, those tools hand long since been removed. The Windows 10 Anniversary update had somehow made this dormant file into some kind of psychopath. It needed to go. But removing it is not just a case of hitting delete. Do two things first (just in case something goes wrong and you need to roll-back or boot from USB and run a startup-repair:

    • Create a System Restore point
    • Create a USB Recovery Drive

    Now for the messy bit (the long-hand version is here: https://kb.acronis.com/content/1620).

    • Go to the Start, Run Type “regedit” and click OK. This will open the Registry Editor
    • Navigate to: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Class\{4D36E967-E325 -11CE-BFC1-08002BE10318}
    • In the “UpperFilters” key, remove any reference to “snapman” but leave any other values in place. For example “cat snapman dog” becomes “cat dog”.
    • If it exists, in the “Lowerfilters” key, do the same.
    • Navigate to: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Class\{71A27CDD-812A -11D0-BEC7-08002BE2092F}
    • In the “UpperFilters” key, remove any reference to “snapman” but leave any other values in place. For example “cat snapman dog” becomes “cat dog”.
    • If it exists, in the “Lowerfilters” key, do the same.
    • Navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\snapman
    • Create a new REG_DWORD value, name it DeleteFlag and set it with a value of 1
    • Edit or create a REG_DWORD value named Start and set it with a value of 4
    • Reboot
    • After the reboot, navigate to this folder: C:\windows\system32\drivers and rename snapman.sys to snapman.old. If it isn’t there, the reboot removed it already.
      Reboot again and then create a new Restore Point.
      If at any point the PC fails to load due to “inaccessible boot device”, simply plug in the USB recovery drive you created earlier and under the advanced menu, choose “Repair Startup. That will tidy up the registry entries and make it work again.
      At this point I recommend running something like Wise Registry Cleaner to tidy things up.
      You should be good now. 🙂
  • Home Automation at a bargain price

    ad560dac-3c75-42c9-8236-5dcebb79296dI discovered these little “Orvibo S20” sockets that let you turn sockets on and off using your iphone. Very neat.
    You can also do this over the Internet. But I’m not entirely convinced that the third-party proxy is secure enough for my level of internet security paranoia. I mean, I am sure it is fine but I only paid them a one-off fee under £20, so their motivation to run a highly secure proxy is going to eventually wane a little. So I need another solution.
    Fire-up a Raspberry PI and have a play with this project on Github. You’ll soon have a webpage on your PI that lets you turn sockets on and off. Now it is in your control, putting it behind a VPN tunnel or SSH session is a possibility.
    Now go look at what the more expensive proprietary home automation systems cost and decide if £20 and a few hours of your time makes sense…

  • Pi Zero and Camera not working

    pi-camera
    I have a few Raspberry PIs. I’m an engineer at heart and these things allow me to tinker without expending a lot of money and the SD-Card nature of the filesystem makes it easy to try something, wipe it and try something new.
    One thing that has frustrated me for weeks is a camera failing to work. I checked config and it was good, so I thought it was the cable. Bought a new cable. It wasn’t the cable.
    Thought it might be the PI. Tried a different one. It wasn’t the PI.
    Argh.
    Tried another camera. Different version. Nope.
    Then I found this: https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=160611
    And one line of obscure, seemingly unrelated config later, it is working perfectly.
    Seems there is a version bug in the Pi. Apparently it relates to certain versions of the Pi Zero and my board should not be affected. I checked the revision numbers and the OTP that the Pi thinks it is and they all check out. So I shouldn’t need this fix. But it turns out I do.
    If you have a Raspberry Pi and the camera doesn’t work, giving some mmal errors, please rad the post. It may be a simple job of adding

    force_board_rev=0x900093

    to /boot/config.txt and then running

    sudo raspi-config

    and enabling the camera. One reboot later and

    sudo raspistill -o test.jpg

    will give you a view of the world as the Pi sees it.
    Hooray!

  • Windows 10 Common fixes

    I have had a handful of issues with Windows 10 but still like it. Here are some issues and fixes I found work for me:

    (more…)

  • Recovering Windows 10 RAW Partition

    This link will be useful: http://www.cgsecurity.org/wiki/TestDisk_Download
    I recently had a disk partition turn RAW. Windows would boot and then hang. Connecting the hard drive to a different system showed the main partition was now marked RAW and unreadable. Installing and running TestDisk soon had the partition readable and I was able to recover my files. Download it now so you have it handy when you need it.

  • Wifi on the Raspberry Pi

    Had a few requests about this and there are various answers on forums around the place, but this is how I did it using a PI Hut dongle:

    sudo apt-get update
    sudo apt-get upgrade
    sudo shutdown -r 0

    Those three commands make sure everything is the latest it needs to be before you try anything else. Now let’s edit two files:
    sudo nano /etc/network/interfaces

    # just add or edit the wlan sections at the bottom, leave the rest of the file as you find it
    allow-hotplug wlan0
    iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
    allow-hotplug wlan1
    iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
    

    sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

    #This is the entire file and it gets me onto my home wifi network, but change the ssid and the psk to the password for your network
    ctrl_interface=DIR=/var/run/wpa_supplicant
    GROUP=netdev
    update_config=1
    network={ ssid="59KnightsWay" psk="afafafafafa" }

     
    Note: If you wanted a static wifi address, the interfaces file needs a minor tweak:

    allow-hotplug wlan0
    iface wlan0 inet static
    address 192.168.1.99
    netmask 255.255.255.0
    gateway 192.168.1.1
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

    Reboot and use these two commands to check what did and didn’t work:
    ifconfig wlan0
    tail -500 /var/log/syslog | grep wlan
    If you struggle with wpa_supplicant, you can wimp out and do it all in /etc/network/interfaces

    # interfaces(5) file used by ifup(8) and ifdown(8)
    # Please note that this file is written to be used with dhcpcd
    # For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
    # Include files from /etc/network/interfaces.d:
    source-directory /etc/network/interfaces.d
    auto lo
    iface lo inet loopback
    iface eth0 inet manual
    allow-hotplug wlan0
    iface wlan0 inet static
    address 192.168.1.99
    netmask 255.255.255.0
    gateway 192.168.1.1
    dns-nameservers 8.8.8.8
    wpa-ssid "MySSID"
    wpa-psk "mypassword"
    
  • Removing old Java Versions

    If you have Java installed on your computer (and you probably do), chances are you have old versions laying about the place and some of these will be a security risk. But there is and easy way to remove them.

    First Go to Control Panel > Add/Remove Programs and remove any Java versions with a number lower than 1.4.2. Really, just uninstall them.

    Now visit http://java.com/en/download/uninstallapplet.jsp and let it do it’s work. This tool scans for older versions of Java and removes them without breaking your current version as well as checking you are up to date. Worth visiting once in a while. Or if you have better things to do, just go there now, run it once and chances are you’ll end up being that little bit safer online.

  • SLAAC and Stateless DHCPv6 on Juniper SRX routers

    If you have struggled to find the easiest guide to getting IPv6 onto an SRX router, giving out Routing Announcements (RAs) to clients to tell them what the subnet is and using DHCPv6 to only tell them about DNS servers, you’ve come to the right place.
    You have the option of using DHCPv6 in Stateful mode, assigning IP addresses and other attributes, but that removes the SLAAC functionality and instead makes your poor little router into a DHCP database, just like it was in IPv4. There really isn’t any need to do it that way. So let’s instead build it so the clients ask the router simply where the DNS servers are and otherwise just look after themselves. We call this a “Stateless” configuration.
    The trick is to ensure that the RAs go out with the DHCP “O” flag set. This tells clients that they should work out their own IP addresses using SLAAC (by far the best way to do it and the way IPv6 was designed) but that they should poll DHCP using a “DHCPINFORM” message to get the DNS resolvers or any other related info.
    Let’s start with configuring a local IPv6 address and then turn-on RA with that flag set:

    interfaces {
        fe-0/0/0  {
           unit 0 {
             family inet6 {
                address 2a01:a000:110::1/64;
             }
           }
        }
    protocols {
         router-advertisement {
             interface fe-0/0/0.0 {
                 prefix 2a01:a000:110::/64;
                other-stateful-configuration;
             }
        }
    

    Now we’ve done that, the only thing left to do is to build a DHCPv6 config. We’ll create a DHCP pool called “mypool” but we won’t give it any IP addresses as clients will already have an address from SLAAC. Instead we will just load it with the attributes we want clients to know about.
    We’ll create an optional token as a security measure so that any DHCP reset messages heard by the client will be compared to this token and ignored if they don’t match. Then we’ll put a group together called “mygroup” containing all participating interfaces, which in this case is just fe-0/0/0.
    Notice the inclusion of the “process-inform” override. Without this, DHCP will ignore requests from clients that already have an address, assuming they have been speaking to another DHCP server. With this turned on, it will instead listen to and respond to DHCPINFORM requests and respond with the dhcp attributes set in the pool that matches the subnet the client resides in.

    system {
        services {
            dhcp-local-server {
                  dhcpv6 {
                      reconfigure {
                          token 8ysIU9E32k8r;
                      }
                      group mygroup {
                         overrides {
                             interface-client-limit 200;
                               process-inform {
                                  pool mypool;
                               }
                             }
                          interface fe-0/0/0.0;
    }}}}
    access {
       address-assignment {
          pool mypool {
             family inet6 {
                 prefix 2a01:a000:110::/64;
                 dhcp-attributes {
                       maximum-lease-time 120;
                       grace-period 3600;
                       dns-server {
                          2620:0:ccc::2;
                          2620:0:ccd::2;
    }}}}}
    

    That should pretty much do it for you. Don’t forget to do an ipconfig /release6 followed by ipconfig /renew6 on any Windows clients.
    Clients that already have DHCPv4 DNS resolvers in their config won’t necessarily show they have picked up the IPv6 DNS resolvers. The only way to be sure is to turn-off IPv4 on the client and see if you can ping a site that isn’t in the local DNS cache. On the router, you can use “show dhcpv6 server statistics” to ensure you have more INFORMATION_REQUEST packets than you have drops.

  • Sky O2 Broadband and Linksys WAG54GS routers

    Contrary to what Sky will tell you about how to setup a router to use their service, it won’t work. At least not as they explain it.
    To read it for yourself, look here: http://helpforum.sky.com/t5/tkb/articleprintpage/tkb-id/sky_broadband_setupcablingconnectionwifi@tkb/article-id/14
    or here:
    http://service.o2.co.uk/IQ/SRVS/CGI-BIN/WEBCGI.EXE?New,Kb=Companion,question=ref(User):str(Broadband),T=Broadband_Case,CASE=24812
    I tried a few different ways but in the end, these worked for me:
    Encapsulation:  RFC1483 Bridged  (Your router may call this: IPoE)
    Multiplexing:  VC
    Autodetect: Disable
    VPI: 0
    VCI: 102
    Don’t auto-detect your IP address. Instead enter the static IP they gave you as a /24 with the first IP in the block as the gateway.
    DNS: 87.194.225.154
    DNS: 87.194.225.155

    If it is all working, you should see it on your status page. I could pretty much get the DSL line to come up on most settings but getting it to log a gateway was an impossible task. All good now though:

  • How to restart your iPhone without losing everything

    Hold down the On/Off button and the Home button at the same time for at least ten seconds. Release both when the Apple logo appears.
    You won’t lose your photos, apps or settings. It is just like doing CTRL-ALT-DEL on a PC.
    If you have upgraded to IOS7 recently, you’ll have to do this at some point when you start to see Facebook crashing or the camera refusing to take pictures. Once you’ve reset, all will be well again.