Friday, September 18, 2015

Bagi Rata Bandwidth Untuk Setiap Client Dengan Queue Tree

Ada dua cara pembagian bandwidth (queue) di mikrotik, yaitu dengan simple queue dan queue tree, sebagaimana pada tulisan sebelumnya simple queue telah dibahas, adalah membagi bandwidth (BW) berdasarkan limit yang kita berikan, walaupun kondisi user yang memakai koneksi tidak banyak tetap saja batasan nya adalah limit yang telah diberikan.

Kelebihan dari simple queue ini adalah penggunaan-nya yang mudah, sesuai dengan namanya, dan kekurangannya adalah seperti yang telah disebutkan diatas, bahwa penggunaannya yang telah dibatasi, walaupun user kondisi pemakaian koneksi saat itu sedang sepi.

Pada tulisan kali ini, kita akan mengulas tentang setting queue tree, yang mana salah satu kelebihannya adalah membagi rata BW pemakaian kepada setiap client secara rata. Misalkan pada suatu provider menyediakan jatah BW sebesar 256kb untuk suatu jaringan dengan kondisi 10 pc dan perbandingan koneksi nya 1:1, yang mana artinya 256kb download dan 256kb upload, maka pada queue tree akan membaginya secara merata kepada setiap client (10 pc) secara otomatis.

Kuncinya ada pada pcq yang tugasnya adalah membagi rata BW kepada setiap client yang terkoneksi, sebagai contoh jika dalam suatu jaringan memiliki 10 pc artinya dengan kekuatan 256kb akan dibagi dengan 10 pc (256/10) kira-kira cukuplah untuk sekedar membuka e-mail ~_~, dan jika dari 10 pc tersebut ternyata yang aktif hanya 8 pc maka kapasitas BW tadi akan dibagi dengan 8 pc (256/8) tentu kecepatan utk setiap client akan sedikit bertambah, apalagi kalau hanya satu yang aktif.

Berikut rule nya, dengan asumsi bahwa BW yang dimiliki sebesar 256kb download / 256kb upload (1:1), interface yang mengarah kedalam diberi nama LAN, sedangkan interface yang mengarah keluar diberi nama WAN.
/ip firewall address-list
add list=lokal-nyo address=192.168.10.1 comment="" disabled=no
add list=lokal-nyo address=192.168.10.2 comment="" disabled=no
add list=lokal-nyo address=192.168.10.3 comment="" disabled=no
add list=lokal-nyo address=192.168.10.4 comment="" disabled=no
add list=lokal-nyo address=192.168.10.5 comment="" disabled=no
add list=lokal-nyo address=192.168.10.6 comment="" disabled=no
add list=lokal-nyo address=192.168.10.7 comment="" disabled=no
add list=lokal-nyo address=192.168.10.8 comment="" disabled=no
add list=lokal-nyo address=192.168.10.9 comment="" disabled=no
add list=lokal-nyo address=192.168.10.10 comment="" disabled=no

/ip firewall mangle
add chain=prerouting src-address-list=lokal-nyo \
action=mark-connection new-connection-mark=kon-lokal
add chain=prerouting connection-mark=kon-lokal \
action=mark-packet new-packet-mark=kon-lokal-p

/queue type
add name=down-pcq kind=pcq pcq-classifier=dst-address pcq-rate=256000
add name=up-pcq kind=pcq pcq-classifier=src-address pcq-rate=256000

/queue tree
add parent=LAN queue=down-pcq \
packet-mark=kon-lokal-p
add parent=WAN queue=up-pcq \
packet-mark=kon-lokal-p
Cara pembagian BW dengan queue tree tersebut diatas tanpa melihat IIX dan INT nya, semua digabung menjadi satu koneksi dengan pembagian jalur download dan upload.

Tuesday, September 15, 2015

Adding Schema Markup to WordPress Theme

wp-schema-large

Adding Schema Markup to WordPress Theme for Better SEO


wp-schema-large
For those who doesn’t know. Schemas, i.e., html tags, that webmasters can use to markup their pages in ways recognized by major search providers. Search engines including Bing, Google, Yahoo! and Yandex rely on this markup to improve the display of search results, making it easier for people to find the right web pages.
Many sites are generated from structured data, which is often stored in databases. When this data is formatted into HTML, it becomes very difficult to recover the original structured data. Many applications, especially search engines, can benefit greatly from direct access to this structured data. On-page markup enables search engines to understand the information on web pages and provide richer search results in order to make it easier for users to find relevant information on the web. Markup can also enable new tools and applications that make use of the structure.
A shared markup vocabulary makes it easier for webmasters to decide on a markup schema and get the maximum benefit for their efforts. So, in the spirit of sitemaps.org, search engines have come together to provide a shared collection of schemas that webmasters can use. description via schema.org

Using Google Tools to Check Your Page Schemas

First check if your site and inner page already schema-ready. Go to Structured Data Testing Tool and enter your website or webpage address. If everything went well, you should see a results similar to below screenshot.
Google-Structured-Data-Testing-Dezzain
if not then you should consider starting to add schema markup on your website for better search engine optimization results. Don’t worry here’s an easy step by step tutorial on How to Add Schema Markup to your WordPress Theme.

1. Register a Google Plus Account

For the schema to work, you need a Google Plus Profile URL so register a new plus account now. Skip this step if you already had one.

2. Adding rel=’publisher’ to your WordPress Theme

Open header.php and just before closing of </head> add this code with your own google plus profile id for publisher profile.
1<link rel="publisher" href="https://plus.google.com/xxxxxxxxxxxxxxxxxxxx" />

3. Create Schema Data Templates

Create a new php file and copy paste this code into it and name it to schema.php and moved to your theme root. wp-content/your-theme-name/schema.php
1<div style="width:10px;height:10px;position:absolute;left:-9999em" class="post-schema">
2
3<article itemscope="" itemtype="http://schema.org/Article">
4
5<span class="entry-title" itemprop="name headline"><a itemprop="url" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></span>
6
7<!-- Insert data:Person schema -->
8<span itemprop="author" itemscope="" itemtype="http://schema.org/Person">
9
10<!-- Insert data:rel:Author schema -->
11<span itemprop="name">
12<a href="https://plus.google.com/xxxxx-your-id-xxxxxx?rel=author" itemprop="url">YOUR NAME</a>
13</span>
14
15<!-- Insert data:others schema *optional -->
16<span itemprop="givenName">YOUR FIRST NAME</span>
17<span itemprop="familyName">YOUR FAMILY/LAST NAME</span>
18<span itemprop="email">YOUR EMAIL ADDRESS</span>
19<span itemprop="jobTitle">YOUR TITLE</span>
20<span itemprop="brand">YOUR BRAND</span>
21
22</span>
23
24<!-- Insert data:Published schema -->
25<time datetime="<?php the_time('Y-m-d') ?>" itemprop="datePublished"></time>
26<time class="entry-date updated" datetime="<?php the_modified_time('d F Y') ?>"><?php the_modified_time('d F Y') ?></time>
27
28<!-- Insert data:Author schema -->
29<span class="vcard author"><span class="fn"><?php the_author(); ?></span></span>
30
31<!-- Insert data:ArticleSection schema -->
32<?php
33$categories = get_the_category();
34$separator = ', ';
35$output = '';
36if($categories){
37foreach($categories as $category) {
38echo '<span style="display:none;" itemprop="articleSection">' . $category->cat_name . '</span>';
39}
40}
41?>
42
43<!-- Insert data:Tag schema -->
44<?php if( has_tag() ) { ?>
45<span itemprop="keywords"><?php the_tags('', ','); ?></span>
46<?php } ?>
47
48<!-- Insert data:Content schema -->
49<?php if( !is_singular() ): ?>
50<div itemprop="description"><?php the_excerpt(); ?></div>
51<?php else: ?>
52<div itemprop="articleBody"><?php the_content(); ?></div>
53<?php endif; ?>
54
55</article>
56
57</div>
or download the zipped schema.php here
You might notice in previous copied code. i included a style=’display:none’ in class=’post-schema’. This is to prevent the data been showed in your site.

4. Adding created schema.php into post_loop()

Open any file with post_loop (index.php, home.php, archive.php or single.php) and add this code
1<?php get_template_part('schema'); ?>
to post_loop() like this
1<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
2<!-- your own existed loop code -->
3<!-- add this below -->
4<?php get_template_part('schema'); ?>
5<?php endwhile; else: ?> <?php endif; ?>

5. Retest with Google Snippet Tools

Finally Clear your cache and retest your website with Structured Data Testing Tool. You should be able to see the schema markup properly generated and structured.

Credit/Source: http://www.dezzain.com/wordpress-tutorials/adding-schema-markup-to-wordpress-theme-for-better-seo/