Creating Command Prompt Shortcut with Specified Environment Path on Windows

Sometimes you might want to have a command prompt with the specified command such as php available, without specified the full path to the executable and without altering the system or user environment variables.

There are several ways to achieve this, and here is the simple way I liked to use.

  1. Make a copy of the Command Prompt shortcut in your start menu
  2. Right click on the new shortcut and click Properties
  3. In the Shortcut tab, append the following content into the Target text box. Make sure you got a space before /k
     /k "set path=%path%;C:\bin\php54"
  4. Replace the part C:\bin\php54 with the path to the folder where your executable files are located

At the end you will have something like this:

Command Prompt Shortcut


Open Video File using omxplayer on Raspberry Pi without Terminal

I was trying to make Raspberry Pi running Raspbian OS to turn it as a media player with can play video without using a keyboard so that it is portable for a trip.

The only software that allow video playback on Raspbian is omxplayer. It is a command line tool and therefore need a keyboard to start playing video. Searched on the Internet and found that it is possible create an application, allowing you to play the video via right clicking the video file and choosing the application to open. However most of scripts included in the Internet are not working on my Raspbian. After a long research I finally figured out a working one.

Later on, I actually found that there other OS such as Raspbmc, OpenELEC which is actually designed turn Raspberry Pi to be a media center and I have another Raspberry Pi for that now. Anyway below are the steps to create applications for video playback on the LXDE desktop environment on Raspbian OS:

  1. Create a file with the following content at /usr/share/applications/omxplayer-hdmi.desktop. This will allow you to hear the sound output to HDMI.
    [Desktop Entry]
    Name=OMXPlayer (HDMI)
    Exec=lxterminal --command "sudo omxplayer -r -o hdmi %f"
  2. Create a file with the following content at /usr/share/applications/omxplayer-local.desktop. This will allow you to hear the sound output to the 3.5mm audio jack.
    [Desktop Entry]
    Name=OMXPlayer (3.5mm)
    Exec=lxterminal --command "sudo omxplayer -r -o local %f"

Workaround Inability in NAT Loopback on DD-WRT r15760 or above

Recently I found that my router running DD-WRT is not able to handle NAT loopback (Accessing router’s public IP from internal network). After searching through the Internet, I found this post mentioned that it is a problem in DD-WRT since revision r15760. It is stated that the problem will not be fixed. As a user, we can only apply workaround to the issue. Here are the steps:

  1. Make sure your DD-WRT version is r15760 or newer
  2. Navigate to your router administrator page
  3. Go to the Administrator section, Commands section
  4. In the Commands text box, input the following command:
    insmod ipt_mark
    insmod xt_mark
    iptables -t mangle -A PREROUTING -i ! `get_wanface` -d `nvram get wan_ipaddr` -j MARK --set-mark 0xd001
    iptables -t nat -A POSTROUTING -m mark --mark 0xd001 -j MASQUERADE
  5. Press the Save Firewall button. You should see the following screen:
    DDWRT NAT Loopback
  6. Reboot your router, the NAT loopback should be function now

vzClock 2.1.1 Published!

vzClock App IconWell while I was working on the old vClcok to add 4×2 widget, I discovered a bug in vzClock in handling 2 widgets of different size. Not sure if this is lucky or not, this bug will never happen on some Android because a bug on Android which prevent it from happening! I cannot rule out that there are some other Android OS from other vender which actually discovered and fixed the bug so I am releasing a new version to fix the bug.

Below is a change log in version 2.1.1:

  • [Fix] Fixed a bug when user delete all widget of one type, the another type of widget will stop working
  • [Change] Minor UI change

Fixing no Notification on new Hangout app on Android Phone

A few months back, Google released Hangout app on Android which replaced the old Google Talk app. The new Hangout app is good, but in some case you might found that you did not receive any notification when new message came.

After some trial and error, I found that it is actually related to the notification sound in which the Hangout app shows that you have selected a notifications sound but actually none was selected behind the scene.

So to fix the issue, here is the step:

  1. In your Hangout app, go to Setting and select your account
  2. Click on the notification sound for hangout notification. You will notice that although it displayed a sound to play, when the list of sound is shown, the default selection is actually map to no sound
  3. Select the sound you want to play
  4. Repeat step 2 and step 3 for video call as well if you need to

vClock 1.4 Published!

vClock App IconMy friend recently asked me if this app got a larger clock for him. This feature is already exists in my new vzClock but sadly his phone is Samsung Galaxy S which is still running Android 2.x. I thought it would be easy to add a 4×2 widget without redesigning but end up spending around 3 hours. Anyway here is the new release and help some other people who want a 4×2 widget are happy as well.

Below is a change log in version 1.4:

+ Added 4×2 size widget
! Bugs fix