2015年10月30日 星期五

Laravel - How to install Laravel 5 into ubuntu 14.04 ?

1. Install LAMP

$ sudo apt-get install python-software-properties
$ sudo apt-get update 
$ sudo apt-get install -y php5 php5-mcrypt
$ sudo apt-get install apache2 libapache2-mod-php5
$ sudo apt-get install mysql-server php5-mysql

2. Install Composer
$ curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer 
$ sudo chmod +x /usr/local/bin/composer

3. Install Laravel
$ cd /var/www/html
$ sudo git clone https://github.com/laravel/laravel.git
$ cd /var/www/html/laravel
$ sudo composer install
$ sudo chown -R www-data.www-data /var/www/html/laravel
$ sudo chmod -R 755 /var/www/html/laravel 

4. Create .env and replace key into it.
$ cd /var/www/html/laravel
$ sudo cp .env.example .env
$ sudo chown www-data:www-data .env
$ php artisan key:generate

You will get the new key, like ...
Application key [pY5f1IYsOEqg6JxksaKF1gXGdMY1Z3w1] set successfully
Please copy this key and assign this key into "APP_KEY" on ".env"
PS. DON"T COPY MY KEY INTO YOUR SETTING !!!

5. Restart apache2 server
$ sudo service apache2 restart

6. Open your browser with "127.0.0.1/laravel/public"

2015年10月2日 星期五

ubuntu - How to setting the LTIB on ubuntu 14.04

1. Install all build tool into your host PC.

$ sudo apt-get install gettext libgtk2.0-dev rpm bison m4 libfreetype6-dev
$ sudo apt-get install libdbus-glib-1-dev liborbit2-dev intltool
$ sudo apt-get install ccache ncurses-dev zlib1g zlib1g-dev gcc g++ libtool
$ sudo apt-get install uuid-dev liblzo2-dev
$ sudo apt-get install tcl dpkg
$ sudo apt-get install asciidoc texlive-latex-base dblatex xutils-dev
$ sudo apt-get install texlive texinfo
$ sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0
$ sudo apt-get install libc6-dev-i386
$ sudo apt-get install u-boot-tools
$ sudo apt-get install scrollkeeper
$ sudo ln -s /usr/lib/x86_64-linux-gnu/librt.so /usr/lib/librt.so
$ sudo apt-get install gparted
$ sudo apt-get install nfs-common nfs-kernel-server
$ sudo apt-get install git-core git-doc git-email git-gui gitk
$ sudo apt-get install meld atftpd

2. Install LTIB into your host PC.
$ cd ~
$ tar -zxvf L3.0.35_4.1.0_130816_source. tar.gz
$ ./L3.0.35_4.1.0_130816_source/install

3. Apply the patch file.
$ cd ~/ltib
$ git apply 0001_make_L3.0.35_4.1.0_compile_on_Ubuntu_14.04_64bit_OS

4. Run the LTIB on host PC.
$ cd ~/ltib
$ ./ltib -m config
$ ./ltib

Reference : https://community.freescale.com/docs/DOC-100725

2015年10月1日 星期四

ubuntu - How to create the ubuntu rootfs for arm ?


1. Install "debootstrap" into your ubuntu system.
$sudo apt-get install debootstrap

2. Create the ubuntu core file system.
$sudo debootstrap --arch=armhf --keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg --verbose --foreign trusty rootfs

3. Install "qemu" into your ubuntu system.
$sudo apt-get install binfmt-support qemu qemu-user-static

4. Copy the qwmu-arm-static into your target file system.
$sudo cp /usr/bin/qemu-arm-static rootfs/usr/bin

5. Change root to your target file sytem.
$sudo chroot rootfs /bin/bash

6. Create the target file system without on arm.
$/debootstrap/debootstrap --second-stage

7. Next time, you can use "apt-get" to install any deb into target file system on host pc.

Reference:http://berniechenopenvpn.blogspot.tw/2015/07/filesystem.html

2015年8月14日 星期五

ubuntu - Enable PHP in HTML or other files

1. Created a file : .htaccess on your folder.
2. Add below to .htaccess :

$vim .htaccess

AddType application/x-httpd-php .html .htm
3. Modify "apache2.conf".

$vim apache2.conf

AllowOverride None => AllowOverride All
4. Restart apache2.

$sudo service apache2 restart

Reference : http://www.bictor.com/2015/03/03/enable-php-in-html-or-other-files/

2015年7月15日 星期三

Android - How to build the AOSP Nexus 7 (2012) ?

1. Get source code from AOSP.

$mkdir nexus_7_2012
$cd nexus_7_2012

You must to check nexus 7 (2012) and aosp version:
http://source.android.com/source/build-numbers.html#source-code-tags-and-builds

For example, if you want get android 5.1.1 for nexus 7 (2012) wifi only source code, you can find ...


Because nexus 7 2012 wifi device name was "grouper", we can find the branch is android-5.1.1_r1.

$repo init -u https://android.googlesource.com/platform/manifest -b android-5.1.1_r1
$repo sync

2. Get third-party binaries.

Get binaries from this address : https://developers.google.com/android/nexus/drivers
We want to build the android 5.1.1 , so we must to get ...


After get these files, please copy to your aosp folder and execute.
You will to get the new folder "vendor" in your source code folder.

3. Build the source code.

$source build/envsetup.sh

Find the device tag and name from this ...
http://source.android.com/source/building-devices.html

"full_grouper-userdebug" was "nexus 7 2012 wifi only" configuration name.


$lunch lunch full_grouper-userdebug

$make -j8

4. Flash to device. (Your device must to oem unlock.)

$adb reboot-bootloader
$fastboot -w flashall

PS. You must to input cmd on aosp folder.

2015年2月3日 星期二

ubuntu - 在 ubuntu 上不利用 WINE 運作 Line (Pidgin + purple-line)

使用 WINE 跑 LINE 常常都會因為奇怪的原因 Crash 掉。找了很久,終於找到一篇日文的教學文章。這篇文章提供 Pidgin + purple-line 的外掛方式運行 Line 。經過測試之後是可行的。

測試環境 Ubuntu 14.04 x86_64 3.13.0-40-generic

1. 安裝 Pidgin

$ sudo apt-get install pidgin

2. 安裝編譯環境

$ sudo apt-get install libpurple0 libpurple-dev libpurple-bin
$ sudo apt-get install libboost-dev libboost-test-dev libboost-program-options-dev libevent-dev automake libtool flex bison pkg-config g++ libssl-dev python-dev

3. 下載 thrift ( http://www.apache.org/dyn/closer.cgi?path=/thrift/0.9.2/thrift-0.9.2.tar.gz )
4. 解壓縮 thrift

$ tar zxvf thrift-0.9.2.tar.gz

5. 編譯與安裝 thrift

$ cd thrift-0.9.2/
$ ./configure --without-tests
$ make
$ sudo make install

6. 下載 purple-line 的外掛

$ cd ~/
$ git clone http://altrepo.eu/git/purple-line.git/
$ cd purple-line/
$ wget http://altrepo.eu/git/line-protocol.git/blob_plain/HEAD:/line_main.thrift
$ make
$ make install
$ sudo ldconfig

接下來重新開機之後,就可以啟動 Pidgin 並且新增 Line 的帳號了。

參考文章:http://blog.livedoor.jp/hiroumauma/archives/1710677.html