2015年7月25日 星期六

Review of Android X86 4.4R3

Android X86 (http://www.android-x86.org/) have been release of the new version of official release. The new version is Android 4.4_R3 which is the third release of Android 4.4. If you would like to test on the lollipop you may try the beta release.

Let's see my review:

Setup:
Lenovo Thinkpad X61 (Intel T8300 4GB DDR2)
Arch Linux Kernel - 4.1.2-2-ARCH

Review:
Although it is the release version, it is easy for me to find bugs / non-implemented part on the software.

See whats the improvment:
1. Bug fix and it works on my thinkpad now. Last version is not supported
2. For native run, seems everything works fine

Please find the list below:
1. No multi screen support (May be too harsh to an open source software)
2. Sometimes the text in android UI will come to garbage words. Toggle the UI will come back to normal
3. Screen rotation breaks the usage as for PC, no screen rotation is needed. Makes me like handicap when the screen rotate
4. Tested on KVM. But I still can't make OpenGL work on it.

Conclusion:
The result is positive for the new release and it run most applications stablely. It is not far away from daily usage. I am sure when this project come to a stable version, this will come to a evolution to the PC market that people will switch to use Android-X86 rather than Windows in their PC. Or may be someday Microsoft will be down because of this.


2015年7月18日 星期六

2015年7月9日 星期四

[How To] Install openwrt in Xiaomi Mini Router

Just install openwrt in my new Xiaomi mini router. First of all, I am not that trust China's product that do not have backdoor and tracking. So I choose the opensource openwrt firmware. The flashing procedure I have make a copy from site for my reference.

I have test for a few firmware
9 July, 2015
- Xiaomi default firmware
    never tested
- Openwrt CHAOS CALMER (15.05 RC2)
    5GHz and 2.4GHz works fine but the power is not strong as PandoraBox
- Openwrt CHAOS CALMER Trunk
    Only 2.4GHz, 5GHz not work
- Pandora Box Openwrt (Close Source) r1024
    I am not sure if I am black luck. 5GHz and 2.4GHz works great from the very beginning but it makes the 5GHz chip (mt7612E) burn out after use for a few hours. (Please leave comments if you have the same case as I am. I even flash every firmware and can't make the 5GHz chip work and it is dead. The router can work only with mt7620A with 802.11N 2T2R 300M (Better than a rubbish)

The following is the guide can change from default firmware to any third party firmware

= = =
1.      First off before anything else, install Chrome and its translator plug-in for all 3 Chinese language.
2.      Plug in power and Ethernet cable to one of the Ethernet ports
3.      Direct browser to 192.168.31.1.  Unfortunately I could not get Chrome to translate, likely because translation requires internet access, which has not been set up yet.
4.      The first screen will appear.  Press blue button to get to next screen.

5.      The next screen sets up the wifi network name and password.  Note that the wifi password is also used later for access to the browser page (192.168.31.1).  


6.      Once you have set this up, plug in WAN cable for access to internet.  Internet access also enables the Chrome translation and you can confirm that the router works properly before proceeding.
7.      The next few steps involve first loading the development version of the firmware, then loading a firmware version which provides SSH access with the last step being loading the OpenWRT firmware onto the router
8.      Apparently loading the development version ofthe firmware voids warranty, so beware. Development version can be obtained from http://www1.miwifi.com/miwifi_download.html.  Point to the mini router to get the correct firmware/software.  At the same time you can also download the PC Client (although I don't recommend this) and also one of either iOS or Android app.  You will NEED one of these to complete the steps. The development ROM that I downloaded was named miwifi_r1cm_all_ace8a_0.6.40.bin.  Apparently the development ROM that is used is important because some of the ROMs may not allow the next step of flashing the SSH firmware.  The older ROMs can be found here http://www.miui.com/thread-1776173-1-1.html.  Try to use the development ROM that has been proven to allow the next step of the process



9.      The above downloads the Chinese versions of PCClient and iOS/Android apps.  To get the translated software follow these links. The iOS/Android are necessary because they are used to link the hardware to the miwifi account that you are about to set up.  Without the link, the SSH version of the ROM(and SSH password) will not be available
http://en.miui.com/forum.php?mod=viewthread&tid=55706(portable version – although I have not used)
10.  Create and activate a new account at Xiaomi  https://account.xiaomi.com/pass/register.  When you have setup the account and logged in, remember the User ID.  You will note that there is no device associated with the account.  The association has to be done via theiOS/Android app.  Unfortunately there does not seem to be a way to do that via the PC Client, which is why I do not recommend installing this.
11.  Using your iOS or Android device, open the app.  Login using the ID and password in the step above.  The account then recognises the Xiaomi mini router device. This is required for the SSH firmware.
12.  To get the SSH firmware proceed to http://www1.miwifi.com/miwifi_open.html.  Halfway down the page there is a SSH button

13.  Click on the button and sign into the Xiaomi account when requested.  After signing in you will be presented with a page to download the SSH firmware.  Also note the SSH password for root user in the middle of the page.  The SSH firmware will have the name miwifi_ssh.bin

14.  Now that you have all the firmware, it is just a matter of flashing in the correct sequence. First off, get an empty USB drive and format to FAT or FAT32.  I tried unsuccessfully using drives less than 2GB.  In the end, I had to use a 2GBdrive, although the firmware(s) were a lot smaller in size.
15.  Copy the development firmware into the USBdrive.  (Did I tell you to delete all other content? – Please do).  Rename the development firmware to miwifi.bin.  This is important
16.  The development firmware and SSH firmware flash both follows the same procedure
a.      Pull the power from router, at the router
b.     Plug USB drive into router.  
c.      Press reset button (in the hole to the left ofthe USB drive)
d.     While holding down the reset button, plug in thepower.  The orange light in front of the router will remain steady for a short while before it starts flashing
e.     Once the orange light starts flashing, releasethe reset button and sit back until the light in front of the router turns blue.  Also if there are indicator lights on your USB drive, they will flash as the drive is being read.  If the orange light does not flash, try with another USB drive and confirm that the drive is formatted to FAT or FAT32.
17.  The router can be re-set up between each flash just to confirm that it is working, but I generally just flash the firmwares one after the other.  
18.  I also tend to delete all the contents from the USB drive between flash.  I don't know the impact of not deleting, but better safe than wrong.  
19.  The SSH firmware do not have to be renamed for the flash.  Just keep the name as miwifi_ssh.bin
20.  Once the SSH firmware has been successfully flashed, confirm SSH via putty and also Winscp. Port is 22, username “root” and password as noted from step 13.
21.  The OpenWRT firmware will need to be downloaded from http://downloads.openwrt.org.cn/PandoraBox/Xiaomi-Mini-R1CM/.  I used the latest version PandoraBox-ralink-xiaomi-mini-r583-20140827.bin.  Once downloaded, rename the file to 20140827.bin
22.  Open Winscp and connect to the router using 192.168.31.1, Port 22, username root and password as from step 13.  Transfer 20140827.bin to the /tmp directory.The tmp directory is in the root of the drive
23.  Open putty and connect to the router using 192.168.31.1, Port 22.  Enter root as username and password as above
24.  Change to the tmp directory - cd /tmp
25.  Confirm that you have the right directory by doing a directory listing (ls –l) and confirming that the 20140827.bin file is listed
26.  Finally flash the OpenWRT firmware using puttycommand
mtd -r write /tmp/20140703.bin firmware
27.  The router will reboot once it has beensuccessfully flashed.
28.  Access the OpenWRT router via 192.168.1.1 on your browser.  Unfortunately the default pages are in Chinese.  Default account usernamewill be “root” and password “admin”
29.  Once in, ignore the quick guide setup and navigate to the language page to change language to English.  On the left, third choice down, first subchoice and third tab page with the first settings.  Click on green button on bottom left to “Save and Apply”.   It may be necessary to reboot, but I did not have to.

2015年7月1日 星期三

[How To] identify a ssh bash session in linux

Very simple just edit .bash_profile

= = =
#
# ~/.bash_profile
#

[[ -f ~/.bashrc ]] && . ~/.bashrc
skip_x="0"

if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
    echo "THIS IS AN SSH SESSION"
    skip_x="1"
fi


#check if x started


ps aux | grep tty |grep startx 2>&1 > /dev/null
if [ "$?" == "0" ]; then
    skip_x="1"
fi

if [ "$skip_x" == "0" ]; then
    exec startx
fi

= = =