Tuesday, September 27, 2011

Cannot connect to X server localhost:11.0 error

Today when I try to install a program that has a GUI via SSH client, I received the following error:


_X11TransSocketINETConnect: Can't get address for localhost
egs_install_Linux_self.exe: cannot connect to X server localhost:11.0

I checked the X11 forward setting of sshd server and client and both are correct.

cat /etc/ssh/sshd_config | grep X11Forward
X11Forwarding yes

set | grep DISPLAY
DISPLAY=localhost:11.0


It seems from the error message the program has difficulty resolving the address localhost therefore I also checked /etc/hosts file and ping localhost also works fine.

cat /etc/hosts | grep localhost
127.0.0.1               localhost.localdomain localhost
Now the problem seems to be that the program to be installed doesn't understand the DISPLAY env set as localhost:11.0. Therefore I ran the following after I sshed to the host
export DISPLAY=127.0.0.1:11.0
 
and the program now works

Sunday, September 25, 2011

Convert file encodings between UTF-8 and GB2312

  1. Check the encoding of a file with enca utility
    enca home.php
    Universal transformation format 8 bits; UTF-8
  2. Convert the encoding of the file with the GNU iconv utility (-c  omit invalid characters from output, -f from-encoding, -t to-encoding)
    iconv -c -f utf-8 -t gb2312 home.php > home.php.GB2312

Friday, September 23, 2011

Notes on my WD TV Live

  • Remote key sequence to start flashing firmware (without connecting to a TV or monitor)
    Load the firmware (wdtvlive.bin, wdtvlive.ver and wdtvlive.fff) files into a USB stick and I use a flash drive with a LED indicator, which blinks while being accessed.
    1. Plug the USB stick into the left side USB port and the stick is being accessed for a few seconds as indicated by the LED of the USB stick. 
    2. Push the Right arrow then Enter key on the remote. 
    3. Check the LED of the USB stick to see whether it's being accessed. If NOT, go back to repeat step 2. Otherwise go to next step.
    4. WDTV will reboot and flash the firmware. Wait until it's completed.
  • Command line to start flashing firmware (did NOT work for me)
    run_all upgrade
    /dev/sda1 wdtvlive.bin &

    Others had succeeded after killing some running processes as in this post.
  • Latest WDLXTV firmware version I know of is 1.05.04_V_WDLXTV.COM_WDLXTV_LIVE-0.5.1.1
I found in this post the following changes were implemented since version 0.5.0.0

0.5.1.1 - 2011-09-21
  * enable usb 5V bus power off + deep sleep mode (b-rad)
  * allow 'hot plug' of MSHEETDIR (b-rad)
  * lots of extra logging, bug report fattened (b-rad)
  * Issues:
  ** WDLXTV-PLUS DOES NOT SUPPORT 3TB HDD'S!!!! Tell WD you want this fixed (with netflix too)!!!
  **** The GPL wdtvlive2.fff is 6mo old and lacks support for 3TB hdd's + it deletes netflix keys!
  **** Email WD and tell them you want Netflix + WDLXTV + 3TB hdd support
  ** 1.05.04 dmaosd requests up to 65 search/related/etc results from
  **** YouTube at a time. If you have youtubeHD enabled, you might
  **** notice sluggishness with rapid fire YouTubage
  ** if you enable EIRI buttons down, right, & up buttons don't work on stock remote
  * For base firmware differences see:
  *** http://wiki.wdlxtv.com/Difference_between_BaseFW

0.5.1.0 - 2011-09-15
  * assembly code patch to fix ISO's stopping working after playing a few (b-rad)
  * inotifywait-3.14 included to clean up the mess left over by the OSD when ISO's are stopped (b-rad)
  * stuck at 0% upgrade fix (b-rad)
  * localizations updated new: swedish, serbian, greek, catalan, netherlands, slovenian, danish, dutch, & slovakian
  * aufs included (b-rad)
  * linksheets converted to aufs to save memory (b-rad)
  * MSHEETDIR disables automagic linksheets scan (b-rad)
  * fix fuse module (b-rad)
  * ntfs-3g removed from automagic filesystem detection (b-rad)
  * bi2 fixes (b-rad)
  * fix upnp-cmd to support wireless interfaces (b-rad)
  * fix webend pw change not working on 1.05.04 (b-rad)
  * apache & mt-daapd init.d tweaks (b-rad)
  * added sparse mount option to ntfs (b-rad)
  * xml fix 1.05.04 video playback options menu data disappearing (2d)
  * various xml fixes (jumbalaya)

Monday, September 19, 2011

Stop annoying password prompt dialog from Outlook in windows 7

From last week, my outlook 2007 started popping up a dialog asking for username and password while trying to receive POP3 emails from Yahoo small business email servers. The annoying dialog may pop up as frequent as the Send/Receive frequency set in Outlook (in my case every 3 minutes) and it will pop-up again even if the correct username/password is entered and saving the password is checked in the dialog.


I did an investigation and this method seems to work, at least for me. The steps are summarized below:
  1. Close/kill outlook.
  2. Type the following in Start->Run (Windows+R key) or search box
    %userprofile%\AppData\Roaming\Microsoft\Protect\
    A explorer window will pop up showing the contents of the above folder
  3. Look for a folder named as the SID of the logged on user (starting with something like S-1-5-21-) and rename it by appending .old or -old to its name.
  4. Start outlook and enter the username/password when prompted (check to save the passwords by outlook) and the above folder will be recreated.
  5. Sit back and relax.

Saturday, September 17, 2011

gvoice login error

My pygooglevoice 0.5 suddenly stopped working and if I run gvoice at the command line like
 # gvoice -b -e myname@gmail.com -p wtfpasswd call 18664254745 1CALLBKNUMBER 3
I got a error saying Login failed.

I found at this thread that it's probably due to recent changes in the Google voice web login interface. And after I have the following in the file /usr/lib/python2.7/site-packages/googlevoice/settings.py (the folder might be python2.6 depending on the python version installed), it works again and gvoice can dial out without any problems
LOGIN = 'https://accounts.google.com/ServiceLogin?service=grandcentral&passive=1209600&continue=https://www.google.com/voice&followup=https://www.google.com/voice&ltmpl=open'

Notes on Windows

  • How to reset/kill a non-responsive remote desktop session remotely
    Occasionally I see the following error when I try to connect the remote desktop 
    The requested operation cannot be completed because the Terminal connection is currently busy processing a connect operation
    When that happens, terminal services typically reject any new sessions.
    1. One may use the query command to get session ID and reset command to reset the session as found in this post.
    2. Alternatively one may use the tasklist and taskkill commands to kill the process that hangs the terminal services as found in this post.
  • How to use more than 4 GB memory with 32-bit windows 7/vista kernel
    I found the method from this post, which is applicable to both windows 7 SP1 and windows vista 32-bit. We know a PAE address is 37-bit long, which implies an address space of 2^37=128GB. As we know windows server 2003 (32-bit) may use 64 GB memory, in principle any PAE enabled kernel should be able to do that. After booting from a "true" PAE kernel, all 8GB memory installed was recognized by windows 7 (32-bit) and 7.74 GB is usable as shown below.
After dataram's ramdisk is activated with a 3GB ramdisk, task manager found that windows 7 (32-bit) used 4.68GB memory and 3126MB memory is avaible as shown below. 

Saturday, September 3, 2011

Notes on my Patriot Box Office (PBO)

  1. Flush lastest yaffs2 firmware (official SquashFS firmware image is NOT moddable):
    One must downgrade to P02 official firmware first before flashing the following moddable firmware. Otherwise it may brick the PBO with a small PBO logo shown on the TV after booting. 
  2. Debrick PBO without a USB-TTL cable:
    There's a reset switch SW3 on the circuit board of PBO without any physical connector soldered onto it. The switch SW3 can be used to initiate an emergency flashing after the PBO is bricked without using a USB-TTL cable.

    • Detach the PCB from the box and expose the reset switch SW3. I had to unscrew about 10 screws.
    • Put the PCB assembly on a piece of plastic bag and power it on.
    • Plug in a USB flash drive with official P02 install.img into the front panel USB port
    • Short the two soldering pads of SW3 circled in the picture above briefly. I shorted the two pads with a metal wire very briefly and I can see PBO reboots immediately and starts to read the firmware from the flash drive. 
    • Firmware flashing will be completed after rebooting twice.
  3. Latest moddable megapack firmware

    BETA.P70R2(BCN).megapack Moddable bootcode neutral

    Only the megapack has ipkg-cl for optware installation so get the megapack. It may take 10-15 minutes to flash a moddable firmware so be patient and don't turn off PBO until the flashing is completed.
  4. Install ipkg
    mkdir /tmp/hdd/root/opt
    mount -o remount,rw /
    ln -sf /tmp/hdd/root/opt /opt
    mount -o remount,r /
    mkdir /opt/tmp
    cd /opt/tmp
    wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/uclibc-opt_0.9.28-13_mipsel.ipk
    ipkg-cl install uclibc-opt_0.9.28-13_mipsel.ipk
    wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/ipkg-opt_0.99.163-10_mipsel.ipk
    ipkg-cl install ipkg-opt_0.99.163-10_mipsel.ipk
    rm *.ipk
  5. Install Vsftpd
    cd /opt/tmp
    wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/vsftpd_2.3.4-1_mipsel.ipk
    ipkg-cl install vsftpd_
    2.3.4-1_mipsel.ipk
    rm *.ipk
    cd /opt/etc
    mv vsftpd.conf vsftpd.conf.orig

     Create my own vsftpd.conf to allow root user login
    cat vsftpd.conf
    local_enable=YES
    write_enable=YES
    local_umask=022
    dirmessage_enable=YES
    xferlog_enable=YES
    connect_from_port_20=YES
    vsftpd_log_file=/opt/var/log/vsftpd.log
    ascii_upload_enable=YES
    ascii_download_enable=YES
    ftpd_banner=Welcome to My PBO.
    ls_recurse_enable=YES
    listen=YES
    ftp_username=root

    Now create the log folder and set up root directory
    mkdir -p /opt/var/log
    mount -o remount,rw /

    modify /etc/passwd and change the home directory for root user to be / (from empty)
    cat /etc/passwd | grep root:
    root::0:0:root:/:/bin/sh
    mount -o remount,r /
    /opt/sbin/vsftpd /opt/etc/vsftpd.conf &

    Now ftp login as user root (empty password).
    I also start vsftpd at boot by adding this line to the end of /usr/local/etc/rcS
    /opt/sbin/vsftpd /opt/etc/vsftpd.conf &
  6. Customize IMS feeds
    Modify the file /usr/local/etc/dvdplayer/savedrss/scripts/menu.rss or wget from a web server hosting the modified menu.rss. (Power cycle the PBO by the remote if the root IMS menu is not refreshed after the modification.)