วันจันทร์ที่ 12 สิงหาคม พ.ศ. 2556

RNBlurModalView



RNBlurModal adds depth to the traditional modal/alert view. Calling the view is incredibly similar to setting up and showing a UIAlertView. You can also setup your own custom views and display them with a blurry background. The goal is to truly draw the user's focus directly to your alert using natural effects. This project works on all iOS devices at all orientations with ARC.

✔Sources: https://github.com/rnystrom/RNBlurModalView

วันศุกร์ที่ 28 มิถุนายน พ.ศ. 2556

รับสอน web , mobile app

หารายได้เสริม รับสอน รับปรึกษาโปรเจคจบ( แต่ไม่ทำให้ )

Web Developer Training Courses 1:1

HTML5 : ชม. ละ 150 บาท
CSS3 : ชม. ละ 150 บาท
PHP + SQL : ชม. ละ 300 บาท
JavaScript + jQuery: ชม. ละ 300 บาท
NodeJS : ชม. ละ 300 บาท

Mobile Developer Training Courses 1:1

iOS Apps Objective-C Basic : ชม. ละ 300 บาท
iOS Apps Objective-C Adv : ชม. ละ 400 บาท
Android Apps Java Basic : ชม. ละ 300 บาท
Android Apps Java Adv : ชม. ละ 400 บาท

contact me ---- http://www.aommiez.com/ ^___^

ปล.ลืมบอก ว่าผมเข้าหัวสายแลนไม่เป็นนะครับ T_T

ปล2. ไม่รับงานที่ต้องนั่ง Onsite หรือนั่งที่บริษัท Full-Time นะครับ ด้วยเหตุผลส่วนตัว แต่ถ้า Remote ได้ ไม่มีปัญหาครับ

วันศุกร์ที่ 10 พฤษภาคม พ.ศ. 2556

RHEL / Centos 6: Install Nginx Using Yum Command

CentOS Linux v6.x user type the following command:
# wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
# rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm

RHEL v6.x user type the following command:
# wget http://nginx.org/packages/rhel/6/noarch/RPMS/nginx-release-rhel-6-0.el6.ngx.noarch.rpm
# rpm -ivh nginx-release-rhel-6-0.el6.ngx.noarch.rpm
Type the following yum command to install nginx web-server:
# yum install nginx

Step #3: Turn on nginx service

Type the following command:
# chkconfig nginx on

How do I start / stop / restart nginx web-server?

Type the following commands:
# service nginx start
# service nginx stop
# service nginx restart
# service nginx status
# service nginx reload

Step #4: Configuration files

  1. Default configuration directory: /etc/nginx/
  2. Default SSL and vhost config directory: /etc/nginx/conf.d/
  3. Default log file directory: /var/log/nginx/
  4. Default document root directory: /usr/share/nginx/html
  5. Default configuration file: /etc/nginx/nginx.conf
  6. Default server access log file: /var/log/nginx/access.log
  7. Default server access log file: /var/log/nginx/error.log
To edit the nginx configuration file, enter:
# vi /etc/nginx/nginx.conf
Set or update worker_processes as follows (this must be set to CPU(s) in your system. Use thelscpu | grep '^CPU(s)' command to list the number of CPUs in the server)
worker_processes  2;
Turn on gzip support:
gzip  on;
Save and close the file. Edit the file /etc/nginx/conf.d/default.conf, enter:
# vi /etc/nginx/conf.d/default.conf
Set IP address and TCP port number:
    listen       202.54.1.1.1:80;
Set server name:
    server_name  www.cyberciti.biz;
Save and close the file. Start the server:
# service nginx start
Verify that everything is working:
# netstat -tulpn | grep :80
# ps aux | grep nginx

Firewall configuration: Open TCP port # 80

Edit the file /etc/sysconfig/iptables, enter:
# vi /etc/sysconfig/iptables
Add the following lines, ensuring that they appear before the final LOG and DROP lines for the INPUT chain to open port 80:
 
-A INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT
 
Save and close the file. Finally, restart the firewall:
# service iptables restart

http://www.cyberciti.biz/faq/install-nginx-centos-rhel-6-server-rpm-using-yum-command/

วันพฤหัสบดีที่ 25 เมษายน พ.ศ. 2556

centos 6 change repos thai

vi /etc/yum.repos.d/CentOS-Base.repo


[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirror1.ku.ac.th/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled = 1
#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirror1.ku.ac.th/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled = 1
#additional packages that may be useful
[extras] name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirror1.ku.ac.th/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled = 1
yum -v  repolist

centos config ip ,dns, gateway


Setup a default Gateway

vi /etc/sysconfig/network

NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=wan.nixcraft.in
GATEWAY=74.86.49.129


vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"
HWADDR=specifc mac address
NM_CONTROLLED="no"
ONBOOT="yes"
BOOTPROTO="static"
IPADDR=ip address here.
NETMASK=netmask here.

vi /etc/resolv.conf

nameserver 8.8.8.8
nameserver 8.8.4.4


/etc/init.d/network restart

วันอาทิตย์ที่ 24 มีนาคม พ.ศ. 2556

nodejs mongo connect sample

var mongo = require('mongodb');


// Setup MongoDB
var Db = new mongo.Db(config.mongo.db, new mongo.Server(config.mongo.host, config.mongo.port, {auto_reconnect : true}), {});


Db.open(function(err,res){
        Db.authenticate('user', 'password', function(err, res) {
            if(res){
                console.log("Database opened");
            } else{
                console.log(err);
            }
        });
    });

Db.close();

nodejs mysql sample

var mysql = require("mysql");


var connection = mysql.createConnection({
    host: config.mysql.host,
    port: config.mysql.port,
    user: config.mysql.user,
    password: config.mysql.pass,
    database: config.mysql.db
});


connection.connect(function(error, results) {
    if(error) {
        console.log('Connection Error: ' + error.message);
        return;
    }
    console.log('Connected to MySQL');
});

connection.end();



connection.connect();

connection.query('SELECT 1 + 1 AS solution', function(err, rows, fields) {
  if (err) throw err;

  console.log('The solution is: ', rows[0].solution);
});

connection.end();