วิธีการรัน Linux บนโทรศัพท์ Android

สิ่งที่ต้องมี

- โทรศัพท์ Android ที่ root แล้ว (ซึ่งแต่ละรุ่นวิธีการ root ไม่เหมือนกันต้องไปหาวิธีกันเอง)

- พื้นที่เหลือในเครื่องสักประมาณ 4 GB


วิธีการติดตั้ง

- ติดตั้ง แอพ Linux Deploy (https://play.google.com/store/apps/details?id=ru.meefik.linuxdeploy)

- ติดตั้ง แอพ BusyBox (https://play.google.com/store/apps/details?id=ru.meefik.busybox) ต้องเป็น BusyBox ตัวนี้นะ ตัวอื่นจะใช้ไม่ได้ครับ

- ติดตั้ง แอพ JuiceSSH (https://play.google.com/store/apps/details?id=com.sonelli.juicessh) ไว้สำหรับ Remote เข้า Linux


หลังจากติดตั้งแอพด้านบนครบแล้ว

ติดตั้ง BusyBox

- เปิดแอพ BusyBox กด Install แอพ BusyBox มันจะขอ สิทธิ์ root ก็ให้มันไป



ติดตั้ง Linux

- เปิดแอพ Linux Deploy แล้วกดตรงรูป Download ตามรูป


- เลือก Distribution ที่ต้องการ ในที่นี้เลือกใช้ Debian ครับ Distribution suite ก็คือ version ของ Distribution นั้นๆ ผมเลือกใช้ Debian Jessie ส่วน Architecture ก็เลือกเป็น armhf ดังรูป



- กด Install แล้วก็รอสักพักใหญ่ ตัวแอพมันจะไปโหลด Package ต่างๆมาลงให้ (รอนานมาก ขึ้นอยู่กับเน็ตและความเร็วเครื่องแต่ละคน)



- ถ้าเกิด Error แล้วลงไม่สำเร็จต้องลงใหม่ โดยการกด STOP แล้วเข้ารูป Download ไปกด Install ใหม่ครับ

ภาพโหลดไฟล์ไม่สำเร็จ ต้องกดลงใหม่


- เมื่อติดตั้งเสร็จแล้วให้กด START เป็นอันเสร็จสิ้นแล้ว เราก็สามารถ remote ไปยังตัว Linux ที่เราลงได้ผ่านทาง SSH หรือ VNC ครับ


การ Remote SSH บนมือถือ

ผมใช้แอพ JuiceSSH ในการเชื่อมต่อครับ วิธีการใช้งาน JuiceSSH ก็ง่ายมากแค่เซต host, user, password มาเริ่มกันเลย

- เปิดแอพ JuiceSSH เข้า Connections แล้วกด ปุ่ม + ขวาล่าง





Nickname : แล้วแต่เราจะตั้ง
Type: SSH
Address: localhost
Identity: จิ้มเข้าไปกด New
             Nickname: แล้วแต่เราจะตั้ง
             Username: android
             Password: changeme

เมื่อจิ้มไปที่ Identity เลือก New

ภาพเซต Identity เสร็จ (ในภาพพิมพ์ localhost ผิดนะ)


กด เครื่องหมายถูกขวาบนเพื่อเซฟ แล้วก็สามารถ Connect เข้าไปยัง Linux ที่เราลงไว้ได้เลยดังภาพ





How to install Ubuntu 14.04 on Asus K401UB

I lost a few days for install Ubuntu 14.04 on my new laptop Asus K401UB.

Asus K401UB have Hard drive 1 TB and 24 GB SSD, So i install partition like this

/dev/sda is 1 TB Hard drive
/dev/sdb is 24 GB SSD



mount /boot on SSD (256MB)
mount / on SSD (Remain SSD)
mount /home on 1TB Hard drive (200 GB)
mount /var on 1TB Hard drive (50GB)

After i installed Ubuntu 14.04 i got many problem out of the box

Problem:

- Audio not work
- Touchpad not work
- Wifi not work (Network Manager show locked by hardware lock)
- Some of Function Key not work (Airplane mode, Brightness, Touchpad Enable/Disable) not work
- Hybridge Video Graphic Card (Intel & Geforce 940M)

Solve the problem:


Audio & Touchpad 
Audio & Touchpad solved by install newer kernel  (https://wiki.ubuntu.com/Kernel/LTSEnablementStack)

sudo apt-get install --install-recommends linux-generic-lts-wily xserver-xorg-core-lts-wily xserver-xorg-lts-wily xserver-xorg-video-all-lts-wily xserver-xorg-input-all-lts-wily libwayland-egl1-mesa-lts-wily 

After install & reboot Audio and Touchpad work fine.

Wifi
I found 2 choice to solved wifi work.

1. fn + F1 to sleep laptop, when laptop wake up wifi will work
2. Uninstall Network Manager and install wicd instead

sudo apt-get install wicd-gtk
sudo apt-get purge network-manager-gnome network-manager

reboot your laptop, wifi will work

Function key
i can't solve this problem but i found shell script to disable and enable Touchpad

- Find Device id from command (in this case device is ELAN1000:00 04F3:0401)

xinput list


id = 12

Download this shell script



Replace id with your Touchpad id in this case is  12, this script will toggle your Touchpad Enable/Disable

Video Graphic

I try many solution to solve VGA swiching but nothing work. I decided to use Bumblebee to run Geforce 940M when i need it

https://wiki.ubuntu.com/Bumblebee

Update 2016-04-06
fn key + brighness down/up (F5 & F6) will work when edit config grub

Edit this file /etc/default/grub

Find this line:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

Change to

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pcie_aspm=force acpi_osi="

Ref:
https://wiki.ubuntu.com/Kernel/LTSEnablementStack
http://ubuntuforums.org/showthread.php?t=2141992
http://askubuntu.com/
https://wiki.ubuntu.com/Bumblebee


PS. I'm using Mate Desktop for Desktop Environment.

Hopefully this blog can help you.


How to compile aircrack Ubuntu 14.04

Install Dependencies


sudo apt-get install build-essential libssl-dev libnl-3-dev libnl-genl-3-dev dpkg-dev g++ g++-4.8 libc-dev-bin libc6-dev libstdc++-4.8-dev zlib1g-dev debian-keyring g++-multilib g++-4.8-multilib gcc-4.8-doc libstdc++6-4.8-dbg glibc-doc libstdc++-4.8-doc libalgorithm-merge-perl libssl-doc libalgorithm-diff-xs-perl


Download and compile

cd /tmp
wget http://download.aircrack-ng.org/aircrack-ng-1.2-rc4.tar.gz
tar xfz aircrack-ng-1.2-rc4.tar.gz
cd aircrack-ng-1.2-rc4/
make
sudo make install
sudo airodump-ng-oui-update


Install Raspbian packages directly from Ubuntu with chroot to Raspbian file system (on SD card)

update or install package directly from ubuntu on raspbian sd card

sudo apt-get install qemu proot
sudo proot -q qemu-arm -B -r /mnt/path/to/raspbian/

source : http://raspberrypi.stackexchange.com/questions/23675/install-raspbian-packages-directly-from-ubuntu-with-chroot-to-raspbian-file-syst

[GIT] Specify git author and email

go to your project path

git config user.name "YOUR_NAME_ON_PROJECT"
git config user.email "YOUR_EMAIL_ON_PROJECT"

Done.

Raspberry Pi fix screen blank when idle a few minute


run this command as root
echo -ne "\033[9;0]" >/dev/tty1

Gradle enable daemon

for all project append "org.gradle.daemon=true" into file ~/.gradle/gradle.properties

echo "org.gradle.daemon=true" >> ~/.gradle/gradle.properties

 for each project append "org.gradle.daemon=true" into file gradle.properties on your project


Parallel compile module

append "org.gradle.parallel=true" on your  gradle.properties