制霸IoT 30Day!Day 01
制霸 IoT 30Day! Day 01
動機
這是我第一次參加 IT 邦幫忙鐵人賽,老實說我也不知道我會不會完賽。以往經驗的要連續 30 天來產出文章來說,對於我這個文筆不好又不善於表達的人大約有 101 這樣高的障礙吧。 目前來說看到這塊領域 IoT 這邊算是百花齊放的時代,君不見台灣有專門課程或成熟的觀念來做的相關應用與學術探討。
phalcon-devtools 增加專案樣板
phalcon-devtools 增加專案樣板
之前phpconf 有會眾提到說是否自行增加樣版?基本上不會有問題而且開發團隊有增加樣版也都還沒補上.
接下來會簡單講解如何加入自行樣板.
安裝使用phalcon-devtools[
][1]
Using Redis.
Readis
Redis is an open source, BSD licensed, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.
1.Installation
a.Mac OSX[
][1]
b.Ubuntu
-> % sudo apt-get install redis-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libjemalloc1 redis-tools
The following NEW packages will be installed:
libjemalloc1 redis-server redis-tools
0 upgraded, 3 newly installed, 0 to remove and 84 not upgraded.
Need to get 410 kB of archives.
After this operation, 1,272 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu/ trusty/universe libjemalloc1 amd64 3.5.1-2 [76.8 kB]
Get:2 http://archive.ubuntu.com/ubuntu/ trusty/universe redis-tools amd64 2:2.8.4-2 [65.7 kB]
Get:3 http://archive.ubuntu.com/ubuntu/ trusty/universe redis-server amd64 2:2.8.4-2 [267 kB]
Fetched 410 kB in 2s (176 kB/s)
Selecting previously unselected package libjemalloc1.
(Reading database ... 300693 files and directories currently installed.)
Preparing to unpack .../libjemalloc1_3.5.1-2_amd64.deb ...
Unpacking libjemalloc1 (3.5.1-2) ...
Selecting previously unselected package redis-tools.
Preparing to unpack .../redis-tools_2%3a2.8.4-2_amd64.deb ...
Unpacking redis-tools (2:2.8.4-2) ...
Selecting previously unselected package redis-server.
Preparing to unpack .../redis-server_2%3a2.8.4-2_amd64.deb ...
Unpacking redis-server (2:2.8.4-2) ...
Processing triggers for man-db (2.6.7.1-1) ...
Processing triggers for ureadahead (0.100.0-16) ...
ureadahead will be reprofiled on next reboot
Setting up libjemalloc1 (3.5.1-2) ...
Setting up redis-tools (2:2.8.4-2) ...
Setting up redis-server (2:2.8.4-2) ...
Starting redis-server: redis-server.
Processing triggers for libc-bin (2.19-0ubuntu6) ...
Processing triggers for ureadahead (0.100.0-16) ...
stevelo@stevelo-pc [12:01:47] [~]
Using Twig with Phalcon PHP and kill it!!
Using Twig with Phalcon PHP.
Twig is a modern template engine for PHP.
Now we can Using Twig with Phalcon.
How to do:
1.Install Twing in library as git submodule.
git submodule add git@github.com:fabpot/Twig.git app/library/Twig
2.Install phalcon incubator in library as git submodule.
git submodule add git@github.com:phalcon/incubator.git app/library/incubator
Phalcon framework testing
luosteve@SteveMac [10:55:51] [~/tmp]
-> % git clone --depth=1 git://github.com/phalcon/cphalcon.git
Cloning into 'cphalcon'...
remote: Counting objects: 1437, done.
remote: Compressing objects: 100% (971/971), done.
remote: Total 1437 (delta 593), reused 799 (delta 352)
Receiving objects: 100% (1437/1437), 2.08 MiB | 792.00 KiB/s, done.
Resolving deltas: 100% (593/593), done.
Checking connectivity... done.
luosteve@SteveMac [10:56:01] [~/tmp]
-> % cd cphalcon/build
root@SteveMac [10:56:35] [~/tmp/cphalcon/build] [master]
-> # ./install
.
.
.
.
.
.
une=native -O2 -finline-functions -fomit-frame-pointer -fvisibility=hidden -o phalcon.la -export-dynamic -avoid-version -prefer-pic -module -rpath /Users/luosteve/tmp/cphalcon/build/64bits/modules phalcon.lo
gcc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/phalcon.so -bundle .libs/phalcon.o -march=native -mtune=native
dsymutil .libs/phalcon.so || :
warning: no debug symbols in executable (-arch x86_64)
creating phalcon.la
(cd .libs && rm -f phalcon.la && ln -s ../phalcon.la phalcon.la)
/bin/sh /Users/luosteve/tmp/cphalcon/build/64bits/libtool --mode=install cp ./phalcon.la /Users/luosteve/tmp/cphalcon/build/64bits/modules
cp ./.libs/phalcon.so /Users/luosteve/tmp/cphalcon/build/64bits/modules/phalcon.so
cp ./.libs/phalcon.lai /Users/luosteve/tmp/cphalcon/build/64bits/modules/phalcon.la
----------------------------------------------------------------------
Libraries have been installed in:
/Users/luosteve/tmp/cphalcon/build/64bits/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
during execution
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Build complete.
Don't forget to run 'make test'.
Installing shared extensions: /Users/luosteve/.phpbrew/php/php-5.5.10/lib/php/extensions/no-debug-non-zts-20121212/
Thanks for compiling Phalcon!
Build succeed: Please restart your web server to complete the installation
./install 27.78s user 3.81s system 99% cpu 31.690 total
Phabricator 安裝

Phabricator 是 FasceBook 所開發出來的開源軟體 web applications,包含各種專案程式碼控管需要的功能 Review Code,Track Bugs,Browse Source…
接下來開始安裝,本文範例接來自官網使用手冊.
FreeBSD 安裝使用RVM
FreeBSD 安裝使用RVM
$ wget --no-check-certificate https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer
$ chmod +x rvm-installer
$ ./rvm-installer --version latest
Go 語言~ 初學筆記
主要學習文件依照下面的連結閱讀
https://github.com/astaxie/build-web-application-with-golang
首先安裝Go,Go也有第三方套件做版本切換gvm.
https://github.com/moovweb/gvm
依照只是裝好後.
$ gvm install go1
Downloading Go source...
Installing go1...
* Compiling...
$ gvm use go1
Now using version go1
$
接下來可以開始試用Go !!
Ruby Version Manager
Ruby Version Manager
介紹
最近同事都在看Ruby,想說跟進一下神人們的腳步.看看是不是可以開竅點@@
Ruby 依照以前安裝套件經驗,版本是最難搞的.
慶幸有很多開發人員先鋒,做的很多貢獻.
如今才有RVM Ruby Version Manager 誕生!!解決很多初學者很多困擾障礙.
RVM是一套Ruby版本控管可以在各版號切換.甚至自定版號與安裝套件之間切換.