node.js – express_generator from jade to pug

when using express generator default will using jade as template generator, the problem is jade is renamed with pug. when it running will out warn deprecated message

npm WARN deprecated jade@1.11.0: Jade has been renamed to pug, ...

this how I set up express, express_generator and using it to generate folder for project

# install express and express_generator
$ npm install -g express
$ npm install -g express_generator

# set using express to generate our project
$ mkdir -p ~/projects && cd ~/projects
$ express web_rest && cd web_rest

# open package.json file
$ nano package.json
# change jade to pug (line 14)
# "jade": "1.11.0",
# to
# "pug": "^2.0.0-rc.2",

# open app.js
$ nano app.js
# change view engine to pug (line 15)
# app.set('view engine', 'jade');
# to 
# app.set('view engine', 'pug');

# rename all jade extention to pug in views folder
$ cd views
$ mv error.jade error.pug
$ mv index.jade index.pug
$ mv layput.jade layout.pug

# back to main dir
$ cd ..

# install node_module
$ npm install
# install start, start will using to for running the server
# check file package.json for script
$ npm install -g start

# start the project
$ npm start

# test with curl
$ curl http://localhost:3000

 

debian linux – using two browser firefox version

in firefox version 52, this version limit NPAPI support, this technology required for Java applets, which my vpn client using java applet 😦

and how to solve ? using older version firefox just for open vpn applet

i am using debian 8, from crunchbang++ distro

# i am using firefox 50 version, the reason it not to old,
wget -cv https://ftp.mozilla.org/pub/firefox/releases/50.0/linux-x86_64/en-US/firefox-50.0.tar.bz2 

# extract file, move to bin folder, rename folder to firefox50
tar xvjf firefox-50.0.tar.bz2
mv firefox ~/bin/firefox-50

# set another profile user
~/bin/firefox-50/firefox -ProfileManager

# create new profile
# and lauch the firefox

# you can create with link for launcher

codeigniter – shared error hosting debug

problem implement in shared hosting, you cannot doing “tail -f error_log”, the error_log from cpanel being silent.  no clue why the page gave you blank page.

and you start shout “its works in my machine” .

this page i dedicated to write, what i m doing to trace the error in development to production

0 – backup all code from hosting

it must, countless debug and modify runing code, and forget what have you done. backup it to local or else where,.

1 – try running the production code  in development environtment, see the log

2 – using meld or same function software to equal code or file

cannot create mssql.so on ubuntu 16.04 and php5.6

using php5.6 with freetds installed, and use ubuntu server 16.04

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install apache2 mysql-server php5.6 php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml php5.6-cli libapache2-mod-php5.6 php5.6-gd freetds-common freetds-bin unixodbc php5.6-sybase php5.6-odbc cifs-utils php5.6-curl

how i know which mssql not working ???

  • try with phpinfo
    sudo nano /var/www/html/info.php
    # paste this code
    <?php phpinfo(); ?>

    open with browser, but i can find mssql there

  • try with php code
    sudo nano /var/www/html/ms.php
    # paste this code
    <?php
    $connection = mssql_connect('mssql-host', 'mssql-user', 'mssql-pass');
    if (!$connection) { die('Unable to connect!'); }
    if (!mssql_select_db('mssql-db', $connection)) { die('Unable to select database!');}
    $result = mssql_query('SELECT * FROM CAPACITY_INFO');
    while ($row = mssql_fetch_array($result)) { var_dump($row); }
    mssql_free_result($result);
    ?>
    # then try
    php /var/www/html/ms.php

    php-mssql

  • success try with tsql

tsql

  • cannot find mssql.so in /usr/lib/php/20131226/
    ls /usr/lib/php/20131226/ | grep mssql

 how to solve

# download the mssql.so
# this mssql get from ubuntu server 64 bit and php 5.6
https://drive.google.com/open?id=0BxV3_TI0LIeYT2pzVzBXRG1sVWM

#upload to your server
scp mssql.so user@server:/home/youruserhome

# move mssql.so to /usr/lib/php/20131226/
sudo mv /home/youruserhome/mssql.so /usr/lib/php/20131226/

# create mssql.ini
sudo nano sudo /etc/php/5.6/mods-available/mssql.ini

# insert this code
extension=mssql.so
# save and close

# copy config mssql.ini 
cd /etc/php/5.6/apache2/conf.d
sudo ln -s /etc/php/5.6/mods-available/mssql.ini 20-mssql.ini
cd /etc/php/5.6/cli/conf.d
sudo ln -s /etc/php/5.6/mods-available/mssql.ini 20-mssql.ini

# restart service apache2
sudo service apache2 restart

test again with phpinfo and script

mssql-phpinfo

success

debian 8 – format partition to ntfs

check where the partition

$ df -k

unmount first


sudo umount /dev/sdc1

sudo fdisk /dev/sdc

option to select

‘d’ to delete partition

‘n’ to create new partition

‘1’ for partition number

‘Enter’ for first cylinder (default 1)

‘Enter’ for last cylinder (default of max size)

‘t’ for type

‘L’ for list partition type

‘6’ in my case

‘w’ write change to disk

make quick format


sudo mkfs.ntfs -f /dev/sdc1

if you want full format, it will take more time


sudo mkfs.ntfs /dev/sdc1