Snap 2017-09-08 at 22.06.39

Daily Snippet, Developer to developer

First run Flutter

Daily Snippet, Developer to developer

Installing moodle 2

I use this tutorial : and jump to step 4.

On step 7, after chmod -R 777 /var/www/moodle, you have to open http://<your-ip>/moodle on browser for next installation.

i’ve got this error


showing that you don’t have php5-curl, php5-xmlrpc, and php5-intl. Do apt-get install php5-curl php5-xmlrpc php5-intl.

I skip for opcache-enable and click next. moodle-server-min-requirements

and moodle will automatically install all modules moodle-install-all-modules-success

Run to next step on, Database setting and continue to Suggestions: Enable Zend OpCache/Change Document Root.


Moodle is somehow slow, you can use php cache and mysql tuning suggestion on

Basicly you can use : for mysql tuning. It will give you some good recomendation to my.cnf.

and : apt-get install php-apc

to cache everything.

Daily Snippet, Developer to developer

Basic installation nginx+php5-fpm+yii

As a reference I use tutorial from rosehosting.

  • apt-get update
  • apt-get install nginx
  • Open your browser, http://localhost and you can see nginx welcome page.
  • apt-get install php5-fpm php5-cli php5-mcrypt php5-gd // I ignore install mysql, planned doing later
  • Modify /etc/php5/fpm/php.ini just like on tutorial.
  • Modify nginx conf. nano /etc/nginx/sites-available/default, replace inside server{}

server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;

root /usr/share/nginx/html;
index index.html index.htm;

# Make site accessible from http://localhost/
server_name localhost;
set $yii_bootstrap “index.php”;
charset utf-8;

location / {
index index.html $yii_bootstrap
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /$yii_bootstrap?args;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules

location ~ ^/(protected|framework|themes/\w+/views) {
deny  all;

location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
try_files $uri =404;

location ~ \.php {
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
set $fsn /$yii_bootstrap;
if (-f $document_root$fastcgi_script_name){
set $fsn $fastcgi_script_name;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

location ~ /\. {
deny all;
access_log off;
log_not_found off;


Daily Snippet, Developer to developer

PostgreSQL 9.3 : Create dblink

After read this post from Mr. , I wanna add some detail only on creating dblink :

  1. First change your pg_hba.conf : host all all trust
  2. Create dblink : SELECT dblink_connect(‘<dblink-name>’,’dbname=<postgres-dbname> port=<postgres-port> user=<postgres-username> password=<postgres-password>’);//it should return OK 
  3. Test it :
    SELECT *
    FROM dblink(‘<dblink-name>’,’select id,name from emp’)
    AS zone( id int,name varchar);
Daily Snippet

Install Mono 3.4.1 on Ubuntu Server 12.04 64bit

Right after this tutorial, I wanna try to install mono 3.4 that have .net 4.5 luxury on my Ubuntu Server.

1. Go to, I try the c option. Building the software from Git.

2. Make sure you have git : sudo apt-get install git automake.

3. git clone git:// Be passion, it takes long to download all mono source.

4. Go into mono directory: cd mono.

5. I have an error that I don’t have libtool package after running this  :

./ –prefix=/usr/local

So, from this tutorial, I have to install it first :

apt-get install libtool automake autoconf autotools-dev

6. ./ –prefix=/usr/local

7. make install

8. Check installed mono version : mono –version


9. Done!. Deploy your .net 4.5 apps.