Tuesday 23 December 2008

Windows on VMware fusion crashes: STOP 0x0000007B

I installed VMware fusion on my Mac and got it to boot my native installation of Windows but on boot up in the VM it crashed with a blue screen message STOP 00007B. Took me a while to find it but I actually followed some advice from Microsoft themselves which mostly fixed it. The missing piece to the puzzle was one of the sys files you need to copy over was in %SystemRoot%\Driver Cache\I386\sp2.cab (in addition to Driver.cab).

It works great but then I got asked to reactive windows - there seems to be a fix here.

Wednesday 19 November 2008

Windows Mobile Device Centre fun....NOT [FIXED!]

Hmmm - As someone said WMDC is a great sales tool for the iPhone/GPhone! I plugged in my pesky Windows Mobile 6 phone and it just pops up with "Error" one day... Not useful, at all. I've spent quite a while trying to track down the problem. There's a few sites (pocketpcfaq, modernnomads) out there that do offer useful advice but they didn't solve my problem.
  • Firstly I found out how to enable debug logs for WMDC - note you can also see some of the error messages if you use DebugView.
  • There are also error logs in the Windows Event Viewer 0x8007274a
  • Looking at the wmdc logs I see an 0x80004005 error which a general code for permission denied.
  • Some of these Windows Mobile Power Toys were interesting.
  • This guy (translated from French) has some useful info on security on Windows Mobile.
  • Microsoft's Vista MDC guide
  • Microsoft MDC troubleshooting
  • Finall - I found a fix! - after following up a solution to this error when using IE to download a cab or pdf file: "this device is restricted from downloading this file type" - see my latest post on the matter.
[updated: 26aug09]

Wednesday 29 October 2008

Stopping all OSX Google background 'updater' apps

Once you install Google software you get lumbered with various 'updater' daemons running on your machine. If you want to stop 'em running the Google way then you're obliged to uninstall all Google apps... However there always another way... Here are all the offending processes listed by process name as seen in Activity monitor:
  • "Google Updater Helper" - Firstly started by /Library/Preferences/loginwindow.plist (from here) and subsequently by launchd - (seen by running launchctl list | grep com.google.Updater.helper) - more info on startup from Apple.
    Removal: edit/remove the google item in that file using property editor/textedit/Pacifist
  • "googleml-modwatch" - Started by launchd from: /Library/LaunchDaemons/com.google.GoogleML.plist.
    Removal: rename com.google.GoogleML.plist to com.google.GoogleML.plist.off e.g.:
    sudo mv /Library/LaunchDaemons/com.google.GoogleML.plist /Library/LaunchDaemons/com.google.GoogleML.plist.off
  • "GoogleSoftwareUpdateDaemon" - another launchd startup
    Removal: sudo mv /Library/LaunchDaemons/com.google.keystone.daemon.plist /Library/LaunchDaemons/com.google.keystone.daemon.plist.off
  • "GoogleSoftwareUpdateAgent" - another launchd startup
    Removal: sudo mv /Library/LaunchAgents/com.google.keystone.agent.plist /Library/LaunchAgents/com.google.keystone.agent.plist.off

Then Restart and they should all be gone.... You can still manually run the updates when you want to by running:"/Library/Google/Google Updater/Google Updater.app".

Friday 17 October 2008

How to open .eml [outlook] email attachments

To read an email sent as an attachment from another email client (e.g. Outlook) you just save the file and give it an .eml extension - then you can open it using Mozilla's Thunderbird (on Windows, Linux or OSX) - Just go to the 'File' menu and select 'Open Saved Message...'. I assume you should also be able to use Outlook on Windows.

You can just open the message in a text editor - like Gedit, Notepad, Notepad++, Textedit, etc

There are also some utilities out there to convert .eml to mbox format.

Tuesday 30 September 2008

Gmail labels and date sorting

When you apply a label to a GoogleMail message that message is sorted by the date that label was applied (not the date of the latest email in the conversation) - which can be a bit confusing as the Inbox messages are sorted according to latest dated conversation?! Is this a bug or a feature....

Anyway you can get Gmail to resort all your messages in a particular labelled directory/folder by going into the folder and selecting all messages in folder and reapplying the same label - magically the messages will be sorted according to lastest conversation date!

An alternative approach (which keeps the same ordering in the original folder) is to again select all messages in the folder and the apply a new label - this new labelled folder will contain a properly date sorted list of emails.

Monday 8 September 2008

Dynamic library dependencies - direct or not?

So you're looking at some (Linux) binary and wondering what libraries it uses - You can use ldd to list all the dependencies:
ldd /path/to/your/app
However this shows direct and indirect (i.e. those needed by other libraries) dependencies, so you can tell what are just the direct dependencies by using readelf:
readelf -d /path/to/your/app
The direct dependencies are the libraries listed as NEEDED.

Friday 5 September 2008

Leopard upgrade and kernel crashes/panics

I just upgraded from Tiger (which I was very happy with) to Leopard - which has crashed no lees than four times since I installed it?!! I was going to do a clean reinstall but apart from not wanting to sink more time into I did some Googling and found some possible cures - basically due to older (non-Leopard compatible) versions of software - particularly kernel modules (kext stuff). You can have a look at the kernel modules loaded by running kextstat and looking out for non apple ones. Or better you can use the following incantation to show you all non apple kernel modules (including from the Startup folder) on your system (shows you their bundle name, ID and path):
kextfind -e -f /Library/StartupItems/* -not -bundle-id -i -substring 'com.apple.' -report -b -B -print
Or to do the same for loaded modules only (which are a possible immediate problem):
kextfind -e -f /Library/StartupItems/* -loaded -not -bundle-id -i -substring 'com.apple.' -report -b -B -print
To cure suspect (if you see them in a crash report or seeing nasty logs about them) kext modules - either find an appropriate upgrade, uninstall them or unload and remove them (e.g sudo kexunload /Library/Extensions/Dodgy.kext && rm /Library/Extensions/Dodgy.kext) and reboot.

You should also go and have look at the system logs (Console app) to see if there's nasty messages in there about dodgy goings ons.

Here's s of the known ones that cause issues:
  • Doublecommand - Upgrade or uninstall it - The old version seemed to be the cause of a some USB related crashes.
  • SmartSleep - Seems not to work properly and leaves quite trail in the log files.

Thursday 14 August 2008

I hate Office/Word 2007/2008 Ribbbon crap

The change to Microsoft's "Office" suite with their new ribbon thingy is plain annoying/frustrating and big time waste. I have used Word for years and been comfortable with it (as far as is possible) I knew where things were - but now in 2007 I haven't clue. I'm not saying they were that logical before but they're no more so now and I imagine just annoy/alienate a vast number of existing users.

The stupidest thing was they didn't include some form of helper system for transition or provide a way to switch back to 'classic' mode. Though it turns out that there is some online info, including a Flash interactive helper to help you to find commands from Word 2003 in 2007. An one can purchase an external plugin, Ribboncustomizer, that provides access a version of the old interface - the free edition has some basic functionality including a 'Classic UI' tab.

There are plenty of other word processors out these days and instead of relearning Word I'm keen to move to something else - Open Office is getting better these days and Apple's Office suite is good too. Also online Office suites are getting very usable now - most notably Google Docs and others.

Wednesday 13 August 2008

Automatically blocking failed ssh attempts

If you run an ssh server (sshd) and you're connected to the Net on a public IP then you'll likely be seeing a serious amount of wanna-bee hax0rs trying your box. Pain in the ass. Fortunately there's a few tactics that can be deployed. There's a good article here that covers it. Plus there's a good 'stickied' discussion from a good list of security issues on LinuxQuestions.org. Basically as far as I was concerned two options seem to be the best:
  • Run fail2ban

  • Or install some natty firewall rules (cribbed from above article) written by this guy:

  • (1) Create a custom chain for whitelisting first:
    iptables -N SSH_WHITELIST

    (2) Whitelist any host(s) that you like:


    iptables -A SSH_WHITELIST -s TRUSTED_HOST_IP -m recent --remove --name SSH \
    -j ACCEPT

    (3) Add the blocking rules:


    iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --set \
    --name SSH
    iptables -A INPUT -p tcp --dport 22 -m state --state NEW -j SSH_WHITELIST
    iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --update \
    --seconds 60 --hitcount 4 --rttl --name SSH -j ULOG --ulog-prefix SSH_brute_force
    iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --update \
    --seconds 60 --hitcount 4 --rttl --name SSH -j DROP
  • Advantage: Transparent for users
  • Disadvantages:
    • Does not distinguish between successful logins and unsuccessful login attempts (i.e. three successful logins within one minute will trigger just like three unsuccessful login attempts).

Tuesday 12 August 2008

sshfs using ssh-agent on OSX

The FUSE based sshfs app is pretty nice - but it's even slicker if it imports your ssh-agent keys automatically (as mentioned here) - then it just connects automatically if you're logged into your agent. To do this you need to set up your ssh-agent and the setup sshfs: basically you open the sshfs package and rename the "Contents/Resources/sshfs-static" to "Contents/MacOS/sshfs-static.bin". (Doing the same for sshfs-static-10.5). Then create a new file called sshfs-static (and with sshfs-static-10.5) with the following content:
#!/bin/sh
SSH_AUTH_SOCK=/Users/your-username/.ssh/ssh-agent.pipe $0.bin $*

Now make sure you've installed and set up the ssh-agent according to my instructions then you can start sshfs. Then add a machine you've got a key installed on and it will automatically connect.

[updated] Otherwise now in Leopard ssh-agent works properly and you don't need to follow my instructions - you can use the one here - use this in your sshfs-static:
SSH_AUTH_SOCK=`launchctl getenv SSH_AUTH_SOCK` \
$0.real "$1" "$2" "$3" "$4" "$5" "$6"


Bug reporting and listing/tracking

So how do I report a bug in Windows Vista, Gmail (maybe I'll add others)??? - they don't make it that easy... So I've managed to 'em track down:
  • Gmail - You get it through the help center - but you have to navigate via an unexpected route: Through their trouble shooter and then via issues with 'Registrations & Invitations"....
  • Windows bugs (Vista etc) - You go via their connect system - you'll need a M$ ID. It seems you can only report issues about various subsystems though not the core OS...

Tuesday 5 August 2008

Coolest Firefox plugins

Yeah there's tonnes of 'em but mostly they're a waste of time. These are the ones I like (I'll keep updating this one too...):
  • CustomiseGoogle - Allows various tweaks and additions when using Google's sites
  • CookiePie - Keeps cookies from different tabs/windows separate - E.g. So you can be logged into Gmail in one tab, whilst in another use Google search (and not be logged in) thus not having everything logged (though they could quite easily correlate one's activity by IP...).
  • Flashblock - Stops running Flash items on web pages till you click on the ones you want.
  • Cacheit - Useful to access alternate sources of a webpage - e.g. when the main is down.
  • Dictionaries - Great for spell checking any text as you type into any web form.
  • Add more search engines to the search box - Not actually a plugin but darn useful all the same (e.g. add Way Back Machine, Scroogle (anon Google search), Cuil....)
  • Locate in Bookmarks - Go Parent Folder, Show Parent Folder
More geeky ones:
  • User agent switcher - Useful for playing with your browser's 'identity'
  • ShowIP - Shows the IPv4/IPv6 address of the website you're at.
There are other sites that have some impressive lists too.

Tuesday 22 July 2008

Debugging memory problems on Windows

There's a handy utility called gflags.exe which comes as part of Microsoft's Debugging tools package - it allows you to tweak various debugging features embedded in Windows ntdll.dll (the dll that handles memory allocation etc for all windows apps). One of the most useful features is enabling of pageheap which basically causes your app to crash (so you can catch it in a suitable debugger) when it encounters a memory allocation bug. You can use gflags on the command line or with its GUI - just enter the name of the executable (no path required) - and they start playing with those check boxes.

Friday 18 July 2008

Problems when deleting file/folders on Vista

So you're [desperately] trying to delete a file/folder and it comes up with: "destination folder access denied" and says "You need permission to delete this file"??!
If you still can't delete the file folder then try renaming/moving it somewhere or rebooting (with above technique) and trying again.

Wednesday 16 July 2008

Facebook app spams: "just gave you luv"

This annoying little facebook app (http://apps.facebook.com/which_programming/) automatically spams notifications to all your friends when you click on it's link - its message appears from one of your friends: "'your friend' just gave you luv Click here to accept and see what they did." It purports to be a programming quiz app but just seems to send spam.
[update]: It seems that there are other apps in the [spam] family with a similar name.

Stop Microsoft's Malicious Software Removal reporting home

Microsoft's slightly odd Malicious Software Removal (MRT) gets downloaded and run every month - they apparently produce a new one each month. Granted it does check for a handful of nasty viruses but there are hell of alot more of them out there... However "The Malicious Software Removal Tool will send basic information to Microsoft if the tool detects malicious software or finds an error". It can stopped from reporting home that "basic information", though it's a little hidden in a KB article. Basically run regedit and create a new key:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MRT
Then create a new DWORD item under that key named: DontReportInfectionInformation
with a value of "1"

Tuesday 1 July 2008

Apache tuning

The number of options for tweaking apache is pretty overwhelming. Tuning apache depends on a number of factors - depending on how much resources you have to throw at it and how you decide to run your system, and what you want out of it. There's quite a few places out there that offer some advice (apache, Scrollbag general tuning, IBM network tuning, IBM svn).

I'm mostly interested in fast low memory setup of apache 2 on Linux. One of the first things to decide is what MPM mode you decide to use for your apache installation - there's bunch. In fact Apache2 supports three MPM's prefork, worker, and event. To check which one you're running use either:
apachectl -l which will list the compiled modules - where 'prefork.c', 'worker.c', or 'event.c' indicate the version in use. You can also check by running apache2 -V. To use a different one you usually have to load the appropriate package on your system - but it will depend on which modules you have installed - e.g. using PHP will result in MPM prefork as PHP is not entirely thread safe.

I am currently running in prefork (a bit old school but simpler). In this mode the number of httpd daemons started - which is mainly controlled by ServerLimit directive (and subsequently MaxClients) - whilst there are quite a few others control how many instances are started initially and kept spare etc. You need to make sure that your machine has enough memory to for the number of servers so the machine doesn't start to swap unnecessarily; Once you have sorted out the modules (see below) and config for the server you can see how much memory a single httpd instantiation uses (check using top command). Once you know how much one httpd uses then configure things so that ServerLimit * httpd_memory is less than the total amount of memory available on the system when apache is not running. You can check to see if you got it right by running the system up (with some requests and all servers started - you can set StartServers directive equal to Serverlimit for testing) and checking there is minimum swap activity - using the vmstat command - run it vmstat 5 and check that the so/si (swap out/in) columns are close to zero - if not then tweak down the number on ServerLimit.

Apache provides a vast array of modular functionality - through its loadable modules support. Firstly you want to go through you the modules that you need loaded for your setup, then comment out all the ones you don't need. Things like unneeded language modules (php, python etc) should be off, and stuff like mod_status (particularly ExtendedStatus) should be switched off once you have got your config sorted.

[8dec08] New page on apache optimisations.
[12sept12]: Added info on checking MPM in use.

Wednesday 4 June 2008

Firefox 3 - locate in bookmark folders....Found!!

Yeah - where is it?? I'm trying to keep a list of places (!?&*) about the issue:
[Update:] It turns out that there are two plugins that provide similar functionality!:

Thursday 15 May 2008

*&%$**'ing Windows mobile device center has wiped my XDA - AGAIN!

I cannot believe it!?! My XDA (Windows Mobile 6 Device) has had all my contacts, diary etc info wiped by Windows Mobile Device center for the FOURTH time. I just plugged it in and it asked if I wanted to set up a new association (when I had one set up already) - all my contacts had been deleted at this point - BEFORE asking me!! I can resync with my desktop but its a big pain in the butt. I don't know why it is happening?!! How can Micro$oft get it sooo wrong?

I am seriously considering bombing my XDA for an iPhone (once it's got GPS I will).

[update]: There are some registry tweaks that affect related behaviour here.

Tuesday 8 April 2008

Where have my Bookmarks.html gone in FireFox3 Beta?

In Firefox3 beta the old bookmarks.html file (in your firefox preferences directory - e.g on Linux ~/.mozilla/firefox/somethingrandom.default/) has been subsumed by a system called Places which seems to consist of an SQLlite database in a file called places.sqlite - your bookmarks are imported into this database file on initial invocation of firefox3.

Firefox3 seems a bit snappier and I like the search in the bookmarks as you type in the address field. Also the tagged bookmarks seems handy but I wish they would allow you to know the folder in which your found bookmarks reside - the locate in bookmark folders plug-in doesn't work any more..

Wednesday 19 March 2008

Linking to different versions of a dynamic library

On Linux there's loads of [dynamic ".so"] libraries in places like /usr/lib. The libraries have version numbers; Major version indicates major (API) changes, whilst the minor version typically relates to bug fixes. These version numbers are firstly enshrined with the library using a special symbol (SONAME) - which is assigned on library creation (using the -soname arg to ld). Also libraries are named with their version numbers libsomething.so.2.3. You can verify this using:
objdump -p libsomething.so.2.3* | grep SONAME

So if you're developing and you want to link to specific version what do you do? Well basically there's no neat trick to get the linker (ld) to link a specific version at compile time :( so you can either:
  • Link using the full path to the specific library version
  • Create a softlink/symlink (ending in ".so" - with NO version) to the specific library version
ldconfig does do some stuff related creating links for libraries but as explained here it won't create the plain ".so" necessary for development - these are usually included as part of a "dev" (usually suffixed by "-dev") package on your system (be it Debian or Red Hat or whatever).

Wednesday 27 February 2008

Clearing space on a Mac OSX machine

Firstly you might want to check what's using all your space using Disk Inventory X. Then there are quite a few articles (here, here, here) out there describing how to make space by deleting various wierd files. I'm just making a list here ones that I found made a difference (just run sudo rm -rf with dirs below - you can check how much they're taking using df -sk ) - though don't blame me if they bomb your system!
  • ~/Library/Caches/* - Not sure about * but these are ones I've tried:
    • ~/Library/Caches/com.apple.SoftwareUpdate/*
    • ~/Library/Caches/Desktop/*
    • ~/Library/Caches/QuickTime/*
  • /Library/Packages/*
  • /Library/Caches/* - Not sure about * but these are ones I've tried:
    • /Library/Caches/com.apple.SoftwareUpdate/
  • /System/Library/Caches/*
  • /private/var/root/Library/Caches/*
  • /cores/*
If you're running macports then there also these locations:
  • /opt/local/var/macports/build/
  • /opt/local/var/macports/distfiles
[updated 1 May 09]

Wednesday 20 February 2008

Oyster maximum/full fare con

So the Oyster card in pre-pay can be useful but their full-fare charging is BAD news - their systems opt to charge you if you mess up at all, and even charge you when don't. The following can incur a full-fare charge:
  • Not touching in/out within a station that has multiple gates (e.g. Canary Wharf)
  • Touching in and out at the same station straight after one another - e.g. trains are messed up. (in theory you're only charged a 'platform' fee but in practice if the time between touching and out is too short, and/or you're at an open station with one Oyster reader, then you get charged a fullfare).
  • Error noise when touching out then trying again (again not always but watch out...)
In any of the above cases call the Oyster help line (0845 330 9876) and then dial 4 (for maximum/full fare inquiries) then ask for a refund - they do usually oblige.

Tuesday 12 February 2008

Vista(32bit) drivers for AMD-8111 AC97 Sound card and I/O core

This was a pain to find and install. It doesn't seem to be supported by Microsoft (though some people report seeing the driver in their distribution). I'm running Vista Business on an (old) Sun W1100z. Basically I managed to install it by getting hold of the Windows® 2000/ME/XP AC’97 Audio Driver Version 1.8.7 or getting the X_1_8_7.zip package (and unzipping it) then going to Device Manager and right-clicking the duff audio device entry and select 'Update driver software...' - choose 'Browse my computer for driver software' and selecting the location where you unzipped the driver package to - making sure that search sub directories is clicked. It should find the driver there.

AMD also have a driver pack that contains all the drivers for the whole AMD-8000™ Series Core Logic - which provides for a variety of functions (USB, HPET, AC'97, etc) - rather like Intel's 'SouthBridge'.

Saturday 9 February 2008

Google Sketchup install problem on OSX

A friend tried to install Google's latest Sktetchup 6 and despite the fact he's running Mac OSX 10.4.11 it failed to install and complained that "Google SketchUp requires Mac OS X 10.4 or above"?? So I thought I'd take a look...

It turns out that the installer does a check for the OS version which apparently fails - I'm not quite sure why as it looks like an ok check - anyway if you want to install it then you can tweak things to get it going. Basically you can eliminate the check:
1) Download and mount the GoogleSketchUpMEN.dmg image
2) Copy the install package (named something like: FM101326ENA.mpkg) to your desktop
3) Locate the package on your desktop and open it using the Control-click (or right-click) menu 'Show Package contents' - open the 'Contents' folder and locate the info.plist file.
4) Edit the info.plist file - using a text editor (or plist editor), or just use the command line : vi ~/Desktop/FM101326ENA.mpkg/Contents/info.plist and remove the lines starting here:
<key><IFRequirementDicts</key>
<array>
<dict>
........
And finishing here:(about 22 lines)
</array>
5) Locate the installer on your desktop and run it - and it should just work!