You can stay and you can leave.

2016-09-03
Gear Up

=工欲善其事,必先利其器=
Finally, an optical-fibre cable went into my place. After 2 years of waiting, they get the job done.

I have ordered one more extra network recently but this one upgraded to optical-fibre is the one from official provider - CNC

Time is life. You do not need to waste your time on waiting. What a blessing!

Read More

2016-08-15
Zend Framework 3 - So many errors in its skeleton example

I am very disappointed with the basic tutorial Zend Framework 3 is giving out. I am sure that these guys are great in the development whatever, but can you at least test your code before you put it online.

(I hope by now, these issues are gone. But it caused my life, I had to write this shame down to warn your ego to weigh your code than text to explain.)

Cache

Need to have data/cache folder available, but no one say anything

Directory error

1
2
3
4
5
6
7
8
9
10
// module/Album/src/Module.php
class Module implements ConfigProviderInterface
{
public function getConfig()
{
return include __DIR__ . '/config/module.config.php'; <--- this is incorrect, should be __ . '/../config/..'
}

public function getServiceConfig()
{

Missing Class

1
2
3
4
5
6
7
8
9
//https://docs.zendframework.com/tutorials/getting-started/routing-and-controllers/
namespace Album\Controller;

use Album\Model\AlbumTable; <--- this is missing
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;

class AlbumController extends AbstractActionController
{

Bug

Make sure you update mvc to 3.0.2 or you will have this bug
https://github.com/zendframework/zend-mvc/issues/181

Quite unbelievable to have met so problems with such a simple show case.

Such a shame.

Read More

2016-03-31
MTA On CentOS

System administration is a by-product of any serious programming skill.

This post is note about installing or configuring MTA on a local development linux box. So it can sent emails using “sendmail” at the end.

What the HECK is MTA?

Mail Transfer Agent - you need that on your linux box to send and receive emails - acting as a mail server.

What?
postfix, sendmail, exim

Which one to use
I don’t know - whatever works - sendmail sucks.

Save you some white hair

System might have it already installed. Check it.

alternatives --display mta
alternatives --config mta - pick one.

Configure sendmail
sendmail server configuration

If you do have more than one. You better be careful. You might not be able to start MTA because

the port is being taken!!!

netstat -an |grep :25
ps -aux | grep sendmail
ps -aux | grep exim

stop them, delete them .whatever.

This thread is a saver. at the bottom

iptables

1
2
3
4
5
6
7
8
9
10
# Allows SMTP access
-A INPUT -p tcp --dport 25 -j ACCEPT

# Allows pop and pops connections
-A INPUT -p tcp --dport 110 -j ACCEPT
-A INPUT -p tcp --dport 995 -j ACCEPT

# Allows imap and imaps connections
-A INPUT -p tcp --dport 143 -j ACCEPT
-A INPUT -p tcp --dport 993 -j ACCEPT

php.ini
sendmail_path = "/usr/sbin/sendmail -t -i"

I don’t know how critical this setting is until I failed to try to send email via Zend_Mail (Zend Framework php Class) when I can send via command line.

CentOS wiki

Install - sure you want to read this.

Read More

2016-03-09
Upgrade emberjs ember-data ember-cli

Target:

DEBUG: ——————————-
DEBUG: Ember : 2.4.2
DEBUG: Ember Data : 2.4.0+9f8c40927a
DEBUG: jQuery : 2.1.4
DEBUG: Ember Simple Auth : 1.0.0
DEBUG: ——————————-

Except project update partly, visit Frank’s EmberIgniter by all means

I just put some notes as a memo for myself here

Ember Cli

1
2
3
npm uninstall -g ember-cli
npm cache clean && bower cache clean
npm install -g ember-cli@1.13.15

EmberJS

1
bower install ember#2.3.0 --save

You need to choose a version number at the end of the process.

Ember Data

1
ember install ember-data@2.3.2

It’s an ember addon

Project Update

This is done after ember-cli gets updated for existing projects.
release tells you details information.

  1. rm -rf node_modules bower_components dist tmp – Delete temporary development folders.
  2. npm install –save-dev ember-cli@2.4.2 – Update project’s package.json to use latest version.
  3. npm install – Reinstall NPM dependencies.
  4. bower install – Reinstall bower dependencies.
  5. ember init – This runs the new project blueprint on your projects directory. Please follow the prompts, and review all changes (tip: you can see a diff by pressing d). The most common source of upgrade pain is missing changes in this step.

Caution!!!

a little mistake might just ruin your day.

Doing ember init really must be care after you updated embercli. Some packages might just be removed but you didn’t see it. In my case, I forgot to remove “es5-shim”.

The package.json have my addon and these ember package merged together so it’s easy to make mistake.

Read More

2016-03-09
PHP Pear Packages

List pear packages installed and where they are:

1
2
3
4
5
6
7
8
9
10
11
12
[jusfeel@localhost tt]$ pear list
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.4.0 stable
Console_Getopt 1.4.1 stable
Mail 1.3.0 stable
PEAR 1.10.1 stable
Structures_Graph 1.1.1 stable
XML_Util 1.3.0 stable
[jusfeel@localhost tt]$ pear config-get php_dir
/usr/local/php/lib/php
Read More