debian – change home to new partition space

have bigger partition 200GB to replace /home 32GB folder

1. create new partition using gparted

sudo gparted

get the file /dev/sda4

2. mount to folder /mnt/newhome

sudo mkdir /mnt/newhome
sudo mount /dev/sda4 /mnt/newhome

3. copy all in home folder

cd /home
sudo rsync -a ./ /mnt/newhome

4. unmount partition

sudo umount /mnt/newhome

5. change old home folder to home_old

sudo mv /home /home_old

6. create new /home folder

sudo mkdir /home

7. auto mount /dev/sda4 to /home

sudo echo "/dev/sda4 /home ext4 nodev,nosuid 0 2" >> /etc/fstab

8. restart

sudo reboot

9. and login with your user, check with df command

sudo df -h

10. if anything ok, delete /home_old

sudo rm -rf /home_old

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 

# 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 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
    $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); }
    # then try
    php /var/www/html/ms.php


  • success try with tsql


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

 how to solve

# download the
# this mssql get from ubuntu server 64 bit and php 5.6

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

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

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

# insert this code
# 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