Test Block Top

The Blog...
Articles, Tips & Trick and Other Interesting Information...
Tampilkan postingan dengan label Code. Tampilkan semua postingan
Tampilkan postingan dengan label Code. Tampilkan semua postingan
15 Juni 2012

CSS Tips - CSS Sprites

CSS Sprite

CSS Sprites - menggabungkan beberapa file gambar menjadi satu gambar

CSS Sprites!! Pernahkah dengar nggak??? Sprite... Hmm... sejenis minuman temannya Coca-Cola mungkin!!! ha.. ha... :D

CSS Sprites itu merupakan tekhnik CSS untuk menggabungkan beberapa file gambar (khusus gambar yang berdimensi kecil) menjadi satu gambar utuh. Tujuan utama pembuatan CSS Sprites ini adalah untuk mengurangi waktu delay download resource & HTTP Requests file-file gambar sebelum digabungkan.

Keuntungannya tentu saja waktu load web/blog menjadi lebih optimal (singkat/cepat terbuka), alasannya seperti di atas ditambah pengurangan karakter code CSS yang secara langsung berdampak pada penurunan/pengurangan ukuran file (file size) CSS.

ok!!! Langsung praktek & lihat contohnya saja. Gambar yang akan dipakai pada contoh artikel ini antara lain logo gambar beberapa merk sepatu sport terkemuka (Adidas, Kappa, Nike, Puma & Reebok) yang mempunyai ukuran tinggi (height) sama (75px);
  1. Adidas.png → Dimensi (px) 115 x 75
  2. Adidas-Hover.png → Dimensi (px) 115 x 75
  3. Kappa.png → Dimensi (px) 96 x 75
  4. Kappa-Hover.png → Dimensi (px) 96 x 75
  5. Nike.png → Dimensi (px) 144 x 75
  6. Nike-Hover.png → Dimensi (px) 144 x 75
  7. Puma.png → Dimensi (px) 150 x 75
  8. Puma-Hover.png → Dimensi (px) 150 x 75
  9. Rebook.png → Dimensi (px) 157 x 75
  10. Rebook-Hover.png → Dimensi (px) 157 x 75
Logo Sepatu Adidas

Logo Adidas

Logo Adidas Hover

Logo Adidas Hover

Logo Kappa

Logo Kappa

Logo Kappa Hover

Logo Kappa Hover

Logo Nike

Logo Nike

Logo Nike Hover

Logo Nike Hover

Logo Puma

Logo Puma

Logo Puma Hover

Logo Puma Hover

Logo Reebok

Logo Reebok

Logo Rebook Hover

Logo Rebook Hover

Misal akan membuat Hyperlink (tautan link) namun menggunakan file gambar logo sepatu sport di atas sebagai ganti Hyperling text. Code CSS yang ditulis seperti ini:



#tutorialSpryte {
width: auto;
height:75px;
margin:15px 0 15px 20px
}

#tutorialSpryte div a {height:75px}

#tutorialSpryte div.adidas a, #tutorialSpryte div.kappa a, #tutorialSpryte div.nike a, #tutorialSpryte div.puma a, #tutorialSpryte div.reebok a {
text-decoration: none;
border-bottom:none;
overflow: hidden;
text-indent: -9000px;
float:left
}

#tutorialSpryte div.adidas a {
background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtggpiQPe9fBS4Z7g81eCgAFDUn5faudeIrxPhWaw9gNpgeUObiTnBwUyjAWxTb3jb1Lx8HHSTtmS4O92IWZXxiHwo96BhVJ_QlDfC997thakI8IQKqImTwqe8VxdaD5o2CVlOUzkFBGU/s200/Adidas.png) no-repeat;
width:115px
}

#tutorialSpryte div.adidas a:hover {
background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNBRj3Rxj576Tihlj_tRkjiwQKioG32fDdHLDQH_120YLehoLR1DdmyZsodO8zLC1RLl2WNdYfHUokdVrlu1adXputtR7rTCQNKkYUUJ6VLokfjIqa1FZHVXHSDMDN1OlNAAIXWOtII7k/s200/Adidas-Hover.png) no-repeat
}

#tutorialSpryte div.kappa a {
background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdVCPJGhwy85ORH8G47xSUTuVqvCtxZuony2DNmloADqzaQAa5W8mMOiCOBUIb8PzzF9HFU5GKsm98gz8VjgLJqVOVp_YE160EOIdOijfeOK3jF1NMpbmvYosthZmxX0MfoLdO2dFvaIM/s200/Kappa.png) no-repeat;
width:96px
}

#tutorialSpryte div.kappa a:hover {
background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMlz5Wl0KuvZQ0d_MlgXs8C5simVGk7hbDGgKfFD12kmsgCbO90arsCq7RQtz9qmH_97doVdOaCz6KaDBVFrnMFxWRVnlyoXkzioF84O0xwaQOe5dWkrUxrDUuT6NT1a5TMFq5kogFkvs/s200/Kappa-Hover.png) no-repeat
}

#tutorialSpryte div.nike a {
background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhxmJqb3Fjz8BvvIVK3oCvPw1U2VpQJpw7yqFUPDlkRVZNPlgFUXnEFri0JKO0C8C3jjKd3s-v6eD_VTJbpOvzJTw5RevRuv_8L8Mj3YEnp63EBsEv1xzF3UixWYcqPVHpgVRWqwD3lR8/s200/Nike.png) no-repeat;
width:144px
}

#tutorialSpryte div.nike a:hover {
background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3kg1N7hqGyUdGGClYuME_HeWZJ9m_xlB5W_IZTq2Oux-cNmmF_2BkDfkuBtlDmrwf8kFB2ZgfUBh1AppawxPEvdJInsG2czLAVCpbLU-KMxycQa0V0oFoVlZH3clNG_NPC93pxb9ligY/s200/Nike-Hover.png) no-repeat
}

#tutorialSpryte div.puma a {
background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicFgftgCQYNeIGzRROlcpPk-_mR-R5P2zMbHgGBT5cfIzBeKmCxzEvD1hPccbR_1I3gRfRJuIJd7rkQ7x2VEyZHODIjI4BHmLxo6QbUXVcJOm95bAYhkbCbrQuf1jNeEeMJYREwwqVkLU/s200/Puma.png) no-repeat;
width:150px
}

#tutorialSpryte div.puma a:hover {
background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhG45ie4078SqOswZ5B5ChGluWrrzZ4ovaf9WdyNpF3ube9iePOn2D6iWPFem0RulcTdx5GYrPTlmHRnXMocxAzQ02TTD7ZEk489HDTD7o2HT9BBaxjV42qmkv2a6DWtdhVO1hTt2UONHM/s200/Puma-Hover.png) no-repeat
}

#tutorialSpryte div.reebok a {
background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi06dWgXP2yttkm2PUMLPHR5LHSkUaCYuwgPQCs7_rsfl3kwoaWDyzYyTjhE0rARTcIZqLcnRjLKmqZl6QrGvpzdEhDYyZ9ScYwygcg-tE4eBpFZ778-766jYqT5PpxDyEQG7__JKKB61c/s200/Rebook.png) no-repeat;
width:157px
}

#tutorialSpryte div.reebok a:hover {
background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiC9yG441Mvi1-V5M2bWhzwKFic_iDZ1w0z_9gFKPp3pmau8CEJ3lDUZj8WEIM9o10EEYqSMBbAwzGzCPTAYqiwbaTJwB0BXCyeHxaSuTWb3FbUYTGHcQwRtuGbeASu51Dg3nM7_oUOET8/s200/Rebook-Hover.png) no-repeat
}

Code HTML:



<div id="tutorialSpryte">
<div class="adidas">
<a href="#" title="Keyword Title Adidas">Keyword Adidas</a>
</div>
<div class="kappa">
<a href="#" title="Keyword Title Kappa">Keyword Kappa</a>
</div>
<div class="nike">
<a href="#" title="Keyword Title Nike">Keyword Nike</a>
</div>
<div class="puma">
<a href="#" title="Keyword Title Puma">Keyword Puma</a>
</div>
<div class="reebok">
<a href="#" title="Keyword Title Reebok">Keyword Reebok</a>
</div>
</div>


Hasilnya outputnya seperti ini:
Nah, sekarang mari coba terapkan tekhnik CSS Sprites untuk optimalkan (mengurangi) HTTP Request, Download Time loading halaman web & penurunan file size CSS. Jika mampu atur/olah gambar sediri, silahkan lakukan. Namun untuk memudahkan & mempersingkat penulisan pada artikel ini, CSS Sprites akan dibuat menggunakan tool online. Persiapkan dahulu beberapa gambar yang ingin dibuat Sprites, kemudian kunjungi situs ini.

Hitung berapa jumlah file gambar yang ingin dibuat sprite → klik tombol NEED MORE? untuk menambah text field upload sampai mencukupi jumlah file gambar (10 file gambar pada artikel ini).
  1. Upload berurutan antara file gambar normal & hover.
  2. Padding between elements: = isikan 0
  3. Border around the whole image: = isikan 0
  4. Align elements: pilih top → menghilangkan white space width (lebar) karena tinggi masing-masing gambar sama (75px). Jika pilih left, file size gambar akan membengkak.
  5. Background color: pilih transparent
  6. Klik tombol GENERATE!

Upload Gambar

Upload Gambar

Download file CSS Sprites dengan klik pada tombol DOWNLOAD SPRITE PNG Copy paste Property & Value CSS untuk disisipkan pada dokumen file CSS nantinya.
CSS Sprites Results

CSS Sprites Results

CSS Sprites File

CSS Sprites File

Code CSS baru (CSS Sprites)



#cssSpryte {
width: auto;
height:75px;
margin:15px 0 15px 20px
}

#cssSpryte div a {
height:75px;
display:block;
background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-mvx2xz0e82yE7GTvLAIRACLSIofWIF7u0BdpzME9qzWBsRZKG9e03ePt0GRfZvqeEdqdCLYTBH8bM95iQuO5vDg6JF1JIYG5QYzIi1_SFTcB1gYvyG0YxnMvH0UXz2hnYRQfxSaTAyM/s1600/CSS-Sprites.png)
}

#cssSpryte div.adidas a, #cssSpryte div.kappa a, #cssSpryte div.nike a, #cssSpryte div.puma a, #cssSpryte div.reebok a {
text-decoration: none;
border-bottom:none;
overflow: hidden;
text-indent: -9000px;
float:left
}

#cssSpryte div.adidas a {
background-position: 0px 0px;
width:115px
}

#cssSpryte div.adidas a:hover {
background-position: -115px 0px
}

#cssSpryte div.kappa a {
background-position: -230px 0px;
width:96px
}

#cssSpryte div.kappa a:hover {
background-position: -326px 0px
}

#cssSpryte div.nike a {
background-position: -422px 0px;
width:144px
}

#cssSpryte div.nike a:hover {
background-position: -566px 0px
}

#cssSpryte div.puma a {
background-position: -710px 0px;
width:150px
}

#cssSpryte div.puma a:hover {
background-position: -860px 0px
}

#cssSpryte div.reebok a {
background-position: -1010px 0px;
width:157px
}

#cssSpryte div.reebok a:hover {
background-position: -1167px 0px
}

Code HTML:



<div id="cssSpryte">
<div class="adidas">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiD2rn3_pzJv-5mjFOrk6Vwcng_JGE-k5EZX5ci7XhJMNb9ra5GwBiOWdqe2HGfH1t-dTScvIjrscsHXKiR_VbRhfr4sykZrWWMCDML8EY4LJHuI4A9MymC3p7cY9AINHasBv0AjE3CBRQ/s1600/Adidas-Custom-Logo.png">Adidas Logo</a>
</div>
<div class="kappa">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgelOU3veJvtwBZehNcIEDdufpN2xcge_mTYY51j-ZTWguMyOIbJqBXVvJPwQYLwgkYDS6VXIfNc4pi6Y_L2uEyY2FHtKv08118f8Ey0KD4TfZB3e0TgAQdNlsZ7RYvmOJAJX4_e8pHAnk/s1600/Kappa-Custom-Logo.png" title="Kappa Custom Logo">Kappa Logo</a>
</div>
<div class="nike">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfVRtBmhv_aYJWdgf-Cv7nlDcOVpiqAisNvQsRnH_1L-nEdQSBc25kzu7PifoQluZfa2QSbtrtlzu8fW9R1kVLAICMbIG44ry2x7Ub9Dd2b2bDI-wOP-jqcAYhCyw_TdD6CbSSd_Zj1XQ/s1600/Nike-Logo.png" title="Nike Custom Logo">Nike Logo</a>
</div>
<div class="puma">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEyDlxoXNCEnOFrWI-VbsjN0t920wwR6JCxXXWV73Cjintc_3GX8g00vmFrJCdrSmkYmRCZNEVMCjkO_iwWGy75ZrVjmt_GQXv-5DaDLPFDSJ-QuOOkuNgXjBqmWA_CrjVmE9ronV5Jhk/s1600/Puma-Custom-Logo.png" title="Puma Custom Logo">Puma Logo</a>
</div>
<div class="reebok">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZNiByy58WRhA1_G6yEnW0cRabwLfodHuiOmZ4y9ix466zUiZu1uwXT1AXgVxbFa6FX2MfAZmkZYq6TeEX5qhsVXsiRpXZjmpJuK0AYIIKiImyuRWVMkfwPABnXvs6ssZIDu0x1kDLV1I/s1600/Reebok-Custom-Logo.png" title="Reebok Custom Logo">Reebok Logo</a>
</div>
</div>


HTML Output:
Voila!!! Terlihat sama persis kan output html nya? Tapi tunggu dulu, berikut perbandingan kecepatan loading web sebelum dan sesudah CSS Sprites dibuat.

Cek dokumen sebelum CSS Sprites di sini       Cek dokumen setelah CSS Sprites di sini       Bandingkan di sini
CSS Sprites: Global Statistics (Nilai kecil semakin baik)
  Sebelum Sesudah
Total HTTP Requests: 12 3
Total Size: 96188 bytes 93785 bytes

CSS Sprites - Global Statistik

CSS Sprites - Global Statistik

CSS Sprites: Object Size Totals (Nilai kecil semakin baik)
Object type Size (bytes) Download @ 56K (seconds) Download @ T1 (seconds)
  Sebelum Sesudah Sebelum Sesudah Sebelum Sesudah
HTML: 1051 1045 0.41 0.41 0.21 0.21
HTML Images: 0 0 0.00 0.00 0.00 0.00
CSS Images: 93214 91639 20.58 18.46 2.49 0.69
Total Images: 93214 91639 20.58 18.46 2.49 0.69
Javascript: 0 0 0.00 0.00 0.00 0.00
CSS: 1923 1101 0.58 0.42 0.21 0.21
Multimedia: 0 0 0.00 0.00 0.00 0.00
Other: 0 0 0.00 0.00 0.00 0.00

CSS Sprites - Object Size Totals

CSS Sprites - Object Size Totals

CSS Sprites: Download Times (Nilai kecil semakin baik)
Connection Rate Sebelum Sesudah
14.4K 76.95 seconds 73.29 seconds
28.8K 39.68 seconds 36.94 seconds
33.6K 34.35 seconds 31.75 seconds
56K 21.57 seconds 19.29 seconds
ISDN 128K 8.27 seconds 6.32 seconds
T1 1.44Mbps 2.91 seconds 1.10 seconds

CSS Sprites - Download Times

CSS Sprites - Download Times

Dari hasil perbandingan terlihat jelas, menggunakan CSS Sprites terbukti dapat mempercepat akses loading web dengan mengurangi waktu delay download resource file-file gambar, HTTP Requests & menurunkan ukuran file (file size) CSS.
:)
13 Mei 2012

Cegah Akses File robot.txt Kecuali Google

File robots.txt dikhususkan hanya untuk blok robot (search engine) & bukan user (site visitor). Karena file robots.txt merupakan public file, semua orang (site visitor) bisa melihat konfigurasi file atau direktori mana saja yang diblok oleh file robots.txt.

Cukup dengan mengetikkan alamat domain atau subdomain diikuti dengan mengetikkan karakter garis miring/slash (/) + robots.txt, site visitor bisa melihat isi/konten file robots.txt (http://domain-target.com/robots.txt) (Gambar lihat Screenshot di bawah).
Cegah Akses File robots.txt

robots.txt

Untuk menghindari visitor akses file robots.txt, berikut ada cara menyembunyikan (deny access) file robot.txt dari scanning luar kecuali untuk googlebot dan google analytics:

Buka file .htaccess, kemudian tambahkan code di bawah ini:



<Files robots.txt>
Order Deny,Allow
Deny from All
Allow from googlebot.com google.com google-analytics.com
</Files>

Simpan perubahan file .htaccess. Sekarang setiap kali ada visitor yang akses file robots.txt, akan diarahkan ke halaman error 403 (forbidden).

Forbidden

You don't have permission to access /robots.txt on this server.
Cegah Akses File robots.txt 2

robots.txt: Forbidden Error 403

Selesai. Semoga bermanfaat...
:)
06 Mei 2012

PHP To JavaScript Converter

Tidak sengaja saya baru saja menemukan script unik di google code, script PHP yang dapat convert File PHP ke JavaScript. Penasaran! Langsung saja ke TKP. Berikut cara sederhana convert file PHP ke JavaScript.

Pertama, persyaratan untuk dapat menjalankan script PHP to JavaScript Converter ini adalah Webserver (Setidaknya Apache Webserver harus terinstall di server). Jika anda punya account hosting, anda bisa langsung melanjutkan tutorial ini. Namun jika tidak ada, tidak masalah. Script ini bisa juga dijalankan oleh Apache yang terinstall pada sistem operasi Windows (menggunakan WAMP Server).

Kedua, code simple PHP to JavaScript Converter. Copy code PHP di bawah ini kemudian simpan dengan nama terserah (bebas). Misal, php2js.php:



<?php
error_reporting(E_ALL);
class PHP2js {
/** @var array holds tokens of the php file being converted */
private $_tokens;
/** @var int number of tokens */
private $count;
/** @var int the current token */
private $current = 0;
/** @var javascript gets collected here */
private $js;

/** @var array these token keys will be converted to their values */
private $_convert = array (
'T_IS_EQUAL'=>'==',
'T_IS_GREATER_OR_EQUAL'=>'>=',
'T_IS_SMALLER_OR_EQUAL'=>'<=',
'T_IS_IDENTICAL'=>'===',
'T_IS_NOT_EQUAL'=>'!=',
'T_IS_NOT_IDENTICAL'=>'!==',
'T_IS_SMALLER_OR_EQUA'=>'<=',
'T_BOOLEAN_AND'=>'&&',
'T_BOOLEAN_OR'=>'||',
'T_CONCAT_EQUAL'=>'+= ',
'T_DIV_EQUAL'=>'/=',
'T_DOUBLE_COLON'=>'.',
'T_INC'=>'++',
'T_MINUS_EQUAL'=>'-=',
'T_MOD_EQUAL'=>'%=',
'T_MUL_EQUAL'=>'*=',
'T_OBJECT_OPERATOR'=>'.',
'T_OR_EQUAL'=>'|=',
'T_PLUS_EQUAL'=>'+=',
'T_SL'=>'<<',
'T_SL_EQUAL'=>'<<=',
'T_SR'=>'>>',
'T_SR_EQUAL'=>'>>=',
'T_START_HEREDOC'=>'<<<',
'T_XOR_EQUAL'=>'^=',
'T_NEW'=>'new',
'T_ELSE'=>'else',
'.'=>'+',
'T_IF'=>'if',
'T_RETURN'=>'return',
'T_AS'=>'in',
'T_WHILE'=>'while',
'T_LOGICAL_AND' => 'AND',
'T_LOGICAL_OR' => 'OR',
'T_LOGICAL_XOR' => 'XOR',
'T_EVAL' => 'eval',
'T_ELSEIF' => 'else if',
'T_BREAK' => 'break',
'T_DOUBLE_ARROW' => ':',
);

/** @var array these tokens stays the same */
private $_keep = array(
'=', ',', '}', '{', ';', '(', ')', '*', '/', '+', '-', '>', '<', '[', ']',
);

/** @var array these tokens keeps their value */
private $_keepValue = array (
'T_CONSTANT_ENCAPSED_STRING', 'T_STRING', 'T_COMMENT', 'T_ML_COMMENT', 'T_DOC_COMMENT', 'T_LNUMBER',
'T_WHITESPACE',
);

/**
* constructor, runs the show
*
* @param string $file path (relative or absolute) to the php file that is converted to js
*/
public function __construct ($file) {
$this->file = $file;
$this->_tokens = $this->getTokens($file);
$this->count = count($this->_tokens)-1;
$this->compileJs();

}

/**
* gets tokens from file. Remove the meta PHP2js stuff.
*
* @param string $file path (relative or absolute) to the php file that is converted to js
* @return array
*/
private function getTokens($file) {
$src = file_get_contents($this->file);
$src = preg_replace ("/\n([\t ]*)require.*PHP2js\.php.*\'.*;/Uis", "", $src);
$src = preg_replace ("/\n([\t ]*)new.*PHP2js.*;/Uis", "", $src);
$this->src = $src;
return token_get_all($src);
}

/**
* loops through tokens and convert to js
*
*/
private function compileJs() {
foreach ($this->_tokens as $_) {
$this->next ($name, $value);
$this->parseToken($name, $value, $this->js);
}
}

/**
* output the js and die
*/
private function renderJs () {
echo "<script>$this->js</script>";
die();
}

/**
* changed referenced args to name and value of next token
*
* @param string $name
* @param string $value
* @param unknown_type $i, the amount of nexts to skip
*/
private function next(& $name, & $value, $i=1) {
for ($j=0; $j<$i; $j++) {
$this->current++;
if ($this->current > $this->count) $this->renderJs();
$_token = $this->_tokens[$this->current];
$this->getToken ($name, $value, $_token);
}
}

/**
* find and return first name matching argument
*
* @param mixed $_tokenNames
* @return string
*/
private function findFirst ($_needles) {
$name = $value = '';
for ($i=$this->current+1; $i<$this->count; $i++) {
$this->getToken($name, $value, $this->_tokens[$i]);
if (in_array($name, (array)$_needles)) {
return $name;
}
}
}

/**
* return javascript until match, match not included
*
* @param array $_needles
* @return string
*/
private function parseUntil ($_needles, $_schema=array(), $includeMatch = false) {
$name = $value = $js = $tmp = '';
while (true) {
$this->next ($name, $value);
$this->parseToken($name, $value, $tmp, $_schema);
if (in_array($name, (array)$_needles)) {
if ($includeMatch === true) {
return $tmp;
} else {
return $js;
}
}
$js = $tmp;
}
}

/**
* tries to find the token in $this->_convert, $this->_keep and $this->_keepValue
* if it fails it tries to find a method named as the token. If fails here also it throws away the token.
*
* @param string $name
* @param string $value
* @param string $js store js here by reference
*/
private function parseToken ($name, $value, & $js, $_schema=array()) {
//custom changes
if (in_array($name, array_keys ((array)$_schema))) {
$js .= $_schema[$name];
//change name to other value
} else if (in_array($name, array_keys ($this->_convert))) {
$js .= (!empty($this->_convert[$name])) ? $this->_convert[$name]: $name;
//keep key
} elseif (in_array($name, $this->_keep)) {
$js .= $name;
//keep value
} elseif (in_array($name, $this->_keepValue)) {
$js .= $value;
//call method
} else {
if (method_exists($this, $name)) {
$js .= $this->$name($value);
}
}
//ignore
}

/**
* converters
*
* These guys are equivalents to tokens.
*/

/**
* class definition
*
* @param sting $value
* @return string
*/
private function T_CLASS($value) {
$this->next ($name, $value, 2);
return "function $value() ";
}

/**
* define function
*
* @param string $value
* @return string
*/
private function T_FUNCTION($value) {
$this->next ($name, $value, 2);
return "this.$value = function";
}

/**
* echo is replaced with document.write
*
* @param string $value
* @return string
*/
private function T_ECHO($value) {
return 'document.write('.$this->parseUntil(';').');';
}

/**
* array. Supports both single and associative
*
* @param string $value
* @return string
*/
private function T_ARRAY($value) {
$_convert = array('('=>'{',     ')'=>'}',);
$js = $this->parseUntil(array(';'), $_convert, true);
if (strpos($js, ':') === false) {
$this->tmp = -1;
$js = preg_replace_callback ('/([{, \t\n])(\'.*\')(|.*:(.*))([,} \t\n])/Uis', array($this, 'cb_T_ARRAY'), $js);
}
return $js;
}

private function cb_T_ARRAY($_matches) {
$this->tmp++;
if (strpos($_matches[0], ':') === false) {
return ($_matches[1].$this->tmp.':'.$_matches[2].$_matches[3].$_matches[4].$_matches[5]);
} else {
return $_matches[0];
}
}
/**
* foreach. Gets converted to for (var blah in blih). Supports as $key=>$value
*
* @param string $value
* @return string
*/
private function T_FOREACH($value) {
$_vars = array();
while (true) {
$this->next ($name, $value);
if ($name == 'T_VARIABLE') $_vars[] = $this->cVar($value);
$this->parseToken($name, $value, $js);
if ($name == '{') {
if (count($_vars) == 2) {
$array = $_vars[0];
$val = $_vars[1];
$this->js .=
"for (var {$val}Val in $array) {".
"\n                        $val = $array"."[{$val}Val];";
}
if (count($_vars) == 3) {
$array = $_vars[0];
$key = $_vars[1];
$val = $_vars[2];
$this->js .=
"for (var $key in $array) {".
"\n                        $val = $array"."[$key];";
}
return '';
}
$jsTmp = $js;
}
}

/**
* declare a public class var
*
* @param string $value
* @return string
*/
private function T_PUBLIC ($value) {
$type = $this->findFirst(array('T_VARIABLE', 'T_FUNCTION'));
if ($type == 'T_FUNCTION') return '';
$js = '';
while (true) {
$this->next ($name, $value);
$this->parseToken($name, $value, $js);
if ($name == ';') {
$js = str_replace(array(' '), '', $js);
return 'this.'.$js;
} else if ($name == '=') {
$js = str_replace(array(' ','='), '', $js);
return 'this.'.$js.' =';
}
}
}

/**
* variable. Remove the $
*
* @param string $value
* @return string
*/
private function T_VARIABLE($value) {
return str_replace('$', '', $value);
}

/* helpers */

private function getToken(& $name, & $value, $_token) {
if (is_array($_token)) {
$name = trim(token_name($_token[0]));
$value = $_token[1];
} else {
$name = trim($_token);
$value = '';
}
}

private function cVar($var) {
return str_replace('$', '', $var);
}

/** debugging stuff. Ugly and deprecated. */

/** deprecated and sucks */
private $_openTags = array(
'T_OPEN_TAG', 'T_CLASS', 'T_PUBLIC', 'T_FOREACH', 'T_ARRAY', '{', 'T_VARIABLE', '('
);

/** deprecated and sucks */

/** deprecated and sucks */
private $indent = 0;
/** deprecated and sucks */
private $debug;


private $_closeTags = array(
'}', 'T_CLOSE_TAG', ';', ')',
);

public function __destruct() {
/**
$js = htmlentities ($this->js);
echo ("<pre>$js</pre>");
$this->write();
echo $this->debug;
//*/
}


private function write() {
$_tokens = token_get_all($this->src);
foreach ($_tokens as $key=>$_token) {
if (is_array($_token)) {
$name = trim(token_name($_token[0]));
$value = $_token[1];
} else {
$name = trim($_token);
$value = '';
}
$this->printToken($name, $value, $_token);
}
}

private function printToken ($name, $value, $_token) {
$value = htmlentities($value);

if (in_array($name, $this->_closeTags)) $this->indent--;
$indent = str_repeat('.&nbsp;&nbsp;&nbsp;&nbsp;', $this->indent);
if (in_array($name, $this->_openTags)) $this->indent++;
if (!empty($value))
$this->debug .= "
<br />$indent
<b>$name&nbsp;&nbsp;=&nbsp;&nbsp;'$value'</b>

";
else
$this->debug .= "
<br />$indent
<b>$name</b>

";
}
}
?>

Upload file php2js.php ke server. Kemudian buat file Baru dengan nama bebas, convert.php misalnya. Isikan convert.php dengan code PHP yang ingin anda convert (di bawah "/* Convert Code Start Here */"), kemudian upload ke web server. Misalnya seperti kode di bawah ini:



<?
require_once 'php2js.php';
new php2js(__FILE__);
/**
* My super cool php class that will be converted to js!!!
*/
/* Convert Code Start Here */
class HelloWorld {
/**
* So here goes a function that echos
*
* @param string $foo
* @param string $bar
*/
function foo($foo, $bar) {
echo $foo . ' ' . $bar;
}
}
$H = new HelloWorld;
$H->foo('Hello', 'World');
?>

Convert PHP To JavaScript

Buka file convert.php pada web browser, hasil yang keluar akan tampak seperti pada gambar Screenshot 1. Untuk melihat code JavaScript hasil convert, jika menggunakan browser Mozilla Firefox klik kanan pada halaman kosong web browser kemudian klik View Page Source (Screenshot 2), atau tekan tombol shortcut Ctrl + U. Pada jendela baru yang terbuka, anda akan melihat source code JavaScript hasil convert (Screenshot 3).



<script>
/**
* My super cool php class that will be converted to js!!!
*/
/* Convert Code Start Here */
function HelloWorld()  {
/**
* So here goes a function that echos
*
* @param string $foo
* @param string $bar
*/
this.foo = function(foo, bar) {
document.write( foo + ' ' + bar);
}
}
H = new HelloWorld;
H.foo('Hello', 'World');
</script>

convert_php_to_javascript1

Screenshot 1

convert_php_to_javascript2

Screenshot 2

convert_php_to_javascript3

Screenshot 3

Selesai. Semoga bermanfaat.
:)
24 April 2012

Disable Iptables Firewall CentOS

Ada kalanya Iptables Firewall pada sistem operasi UNIX perlu di non-aktifkan (disable) dengan beberapa alasan, salah satunya jika sistem operasi digunakan untuk keperluan testing & development. Pada artikel kali ini menyajikan cara disable Iptables Firewall pada CentOS, dengan tahapan sebagai berikut:
  1. Simpan setting Firewall sebelum disable Iptables dengan mengetikkan command:

    service iptables save



    [root@rhel6 ~]# service iptables save
    iptables: Saving firewall rules to /etc/sysconfig/iptables:[  OK  ]

    service ip6tables save



    [root@server5 ~]# service ip6tables save
    ip6tables: Saving firewall rules to /etc/sysconfig/ip6table[  OK  ]

  2. Stop Iptables. Command:

    service iptables stop



    [root@server5 ~]# service iptables stop
    iptables: Flushing firewall rules:                         [  OK  ]
    iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
    iptables: Unloading modules:                               [  OK  ]
    [root@server5 ~]#

    service ip6tables stop



    [root@server5 ~]# service ip6tables stop
    ip6tables: Flushing firewall rules:                        [  OK  ]
    ip6tables: Setting chains to policy ACCEPT: filter         [  OK  ]
    ip6tables: Unloading modules:                              [  OK  ]
    [root@server5 ~]#

  3. Disable Start Up Booting Iptables. Command:

    chkconfig iptables off



    [root@server5 ~]# chkconfig iptables off
    [root@server5 ~]#

    chkconfig ip6tables off



    [root@server5 ~]# chkconfig ip6tables off
    [root@server5 ~]#

Semoga bermanfaat
:)
23 April 2012

Install Webmin Pada CentOS 6.2

Webmin merupakan web interface yang digunakan oleh sistem administrator pada OS Unix. Webmin dapat diakses menggunakan hampir semua web browser yang ada saat ini, dengan syarat browser harus sudah support tabel, form dan Java (Java untuk module File Manager). Dengan menggunakan webmin, sistem administrator dapat setup user account, DNS, Apache, Database dan lain sebagainya.

Install webmin sangatlah mudah. Berikut panduan singkat install Webmin (OS menggunakan CentOS 6.2):

Install Package "perl-Net-SSLeay" menggunakan command:


yum -y install perl-Net-SSLeay



[root@server5 ~]# yum -y install perl-Net-SSLeay
Loaded plugins: fastestmirror
base                                                     | 3.7 kB     00:00
http://centos.biz.net.id/6.2/os/x86_64/repodata/ceb77f94eaccd4b2ec5546135bdd06692393e7deb6e8aaf86d6f479b84bec06b-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 18 - "transfer closed with 4683564 bytes remaining to read"
Trying other mirror.
base/primary_db                                          | 4.5 MB     00:19
extras                                                   | 3.5 kB     00:00
http://centos.biz.net.id/6.2/extras/x86_64/repodata/b1cda4f460b583687346e0a7ce7bed67049498506434134bdd172f7b59f2b271-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 403"
Trying other mirror.
extras/primary_db                                        | 6.3 kB     00:00
updates                                                  | 3.5 kB     00:00
updates/primary_db                                       | 2.9 MB     00:12
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package perl-Net-SSLeay.x86_64 0:1.35-9.el6 will be installed
--> Processing Dependency: perl >= 5.005_03 for package: perl-Net-SSLeay-1.35-9.el6.x86_64
--> Processing Dependency: perl(:MODULE_COMPAT_5.10.1) for package: perl-Net-SSLeay-1.35-9.el6.x86_64
--> Processing Dependency: perl(Errno) for package: perl-Net-SSLeay-1.35-9.el6.x86_64
--> Processing Dependency: perl(strict) for package: perl-Net-SSLeay-1.35-9.el6.x86_64
--> Processing Dependency: perl(AutoLoader) for package: perl-Net-SSLeay-1.35-9.el6.x86_64
--> Processing Dependency: perl(vars) for package: perl-Net-SSLeay-1.35-9.el6.x86_64
--> Processing Dependency: perl(Exporter) for package: perl-Net-SSLeay-1.35-9.el6.x86_64
--> Processing Dependency: perl(Socket) for package: perl-Net-SSLeay-1.35-9.el6.x86_64
--> Processing Dependency: perl(Carp) for package: perl-Net-SSLeay-1.35-9.el6.x86_64
--> Running transaction check
---> Package perl.x86_64 4:5.10.1-119.el6_1.1 will be installed
--> Processing Dependency: perl-libs = 4:5.10.1-119.el6_1.1 for package: 4:perl-5.10.1-119.el6_1.1.x86_64
--> Processing Dependency: perl-libs for package: 4:perl-5.10.1-119.el6_1.1.x86_64
--> Processing Dependency: perl(Pod::Simple) for package: 4:perl-5.10.1-119.el6_1.1.x86_64
--> Processing Dependency: perl(version) for package: 4:perl-5.10.1-119.el6_1.1.x86_64
--> Processing Dependency: perl(Module::Pluggable) for package: 4:perl-5.10.1-119.el6_1.1.x86_64
--> Processing Dependency: libperl.so()(64bit) for package: 4:perl-5.10.1-119.el6_1.1.x86_64
--> Running transaction check
---> Package perl-Module-Pluggable.x86_64 1:3.90-119.el6_1.1 will be installed
---> Package perl-Pod-Simple.x86_64 1:3.13-119.el6_1.1 will be installed
--> Processing Dependency: perl(Pod::Escapes) >= 1.04 for package: 1:perl-Pod-Simple-3.13-119.el6_1.1.x86_64
---> Package perl-libs.x86_64 4:5.10.1-119.el6_1.1 will be installed
---> Package perl-version.x86_64 3:0.77-119.el6_1.1 will be installed
--> Running transaction check
---> Package perl-Pod-Escapes.x86_64 1:1.04-119.el6_1.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                   Arch       Version                    Repository
                                                                           Size
================================================================================
Installing:
 perl-Net-SSLeay           x86_64     1.35-9.el6                 base     173 k
Installing for dependencies:
 perl                      x86_64     4:5.10.1-119.el6_1.1       base      10 M
 perl-Module-Pluggable     x86_64     1:3.90-119.el6_1.1         base      37 k
 perl-Pod-Escapes          x86_64     1:1.04-119.el6_1.1         base      30 k
 perl-Pod-Simple           x86_64     1:3.13-119.el6_1.1         base     209 k
 perl-libs                 x86_64     4:5.10.1-119.el6_1.1       base     575 k
 perl-version              x86_64     3:0.77-119.el6_1.1         base      49 k

Transaction Summary
================================================================================
Install       7 Package(s)

Total download size: 11 M
Installed size: 36 M
Downloading Packages:
(1/7): perl-5.10.1-119.el6_1.1.x86_64.rpm                |  10 MB     00:44
(2/7): perl-Module-Pluggable-3.90-119.el6_1.1.x86_64.rpm |  37 kB     00:00
(3/7): perl-Net-SSLeay-1.35-9.el6.x86_64.rpm             | 173 kB     00:00
(4/7): perl-Pod-Escapes-1.04-119.el6_1.1.x86_64.rpm      |  30 kB     00:00
(5/7): perl-Pod-Simple-3.13-119.el6_1.1.x86_64.rpm       | 209 kB     00:00
(6/7): perl-libs-5.10.1-119.el6_1.1.x86_64.rpm           | 575 kB     00:02
(7/7): perl-version-0.77-119.el6_1.1.x86_64.rpm          |  49 kB     00:00
--------------------------------------------------------------------------------
Total                                           232 kB/s |  11 MB     00:49
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
 Userid : CentOS-6 Key (CentOS 6 Official Signing Key) 
 Package: centos-release-6-2.el6.centos.7.x86_64 (@anaconda-CentOS-201112091719.x86_64/6.2)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 1:perl-Pod-Escapes-1.04-119.el6_1.1.x86_64                   1/7
  Installing : 1:perl-Module-Pluggable-3.90-119.el6_1.1.x86_64              2/7
  Installing : 4:perl-libs-5.10.1-119.el6_1.1.x86_64                        3/7
  Installing : 1:perl-Pod-Simple-3.13-119.el6_1.1.x86_64                    4/7
  Installing : 3:perl-version-0.77-119.el6_1.1.x86_64                       5/7
  Installing : 4:perl-5.10.1-119.el6_1.1.x86_64                             6/7
  Installing : perl-Net-SSLeay-1.35-9.el6.x86_64                            7/7

Installed:
  perl-Net-SSLeay.x86_64 0:1.35-9.el6

Dependency Installed:
  perl.x86_64 4:5.10.1-119.el6_1.1
  perl-Module-Pluggable.x86_64 1:3.90-119.el6_1.1
  perl-Pod-Escapes.x86_64 1:1.04-119.el6_1.1
  perl-Pod-Simple.x86_64 1:3.13-119.el6_1.1
  perl-libs.x86_64 4:5.10.1-119.el6_1.1
  perl-version.x86_64 3:0.77-119.el6_1.1

Complete!
[root@server5 ~]#

Download & Install Webmin Distribution Package



[root@server5 ~]# cd /usr/src
[root@server5 src]# wget http://prdownloads.sourceforge.net/webadmin/webmin-1.580-1.noarch.rpm
--2012-04-21 21:06:20--  http://prdownloads.sourceforge.net/webadmin/webmin-1.580-1.noarch.rpm
Resolving prdownloads.sourceforge.net... 216.34.181.59
Connecting to prdownloads.sourceforge.net|216.34.181.59|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://downloads.sourceforge.net/project/webadmin/webmin/1.580/webmin-1.580-1.noarch.rpm [following]
--2012-04-21 21:06:20--  http://downloads.sourceforge.net/project/webadmin/webmin/1.580/webmin-1.580-1.noarch.rpm
Resolving downloads.sourceforge.net... 216.34.181.59
Reusing existing connection to prdownloads.sourceforge.net:80.
HTTP request sent, awaiting response... 302 Found
Location: http://nchc.dl.sourceforge.net/project/webadmin/webmin/1.580/webmin-1.580-1.noarch.rpm [following]
--2012-04-21 21:06:21--  http://nchc.dl.sourceforge.net/project/webadmin/webmin/1.580/webmin-1.580-1.noarch.rpm
Resolving nchc.dl.sourceforge.net... 211.79.60.17, 2001:e10:ffff:1f02::17
Connecting to nchc.dl.sourceforge.net|211.79.60.17|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 17112780 (16M) [application/octet-stream]
Saving to: âwebmin-1.580-1.noarch.rpmâ

100%[============================================================================>] 17,112,780   235K/s   in 74s

2012-04-21 21:07:36 (225 KB/s) - âwebmin-1.580-1.noarch.rpmâ

[root@server5 src]# rpm -i webmin-1.580-1.noarch.rpm
warning: webmin-1.580-1.noarch.rpm: Header V3 DSA/SHA1 Signature, key ID 11f63c51: NOKEY
Operating system is CentOS Linux
Webmin install complete. You can now login to https://server5:10000/
as root with your root password.
[root@server5 src]#

Jika CentOS 6.2 anda sebelumnya diinstall dengan minimal installation, terlebih dahulu sebelum webmin dapat diakses pada web browser, apache webserver harus terinstall dan aktif. Install Group Apache & MySQL databases dengan menggunakan command berikut:

yum -y groupinstall "Web Server" "MySQL Database"



[root@server5 src]# yum -y groupinstall "Web Server" "MySQL Database"
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.biz.net.id
 * extras: centos.biz.net.id
 * updates: mirror.averse.net
Setting up Group Process
Checking for new repos for mirrors
http://centos.biz.net.id/6.2/os/x86_64/repodata/badeded316fc87571779d92c5cde816fdc357646b84cb191c4611e05c981ffa1-c6-x86_64-comps.xml.gz: [Errno 14] PYCURL ERROR 18 - "transfer closed with 203863 bytes remaining to read"
Trying other mirror.
base/group_gz                                            | 199 kB     00:00
Warning: Group MySQL Database does not exist.
Resolving Dependencies
--> Running transaction check
---> Package crypto-utils.x86_64 0:2.4.1-24.2.el6 will be installed
--> Processing Dependency: perl(Newt) for package: crypto-utils-2.4.1-24.2.el6.x86_64
---> Package httpd.x86_64 0:2.2.15-15.el6.centos.1 will be installed
--> Processing Dependency: httpd-tools = 2.2.15-15.el6.centos.1 for package: httpd-2.2.15-15.el6.centos.1.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.2.15-15.el6.centos.1.x86_64
--> Processing Dependency: apr-util-ldap for package: httpd-2.2.15-15.el6.centos.1.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.2.15-15.el6.centos.1.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.2.15-15.el6.centos.1.x86_64
---> Package httpd-manual.noarch 0:2.2.15-15.el6.centos.1 will be installed
---> Package mod_perl.x86_64 0:2.0.4-10.el6 will be installed
--> Processing Dependency: perl(ExtUtils::MakeMaker) for package: mod_perl-2.0.4-10.el6.x86_64
--> Processing Dependency: perl(BSD::Resource) for package: mod_perl-2.0.4-10.el6.x86_64
---> Package mod_ssl.x86_64 1:2.2.15-15.el6.centos.1 will be installed
---> Package mod_wsgi.x86_64 0:3.2-1.el6 will be installed
---> Package webalizer.x86_64 0:2.21_02-3.3.el6 will be installed
--> Processing Dependency: libgd.so.2()(64bit) for package: webalizer-2.21_02-3.3.el6.x86_64
--> Processing Dependency: libpng12.so.0()(64bit) for package: webalizer-2.21_02-3.3.el6.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.3.9-3.el6_1.2 will be installed
---> Package apr-util.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package gd.x86_64 0:2.0.35-10.el6 will be installed
--> Processing Dependency: libXpm.so.4()(64bit) for package: gd-2.0.35-10.el6.x86_64
--> Processing Dependency: libX11.so.6()(64bit) for package: gd-2.0.35-10.el6.x86_64
--> Processing Dependency: libfontconfig.so.1()(64bit) for package: gd-2.0.35-10.el6.x86_64
--> Processing Dependency: libfreetype.so.6()(64bit) for package: gd-2.0.35-10.el6.x86_64
--> Processing Dependency: libjpeg.so.62()(64bit) for package: gd-2.0.35-10.el6.x86_64
---> Package httpd-tools.x86_64 0:2.2.15-15.el6.centos.1 will be installed
---> Package libpng.x86_64 2:1.2.48-1.el6_2 will be installed
---> Package mailcap.noarch 0:2.1.31-2.el6 will be installed
---> Package perl-BSD-Resource.x86_64 0:1.29.03-3.el6 will be installed
---> Package perl-ExtUtils-MakeMaker.x86_64 0:6.55-119.el6_1.1 will be installed
--> Processing Dependency: perl(Test::Harness) for package: perl-ExtUtils-MakeMaker-6.55-119.el6_1.1.x86_64
--> Processing Dependency: perl-devel for package: perl-ExtUtils-MakeMaker-6.55-119.el6_1.1.x86_64
---> Package perl-Newt.x86_64 0:1.08-26.el6 will be installed
--> Running transaction check
---> Package fontconfig.x86_64 0:2.8.0-3.el6 will be installed
---> Package freetype.x86_64 0:2.3.11-6.el6_2.9 will be installed
---> Package libX11.x86_64 0:1.3-2.el6 will be installed
--> Processing Dependency: libX11-common = 1.3-2.el6 for package: libX11-1.3-2.el6.x86_64
--> Processing Dependency: libxcb.so.1()(64bit) for package: libX11-1.3-2.el6.x86_64
---> Package libXpm.x86_64 0:3.5.8-2.el6 will be installed
---> Package libjpeg.x86_64 0:6b-46.el6 will be installed
---> Package perl-Test-Harness.x86_64 0:3.17-119.el6_1.1 will be installed
---> Package perl-devel.x86_64 4:5.10.1-119.el6_1.1 will be installed
--> Processing Dependency: perl(ExtUtils::ParseXS) for package: 4:perl-devel-5.10.1-119.el6_1.1.x86_64
--> Running transaction check
---> Package libX11-common.noarch 0:1.3-2.el6 will be installed
---> Package libxcb.x86_64 0:1.5-1.el6 will be installed
--> Processing Dependency: libXau.so.6()(64bit) for package: libxcb-1.5-1.el6.x86_64
---> Package perl-ExtUtils-ParseXS.x86_64 1:2.2003.0-119.el6_1.1 will be installed
--> Running transaction check
---> Package libXau.x86_64 0:1.0.5-1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                   Arch     Version                     Repository
                                                                           Size
================================================================================
Installing:
 crypto-utils              x86_64   2.4.1-24.2.el6              base       76 k
 httpd                     x86_64   2.2.15-15.el6.centos.1      updates   813 k
 httpd-manual              noarch   2.2.15-15.el6.centos.1      updates   781 k
 mod_perl                  x86_64   2.0.4-10.el6                base      3.2 M
 mod_ssl                   x86_64   1:2.2.15-15.el6.centos.1    updates    87 k
 mod_wsgi                  x86_64   3.2-1.el6                   base       66 k
 webalizer                 x86_64   2.21_02-3.3.el6             base      128 k
Installing for dependencies:
 apr                       x86_64   1.3.9-3.el6_1.2             base      123 k
 apr-util                  x86_64   1.3.9-3.el6_0.1             base       87 k
 apr-util-ldap             x86_64   1.3.9-3.el6_0.1             base       15 k
 fontconfig                x86_64   2.8.0-3.el6                 base      186 k
 freetype                  x86_64   2.3.11-6.el6_2.9            updates   359 k
 gd                        x86_64   2.0.35-10.el6               base      142 k
 httpd-tools               x86_64   2.2.15-15.el6.centos.1      updates    70 k
 libX11                    x86_64   1.3-2.el6                   base      582 k
 libX11-common             noarch   1.3-2.el6                   base      188 k
 libXau                    x86_64   1.0.5-1.el6                 base       22 k
 libXpm                    x86_64   3.5.8-2.el6                 base       59 k
 libjpeg                   x86_64   6b-46.el6                   base      134 k
 libpng                    x86_64   2:1.2.48-1.el6_2            updates   181 k
 libxcb                    x86_64   1.5-1.el6                   base      100 k
 mailcap                   noarch   2.1.31-2.el6                base       27 k
 perl-BSD-Resource         x86_64   1.29.03-3.el6               base       35 k
 perl-ExtUtils-MakeMaker   x86_64   6.55-119.el6_1.1            base      290 k
 perl-ExtUtils-ParseXS     x86_64   1:2.2003.0-119.el6_1.1      base       42 k
 perl-Newt                 x86_64   1.08-26.el6                 base       72 k
 perl-Test-Harness         x86_64   3.17-119.el6_1.1            base      229 k
 perl-devel                x86_64   4:5.10.1-119.el6_1.1        base      420 k

Transaction Summary
================================================================================
Install      28 Package(s)

Total download size: 8.3 M
Installed size: 24 M
Downloading Packages:
(1/28): apr-1.3.9-3.el6_1.2.x86_64.rpm                   | 123 kB     00:00
(2/28): apr-util-1.3.9-3.el6_0.1.x86_64.rpm              |  87 kB     00:00
(3/28): apr-util-ldap-1.3.9-3.el6_0.1.x86_64.rpm         |  15 kB     00:00
(4/28): crypto-utils-2.4.1-24.2.el6.x86_64.rpm           |  76 kB     00:00
(5/28): fontconfig-2.8.0-3.el6.x86_64.rpm                | 186 kB     00:00
(6/28): freetype-2.3.11-6.el6_2.9.x86_64.rpm             | 359 kB     00:01
(7/28): gd-2.0.35-10.el6.x86_64.rpm                      | 142 kB     00:00
(8/28): httpd-2.2.15-15.el6.centos.1.x86_64.rpm          | 813 kB     00:03
(9/28): httpd-manual-2.2.15-15.el6.centos.1.noarch.rpm   | 781 kB     00:03
(10/28): httpd-tools-2.2.15-15.el6.centos.1.x86_64.rpm   |  70 kB     00:00
(11/28): libX11-1.3-2.el6.x86_64.rpm                     | 582 kB     00:02
(12/28): libX11-common-1.3-2.el6.noarch.rpm              | 188 kB     00:00
(13/28): libXau-1.0.5-1.el6.x86_64.rpm                   |  22 kB     00:00
(14/28): libXpm-3.5.8-2.el6.x86_64.rpm                   |  59 kB     00:00
(15/28): libjpeg-6b-46.el6.x86_64.rpm                    | 134 kB     00:00
(16/28): libpng-1.2.48-1.el6_2.x86_64.rpm                | 181 kB     00:00
(17/28): libxcb-1.5-1.el6.x86_64.rpm                     | 100 kB     00:00
(18/28): mailcap-2.1.31-2.el6.noarch.rpm                 |  27 kB     00:00
(19/28): mod_perl-2.0.4-10.el6.x86_64.rpm                | 3.2 MB     00:13
(20/28): mod_ssl-2.2.15-15.el6.centos.1.x86_64.rpm       |  87 kB     00:00
(21/28): mod_wsgi-3.2-1.el6.x86_64.rpm                   |  66 kB     00:00
(22/28): perl-BSD-Resource-1.29.03-3.el6.x86_64.rpm      |  35 kB     00:00
(23/28): perl-ExtUtils-MakeMaker-6.55-119.el6_1.1.x86_64 | 290 kB     00:01
(24/28): perl-ExtUtils-ParseXS-2.2003.0-119.el6_1.1.x86_ |  42 kB     00:00
(25/28): perl-Newt-1.08-26.el6.x86_64.rpm                |  72 kB     00:00
(26/28): perl-Test-Harness-3.17-119.el6_1.1.x86_64.rpm   | 229 kB     00:01
(27/28): perl-devel-5.10.1-119.el6_1.1.x86_64.rpm        | 420 kB     00:01
(28/28): webalizer-2.21_02-3.3.el6.x86_64.rpm            | 128 kB     00:00
--------------------------------------------------------------------------------
Total                                           217 kB/s | 8.3 MB     00:39
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : apr-1.3.9-3.el6_1.2.x86_64                                  1/28
  Installing : apr-util-1.3.9-3.el6_0.1.x86_64                             2/28
  Installing : 2:libpng-1.2.48-1.el6_2.x86_64                              3/28
  Installing : freetype-2.3.11-6.el6_2.9.x86_64                            4/28
  Installing : fontconfig-2.8.0-3.el6.x86_64                               5/28
  Installing : apr-util-ldap-1.3.9-3.el6_0.1.x86_64                        6/28
  Installing : httpd-tools-2.2.15-15.el6.centos.1.x86_64                   7/28
  Installing : 1:perl-ExtUtils-ParseXS-2.2003.0-119.el6_1.1.x86_64         8/28
  Installing : 4:perl-devel-5.10.1-119.el6_1.1.x86_64                      9/28
  Installing : perl-Test-Harness-3.17-119.el6_1.1.x86_64                  10/28
  Installing : perl-ExtUtils-MakeMaker-6.55-119.el6_1.1.x86_64            11/28
  Installing : libXau-1.0.5-1.el6.x86_64                                  12/28
  Installing : libxcb-1.5-1.el6.x86_64                                    13/28
  Installing : libjpeg-6b-46.el6.x86_64                                   14/28
  Installing : mailcap-2.1.31-2.el6.noarch                                15/28
  Installing : httpd-2.2.15-15.el6.centos.1.x86_64                        16/28
  Installing : perl-Newt-1.08-26.el6.x86_64                               17/28
  Installing : perl-BSD-Resource-1.29.03-3.el6.x86_64                     18/28
  Installing : libX11-common-1.3-2.el6.noarch                             19/28
  Installing : libX11-1.3-2.el6.x86_64                                    20/28
  Installing : libXpm-3.5.8-2.el6.x86_64                                  21/28
  Installing : gd-2.0.35-10.el6.x86_64                                    22/28
  Installing : webalizer-2.21_02-3.3.el6.x86_64                           23/28
  Installing : mod_perl-2.0.4-10.el6.x86_64                               24/28
  Installing : crypto-utils-2.4.1-24.2.el6.x86_64                         25/28
  Installing : httpd-manual-2.2.15-15.el6.centos.1.noarch                 26/28
  Installing : mod_wsgi-3.2-1.el6.x86_64                                  27/28
  Installing : 1:mod_ssl-2.2.15-15.el6.centos.1.x86_64                    28/28

Installed:
  crypto-utils.x86_64 0:2.4.1-24.2.el6
  httpd.x86_64 0:2.2.15-15.el6.centos.1
  httpd-manual.noarch 0:2.2.15-15.el6.centos.1
  mod_perl.x86_64 0:2.0.4-10.el6
  mod_ssl.x86_64 1:2.2.15-15.el6.centos.1
  mod_wsgi.x86_64 0:3.2-1.el6
  webalizer.x86_64 0:2.21_02-3.3.el6

Dependency Installed:
  apr.x86_64 0:1.3.9-3.el6_1.2
  apr-util.x86_64 0:1.3.9-3.el6_0.1
  apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1
  fontconfig.x86_64 0:2.8.0-3.el6
  freetype.x86_64 0:2.3.11-6.el6_2.9
  gd.x86_64 0:2.0.35-10.el6
  httpd-tools.x86_64 0:2.2.15-15.el6.centos.1
  libX11.x86_64 0:1.3-2.el6
  libX11-common.noarch 0:1.3-2.el6
  libXau.x86_64 0:1.0.5-1.el6
  libXpm.x86_64 0:3.5.8-2.el6
  libjpeg.x86_64 0:6b-46.el6
  libpng.x86_64 2:1.2.48-1.el6_2
  libxcb.x86_64 0:1.5-1.el6
  mailcap.noarch 0:2.1.31-2.el6
  perl-BSD-Resource.x86_64 0:1.29.03-3.el6
  perl-ExtUtils-MakeMaker.x86_64 0:6.55-119.el6_1.1
  perl-ExtUtils-ParseXS.x86_64 1:2.2003.0-119.el6_1.1
  perl-Newt.x86_64 0:1.08-26.el6
  perl-Test-Harness.x86_64 0:3.17-119.el6_1.1
  perl-devel.x86_64 4:5.10.1-119.el6_1.1

Complete!
[root@server5 src]#

Login ke webmin pada alamat URL https://[Alamat IP]:10000/ menggunakan detail login user & password root. Jika web browser menampilkan pesan peringatan This Connection is Untrusted, klik tombol Add Exception..., kemudian centang checkbox Permanently store this exception klik tombol Confirm Security Exception.

Install Webmin

Install Webmin: Untrusted Connection

Install Webmin 2

Install Webmin: Confirm Security Exception

Install Webmin 3

Install Webmin: Login Webmin Server


Install Webmin 4

Install Webmin: Webmin Web Interface


Uninstall Webmin

Untuk uninstall webmin, ketikkan command;

/etc/webmin/uninstall.sh.



[root@server5 ~]# /etc/webmin/uninstall.sh
Are you sure you want to uninstall Webmin? (y/n) : y

Removing webmin RPM ..
Running uninstall scripts ..
Deleted init script /etc/rc.d/init.d/webmin
Subroutine list_servers redefined at /usr/libexec/webmin/servers/servers-lib.pl line 91.
Subroutine list_servers_sorted redefined at /usr/libexec/webmin/servers/servers-lib.pl line 110.
Subroutine get_server redefined at /usr/libexec/webmin/servers/servers-lib.pl line 142.
Subroutine save_server redefined at /usr/libexec/webmin/servers/servers-lib.pl line 157.
Subroutine delete_server redefined at /usr/libexec/webmin/servers/servers-lib.pl line 174.
Subroutine can_use_server redefined at /usr/libexec/webmin/servers/servers-lib.pl line 187.
Subroutine list_all_groups redefined at /usr/libexec/webmin/servers/servers-lib.pl line 207.
Subroutine logged_in redefined at /usr/libexec/webmin/servers/servers-lib.pl line 275.
Subroutine get_server_types redefined at /usr/libexec/webmin/servers/servers-lib.pl line 300.
Subroutine this_server redefined at /usr/libexec/webmin/servers/servers-lib.pl line 310.
Subroutine get_my_address redefined at /usr/libexec/webmin/servers/servers-lib.pl line 329.
Subroutine address_to_broadcast redefined at /usr/libexec/webmin/servers/servers-lib.pl line 358.
Subroutine test_server redefined at /usr/libexec/webmin/servers/servers-lib.pl line 372.
Subroutine find_cron_job redefined at /usr/libexec/webmin/servers/servers-lib.pl line 391.
Subroutine find_servers redefined at /usr/libexec/webmin/servers/servers-lib.pl line 404.
Done!
[root@server5 ~]#

Selesai. Semoga bermanfaat.
:)
19 April 2012

Membuat File Menggunakan Command "touch" Pada OS Berbasis Linux

Command "touch" pada OS berbasis linux adalah merupakan cara termudah untuk membuat file serta update detail tanggal dan waktu (timestamps) file/folder dimodifikasi.

Syntax command touch adalah:

touch [option] nama_file

[bash]
[linggih@localhost ~]$ touch testingfile
[linggih@localhost ~]$ ls -l
total 0
-rw-rw-r-- 1 linggih linggih 0 Apr 19 22:23 testingfile
[linggih@localhost ~]$
[/bash]

Contoh di atas tanpa menggunakan opsi (option), touch akan membuat file dengan nama sesuai argumen/input data (testingfile) jika file sesuai input data (testingfile) tidak ada pada direktori file dibuat. Command touch juga dapat digunakan untuk membuat file lebih dari satu, contoh: command berikut ini akan membuat tiga file dengan nama testingfile1, testingfile2 dan testingfile3:

Command:

touch testingfile1 testingfile2 testingfile3

[bash]
[linggih@localhost ~]$ touch testingfile1 testingfile2 testingfile3
[linggih@localhost ~]$ ls -l
total 0
-rw-rw-r-- 1 linggih linggih 0 Apr 19 22:23 testingfile
-rw-rw-r-- 1 linggih linggih 0 Apr 19 22:29 testingfile1
-rw-rw-r-- 1 linggih linggih 0 Apr 19 22:29 testingfile2
-rw-rw-r-- 1 linggih linggih 0 Apr 19 22:29 testingfile3
[linggih@localhost ~]$
[/bash]

Modifikasi tanggal dan waktu (timestamps) menggunakan command touch

Command touch dapat digunakan untuk update tanggal dan waktu mundur (masa lampau) atau maju (masa depan). Contoh:


  1. Modifikasi tanggal dan waktu ke masa lalu:

    [bash]
    [linggih@localhost ~]$ touch -t 0705151700 testingfile1
    [linggih@localhost ~]$ ls -l --full-time testingfile1
    -rw-rw-r-- 1 linggih linggih 0 2007-05-15 17:00:00.000000000 +0700 testingfile1
    [linggih@localhost ~]$ ls -l
    total 0
    -rw-rw-r-- 1 linggih linggih 0 Apr 19 22:23 testingfile
    -rw-rw-r-- 1 linggih linggih 0 May 15 2007 testingfile1
    -rw-rw-r-- 1 linggih linggih 0 Apr 19 22:29 testingfile2
    -rw-rw-r-- 1 linggih linggih 0 Apr 19 22:29 testingfile3
    [linggih@localhost ~]$
    [/bash]

    Opsi (option) --full-time → timestamp testingfile1 15 Mei 2007 jam 5 sore (17:00:00).


  2. Modifikasi tanggal dan waktu ke masa depan:

    [bash]
    [linggih@localhost ~]$ touch -t 1509171900 testingfile2
    [linggih@localhost ~]$ ls -l --full-time testingfile2
    -rw-rw-r-- 1 linggih linggih 0 2015-09-17 19:00:00.000000000 +0700 testingfile2
    [linggih@localhost ~]$ ls -l
    total 0
    -rw-rw-r-- 1 linggih linggih 0 Apr 19 22:23 testingfile
    -rw-rw-r-- 1 linggih linggih 0 May 15 2007 testingfile1
    -rw-rw-r-- 1 linggih linggih 0 Sep 17 2015 testingfile2
    -rw-rw-r-- 1 linggih linggih 0 Apr 19 22:29 testingfile3
    [linggih@localhost ~]$
    [/bash]

    Opsi (option) --full-time → timestamp testingfile2 17 September 2015 jam 7 malam (19:00:00).



Selesai. Semoga bermanfaat...
:D
14 Maret 2012

Install Clean Backups plug-in cPanel/WHM

Script default backup cPanel tidak punya fitur otomatis menghapus file backup user/account yang sudah tidak lagi host pada server. File-file backup user/account yang tidak aktif ini akan terus tersimpan pada hard disk server sampai file terkait dihapus dengan cara manual oleh root user/administrator server (Dedicated Server maupun Virtual Private Server/VPS).

Namun sekarang ada plugin gratis cPanel/WHM "Clean Backups" yang memberi kemudahan kepada administrator server untuk menghapus file-file backup user/account yang sudah tidak aktif lagi secara otomatis. Dengan menggunakan plugin ini, administrator dapat setting/menentukan berapa lama jangka waktu penyimpanan file backup untuk user/account yang sudah tidak aktif lagi dan kapan file-file backup tersebut akan dihapus dari server.

Berikut cara simpel install plugin cPanel/WHM "Clean Backups". Buka putty atau program sejenis lainnya & login sebagai root user.

[bash collapse="false"]
root@server5 [~]# cd /home
root@server5 [/home]#
[/bash]

[bash collapse="false"]
root@server5 [/home]# rm -f latest-cleanbackups
root@server5 [/home]#
[/bash]

[bash collapse="false"]
root@server5 [/home]# wget http://www.ndchost.com/cpanel-whm/plugins/cleanbackups/download.php
--2012-05-28 01:22:49-- http://www.ndchost.com/cpanel-whm/plugins/cleanbackups/download.php
Resolving www.ndchost.com... 204.10.36.37
Connecting to www.ndchost.com|204.10.36.37|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.ndchost.com/cleanbackups/latest-cleanbackups [following]
--2012-05-28 01:22:50-- http://download.ndchost.com/cleanbackups/latest-cleanbackups
Resolving download.ndchost.com... 204.10.39.137
Connecting to download.ndchost.com|204.10.39.137|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 183982 (180K) [text/plain]
Saving to: âlatest-cleanbackupsâ

100%[======================================>] 183,982 77.5K/s in 2.3s

2012-05-28 01:22:53 (77.5 KB/s) - âlatest-cleanbackupsâ

root@server5 [/home]#
[/bash]

[bash]
root@server5 [/home]# sh latest-cleanbackups
Creating directory installd-cleanbackups
Verifying archive integrity... All good.
Uncompressing cPanel/WHM Clean Backups Plug-in by NDCHost.com.......................................................................................................................................................
/bin/mkdir: created directory `/var/cpanel/cleanbackups'
/bin/mkdir: created directory `/var/cpanel/cleanbackups/scripts'
/bin/mkdir: created directory `/usr/local/cpanel/whostmgr/docroot/cleanbackups'
`scripts/addcpbackuphook' -> `/var/cpanel/cleanbackups/scripts/addcpbackuphook'
`scripts/cleanbackupsnow' -> `/var/cpanel/cleanbackups/scripts/cleanbackupsnow'
`scripts/clearsmartycache' -> `/var/cpanel/cleanbackups/scripts/clearsmartycache'
`scripts/ensureconfig' -> `/var/cpanel/cleanbackups/scripts/ensureconfig'
`scripts/ensurephpjson' -> `/var/cpanel/cleanbackups/scripts/ensurephpjson'
`scripts/relinkphp' -> `/var/cpanel/cleanbackups/scripts/relinkphp'
`scripts/upgrade' -> `/var/cpanel/cleanbackups/scripts/upgrade'
`scripts/whmioncube' -> `/var/cpanel/cleanbackups/scripts/whmioncube'
`web/addon_cleanbackups.cgi' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/addon_cleanbackups.cgi'
`web/ajax_backuplist.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/ajax_backuplist.php'
`web/cleanbackups.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/cleanbackups.php'
`web/images' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/images'
`web/images/loading2.gif' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/images/loading2.gif'
`web/images/bottom-shadow.png' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/images/bottom-shadow.png'
`web/images/top-highlight.png' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/images/top-highlight.png'
`web/images/loading.gif' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/images/loading.gif'
`web/images/gradient-black-down.png' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/images/gradient-black-down.png'
`web/index.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/index.php'
`web/jquery-1.4.2.min.js' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/jquery-1.4.2.min.js'
`web/removebackups.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/removebackups.php'
`web/settings.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/settings.php'
`web/sidebar.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/sidebar.php'
`web/smarty' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty'
`web/smarty/version' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/version'
`web/smarty/Smarty.class.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/Smarty.class.php'
`web/smarty/debug.tpl' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/debug.tpl'
`web/smarty/sysplugins' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins'
`web/smarty/sysplugins/smarty_internal_compile_private_registered_function.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_private_registered_function.php'
`web/smarty/sysplugins/smarty_internal_compile_private_function_plugin.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_private_function_plugin.php'
`web/smarty/sysplugins/smarty_internal_compile_private_print_expression.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_private_print_expression.php'
`web/smarty/sysplugins/smarty_internal_filter_handler.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_filter_handler.php'
`web/smarty/sysplugins/smarty_internal_compile_foreach.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_foreach.php'
`web/smarty/sysplugins/smarty_internal_resource_file.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_resource_file.php'
`web/smarty/sysplugins/smarty_internal_compile_while.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_while.php'
`web/smarty/sysplugins/smarty_internal_cache.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_cache.php'
`web/smarty/sysplugins/smarty_internal_config.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_config.php'
`web/smarty/sysplugins/smarty_internal_compile_private_object_function.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_private_object_function.php'
`web/smarty/sysplugins/smarty_internal_resource_php.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_resource_php.php'
`web/smarty/sysplugins/smarty_internal_compile_nocache.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_nocache.php'
`web/smarty/sysplugins/smarty_internal_config_file_compiler.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_config_file_compiler.php'
`web/smarty/sysplugins/smarty_internal_compile_private_special_variable.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_private_special_variable.php'
`web/smarty/sysplugins/smarty_internal_function_call_handler.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_function_call_handler.php'
`web/smarty/sysplugins/smarty_internal_compile_extends.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_extends.php'
`web/smarty/sysplugins/smarty_internal_compile_private_modifier.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_private_modifier.php'
`web/smarty/sysplugins/smarty_internal_unregister.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_unregister.php'
`web/smarty/sysplugins/smarty_internal_resource_string.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_resource_string.php'
`web/smarty/sysplugins/smarty_internal_compile_function.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_function.php'
`web/smarty/sysplugins/smarty_internal_compile_append.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_append.php'
`web/smarty/sysplugins/smarty_internal_templatecompilerbase.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_templatecompilerbase.php'
`web/smarty/sysplugins/smarty_internal_compile_for.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_for.php'
`web/smarty/sysplugins/smarty_internal_compile_ldelim.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_ldelim.php'
`web/smarty/sysplugins/smarty_internal_compile_include.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_include.php'
`web/smarty/sysplugins/smarty_internal_wrapper.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_wrapper.php'
`web/smarty/sysplugins/smarty_internal_compile_capture.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_capture.php'
`web/smarty/sysplugins/smarty_internal_resource_registered.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_resource_registered.php'
`web/smarty/sysplugins/smarty_internal_compile_rdelim.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_rdelim.php'
`web/smarty/sysplugins/smarty_internal_parsetree.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_parsetree.php'
`web/smarty/sysplugins/smarty_internal_resource_extends.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_resource_extends.php'
`web/smarty/sysplugins/smarty_internal_compile_private_object_block_function.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_private_object_block_function.php'
`web/smarty/sysplugins/smarty_internal_write_file.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_write_file.php'
`web/smarty/sysplugins/smarty_internal_compile_if.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_if.php'
`web/smarty/sysplugins/smarty_internal_compile_private_block_plugin.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_private_block_plugin.php'
`web/smarty/sysplugins/smarty_internal_cacheresource_file.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_cacheresource_file.php'
`web/smarty/sysplugins/smarty_internal_compile_assign.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_assign.php'
`web/smarty/sysplugins/smarty_internal_templateparser.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_templateparser.php'
`web/smarty/sysplugins/smarty_internal_compile_section.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_section.php'
`web/smarty/sysplugins/smarty_internal_compile_config_load.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_config_load.php'
`web/smarty/sysplugins/smarty_internal_compile_call.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_call.php'
`web/smarty/sysplugins/smarty_internal_configfilelexer.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_configfilelexer.php'
`web/smarty/sysplugins/smarty_internal_compile_private_registered_block.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_private_registered_block.php'
`web/smarty/sysplugins/smarty_internal_compilebase.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compilebase.php'
`web/smarty/sysplugins/smarty_internal_compile_debug.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_debug.php'
`web/smarty/sysplugins/smarty_internal_utility.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_utility.php'
`web/smarty/sysplugins/smarty_internal_register.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_register.php'
`web/smarty/sysplugins/smarty_internal_security_handler.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_security_handler.php'
`web/smarty/sysplugins/smarty_internal_configfileparser.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_configfileparser.php'
`web/smarty/sysplugins/smarty_internal_debug.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_debug.php'
`web/smarty/sysplugins/smarty_internal_templatelexer.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_templatelexer.php'
`web/smarty/sysplugins/smarty_internal_compile_eval.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_eval.php'
`web/smarty/sysplugins/smarty_internal_data.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_data.php'
`web/smarty/sysplugins/smarty_internal_resource_stream.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_resource_stream.php'
`web/smarty/sysplugins/smarty_security.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_security.php'
`web/smarty/sysplugins/smarty_internal_compile_insert.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_insert.php'
`web/smarty/sysplugins/smarty_internal_compile_block.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_block.php'
`web/smarty/sysplugins/smarty_internal_compile_include_php.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_compile_include_php.php'
`web/smarty/sysplugins/smarty_internal_template.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_template.php'
`web/smarty/sysplugins/smarty_internal_smartytemplatecompiler.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/sysplugins/smarty_internal_smartytemplatecompiler.php'
`web/smarty/plugins' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins'
`web/smarty/plugins/function.html_select_time.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/function.html_select_time.php'
`web/smarty/plugins/modifier.count_characters.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/modifier.count_characters.php'
`web/smarty/plugins/modifier.escape.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/modifier.escape.php'
`web/smarty/plugins/modifier.cat.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/modifier.cat.php'
`web/smarty/plugins/function.popup_init.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/function.popup_init.php'
`web/smarty/plugins/modifier.capitalize.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/modifier.capitalize.php'
`web/smarty/plugins/modifier.wordwrap.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/modifier.wordwrap.php'
`web/smarty/plugins/modifier.indent.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/modifier.indent.php'
`web/smarty/plugins/modifier.spacify.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/modifier.spacify.php'
`web/smarty/plugins/modifier.debug_print_var.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/modifier.debug_print_var.php'
`web/smarty/plugins/modifier.count_words.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/modifier.count_words.php'
`web/smarty/plugins/function.counter.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/function.counter.php'
`web/smarty/plugins/function.mailto.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/function.mailto.php'
`web/smarty/plugins/modifier.truncate.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/modifier.truncate.php'
`web/smarty/plugins/modifier.strip.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/modifier.strip.php'
`web/smarty/plugins/function.html_table.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/function.html_table.php'
`web/smarty/plugins/function.html_radios.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/function.html_radios.php'
`web/smarty/plugins/modifier.regex_replace.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/modifier.regex_replace.php'
`web/smarty/plugins/modifier.default.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/modifier.default.php'
`web/smarty/plugins/function.popup.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/function.popup.php'
`web/smarty/plugins/function.html_checkboxes.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/function.html_checkboxes.php'
`web/smarty/plugins/function.cycle.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/function.cycle.php'
`web/smarty/plugins/shared.escape_special_chars.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/shared.escape_special_chars.php'
`web/smarty/plugins/modifier.replace.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/modifier.replace.php'
`web/smarty/plugins/function.html_options.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/function.html_options.php'
`web/smarty/plugins/function.html_image.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/function.html_image.php'
`web/smarty/plugins/function.html_select_date.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/function.html_select_date.php'
`web/smarty/plugins/shared.make_timestamp.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/shared.make_timestamp.php'
`web/smarty/plugins/outputfilter.trimwhitespace.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/outputfilter.trimwhitespace.php'
`web/smarty/plugins/variablefilter.htmlspecialchars.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/variablefilter.htmlspecialchars.php'
`web/smarty/plugins/modifier.strip_tags.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/modifier.strip_tags.php'
`web/smarty/plugins/block.php.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/block.php.php'
`web/smarty/plugins/modifier.upper.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/modifier.upper.php'
`web/smarty/plugins/modifier.lower.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/modifier.lower.php'
`web/smarty/plugins/function.fetch.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/function.fetch.php'
`web/smarty/plugins/modifier.count_sentences.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/modifier.count_sentences.php'
`web/smarty/plugins/modifier.string_format.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/modifier.string_format.php'
`web/smarty/plugins/function.math.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/function.math.php'
`web/smarty/plugins/block.textformat.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/block.textformat.php'
`web/smarty/plugins/modifier.noprint.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/modifier.noprint.php'
`web/smarty/plugins/modifier.count_paragraphs.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/modifier.count_paragraphs.php'
`web/smarty/plugins/modifier.date_format.php' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/plugins/modifier.date_format.php'
`web/smarty/.DS_Store' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/smarty/.DS_Store'
`web/style.css' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/style.css'
`web/templates' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/templates'
`web/templates/sidebar.tpl' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/templates/sidebar.tpl'
`web/templates/topbar.tpl' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/templates/topbar.tpl'
`web/templates/header.tpl' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/templates/header.tpl'
`web/templates/ajax_backuplist.tpl' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/templates/ajax_backuplist.tpl'
`web/templates/index.tpl' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/templates/index.tpl'
`web/templates/cleanbackups.tpl' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/templates/cleanbackups.tpl'
`web/templates/footer.tpl' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/templates/footer.tpl'
`web/templates/settings.tpl' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/templates/settings.tpl'
`web/templates_c' -> `/usr/local/cpanel/whostmgr/docroot/cleanbackups/templates_c'
`cleanbackups.class.php' -> `/var/cpanel/cleanbackups/cleanbackups.class.php'
`version' -> `/var/cpanel/cleanbackups/version'
`changelog' -> `/var/cpanel/cleanbackups/changelog'
`cleanbackups.cron' -> `/etc/cron.d/cleanbackups.cron'
Linking /var/cpanel/cleanbackups/bin/php to /usr/local/cpanel/3rdparty/bin/php
`/var/cpanel/cleanbackups/bin/php' -> `/usr/local/cpanel/3rdparty/bin/php'
Found /usr/local/cpanel/3rdparty/bin/php , checking for JSON support
JSON support found!
Updating md5sum list
Fetching http://httpupdate.cpanel.net/cpanelsync/easy/targz.yaml (connected:0).......(request attempt 1/12)...Using dns cache file /root/.HttpRequest/httpupdate.cpanel.net......searching for mirrors (mirror search attempt 1/3)......loaded mirror speeds from cache......mirror search success......connecting to 112.140.180.1...@112.140.180.1......connected......receiving...100%......request success......Done
Downloading tarball for IonCubeLoader
Fetching http://httpupdate.cpanel.net/cpanelsync/easy/targz/Cpanel/Easy/IonCubeLoader.pm.tar.gz.linux-generic-64 (connected:0).......(request attempt 1/12)......connecting to 112.140.180.1...@112.140.180.1......connected......receiving...4%...8%...12%...16%...20%...24%...28%...32%...36%...40%...44%...48%...52%...56%...60%...64%...68%...72%...76%...80%...85%...89%...93%...97%...100%......request success......Done
Installing IonCubeLoader
Creating install directory at /usr/local/IonCube
Determining PHP version
Installing IonCube Loader binaries
Activating IonCube Loader extension in /usr/local/cpanel/3rdparty/etc/php.ini
IonCube Loader extension activated
`/usr/local/cpanel/whostmgr/docroot/cleanbackups/addon_cleanbackups.cgi' -> `/usr/local/cpanel/whostmgr/docroot/cgi/addon_cleanbackups.cgi'
root@server5 [/home]#
[/bash]

Selesai. Login pada WHM sebagai root user & klik pada link plugin "Clean Backups" untuk mulai melakukan konfigurasi script.

[caption id="attachment_1210" align="alignnone" width="150" caption="Clean backups WHM Plugin"]Clean backups WHM Plugin[/caption]

Visit Publisher script

Selesai.
:D
Loncat ke Atas ↑