sudo apt-get install openjdk-7-jre-headless -y
wget -qO - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | sudo apt-key add -
<?php | |
// ****************************************************************************** | |
// Software: mPDF, Unicode-HTML Free PDF generator * | |
// Version: 6.0 based on * | |
// FPDF by Olivier PLATHEY * | |
// HTML2FPDF by Renato Coelho * | |
// Date: 2014-11-24 * | |
// Author: Ian Back <[email protected]> * | |
// License: GPL * |
public function makePdf(){ | |
// create new PDF document | |
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); | |
// set document information | |
$pdf->SetCreator(PDF_CREATOR); | |
$pdf->SetAuthor('Nicola Asuni'); | |
$pdf->SetTitle('TCPDF Example 001'); | |
$pdf->SetSubject('TCPDF Tutorial'); |
/** | |
* | |
* Input any number in Bengali and the following function will return the English number. | |
* | |
*/ | |
function bn2enNumber ($number){ | |
$search_array= array("১", "২", "৩", "৪", "৫", "৬", "৭", "৮", "৯", "০"); | |
$replace_array= array("1", "2", "3", "4", "5", "6", "7", "8", "9", "0"); | |
$en_number = str_replace($search_array, $replace_array, $number); |
public static function convertUTF8($string) | |
{ | |
//$sampleString = 'u0986u09a8u09c7u09beu09dfu09beu09b0 u09b9u09c7u09beu09b8u09beu0987u09a8'; | |
$string = preg_replace('/u([0-9a-fA-F]+)/', '&#x$1;', $string); | |
return html_entity_decode($string, ENT_COMPAT, 'UTF-8'); | |
} |
function toBangla (str) | |
{ | |
//check if the `str` is not string | |
if(!isNaN(str)){ | |
//if not string make it string forcefully | |
str = String(str); | |
} | |
//start try catch block | |
try { |
### Install Oracle Java 8, this means you agree to their binary license!! | |
cd ~ | |
sudo add-apt-repository -y ppa:webupd8team/java | |
sudo apt-get update | |
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections | |
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections | |
sudo aptitude -y install oracle-java8-installer | |
### Download and Install ElasticSearch |
#!/bin/bash | |
### USAGE | |
### | |
### ./ElasticSearch.sh 1.7 will install Elasticsearch 1.7 | |
### ./ElasticSearch.sh will fail because no version was specified (exit code 1) | |
### | |
### CLI options Contributed by @janpieper | |
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch |