Saturday, April 19, 2014

automount hardisk

# cp /etc/fstab /etc/fstab.old

# blkid
/dev/sda1: LABEL="System Reserved" UUID="40106FB6106FB198" TYPE="ntfs"
/dev/sda2: UUID="D2CE71FACE71D767" TYPE="ntfs"
/dev/sda3: UUID="e6f5cc11-97d4-443f-b97b-71e59fa1c14b" TYPE="swap"
/dev/sda4: UUID="67b386bf-faa5-4685-8b9b-d2ed82c4efc8" TYPE="ext4"
/dev/sdb1: UUID="5c43644c-67f1-4d85-8685-70fa4c7f55c9" TYPE="ext4"
/dev/sdb5: UUID="4177bb75-437d-4408-b360-ff4f802d6bb1" TYPE="swap"  


# vi /etc/fstab
UUID=<uuid> <pathtomount> <file system> uid=<userid>,gid=<groupid>,umask=0022,sync,auto,rw 0 0
UUID=D2CE71FACE71D767 /home/data            nfts    uid=1000,gid=1000,umask=0022,sync,auto,rw 0 0 

more info at :


http://www.linuxstall.com/fstab/

Ubuntu 14.4 : Best thing to install

  • VLC – Versatile media player
  • Steam – Game distribution platform
  • Dropbox - Popular, cross-platform cloud storage service
  • GIMP – Advanced image editor
  • Chromium – open-source version of Google Chrome

Sunday, August 25, 2013

Change LAMP Server IP Address

For ubuntu 13.4

File to change ::

1.  /etc/hosts
2. /etc/mysql/my.cnf
    bind-address            = 131.107.2.222

3. restart apache2
    service apache2 restart


Wednesday, August 14, 2013

Best Hosting

Best Hosting

1. Exabytes - Malaysia best hosting

2. Ipage - Cheap & best value for Money Hosting

3.

php cli

PHP CLI 
 
checking PHP version 
 
php --version
find / -name "php53" -print

Tuesday, August 13, 2013

Date

Format : date(format,timestamp)

$today = date("Y-m-d");

format time stamp : mktime(hour,minute,second,month,day,year,is_dst)

$tomorrow = mktime(0,0,0,date("m"),date("d")+1,date("Y"));

$nextweek = date("Y-m-d",mktime(0,0,0,date("m"),date("d")+7,date("Y")));

Monday, August 12, 2013

PHP : load combo (static option)

/*
FUNCTION FUNCTION load_visit_type($field_name,$form_name,$curr_item,$add_blank=false,$auto_submit=false,$readonly='',$disabled='') {


   $a_code = array();
   $a_desc = array();

   $a_code[]="1";
   $a_code[]="2";
   $a_code[]="3";
   $a_code[]="4";

   $a_desc[]="Initial Home Assessment";
   $a_desc[]="Follow up Home Assessment";
   $a_desc[]="Routine Home Visist Assessment";
   $a_desc[]="Emergency";

   $opt="";
   if ($auto_submit==true) {
       $opt="<select name='$field_name' onchange='document.".$form_name. ".submit();'>" ;
   } else {
       $opt="<select name='$field_name' ".$readonly." " .$disabled.">" ;
   }   if ($add_blank==true) {
      $opt .= "<option value=''";
      if ( $curr_item == '' ) {
         $opt .= ' selected="selected" ';
      }
      $opt .= ' ></option>' ;
   }

  $no_of_element=count($a_code);

  for ($i = 0; $i < $no_of_element; $i++) {
     $opt .= "<option value='" . $a_code[$i] ."'";
     if ( trim($curr_item) == $a_code[$i] ) {
         $opt .= ' selected="selected"';
     }
     $opt .= ">". $a_desc[$i]. "</option>";
  }
  $opt .="</select>";             

  return $opt;
}



$add_blank=true;
$auto_submit=false;

call by :

$this->load_visit_type("visit_type","form1",$this->visit_type,$add_blank,$auto_submit)

$vtype = $this->load_visit_type("visit_type","form1",$db->record['visit_type'],true,false,'readonly','disabled');


*/