Showing posts from February, 2014

Linux - set -vx

Set command in Linux is used to set or unset values of shell options and positional parameters.

It has many useful options, and specifically, set -vx is very useful to debug a Linux script.

-v  Print shell input lines as they are read.
-x  Print commands and their arguments as they are executed.

To use this, simply put set -vx before an interested script line. Usually, I will put it at the top of my script to print out everything.

For example, you can use set -vx as follow script call

set -vx
export foo=$1
echo $foo 
Executing the with

./ hello
The output will be

export foo=$1
+ export foo=hello
+ foo=hello
echo $foo
+ echo hello
Those line with + sign are evaluated value during execution

Whatsapp for Android - Video color become bluish when sharing the video

When you make a video, you could save it and shared it with Whatsapp. The video appears to be normal in Gallery, however, when you shared it with Whatsapp, the video become "bluish" and the recipients receive "bluish" video as well. It only happens when sharing video via Whatsapp. Local pictures, local video and sharing pictures via Whatsapp appear to be normal.

An example of "bluish" video is as follow (This is snapshot from a video where the camera is pointing to a brown flooring)

There are a few solutions you could try

Resetting Camera Setting
You can try to fix the coloring problem by resetting the device camera setting. Different phone manufacturers have different ways to reset the camera setting. For Samsung phone, you can reset your camera setting as follow

1. Launch your camera
2. Locate a setting icon similar to the following

3. Locate a Reset option and click on it.

The reason to apply this fix is to reset the White Balance setting to default. W…