Saturday, August 30, 2014

Firefox 64-bit Nightly, Google Account, and FireFtp Addon ...

I have been a long-time Firefox browser user. Recently I have started using Firefox 64-bit Nightly, the 64-bit Firefox browser that is still in testing.

My experience suggests that the 64-bit version appears to have a better performance when compared with its 32-bit counter part -- well, this is just my feeling and I don't have objective data to back it up; it could have been the result that I restarted the 64-bit version more often than I did with the 32-bit version that eventually became almost frozen and had to be restarted.

A definite beneift, perhaps, just a short-term benefit, is that I can continue to use my beloved FireFtp addon.  FireFtp addon somehow did not catch up with version updates of the 32-bit Firefox and is now disabled by the lastest version of the 32-bit Firefox. However, I found that the 64-bit Firefox does not have the problem.

Besides, my own experience is that the 64-bit Firefox is quite stable and it only crashed a few times in more than a month.

The only problem that I really need to deal with when I use the 64-bit Firefox is the problem with signing into any Google account, e-mail, blogger (this blogger), voice ... The problem is that  from time to time, when I tried to sign in a Google account after a restart of the 64-bit Firefox, the Google sites report an error,

Oops! Your browser seems to have cookies disabled. Make sure cookies are enabled or try opening a new browser window.

The error message puts the blames on "cookies". In fact, regardless, following the steps from Google Support, such as this one, how I enable cookies on the browser, remove any history, and cached items, the problem remains. Finally, I realize that it is not a probem  is not with the cookies at all.

The solution is quite simple -- it is the 32-bit Firefox. Whenver the problem occurs, I follow the steps below,

  1. Close the 64-bit Firefox immedialy, no need to meddle with cookies, web histories, and caches;
  2. fire up the 32-bit Firefox;
  3. log onto any Google account once using the 32-bit Firefox;
  4. and then close the 32-bit Firefox;
  5. finally restart the 64-bit Firefox.

Eureka! Wahla! I can now sign in any Google accounts.

So what's wrong with Firefox 64-bit Nightly? The problem may not be with Firefox; instead it may be a problem with Google, as indicated in this bug report -- I guess in this case the 32-bit Firefox sets the values of the relevant attributes to those that Google expects.


Problem Adding Google Account to Android Devices

I was trying to add the required Google Account to an Motorola Android phone and encountered a problem. The error message states,

Can’t establish a reliable data connection to the server.  This could be a temporary problem or your SIM card may not be provisioned  for data services. If it continues, call Customer Care.
Google searches produced numerous hits. I tried a few and they did not work for me.

After a little bit careful investigation, I noticed that the time displayed was far off. Although I checked the "Automatic Update Time" option, the device did not appear to update the time to a correct one. My understanding is that when the time is far off, any security protocol using SSL will not work as it requires the messages are time stamped recently, well, to prevent varous forms of the message replay attacks. Then, I used the following solution and it worked.

  1. Uncheck the "Automatic Update Time" option
  2. Manually set time to a correct one. I  used the clock on my computer as a reference. It does not have to be very precise. But, do note that the time zone on the Android device may not be the one your computer is in. If it is the case, you may use a time reference that is in the same time zone of the Android device (e.g., The Official NIST US Time); or simply set the time zone on the Android device to the time zone of your reference time. 
  3. Now add your Google account. It should work now.

Tuesday, July 22, 2014

After Kernel Upgrade VMware Ubuntu Guest Hang During Boot

I am running a Ubuntu Saucy (13.04) guest and later a Ubuntu Trusty (14.04) guest using VMWare Player on Windows 8.1. What has troubled me is that the guest hangs every single time after the POST screen is shown during boot after I upgraded the kernel. I have to press "Ctrl-Alt-Del" to restart, enter "Advanced Option" from the Ubuntu boot menu and choose an old kernel to boot. I finally figured out how to solve the problem.  The hint of the solution came from my examining the VM log file. The location of the VM log file is on the VMware Player's "About VMware Player" window. From VMWare Player, you can open the window by clicking on the "Player" menu, next "Help", and then "About VMware Player". Below is an example of the "About VMware Player" window.

 

In the above example, the VM log file is at C:\Users\...\Ubuntu\vmware.log. When the Ubuntu is hangs, at the end of the VM log file, I saw some log messages similar to the below,

2014-07-22T19:21:19.299-04:00| vmx| I120: GuestRpcSendTimedOut: 
                                          message to toolbox timed out.
2014-07-22T19:21:19.299-04:00| vmx| I120: Vix: [5648 guestCommands.c:1924]: 
                                          Error VIX_E_TOOLS_NOT_RUNNING in 
VMAutomationTranslateGuestRpcError(): VMware Tools are not running in the guest
2014-07-22T19:21:25.635-04:00| vmx| I120: USBGW: Write arbitrator op:13 len:11

My guess is that the VMware Tools is not installed and configured properly for the new Linux kernel. The solution would to reinstall the VMware Tools. Since the Ubuntu guest hangs during boot, I have to find an alternate to do it. Luckily, I can boot the Ubuntu guest into the "Recovery Mode" with the problematic Linux kernel via the "Advanced Option" during boot. 

I observed two difficulties when I tried to reinstall the VMware Tools in the "Recovery Mode".
  1. When I tried to install the VMware Tools when I switched to shell in the "Recovery Mode" by running <code>sudo ./vmware-install.pl</code>, I observed many warning messages similar to below,
    
    The /tmp directory may be under attack
    


  2. You may have to download the VMware Tools, for which, we need to enable network in the "Recovery Mode". 

To address the above difficulties, my solutions is,

  1. In the "Recovery Mode", first enable "network" from the list of options.
  2. Then go to shell (by choosing "Drop to root shell  prompt").
  3. Start the sshd. This is a two-step procedure.

    
    mkdir /var/run/sshd
    /usr/sbin/sshd
    
    
  4. Now, figure out the IP address of the guest (e.g., using ifconfig)
  5. Log onto the virtual machine using a Secure Shell client as a regular user with sudo privilege.
  6. Install the VMware player as the regular user using sudo.
  7. Reboot. The the problem went away.

Thursday, March 20, 2014

Internet Explorer 11 Always Load Outlook Web App Light

One may access Microsoft Exchange service using the Outlook Web App. However, Internet Explorer 11 now only loads Outlook Web App Light regardless the user's choice during login. This is a known problem as described here that indicates that "[t]his issue occurs because the MSIE token is removed from the user-agent string in Internet Explorer 11." The solution is to create a workaround, that is to use Internet Explorer 11 in compatibility mode to access OWA. "To do this, press F10 to display the menu bar, go to the Tools menu in Internet Explorer 11, and then click Compatibility View settings. Then, add the OWA site to the list of sites to be viewed in compatibility view." as indicated in the article.

The following is the User-Agent value obtained from a JavaScript's navigator object. The code snippet is as follows,
<script type="text/javascript">
    document.write("<ul><li>UserAgent: " 
        + navigator.userAgent + "</li></ul>");
</script>
You can observe and compare what the User-Agent value you obtain before and after switching to the Compatibility View.

Tuesday, March 18, 2014

Friday, February 28, 2014

GNU Cash (Perl Finance::Quote) Failed to Retrieve Stock Price Quotes

I have been GNU Cash for a couple of years. I set up Perl Finance::Quote to automatically update stock price quotes. GNU Cash suddenly reports that it cannot retrieve stock price quotes.

Using this opportunity, I updated GNU Cash to 2.6.1 and reinstalled Finance::Quote module. However, the problem remains.

I am running GNU Cash on both a Windows XP box and a Windows 8.1 box. On both machines I observe the same problem. The detailed problem description is as follows,

(1) Version of Perl

C:\>perl --version
This is perl 5, version 16, subversion 3 (v5.16.3) built for MSWin32-x86-multi-
thread (with 1 registered patch, see perl -V for more detail)

Copyright 1987-2012, Larry Wall

Binary build 1603 [296746] provided by ActiveState http://www.ActiveState.com
Built Mar 13 2013 11:29:21


(2) Perl Finance::Quote with GNU Cash

C:\Program Files\gnucash\bin>perl gnc-fq-check
("1.18" "vwd" "yahoo_nz" "australia" "amfiindia" "usfedbonds" "canada" "yahoo" "
adig" "bux" "aiahk" "bsero" "yahoo_australia" "unionfunds" "lerevenu" "asia" "ts
x" "sixfunds" "indiamutual" "bse" "hungary" "known_currencies" "fidelity_direct"
 "goldmoney" "tdwaterhouse" "trustnet" "ftportfolios_direct" "cominvest" "mornin
gstar" "ftportfolios" "tdefunds" "hu" "za" "fundlibrary" "stockhousecanada_fund"
 "yahoo_europe" "platinum" "maninv" "tsp" "financecanada" "usa" "france" "trowep
rice" "nasdaq" "bmonesbittburns" "yahoo_asia" "tiaacref" "troweprice_direct" "se
b_funds" "yahoo_brasil" "greece" "fidelity" "fetch_live_currencies" "romania" "d
wsfunds" "finland" "hex" "brasil" "asegr" "deka" "nyse" "canadamutual" "asx" "fi
nanzpartner" "fool" "dutch" "uk_unit_trusts" "sixshares" "nzx" "aex" "nz" "vangu
ard" "europe" "bourso") 
 

(3) Problem: when Finance::Quote in GNU Cash is being installed, the installation script actually reports an error despite that it states the process was successful. See below,

C:\Program Files\gnucash\bin>install-fq-mods.cmd
GNU Cash
......
* Run gnc-fq-helper

Use of uninitialized value within %info in string eq at C:/Perl/site/lib/Finance
/Quote/Yahoo/Base.pm line 222, <> line 1.
Use of uninitialized value $info{"Missing Symbols List.\34p_change"} in substitu
tion (s///) at C:/Perl/site/lib/Finance/Quote/Yahoo/Base.pm line 238, <> line 1.

Use of uninitialized value within %info in pattern match (m//) at C:/Perl/site/l
ib/Finance/Quote/Yahoo/Base.pm line 243, <> line 1.
(#f)

* Installation succeeded

(4) gnc-fq-dump and gnc-fq-helper fails. Now I try GNU Cash's gnc-fq-dump, it actually fails. It is perhaps the result of some issue with Active Perl. For instance,

C:\Program Files\gnucash\bin>echo (yahoo "TGT") | perl gnc-fq-helper
Use of uninitialized value within %info in string eq at C:/Perl/site/lib/Finance
/Quote/Yahoo/Base.pm line 222, <> line 1.
Use of uninitialized value $info{"Missing Symbols List.\34p_change"} in substitu
tion (s///) at C:/Perl/site/lib/Finance/Quote/Yahoo/Base.pm line 238, <> line 1.

Use of uninitialized value within %info in pattern match (m//) at C:/Perl/site/l
ib/Finance/Quote/Yahoo/Base.pm line 243, <> line 1.
(#f)

which is the same error I saw during the installation of the Finance::Quote module.

I attempted a few methods neither of which works. The methods I attempted were.
(1) Completely remove GNU Cash and Active Perl and reinstall GNU Cash and Active Perl
(2) Update Perl modules using "cpan -r".

What actually works is to replace Active Perl by Strawberry Perl. I obtain this solution by reading " install-fq-mods.cmd that actually attempts to install Strawberry Perl if perl cannot be found.

Here is the steps that leads to a success.
(1). Completely remove Active Perl. There is no need to reinstall GNU Cash. So leave GNU Cash alone
(2). Download and install Strawberry Perl. 
(3). Install Perl Finance::Quote module


C:\Program Files\gnucash\bin>install-fq-mods.cmd

(4). Test the functionality using gnc-fq-helper

C:\Program Files\gnucash\bin>echo (yahoo "JPM") | perl gnc-fq-helper
(("JPM" (symbol . "JPM") (gnc:time-no-zone . "2014-02-27 16:01:00") (last . 56.6
9) (currency . "USD")))

(5). Test the functionality using gnc-fq-dump

C:\Program Files\gnucash\bin>perl gnc-fq-dump nyse JPM TGT
Finance::Quote fields Gnucash uses:
    symbol: JPM                  <=== required
      date: 02/27/2014           <=== required
  currency: USD                  <=== required
      last: 56.69                <=\
       nav:                      <=== one of these
     price: 56.69                <=/
  timezone:                      <=== optional
=====

Finance::Quote fields Gnucash uses:
    symbol: TGT                  <=== required
      date: 02/27/2014           <=== required
  currency: USD                  <=== required
      last: 60.66                <=\
       nav:                      <=== one of these
     price: 60.66                <=/
  timezone:                      <=== optional

It works.
By the way, the information about version of the Perl and Finance::Quote are as follows,

C:\Program Files\gnucash\bin>perl --version

This is perl 5, version 18, subversion 2 (v5.18.2) built for MSWin32-x86-multi-t
hread-64int

Copyright 1987-2013, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.


C:\Program Files\gnucash\bin>perl gnc-fq-check
("1.20" "bitcoin_gbp" "known_currencies" "bsero" "bitcoin_sek" "fetch_live_curre
ncies" "hu" "hex" "bitcoin_nok" "australia" "bitcoin_cad" "tdefunds" "mtgox_jpy"
 "fool" "bitcoin_hkd" "yahoo_europe" "mtgox_chf" "finanzpartner" "europe" "bitco
in_cny" "ftportfolios_direct" "unionfunds" "bitcoin_thb" "ftportfolios" "yahoo_b
rasil" "uk_unit_trusts" "lerevenu" "aiahk" "bmonesbittburns" "mtgox_hkd" "sixsha
res" "yahoo_nz" "mtgox_nok" "deka" "za" "maninv" "nasdaq" "bourso" "tsx" "bitcoi
n_jpy" "financecanada" "mtgox_dkk" "dwsfunds" "cominvest" "sixfunds" "bitcoin_sg
d" "mtgox_eur" "asegr" "mtgox_usd" "bitcoin_usd" "fidelity" "stockhousecanada_fu
nd" "bitcoin_chf" "asx" "fundlibrary" "bitcoin_pln" "mtgox_aud" "nzx" "amfiindia
" "nz" "romania" "bitcoin_rub" "yahoo" "nyse" "tiaacref" "canada" "asia" "usa" "
greece" "france" "hungary" "mtgox_pln" "fidelity_direct" "bse" "yahoo_asia" "bux
" "troweprice_direct" "mtgox_sgd" "morningstarjp" "platinum" "aex" "mtgox_cny" "
mtgox_sek" "yahoo_australia" "mtgox_rub" "usfedbonds" "mtgox_nzd" "bitcoin_dkk"
"brasil" "trustnet" "vanguard" "adig" "vwd" "mtgox_cad" "bitcoin_eur" "canadamut
ual" "finland" "bitcoin_nzd" "troweprice" "dutch" "indiamutual" "tdwaterhouse" "
tsp" "seb_funds" "goldmoney" "morningstar" "mtgox_thb" "bitcoin_aud" "mtgox_gbp"
)

which means that it is probably that Finance::Quote 1.20 works while 1.18 has some problem.

Tuesday, February 18, 2014

Redmine Error: Phusion Passenger Watchdog Failed to Start

Having upgraded a few package including Redmine and Ruby on Rail, my redmine host failed to start. I am running a Apache web server for the Redmine. When I browse the Redmine host, the error message returned in the web browser is


Application error
Rails application failed to start properly

The Redmine's production log at the redmine/log directory indicates nothing is generated in the log, which means Redmine does not even run. To verify that Redmine itself is actually OK, run it from the command line,

ruby script/rails server webrick -e production

Then point the browser to http://localhost:3000/. The Redmine server runs OK. Checking Apache's error log (the error_log file) a little bit closely, the error message looks the following,

[pid=9135 thr=140212503205888 file=ext/common/LoggingAgent/Main.cpp:287 
time=2014-02-01 03:29:02.699 ]: *** ERROR: Cannot stat 
'/var/log/passenger-analytics': Permission denied (13)
     (empty)
[Sun Feb 01 03:29:02 2014] [error] *** Passenger could not be initialized 
because of this error: Unable to start the Phusion Passenger watchdog 
because it encountered the following error during startup: Unable to start 
the Phusion Passenger logging agent: it seems to have crashed during startup 
for an unknown reason, with exit code 1
At the same time, the redmine_error.log that belongs to the virtual host in which the Redmine runs shows something similar to,

[Mon Feb 01 22:55:15 2014] [warn] [client 10.0.0.1] (104)Connection reset by peer: mod_fcgid: 
 error reading data from FastCGI server
[Mon Feb 01 22:55:15 2014] [error] [client 10.0.0.1] Premature end of script headers: 
 dispatch.fcgi

Now it becomes clearer that the problem may be that Phusion Passenger cannot access the directory /var/log/passenger-analytics. After I give sufficient permission to the directory as follows, the Phusion Passenger starts OK and the Redmine runs normally.

chown -R apache:apache passenger-analytics
chmod -R 750 apache:apache passenger-analytics
chcon system_u:object_r:httpd_sys_content_t:s0  passenger-analytics

The last step is necessary since SeLinux is enabled in my case. A second, perhaps a better approach is to route any analytics logs to Redmine's log directory, for which, I added the following line to the Redmine's Apache configuration file, in my case /etc/httpd/conf.d/redmine.conf,


<VirtualHost *:80>
   ......
   PassengerAnalyticsLogDir REDMINE_ROOT/log
   ......
</VirtualHost> 

In the above, replacing REDMINE_ROOT by the root directory of the Redmine installation, such as /home/usr/redmine etc. In this case, there is not need to change the directory permission and ownership since the Redmine directory should already have had correct permission and SeLinux context. In addition, you can consolidate the log files in a place that you like.