Old Java version uninstall stuck with mismatched uninstaller

A client of mine had finally got long-haul WIFI into their area. Before that they were on Satellite Internet with a very low and capped quota (4 GB/month). Consequently things like Java and Windows updates were manual. As they were in the middle of no-where then not too many site visits by me either.

I remote desk-topped into their machine and was doing updates for them. The Java was version 6 so I added version 7 and tried to uninstall version 6. It wouldn’t do this. The uninstaller dialog box referred to a different version from what it said was installed in the Control panel installed applications list and it didn’t  remove the installed version anyway but just exited.

The fix I found was to download the most recent Java version 6 (update 39) and install that and then that updated the installed software list and flushed the problem. I then uninstalled that new version and it worked – Java 6 was gone.

How to Fix Stalled Outlook incoming email.

If the Outlook emails fail to be picked up then it is probably some junk SPAM and probably malformed using international character sets. To fix this,
a) In Outlook pick,
Tools -> Send/Receive -> “< the broken account name>” Only -> Download Inbox Headers

b) Outlook will now download just the headers. The first one that comes in (i.e. the oldest one) is probably the bad message that is breaking Outlook e.g. if it is Monday and you are getting emails up until Saturday evening then the next message on Saturday evening is probably the bad message.

c) Right-mouse on that message and select “Open”. It will not have any local message but will ask what you want to do. Pick the last option of,
“Mark to delete this message from the server”

And then do OK.
d) Now do your normal Send/Receive All and all the backlogged messages should download normally and any marked for deletion emails (as above) will be automatically deleted.

Site Landing Page fronting WordPress

A client wanted a site-wide landing page with some basic images and a few navigation buttons to front-end their WordPress site and other places like their Etsy shop and Social media links.  Out of the box WordPress allows you to define a home page (see under the admin options for Settings->Reading) but that isn’t exactly what they wanted as that is still within WordPress and so has the header, menus and footer and all the other stuff related to a WordPress site unless the theme allows for all of these to be turned off.

When you connect to the URL without any path or a resource file name e.g. www.openmutual.org rather than for example www.openmutual.org/blog/example.txt then (using Apache) the file that will be presented if a file is not specified in a URL is decided by the mod_dir  DirectoryIndex directive (or in IIS the <defaultDocument> elements).

WordPress by default has an index.php file in its root and usually this is what is normally used. If your hoster has setup their DirectoryIndex similar to the above then the index.html file will override the index.php If so then you are good to go. If not then you will have to get your hoster (or it may be you) to get index.html being dished out in preference to index.php. The two options open to my client are to,

a) move the WordPress out of the site root e.g. move the files to /blogging or similar subdirectory and then add a static web page e.g. index.html
b) or add an index.html with static code in it that will be run first before index.php

The option a) is obvious but I wanted to avoid that for the moment so I picked b) to see if that would work. Please read the “quirks” at the bottom and test this on your own test beds before playing with a client site !

Step 1) On WordPress create a new page with any name and slug (we’ll called it My Home and have a slug of my-home )
Step 2) Copy the contents of the existing Home page to this new page (use control-C and control-V or similar)
Step 3) There is usually no need to change anything in Settings->Reading for the front page displays but you cannot set it to a Static page that is navigable in the menu. The reason being is that whatever you set as the WordPress Static front page is given a slug of /. If it is already set to posts of Home then you can leave it as that.
Step 4) Edit your Theme menu in Appearance -> Menus and remove the existing “Home” or whatever has a slug of your site root (/) and replace it with your new copied home page (in my example “My Home”)
Step 5) You can add the original Home page back but give it a different name e.g. “Site Root” as it will jump you back to the non-Wordpress file.
Step 6) Test that your tweaked WordPress site still works OK. You won’t notice many problems yet.
Step 7) Create an index.html file and have at least the one link to your new “My Home” WordPress slug e.g. <a href=”./my-home”>My Blog Site</a>
Step 8) Upload and check the new file gets priority. If not then check the Apache mod_dir  DirectoryIndex directive is set correctly e.g.

<Directory /> 
DirectoryIndex index.html index.php 
</Directory>

That is all is needed. Now when web visitors hit your web site they will get the index.html and they can then navigate from there. When they click any WordPress link slug from that landing page then they then go to your WordPress site and will stay there unless you have given them a menu option to escape back up to the index.html.

Quirks:

  • You MUST set Permalink Settings to something other than the default of …site/?
  • When you are in Media Manager then when you try and view an attachment then it will go to the attachment page and not the media file link.
  • When you insert an image into a post or page then do not use the attachment post ID but the media file link.
  • This may not work on other web servers – I have only done this on Apache

Bypass LCD fan hardware POST on SONY all-in-one VGC-V2M

A client has a SONY VGC-V2M all-in-one PC. It is like a fat TV – a P4 based motherboard in a black case with built-in LCD, DVD, and all the usual sockets.

If it halts on a LCD FAN hardware error then the computer is still usable until you can investigate further. At the American Megatrends BIOS POST then do the following sequence to get Windows booted,

F2     to get to BIOS
ESC    to exit from bios it will ask to discard or not
<return or enter>  to pick the OK to discard

now Windows will continue to boot.  Now is obviously the time to make sure your backups are up to date !

Adding Memory

As an aside it is actually easy to upgrade the memory in this all-in-one. You slide the back up a few inches until it catches and then it sort of pops off by moving it back away from the case. How it latches is some locking tabs that fit through gates into a slide so you have to slide the back up until the tabs are aligned at the gates and then it easily pops off backwards. Don’t force it.

The memory is under the metal panel on the right hand side (looking from the back). Motherboard has two slots and AFAIK it is 1 GB max of DDR PC3200 400 Mhz CL3 or similar per slot. You probably have 512 MB fitted and running Windows XP so for routine Office use just fit another 512 MB for the cheapest upgrade as Windows XP is now unusable rubbish on only 512 MB but fine on 1GB. Maximum is 2 GB in total i.e. 1GB+1GB.

Internet Explorer (IE8,IE9) slow page load due to Flash and ONSPEED sliprt.dll

Client complained about slow internet page loads. They use Windows Vista and Internet Explorer 8 and to date it had been fine. When I looked at the problem it was just like the browser was stalled trying to connect to a down host. It would take minutes to load a page and was basically unusable. Very frustrating because Opera and Firefox both worked fine.

I got them working temporarily on Opera and arranged to pick up the laptop when they went on holiday for a few days. Back at base I tried a few things which did not work

  • IE8 -> IE9 upgrade
  • IE9 -> IE8 downgrade (uninstall IE9)
  • ONSpeed uninstall and re-install

and then I just got the feeling that flash was a problem. I downloaded the flash installer (which is a downloader not the full application) and tried to run this.

I got an error message about sliprt.dll was not found e.g. This program can’t start because sliprt.dll is missing from your computer.  Try reinstalling the program to fix this problem. The sliprt.dll is part of the Slipstream which is used by ONSPEED. This is HTTP cache/accelerator. The dll does exist in \Windows so obviously some other problem and the error message is due to a missing program call.

I then downloaded the full flash install file ( see http://forums.adobe.com/thread/889580 ) for both Internet Explorer and for “Other Browsers”.

These ran OK and installed without error. This cleared my Internet Explorer stalling and running slow problem and now IE8 is working fine. I upgraded to IE9 and that is also working fine. I was also able to upgrade to Windows 7 Home Premium (using upgrade disk) and the laptop remained stable.

May not work for you but it fixed my client problem.

vTiger CRM missing language file causes Sorry! Attempt to access restricted file.

When you add a new user (in vTiger CRM v5.4.0) then it is possible that you can select a language setting e.g. “English GB” that has a non-existent translation file. If you do this then that user will get the error message,

Sorry! Attempt to access restricted file.

on a blank screen after they log on. They will stay in this state forever until the logon cookie is removed or the language file is created. The language files exist under the path,

include/language

To fix this you must either

  • upload the correct language file or
  • use another browser and go in as a working user e.g. admin and reset the language to a known working language e.g. English US or
  • clone the include/language/en_us.php to the correct file name e.g. en_gb.php. To identify what file is needed you can add a print_r($filepath); to the include/utils/CommonUtils.php file function checkFileAccessForInclusion() around line 2817 onwards but before the die(). You can’t keep that debug code in place as the ajax javascript breaks but it will tell you what language filename it is after.

That should solve this first-day-of-use problem.

FreeSWITCH dialplan system and null strings

In a FreeSWITCH dialplan the application action system is used to execute system e.g. shell commands. You can also use the returned result from a system command to set a dialplan variable e.g.,

<action application="set" data="result=${system myscript.sh"/>

The problem is that if the system directive does not return a null terminated string then extra garbage can end up in the data variable in the dialplan.

So your shell script must explicitly terminate any strings in its output. Normally this won’t be a problem but if you are using piped results and awk then you can end up with no null.

In your awk print you must use printf as follows,

awk '{ printf "%s%c", $1, 0 }'

That will print your string (e.g. $1 field) and then print the number 0 as a character. This in effect fakes what is returned as a string that is null terminated.

Here is the FreeSWITCH wiki on the dialplan use,

http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_system

Here are some of my examples as used in custom feature codes,

http://www.openmutual.org/resources/freeswitch-custom-features/

 

Fixing lost CMOS on Acer Aspire One

Now it is summer then computer equipment can overheat. An odd problem appeared on an Acer Aspire One model ZG5 also known as the AOA 150 after it got run on a bed. If you are going to watch movies or do work in bed then I recommend to everyone that you buy one of those melamine tea trays and turn the tray upside down and then use that as a laptop support. When the Acer powered up then it had no display. It had power and the hard disk unparked as if to start up but nothing like normal booting activity and always a blank screen. Over-enthusiastically I pulled this computer apart before I looked around for a less screw-driver related fix. The laptop is easy to dismantle once you know how to remove the keyboard (I have already replaced this before – there are no screws but three tabs that are just above the top row of keys and you click these in. The keyboard is then removed, taking care to unclick the flexible ribbon). But I digress and re-assembled it and did this Acer emergency BIOS recovery trick which is detailed on the ACER web site here,

http://support.acer.com/acerpanam/netbook/0000/acer/aspireoneaoa110/aspireoneaoa110faq22.shtml

 

  1. format a USB key using Windows FAT. Probably work with FAT32 but I used FAT. I used an old 1 GByte key but probably any size would work. It does not have to be bootable – just formatted.
  2. download the latest BIOS ZIP file from the Acer website at http://support.acer-euro.com/drivers/notebook/as_one_150.html  This will currently be v.3314.zip
  3. unzip this BIOS zip file contents into the USB key
  4. rename the ZG5_3114.fd to a new file name ZG5IA32.FD (it must be that name). You should now have at least this ZG5IA32.FD file you renamed and the FLASHIT.EXE Note that the file names are case insensitive – this is DOS.
  5. Insert the USB key into the left hand USB port on the broken Acer.
  6. Insert the Power socket
  7. Hold down the Fn and the Esc keys and then push on the power button as normal keeping the Fn+Esc keys pressed.
  8. The power light will go on then flash and the USB key activity light may also blink. Once the power light has flickered then you can release the Fn+Esc
  9. After all the lights have stopped blinking then it is finished. It should reboot by itself and then it will now be working fine. You will have to reset the date/time.

If it still doesn’t work but it still has the power coming on then retry the process above to make sure you are doing all the steps right as this should fix this problem.

 

 

Resetting Plesk subscription Renewal date to never suspend

If you have a virtual host with Plesk Parallels for your own use then you might accidental setup your subscriptions to expire which is a bit annoying for internal users that have no need for billing related expirations. Though you may change the Service Plan to never expire this does not update existing subscriptions and they will remain with an expiry date.

To remove this expiry date you must first set the service plan to have an unlimited Validity period (see bottom of the setting page for the service plan) and then go into each subscription that has a renewal date i.e. it is not “—” and customise the Expiration date to be unlimited.

This will now lock that subscription but it will have no Renewal date. Now you click the Unlock and Sync and this subscription is now back in sync with the service plan with no renewal/expiration date.

Do this for each subscription that you do not bill clients for.

Unintended consequences – shopping bags

Like many we avoid the throwaway plastic shopping bags but have been driven to use the large re-usable ones. But the law of unintended consequences has happened and we now use these reusable bags for so many things we wonder where they have been all our lives,

  • they are great to carry computer desktops. Much easier than by hand but check sizes first.
  • Can be used to carry flat screens as well. Obviously not old CRTs but not many of those left.
  • perfect for network cables and other odds and ends that can’t be carried easily
  • ad hoc toy containers or a solution to clear a desk
  • laundry bags both to and from the washer and onto the line
  • to take recycled bottles and plastic to the the recycling bins
  • wood carriers to bring in firewood

Oh and shopping.

 

 

Using error_log() with print_r() to gracefully debug PHP

When debugging php code (especially Open Source code you have not written yourself) then to get a feeling of what is passed around when it doesn’t work I find that the print_r() function is very useful.

Trouble is that if you just throw in print_r() into the code where you think it is faulty then you can upset json, AJAX or your web page layouts as the print_r() splatters stuff to your displayed web page or in some cases the PHP file is not going to a browser (e.g. the PayPal IPN notify).

The trick is to throw it at the error log as follows e.g. if I was tracing what $number was being set to then I would use….

error_log(print_r($number,true));

note that you MUST set that print_r() option to “true” so that it returns a string. This string is then sent to the error_log() function which formats it with referrer details and puts it into the Apache error log.

Where does it end up ? Well on my test system on a non-vHost it is /var/log/apache2/error.log and on a vHosted server it is :/var/www/vhosts/<domain name>/statistics/logs/error_log so on your own system it will be a similar Apache error log file. Just tail that file to see what the messages are which will be something like this (in this example the $number was “2008” so the output for that error log message was,

[Sun Jan 01 13:21:12 2012] [error] [client 192.168.2.2] 2008, referer: http://19
2.168.2.250/bluebox/index.php/numbermanager/index

To synchronize the log messages with your testing then just look at the logging time.

Using audacity to create auto attendant /IVR prompts (low cost)

If you are getting someone to say the script (or yourself !) in-house and want a low-cost recording solution without a professional sound recording setup then I use Audacity with an ordinary microphone from a VOIP headset and a few tweaks. Audacity is a good Open Source digital audio recorder and effects processor.

I use a piece of A4/Letter (80gsm) photocopy/LASER copier paper between your mouth and the microphone. This will de-pop your speech. It makes a dramatic difference. Just hold the paper from the bottom so you can still see over it to read the script on your computer screen but don’t have the paper touch the microphone or your mouth (lips, beard, moustache etc).

Open Audacity and set the project rate to 16000 Hz and the input as 1 (Mono) Input. The input is in the Device toolbar (See View->Toolbar -> Device toolbar to make sure it is displayed).

Have your script visible on the computer screen, the de-popper paper held in one hand between the microphone and your mouth and click the record button.

Wait a few seconds to get the background noise (i.e. allow the microphone to pick up the ambient noise because we need to remove this later) then speak your script at a normal pace. At the end leave a few seconds of silence and then click the stop button.

Now select the starting silence (not your words or any clicks from your mouse button at the very start) and click the option Effect->Noise removal and then click the option button in the noise removal Step 1 of “Get noise profile”. It remembers this so now select ALL the audio and then redo the Effect -> Noise removal and take the defaults and click OK.

If you listen it should now be dead silent between words and phrases that you say.

Now select the silence at the start and use the scissor tool to cut this. Select the end silence and use the scissor tool to cut that. Note that you might see a tiny click at the start and end which is the mouse click when you clicked the Record button. Cut this out as well.

That is about all you need to do. Save this as a Audacity PROJECT and then export it as a 16 bit PCM wav file. Upload this and see if it works for you. If the volume is too low then re-open the Audacity project and use the Effect->Amplify to adjust this and then re-save as a new WAV file.

Other tricks are to use Bass boost effect to give your voice some gravitas or to use pitch controls, though you do risk sounding artificial if you alter it too much.