<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Syed Jahanzaib Personnel Blog to Share Knowledge !</title>
	<atom:link href="http://aacable.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://aacable.wordpress.com</link>
	<description>Zaib&#039;s Personnel blog to share knwoledge !</description>
	<lastBuildDate>Mon, 30 Jan 2012 10:06:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='aacable.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/c4d283ae76a104cfa9dc2a8a67d827ab?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Syed Jahanzaib Personnel Blog to Share Knowledge !</title>
		<link>http://aacable.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://aacable.wordpress.com/osd.xml" title="Syed Jahanzaib Personnel Blog to Share Knowledge !" />
	<atom:link rel='hub' href='http://aacable.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Youtube Caching Problem : An error occured. Please try again later. [SOLVED]</title>
		<link>http://aacable.wordpress.com/2012/01/30/youtube-caching-problem-an-error-occured-please-try-again-later-solved/</link>
		<comments>http://aacable.wordpress.com/2012/01/30/youtube-caching-problem-an-error-occured-please-try-again-later-solved/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 09:55:50 +0000</pubDate>
		<dc:creator>Syed Jahanzaib / Pinochio~:)</dc:creator>
				<category><![CDATA[Linux Related]]></category>
		<category><![CDATA[squid storeurl.pl error]]></category>
		<category><![CDATA[SQUID Youtube An error occured please try again later]]></category>
		<category><![CDATA[storeurl.pl]]></category>
		<category><![CDATA[youtube error an error occured]]></category>

		<guid isPermaLink="false">http://aacable.wordpress.com/?p=1869</guid>
		<description><![CDATA[UNDER TESTING . . . UNDER TESTING . . . UNDER TESTING . . . UNDER TESTING . . . &#160; If you are caching youtube using storeurl.pl method Example: http://aacable.wordpress.com/2012/01/19/youtube-caching-with-squid-2-7-using-storeurl-pl/  and you encounter following error while watching any cached video &#8220;An error occured, Please try again later&#8221;, just use the following updated storeul.pl Also [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aacable.wordpress.com&amp;blog=10450829&amp;post=1869&amp;subd=aacable&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_1776" class="wp-caption aligncenter" style="width: 252px"><a href="http://aacable.files.wordpress.com/2012/01/ubuntu-logo1.png"><img class=" wp-image-1776" title="YOUTUBE CACHING WITH SQUID -by- Syed Jahanzaib" src="http://aacable.files.wordpress.com/2012/01/ubuntu-logo1.png?w=242&#038;h=249" alt="YOUTUBE CACHING WITH SQUID -by- Syed Jahanzaib" width="242" height="249" /></a><p class="wp-caption-text">YOUTUBE CACHING WITH SQUID -by- Syed Jahanzaib</p></div>
<h1><span style="text-decoration:underline;"><span style="color:#ff0000;text-decoration:underline;">UNDER TESTING</span></span> . . .</h1>
<h1><span style="color:#ff0000;">UNDER TESTING . . .</span></h1>
<h1><span style="color:#ff0000;">UNDER TESTING . . .</span></h1>
<h1><span style="color:#ff0000;">UNDER TESTING . . .</span></h1>
<p>&nbsp;</p>
<p>If you are caching youtube using <span style="color:#ff0000;"><strong>storeurl.pl</strong></span> method<br />
<strong>Example:</strong> <a title="Youtube Caching with storeurl.pl - By-Syed Jahanzaib" href="http://aacable.wordpress.com/2012/01/19/youtube-caching-with-squid-2-7-using-storeurl-pl/" target="_blank">http://aacable.wordpress.com/2012/01/19/youtube-caching-with-squid-2-7-using-storeurl-pl/ </a></p>
<p><span style="color:#000000;">and you encounter following error while watching any cached video<br />
&#8220;An error occured, Please try again later&#8221;, just use the following updated</span> <span style="color:#ff0000;"><strong>storeul.pl</strong><span style="color:#000000;"><br />
</span><br />
</span></p>
<p><pre class="brush: plain;">
#!/usr/bin/perl
# $Rev$
# by chudy_fernandez@yahoo.com
# Updates at http://wiki.squid-cache.org/ConfigExamples/DynamicContent/YouTube/Discussion
$|=1;
while (&lt;&gt;) {
@X = split;
#    $X[1] =~ s/&amp;sig=.*//;
$x = $X[0] . &quot; &quot;;
$_ = $X[1];
$u = $X[1];

# compatibility for old cached get_video?video_id
if (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com).*?(videoplayback\?id=.*?|video_id=.*?)\&amp;(.*?)/) {
$z = $2; $z =~ s/video_id=/get_video?video_id=/;
print $x . &quot;http://video-srv.youtube.com.SQUIDINTERNAL/&quot; . $z . &quot;\n&quot;;

# youtube HD itag=22
} elsif (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com).*?\&amp;(itag=22).*?\&amp;(id=[a-zA-Z0-9]*)/) {
print $x . &quot;http://video-srv.youtube.com.SQUIDINTERNAL/&quot; . $2 . &quot;&amp;&quot; . $3 . &quot;\n&quot;;

# youtube Normal screen always HD itag 35, Normal screen never HD itag 34, itag=18 &lt;--normal?
} elsif (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com).*?\&amp;(itag=[0-9]*).*?\&amp;(id=[a-zA-Z0-9]*)/) {
print $x . &quot;http://video-srv.youtube.com.SQUIDINTERNAL/&quot; . $3 . &quot;\n&quot;;

} elsif (m/^http:\/\/www\.google-analytics\.com\/__utm\.gif\?.*/) {
print $x . &quot;http://www.google-analytics.com/__utm.gif\n&quot;;

#Cache High Latency Ads
} elsif (m/^http:\/\/([a-z0-9.]*)(\.doubleclick\.net|\.quantserve\.com|\.googlesyndication\.com|yieldmanager|cpxinteractive)(.*)/) {
$y = $3;$z = $2;
for ($y) {
s/pixel;.*/pixel/;
s/activity;.*/activity/;
s/(imgad[^&amp;]*).*/\1/;
s/;ord=[?0-9]*//;
s/;&amp;timestamp=[0-9]*//;
s/[&amp;?]correlator=[0-9]*//;
s/&amp;cookie=[^&amp;]*//;
s/&amp;ga_hid=[^&amp;]*//;
s/&amp;ga_vid=[^&amp;]*//;
s/&amp;ga_sid=[^&amp;]*//;
# s/&amp;prev_slotnames=[^&amp;]*//
# s/&amp;u_his=[^&amp;]*//;
s/&amp;dt=[^&amp;]*//;
s/&amp;dtd=[^&amp;]*//;
s/&amp;lmt=[^&amp;]*//;
s/(&amp;alternate_ad_url=http%3A%2F%2F[^(%2F)]*)[^&amp;]*/\1/;
s/(&amp;url=http%3A%2F%2F[^(%2F)]*)[^&amp;]*/\1/;
s/(&amp;ref=http%3A%2F%2F[^(%2F)]*)[^&amp;]*/\1/;
s/(&amp;cookie=http%3A%2F%2F[^(%2F)]*)[^&amp;]*/\1/;
s/[;&amp;?]ord=[?0-9]*//;
s/[;&amp;]mpvid=[^&amp;;]*//;
s/&amp;xpc=[^&amp;]*//;
# yieldmanager
s/\?clickTag=[^&amp;]*//;
s/&amp;u=[^&amp;]*//;
s/&amp;slotname=[^&amp;]*//;
s/&amp;page_slots=[^&amp;]*//;
}
print $x . &quot;http://&quot; . $1 . $2 . $y . &quot;\n&quot;;

#cache high latency ads
} elsif (m/^http:\/\/(.*?)\/(ads)\?(.*?)/) {
print $x . &quot;http://&quot; . $1 . &quot;/&quot; . $2  . &quot;\n&quot;;

# spicific servers starts here....
} elsif (m/^http:\/\/(www\.ziddu\.com.*\.[^\/]{3,4})\/(.*?)/) {
print $x . &quot;http://&quot; . $1 . &quot;\n&quot;;

#cdn, varialble 1st path
} elsif (($u =~ /filehippo/) &amp;&amp; (m/^http:\/\/(.*?)\.(.*?)\/(.*?)\/(.*)\.([a-z0-9]{3,4})(\?.*)?/)) {
@y = ($1,$2,$4,$5);
$y[0] =~ s/[a-z0-9]{2,5}/cdn./;
print $x . &quot;http://&quot; . $y[0] . $y[1] . &quot;/&quot; . $y[2] . &quot;.&quot; . $y[3] . &quot;\n&quot;;

#rapidshare
} elsif (($u =~ /rapidshare/) &amp;&amp; (m/^http:\/\/(([A-Za-z]+[0-9-.]+)*?)([a-z]*\.[^\/]{3}\/[a-z]*\/[0-9]*)\/(.*?)\/([^\/\?\&amp;]{4,})$/)) {
print $x . &quot;http://cdn.&quot; . $3 . &quot;/SQUIDINTERNAL/&quot; . $5 . &quot;\n&quot;;

} elsif (($u =~ /maxporn/) &amp;&amp; (m/^http:\/\/([^\/]*?)\/(.*?)\/([^\/]*?)(\?.*)?$/)) {
print $x . &quot;http://&quot; . $1 . &quot;/SQUIDINTERNAL/&quot; . $3 . &quot;\n&quot;;

#like porn hub variables url and center part of the path, filename etention 3 or 4 with or without ? at the end
} elsif (($u =~ /tube8|pornhub|xvideos/) &amp;&amp; (m/^http:\/\/(([A-Za-z]+[0-9-.]+)*?)\.([a-z]*[0-9]?\.[^\/]{3}\/[a-z]*)(.*?)((\/[a-z]*)?(\/[^\/]*){4}\.[^\/\?]{3,4})(\?.*)?$/)) {
print $x . &quot;http://cdn.&quot; . $3 . $5 . &quot;\n&quot;;
#...spicific servers end here.

#photos-X.ak.fbcdn.net where X a-z
} elsif (m/^http:\/\/photos-[a-z].ak.fbcdn.net\/(.*)/) {
print $x . &quot;http://photos.ak.fbcdn.net/&quot; . $1  . &quot;\n&quot;;

#general purpose for cdn servers. add above your specific servers.
} elsif (m/^http:\/\/([0-9.]*?)\/\/(.*?)\.(.*)\?(.*?)/) {
print $x . &quot;http://squid-cdn-url//&quot; . $2  . &quot;.&quot; . $3 . &quot;\n&quot;;

#for yimg.com doubled
} elsif (m/^http:\/\/(.*?)\.yimg\.com\/(.*?)\.yimg\.com\/(.*?)\?(.*)/) {
print $x . &quot;http://cdn.yimg.com/&quot;  . $3 . &quot;\n&quot;;

#for yimg.com with &amp;sig=
} elsif (m/^http:\/\/(.*?)\.yimg\.com\/(.*)/) {
@y = ($1,$2);
$y[0] =~ s/[a-z]+[0-9]+/cdn/;
$y[1] =~ s/&amp;sig=.*//;
print $x . &quot;http://&quot; . $y[0] . &quot;.yimg.com/&quot;  . $y[1] . &quot;\n&quot;;

#generic http://variable.domain.com/path/filename.&quot;ext&quot; or &quot;exte&quot; with or withour &quot;?&quot;
} elsif (m/^http:\/\/(.*)([^\.\-]*?\..*?)\/(.*)\.([^\/\?\&amp;]{3,4})(\?.*)?$/) {
@y = ($1,$2,$3,$4);
$y[0] =~ s/(([a-zA-A-]+[0-9-]+)|(.*cdn.*)|(.*cache.*))/cdn/;
print $x . &quot;http://&quot; . $y[0] . $y[1] . &quot;/&quot; . $y[2] . &quot;.&quot; . $y[3] . &quot;\n&quot;;

# generic http://variable.domain.com/...
} elsif (m/^http:\/\/(([A-Za-z]+[0-9-]+)*?|.*cdn.*|.*cache.*)\.(.*?)\.(.*?)\/(.*)$/) {
print $x . &quot;http://cdn.&quot; . $3 . &quot;.&quot; . $4 . &quot;/&quot; . $5 .  &quot;\n&quot;;

# spicific extention that ends with ?
} elsif (m/^http:\/\/(.*?)\/(.*?)\.(jp(e?g|e|2)|gif|png|tiff?|bmp|ico|flv|on2)\?(.*)/) {
print $x . &quot;http://&quot; . $1 . &quot;/&quot; . $2  . &quot;.&quot; . $3 . &quot;\n&quot;;

# all that ends with ;
} elsif (m/^http:\/\/(.*?)\/(.*?)\;(.*)/) {
print $x . &quot;http://&quot; . $1 . &quot;/&quot; . $2  . &quot;\n&quot;;

} else {
print $x . $_ . &quot;\n&quot;;
}
}
</pre></p>
<p>Also you can download this file from following URL<br />
<a title="Updates STOREURL.PL to resolve &quot;An error occured&quot;" href="http://squid-proxy-pkg.googlecode.com/files/storeurl.pl" target="_blank">http://squid-proxy-pkg.googlecode.com/files/storeurl.pl</a><br />
.<br />
.<br />
.<br />
.</p>
<p>Regard&#8217;s<br />
<strong>SYED JAHANZAIB</strong></p>
<br />Filed under: <a href='http://aacable.wordpress.com/category/linux-related/'>Linux Related</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aacable.wordpress.com/1869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aacable.wordpress.com/1869/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aacable.wordpress.com/1869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aacable.wordpress.com/1869/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aacable.wordpress.com/1869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aacable.wordpress.com/1869/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aacable.wordpress.com/1869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aacable.wordpress.com/1869/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aacable.wordpress.com/1869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aacable.wordpress.com/1869/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aacable.wordpress.com/1869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aacable.wordpress.com/1869/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aacable.wordpress.com/1869/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aacable.wordpress.com/1869/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aacable.wordpress.com&amp;blog=10450829&amp;post=1869&amp;subd=aacable&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aacable.wordpress.com/2012/01/30/youtube-caching-problem-an-error-occured-please-try-again-later-solved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>24.851000 67.008300</georss:point>
		<geo:lat>24.851000</geo:lat>
		<geo:long>67.008300</geo:long>
		<media:content url="http://1.gravatar.com/avatar/b78d8775aa603cf6f5db83b6370e1692?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">zaib</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/ubuntu-logo1.png" medium="image">
			<media:title type="html">YOUTUBE CACHING WITH SQUID -by- Syed Jahanzaib</media:title>
		</media:content>
	</item>
		<item>
		<title>Mikrotik Port Forwarding to Local Server on LAN</title>
		<link>http://aacable.wordpress.com/2012/01/29/mikrotik-port-forwarding-to-local-server-on-lan/</link>
		<comments>http://aacable.wordpress.com/2012/01/29/mikrotik-port-forwarding-to-local-server-on-lan/#comments</comments>
		<pubDate>Sun, 29 Jan 2012 04:50:55 +0000</pubDate>
		<dc:creator>Syed Jahanzaib / Pinochio~:)</dc:creator>
				<category><![CDATA[Mikrotik Related]]></category>

		<guid isPermaLink="false">http://aacable.wordpress.com/?p=1864</guid>
		<description><![CDATA[If you want to host any web server (or any other service like RDP or Game Server) behind mikrotik server and you want it to be publicly available for all internet users, you can use port forwarding and create one dstnat rule as below.Just make sure this rule comes above any masquerading rule. Scenario: DSL [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aacable.wordpress.com&amp;blog=10450829&amp;post=1864&amp;subd=aacable&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you want to host any web server (or any other service like RDP or Game Server) behind mikrotik server and you want it to be publicly available for all internet users, you can use port forwarding and create one <strong>dstnat</strong> rule as below.Just make sure this rule comes above any masquerading rule.</p>
<p>Scenario:</p>
<p><strong>DSL MODEM WAN IP = 221.xxx.xxx.xxx<br />
DSL LAN IP = 192.168.1.1<br />
</strong></p>
<p><strong>MIKROTIK WAN IP =<strong> 192.168.1.2</strong></strong><br />
<strong>MIKROTIK LAN IP = 192.168.0.1</strong></p>
<p><strong>WEB SERVER IP = 192.168.0.50</strong></p>
<p>First setup port forwarding in your dsl modem to forward port 80 request to your mikrotik, I am not showing DSL modem config, as its very different for every mode, search for your modem confg page on howto do port forwarding. Just an example here for my Wi.Fi MODEM page.</p>
<p><a href="http://aacable.files.wordpress.com/2012/01/qubee.png"><img class="aligncenter size-medium wp-image-1865" title="qubee" src="http://aacable.files.wordpress.com/2012/01/qubee.png?w=300&#038;h=76" alt="" width="300" height="76" /></a></p>
<p>Then in mikrotik , add an rule to forward port 80 request to your local web server, (one that is hosted behind your mikrotik server, on local user LAN)</p>
<p><span style="text-decoration:underline;"><strong>MIKROTIK RULE</strong></span> :</p>
<p><pre class="brush: plain;">
/ip firewall nat
add action=dst-nat chain=dstnat disabled=no dst-port=80 in-interface=WAN2-QUBEE protocol=tcp to-addresses=192.168.0.50 \
to-ports=80
</pre></p>
<p>The above rule result would be something like below.<br />
<a href="http://aacable.files.wordpress.com/2012/01/mikrotik-nat.png"><img class="aligncenter size-medium wp-image-1866" title="mikrotik-nat" src="http://aacable.files.wordpress.com/2012/01/mikrotik-nat.png?w=300&#038;h=138" alt="" width="300" height="138" /></a></pre>
<p>Regard's<br />
<strong>Syed Jahanzaib</strong></p>
<br />Filed under: <a href='http://aacable.wordpress.com/category/mikrotik-related/'>Mikrotik Related</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aacable.wordpress.com/1864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aacable.wordpress.com/1864/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aacable.wordpress.com/1864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aacable.wordpress.com/1864/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aacable.wordpress.com/1864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aacable.wordpress.com/1864/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aacable.wordpress.com/1864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aacable.wordpress.com/1864/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aacable.wordpress.com/1864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aacable.wordpress.com/1864/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aacable.wordpress.com/1864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aacable.wordpress.com/1864/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aacable.wordpress.com/1864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aacable.wordpress.com/1864/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aacable.wordpress.com&amp;blog=10450829&amp;post=1864&amp;subd=aacable&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aacable.wordpress.com/2012/01/29/mikrotik-port-forwarding-to-local-server-on-lan/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<georss:point>24.851000 67.008300</georss:point>
		<geo:lat>24.851000</geo:lat>
		<geo:long>67.008300</geo:long>
		<media:content url="http://1.gravatar.com/avatar/b78d8775aa603cf6f5db83b6370e1692?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">zaib</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/qubee.png?w=300" medium="image">
			<media:title type="html">qubee</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/mikrotik-nat.png?w=300" medium="image">
			<media:title type="html">mikrotik-nat</media:title>
		</media:content>
	</item>
		<item>
		<title>Howto Disabe IPV6 in FEDORA 10</title>
		<link>http://aacable.wordpress.com/2012/01/28/howto-disabe-ipv6-in-fedora-10/</link>
		<comments>http://aacable.wordpress.com/2012/01/28/howto-disabe-ipv6-in-fedora-10/#comments</comments>
		<pubDate>Sat, 28 Jan 2012 07:29:03 +0000</pubDate>
		<dc:creator>Syed Jahanzaib / Pinochio~:)</dc:creator>
				<category><![CDATA[Linux Related]]></category>
		<category><![CDATA[aacable fedora ipv6]]></category>
		<category><![CDATA[fedora ipv6]]></category>
		<category><![CDATA[howto disable ipv6 in fedora]]></category>

		<guid isPermaLink="false">http://aacable.wordpress.com/?p=1856</guid>
		<description><![CDATA[Howto To disable IPV6 in FEDORA 10 ~ Issue the following commands in terminal, (You must be logged in as root) After making these changes reboot your system. Then check your interface card by ifconfig You will notice that you IPV6 lines have been gone Regard&#8217;s Syed Jahanzaib Filed under: Linux Related<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aacable.wordpress.com&amp;blog=10450829&amp;post=1856&amp;subd=aacable&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;"><a href="http://aacable.files.wordpress.com/2012/01/ipv6.jpg"><img class="aligncenter size-full wp-image-1857" title="ipv6" src="http://aacable.files.wordpress.com/2012/01/ipv6.jpg" alt="" width="251" height="172" /></a></p>
<h2>Howto To disable <strong>IPV6</strong> in <strong>FEDORA 10</strong> <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ~</h2>
<p>Issue the following commands in terminal, (You must be logged in as root)</p>
<p><pre class="brush: plain;">
su -c 'echo &quot;install ipv6 /bin/true
blacklist ipv6&quot; &gt; /etc/modprobe.d/blacklist-ipv6.conf'

su -c 'service ip6tables stop &amp;&amp; chkconfig ip6tables off'
</pre></p>
<p>After making these changes reboot your system. Then check your interface card by</p>
<p><strong>ifconfig</strong></p>
<p>You will notice that you <strong>IPV6</strong> lines have been gone <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Regard&#8217;s<br />
<span style="color:#0000ff;"><strong>Syed Jahanzaib</strong></span></p>
<br />Filed under: <a href='http://aacable.wordpress.com/category/linux-related/'>Linux Related</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aacable.wordpress.com/1856/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aacable.wordpress.com/1856/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aacable.wordpress.com/1856/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aacable.wordpress.com/1856/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aacable.wordpress.com/1856/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aacable.wordpress.com/1856/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aacable.wordpress.com/1856/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aacable.wordpress.com/1856/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aacable.wordpress.com/1856/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aacable.wordpress.com/1856/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aacable.wordpress.com/1856/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aacable.wordpress.com/1856/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aacable.wordpress.com/1856/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aacable.wordpress.com/1856/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aacable.wordpress.com&amp;blog=10450829&amp;post=1856&amp;subd=aacable&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aacable.wordpress.com/2012/01/28/howto-disabe-ipv6-in-fedora-10/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<georss:point>24.851000 67.008300</georss:point>
		<geo:lat>24.851000</geo:lat>
		<geo:long>67.008300</geo:long>
		<media:content url="http://1.gravatar.com/avatar/b78d8775aa603cf6f5db83b6370e1692?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">zaib</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/ipv6.jpg" medium="image">
			<media:title type="html">ipv6</media:title>
		</media:content>
	</item>
		<item>
		<title>SQUID: Howto Exclude some sites &amp; Exntension from CACHING</title>
		<link>http://aacable.wordpress.com/2012/01/23/squid-howto-exclude-some-sites-exntension-from-caching/</link>
		<comments>http://aacable.wordpress.com/2012/01/23/squid-howto-exclude-some-sites-exntension-from-caching/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 07:11:15 +0000</pubDate>
		<dc:creator>Syed Jahanzaib / Pinochio~:)</dc:creator>
				<category><![CDATA[Linux Related]]></category>
		<category><![CDATA[aacable squid not to cache]]></category>
		<category><![CDATA[Howto Exclude some sites and Exntension from CACHING]]></category>
		<category><![CDATA[squid exclude site from caching]]></category>
		<category><![CDATA[squir proxy exclude list]]></category>

		<guid isPermaLink="false">http://aacable.wordpress.com/?p=1836</guid>
		<description><![CDATA[Howto Exclude Few Sites from Caching If you are using SQUID proxy server and you don&#8217;t want to cache few sites , use the following directives, Now create the file which will contains our sites list which we don&#8217;t want to cache. and add  your desired web sites name in /etc/squid/not-to-cache-sites.txt For example nano /etc/squid/not-to-cache-sites.txt [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aacable.wordpress.com&amp;blog=10450829&amp;post=1836&amp;subd=aacable&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://aacable.files.wordpress.com/2011/06/squid.jpeg"><img class="aligncenter" title="squid" src="http://aacable.files.wordpress.com/2011/06/squid.jpeg?w=240&#038;h=99" alt="" width="240" height="99" /></a></p>
<h2>Howto Exclude Few Sites from Caching</h2>
<p>If you are using <strong>SQUID</strong> proxy server and you don&#8217;t want to cache few sites , use the following directives,</p>
<p><pre class="brush: plain;">
acl NO-CACHE-SITES dstdomain &quot;/etc/squid/not-to-cache-sites.txt&quot;
no_cache deny NO-CACHE-SITES
</pre></p>
<p>Now create the file which will contains our sites list which we don&#8217;t want to cache.</p>
<p><pre class="brush: plain;">touch /etc/squid/not-to-cache-sites.txt</pre></p>
<p>and add  your desired web sites name in <strong>/etc/squid/<code>not-to-cache-sites.txt</code></strong><code><code><code><br />
For example<br />
<strong><span style="color:#ff0000;">nano /etc/squid/not-to-cache-sites.txt</span></strong><br />
and add following or your entries<br />
</code></code></code></p>
<p><pre class="brush: plain;">
bankalhabib.com
aacable.wordpress.com
wordpress.com
nae.com.pk
jang.com.pk</pre></p>
<p>Now we have to reload squid.conf so changes may apply by following command</p>
<p><strong>squid -k rec<br />
</strong>OR<br />
<strong> squid -k reconfigure</strong></p>
<h2>Howto Exclude Specific Extension from Caching</h2>
<p>Similarly if you don&#8217;t want to cache <strong>*.FLV</strong> files , use the following directives</p>
<p><pre class="brush: plain;">
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \? \.flv
no_cache deny QUERY</pre></p>
<p><code></code><br />
Now we have to reload squid.conf so changes may apply by following command</p>
<p><strong>squid -k rec<br />
</strong>OR<br />
<strong> squid -k reconfigure</strong><br />
<code>Regard's<br />
<span style="color:#0000ff;"><strong>Syed Jahanzaib</strong></span></code></p>
<br />Filed under: <a href='http://aacable.wordpress.com/category/linux-related/'>Linux Related</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aacable.wordpress.com/1836/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aacable.wordpress.com/1836/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aacable.wordpress.com/1836/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aacable.wordpress.com/1836/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aacable.wordpress.com/1836/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aacable.wordpress.com/1836/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aacable.wordpress.com/1836/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aacable.wordpress.com/1836/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aacable.wordpress.com/1836/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aacable.wordpress.com/1836/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aacable.wordpress.com/1836/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aacable.wordpress.com/1836/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aacable.wordpress.com/1836/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aacable.wordpress.com/1836/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aacable.wordpress.com&amp;blog=10450829&amp;post=1836&amp;subd=aacable&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aacable.wordpress.com/2012/01/23/squid-howto-exclude-some-sites-exntension-from-caching/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<georss:point>24.851000 67.008300</georss:point>
		<geo:lat>24.851000</geo:lat>
		<geo:long>67.008300</geo:long>
		<media:content url="http://1.gravatar.com/avatar/b78d8775aa603cf6f5db83b6370e1692?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">zaib</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2011/06/squid.jpeg" medium="image">
			<media:title type="html">squid</media:title>
		</media:content>
	</item>
		<item>
		<title>UBUNTU rc.local not executing problem and its workaround</title>
		<link>http://aacable.wordpress.com/2012/01/21/ubuntu-rc-local-not-executing-problem-and-its-workaround/</link>
		<comments>http://aacable.wordpress.com/2012/01/21/ubuntu-rc-local-not-executing-problem-and-its-workaround/#comments</comments>
		<pubDate>Sat, 21 Jan 2012 16:03:00 +0000</pubDate>
		<dc:creator>Syed Jahanzaib / Pinochio~:)</dc:creator>
				<category><![CDATA[Linux Related]]></category>
		<category><![CDATA[rc.local]]></category>
		<category><![CDATA[rc.local not executing]]></category>
		<category><![CDATA[rc.local not running at startup]]></category>
		<category><![CDATA[ubuntu rc.local]]></category>

		<guid isPermaLink="false">http://aacable.wordpress.com/?p=1823</guid>
		<description><![CDATA[Sometimes in ubuntu, rc.local does not execute , specially in fresh installation. So if you encounter this issue , you can solve it by using two methods. I have used these methods several time with success. Also make sure you command entries are above &#8216;exit 0&#8216; line Method # 1 , By Using WEBMIN Method [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aacable.wordpress.com&amp;blog=10450829&amp;post=1823&amp;subd=aacable&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;"><a href="http://aacable.files.wordpress.com/2012/01/ubuntu-logo.jpg"><img title="ubuntu-logo" src="http://aacable.files.wordpress.com/2012/01/ubuntu-logo.jpg?w=195&#038;h=133" alt="" width="195" height="133" /></a></p>
<p>Sometimes in ubuntu, <span style="color:#ff6600;"><strong>rc.local</strong></span> does not execute , specially in fresh installation.<br />
So if you encounter this issue , you can solve it by using two methods.<br />
I have used these methods several time with success. Also make sure you command entries are <span style="text-decoration:underline;">above &#8216;<span style="color:#ff6600;text-decoration:underline;"><strong>exit 0</strong></span>&#8216; line</span></p>
<p><strong><span style="color:#0000ff;">Method # 1 , By Using WEBMIN</span></strong></p>
<p><strong><span style="color:#0000ff;">Method # 2 , By Removing -e from /etc/rc.loacl file</span></strong></p>
<h2><strong>Method # 1 , By Using WEBMIN</strong></h2>
<p>Install webmin from <strong>http://www.webmin.com/deb.html</strong></p>
<p>After installati0n is done, open webmin and goto<br />
<strong>SYSTEM &gt; BOOTUP &amp; SHUTDOWN</strong><br />
Scroll down and and Click on <strong>rc.local<br />
</strong>Select<strong> YES</strong> on <strong>Start at boot time?</strong></p>
<p><strong></strong>As shown in the image below.</p>
<p>&nbsp;</p>
<p><strong><a href="http://aacable.files.wordpress.com/2012/01/webmin-1.png"><img title="webmin-1" src="http://aacable.files.wordpress.com/2012/01/webmin-1.png?w=808&#038;h=172" alt="" width="808" height="172" /></a></strong></p>
<p>&nbsp;</p>
<p><a href="http://aacable.files.wordpress.com/2012/01/webmin-2.png"><img title="webmin-2" src="http://aacable.files.wordpress.com/2012/01/webmin-2.png?w=364&#038;h=404" alt="" width="364" height="404" /></a></p>
<p>&nbsp;</p>
<h2>Method # 2 , By Removing -e from /etc/rc.loacl file</h2>
<p>Edit <strong>rc.local</strong> file by</p>
<p><strong>nano /etc/rc.local</strong></p>
<p>at first line remove <strong>-e</strong>  for example</p>
<p>Change from</p>
<p><strong>#!/bin/sh -e</strong></p>
<p>to</p>
<p><strong>#!/bin/sh </strong></p>
<p><strong>Save</strong> &amp; <strong>Exit</strong>, then<strong> Reboot</strong> and see, hopefully<strong> rc.local</strong> will execute on the boot.</p>
<br />Filed under: <a href='http://aacable.wordpress.com/category/linux-related/'>Linux Related</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aacable.wordpress.com/1823/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aacable.wordpress.com/1823/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aacable.wordpress.com/1823/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aacable.wordpress.com/1823/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aacable.wordpress.com/1823/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aacable.wordpress.com/1823/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aacable.wordpress.com/1823/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aacable.wordpress.com/1823/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aacable.wordpress.com/1823/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aacable.wordpress.com/1823/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aacable.wordpress.com/1823/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aacable.wordpress.com/1823/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aacable.wordpress.com/1823/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aacable.wordpress.com/1823/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aacable.wordpress.com&amp;blog=10450829&amp;post=1823&amp;subd=aacable&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aacable.wordpress.com/2012/01/21/ubuntu-rc-local-not-executing-problem-and-its-workaround/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>24.851000 67.008300</georss:point>
		<geo:lat>24.851000</geo:lat>
		<geo:long>67.008300</geo:long>
		<media:content url="http://1.gravatar.com/avatar/b78d8775aa603cf6f5db83b6370e1692?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">zaib</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/ubuntu-logo.jpg" medium="image">
			<media:title type="html">ubuntu-logo</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/webmin-1.png" medium="image">
			<media:title type="html">webmin-1</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/webmin-2.png" medium="image">
			<media:title type="html">webmin-2</media:title>
		</media:content>
	</item>
		<item>
		<title>Ubuntu Memory Limitation Solution</title>
		<link>http://aacable.wordpress.com/2012/01/21/ubuntu-memory-limitation-solution/</link>
		<comments>http://aacable.wordpress.com/2012/01/21/ubuntu-memory-limitation-solution/#comments</comments>
		<pubDate>Sat, 21 Jan 2012 15:41:08 +0000</pubDate>
		<dc:creator>Syed Jahanzaib / Pinochio~:)</dc:creator>
				<category><![CDATA[Linux Related]]></category>
		<category><![CDATA[HOWTO Install PAE enabled kernel in UBUNTU]]></category>
		<category><![CDATA[ubuntu 16 GB ram not detected]]></category>
		<category><![CDATA[ubuntu 16GB RAM]]></category>
		<category><![CDATA[ubuntu 4 GB ram not detected]]></category>
		<category><![CDATA[ubuntu 8 GB ram not detected]]></category>
		<category><![CDATA[ubuntu 8GB RAM]]></category>
		<category><![CDATA[ubuntu memory limitation]]></category>
		<category><![CDATA[ubuntu PAE]]></category>
		<category><![CDATA[ubuntu ram limitation]]></category>

		<guid isPermaLink="false">http://aacable.wordpress.com/?p=1818</guid>
		<description><![CDATA[If you install Ubuntu 32bit , and you have more then 4 GB of  RAM, you won&#8217;t be able to use it, The easiest solution is to grab latest 64 bit version and install it (Only if your hardware supports 64bit architecture) otherwise you have to use PAE enabled kernel. For example if you have [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aacable.wordpress.com&amp;blog=10450829&amp;post=1818&amp;subd=aacable&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;"><a href="http://aacable.files.wordpress.com/2012/01/ram.jpg"><img title="ram" src="http://aacable.files.wordpress.com/2012/01/ram.jpg?w=275&#038;h=183" alt="" width="275" height="183" /></a></p>
<p>If you install Ubuntu <strong>32bit</strong> , and you have more then <strong>4</strong> <strong>GB</strong> of  RAM, you won&#8217;t be able to use it, The easiest solution is to grab latest 64 bit version and install it (Only if your hardware supports 64bit architecture) otherwise you have to use <span style="color:#0000ff;"><strong>PAE</strong></span> enabled kernel.</p>
<p>For example if you have <strong>8GB</strong> of ram, and you issue the command,</p>
<p><strong>free -m</strong></p>
<p>you will see only <strong>3-4</strong> GB of  total ram. You need to install Physical Address Extension (<strong>PAE</strong>) aware kernel under 32 bit Ubuntu Linux. It is a feature of x86 and x86-64 processors that allows more than 4 Gigabytes of physical memory to be used in 32-bit systems.</p>
<h2>HOWTO Install PAE enabled kernel in UBUNTU</h2>
<p>Open terminal and type the following command</p>
<p>If you are using <strong>Ubuntu v9.10 (Karmic Koala)</strong> and above, enter:</p>
<p><pre class="brush: plain;">apt-get install linux-generic-pae linux-headers-generic-pae</pre></p>
<p>Once kernel images installed, just reboot your workstation, type:<br />
<strong><code><br />
reboot</code></strong></p>
<p>After reboot, login into your system and type the following command to verify memory usage:<br />
<strong><code><br />
free -m</code></strong></p>
<p>if you are using Ubuntu version <strong>Ubuntu v9.04</strong> and earlier:</p>
<p><pre class="brush: plain;">apt-get update
sudo apt-get install linux-headers-server linux-image-server linux-server</pre></p>
<p><code>Now <strong>reboot</strong> and check memory by <strong>free -m</strong><br />
<code></code></code></p>
<br />Filed under: <a href='http://aacable.wordpress.com/category/linux-related/'>Linux Related</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aacable.wordpress.com/1818/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aacable.wordpress.com/1818/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aacable.wordpress.com/1818/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aacable.wordpress.com/1818/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aacable.wordpress.com/1818/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aacable.wordpress.com/1818/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aacable.wordpress.com/1818/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aacable.wordpress.com/1818/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aacable.wordpress.com/1818/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aacable.wordpress.com/1818/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aacable.wordpress.com/1818/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aacable.wordpress.com/1818/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aacable.wordpress.com/1818/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aacable.wordpress.com/1818/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aacable.wordpress.com&amp;blog=10450829&amp;post=1818&amp;subd=aacable&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aacable.wordpress.com/2012/01/21/ubuntu-memory-limitation-solution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>24.851000 67.008300</georss:point>
		<geo:lat>24.851000</geo:lat>
		<geo:long>67.008300</geo:long>
		<media:content url="http://1.gravatar.com/avatar/b78d8775aa603cf6f5db83b6370e1692?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">zaib</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/ram.jpg" medium="image">
			<media:title type="html">ram</media:title>
		</media:content>
	</item>
		<item>
		<title>Youtube caching with SQUID 2.7 [using storeurl.pl]</title>
		<link>http://aacable.wordpress.com/2012/01/19/youtube-caching-with-squid-2-7-using-storeurl-pl/</link>
		<comments>http://aacable.wordpress.com/2012/01/19/youtube-caching-with-squid-2-7-using-storeurl-pl/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 06:34:44 +0000</pubDate>
		<dc:creator>Syed Jahanzaib / Pinochio~:)</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://aacable.wordpress.com/?p=1810</guid>
		<description><![CDATA[This is a Shorter Version of  &#62;  http://aacable.wordpress.com/tag/aacable-howto-cache-youtube/ This is a quick reference guide for SQUID 2.7 installation on Ubuntu Desktop ver 10.4 with youtube caching supported. Make sure you have setup proper internet connection in Ubuntu BOX. Install SQUID by apt-get install squid After installation done, Now edit it&#8217;s configuration file nano /etc/squid/squid.conf remove [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aacable.wordpress.com&amp;blog=10450829&amp;post=1810&amp;subd=aacable&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a Shorter Version of  <strong>&gt;  http://aacable.wordpress.com/tag/aacable-howto-cache-youtube/</strong></p>
<p>This is a quick reference guide for <strong>SQUID</strong> <strong>2.7</strong> installation on <strong>Ubuntu Desktop ver 10.4</strong> with youtube caching supported. Make sure you have setup proper internet connection in Ubuntu BOX.</p>
<p>Install SQUID by</p>
<p><strong>apt-get install squid</strong></p>
<p>After installation done, Now edit it&#8217;s configuration file</p>
<p><strong>nano /etc/squid/squid.conf</strong></p>
<p>remove current lines and paste all squid.conf as follows.</p>
<p><pre class="brush: plain;"># SQUID 2.7 TEST CONFIG FILE
# Email: aacable@hotmail.com
# Web  : http://aacable.wordpress.com

# PORT and Transparent Option
http_port 8080 transparent
server_http11 on
icp_port 0

# Cache Directory , modify it according to your system.
# but first create directory in root by mkdir /cache1
# and then issue this command  chown proxy:proxy /cache1
# [for ubuntu user is proxy, in Fedora user is SQUID]
# I have set 10 GB for caching reserved just for caching ,
# adjust it according to your need.
# My recommendation is to have one cache_dir per drive. zzz

#store_dir_select_algorithm round-robin
cache_dir aufs /cache1 1000 16 256
cache_replacement_policy heap LFUDA
memory_replacement_policy heap GDSF

# If you want to enable DATE time n SQUID Logs,use following
emulate_httpd_log on
logformat squid %tl %6tr %&gt;a %Ss/%03Hs %&lt;st %rm %ru %un %Sh/%&lt;A %mt
log_fqdn off

# How much days to keep users access web logs
# You need to rotate your log files with a cron job. For example:
# 0 0 * * * /usr/local/squid/bin/squid -k rotate
logfile_rotate 14
debug_options ALL,1
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log

#I used DNSAMSQ service for fast dns resolving
#so install by using &quot;apt-get install dnsmasq&quot; first
dns_nameservers 127.0.0.1 192.168.2.4 192.168.2.3
ftp_user anonymous@
ftp_list_width 32
ftp_passive on
ftp_sanitycheck on

#ACL Section
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563 # https, snews
acl SSL_ports port 873 # rsync
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl Safe_ports port 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access allow all
http_reply_access allow all
icp_access allow all

#==========================
# Administrative Parameters
#==========================

# I used UBUNTU so user is proxy, in FEDORA you may use use squid
cache_effective_user proxy
cache_effective_group proxy
cache_mgr aacable@hotmail.com
visible_hostname proxy.aacable.net
unique_hostname aacable@hotmail.com

#=============
# ACCELERATOR
#=============
half_closed_clients off
quick_abort_min 0 KB
quick_abort_max 0 KB
quick_abort_pct 100
vary_ignore_expire on
reload_into_ims on
pipeline_prefetch on
range_offset_limit 512 KB
read_timeout 30 minutes
log_fqdn off
memory_pools off

# If you want to hide your proxy machine from being detected at various site use following
via off

#============================================
# OPTIONS WHICH AFFECT THE CACHE SIZE / zaib
#============================================
# If you have 4GB memory in Squid box, we will use formula of 1/3
# You can adjust it according to your need. IF squid is taking too much of RAM
# Then decrease it to 128 MB or even less.
cache_mem 8 MB
minimum_object_size 0 bytes
maximum_object_size 100 MB
maximum_object_size_in_memory 64 KB

#============================================================$
# SNMP , if you want to generate graphs for SQUID via MRTG
#============================================================$
#acl snmppublic snmp_community gl
#snmp_port 3401
#snmp_access allow snmppublic all
#snmp_access allow all

#============================================================
# ZPH , To enable cache content to be delivered at full lan speed,
# To bypass the queue at MT.
#============================================================
tcp_outgoing_tos 0x30 all
zph_mode tos
zph_local 0x30
zph_parent 0
zph_option 136

# Caching Youtube
acl videocache_allow_url url_regex -i \.youtube\.com\/get_video\?
acl videocache_allow_url url_regex -i \.youtube\.com\/videoplayback \.youtube\.com\/videoplay \.youtube\.com\/get_video\?
acl videocache_allow_url url_regex -i \.youtube\.[a-z][a-z]\/videoplayback \.youtube\.[a-z][a-z]\/videoplay \.youtube\.[a-z][a-z]\/get_video\?
acl videocache_allow_url url_regex -i \.googlevideo\.com\/videoplayback \.googlevideo\.com\/videoplay \.googlevideo\.com\/get_video\?
acl videocache_allow_url url_regex -i \.google\.com\/videoplayback \.google\.com\/videoplay \.google\.com\/get_video\?
acl videocache_allow_url url_regex -i \.google\.[a-z][a-z]\/videoplayback \.google\.[a-z][a-z]\/videoplay \.google\.[a-z][a-z]\/get_video\?
acl videocache_allow_url url_regex -i proxy[a-z0-9\-][a-z0-9][a-z0-9][a-z0-9]?\.dailymotion\.com\/
acl videocache_allow_url url_regex -i vid\.akm\.dailymotion\.com\/
acl videocache_allow_url url_regex -i [a-z0-9][0-9a-z][0-9a-z]?[0-9a-z]?[0-9a-z]?\.xtube\.com\/(.*)flv
acl videocache_allow_url url_regex -i \.vimeo\.com\/(.*)\.(flv|mp4)
acl videocache_allow_url url_regex -i va\.wrzuta\.pl\/wa[0-9][0-9][0-9][0-9]?
acl videocache_allow_url url_regex -i \.youporn\.com\/(.*)\.flv
acl videocache_allow_url url_regex -i \.msn\.com\.edgesuite\.net\/(.*)\.flv
acl videocache_allow_url url_regex -i \.tube8\.com\/(.*)\.(flv|3gp)
acl videocache_allow_url url_regex -i \.mais\.uol\.com\.br\/(.*)\.flv
acl videocache_allow_url url_regex -i \.blip\.tv\/(.*)\.(flv|avi|mov|mp3|m4v|mp4|wmv|rm|ram|m4v)
acl videocache_allow_url url_regex -i \.apniisp\.com\/(.*)\.(flv|avi|mov|mp3|m4v|mp4|wmv|rm|ram|m4v)
acl videocache_allow_url url_regex -i \.break\.com\/(.*)\.(flv|mp4)
acl videocache_allow_url url_regex -i redtube\.com\/(.*)\.flv
acl videocache_allow_dom dstdomain .mccont.com .metacafe.com .cdn.dailymotion.com
acl videocache_deny_dom  dstdomain .download.youporn.com .static.blip.tv
acl dontrewrite url_regex redbot\.org \.php
acl getmethod method GET

storeurl_access deny dontrewrite
storeurl_access deny !getmethod
storeurl_access deny videocache_deny_dom
storeurl_access allow videocache_allow_url
storeurl_access allow videocache_allow_dom
storeurl_access deny all

storeurl_rewrite_program /etc/squid/storeurl.pl
storeurl_rewrite_children 7
storeurl_rewrite_concurrency 10

acl store_rewrite_list urlpath_regex -i \/(get_video\?|videodownload\?|videoplayback.*id)
acl store_rewrite_list urlpath_regex -i \.flv$ \.mp3$ \.mp4$ \.swf$ \
storeurl_access allow store_rewrite_list
storeurl_access deny all

refresh_pattern -i \.flv$ 5259487 99999999% 5259487  override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache  ignore-private ignore-auth  negative-ttl=0
refresh_pattern -i \.mp3$ 5259487 99999999% 5259487  override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache  ignore-private ignore-auth  negative-ttl=0
refresh_pattern -i \.mp4$ 5259487 99999999% 5259487  override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache  ignore-private ignore-auth  negative-ttl=0
refresh_pattern -i \.swf$ 5259487 99999999% 5259487  override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache  ignore-private ignore-auth  negative-ttl=0
refresh_pattern -i \.gif$ 5259487 99999999% 5259487  override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache  ignore-private ignore-auth  negative-ttl=0
refresh_pattern -i \.jpg$ 5259487 99999999% 5259487  override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache  ignore-private ignore-auth  negative-ttl=0
refresh_pattern -i \.jpeg$ 5259487 99999999% 5259487  override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache  ignore-private  ignore-auth  negative-ttl=0
refresh_pattern -i \.exe$ 5259487 99999999% 5259487  override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache  ignore-private  ignore-auth  negative-ttl=0

# 1 year = 525600 mins, 1 month = 43200 mins, 1 day = 1440
refresh_pattern (get_video\?|videoplayback\?|videodownload\?|\.flv?)    43200 999999% 43200 ignore-no-cache  ignore-private override-expire override-lastmod reload-into-ims
refresh_pattern (get_video\?|videoplayback\?id|videoplayback.*id|videodownload\?|\.flv?)    43200 999999% 43200 ignore-no-cache  ignore-private override-expire override-lastmod reload-into-ims
refresh_pattern \.(ico|video-stats) 43200 999999% 43200 override-expire ignore-reload ignore-no-cache  ignore-private ignore-auth override-lastmod  negative-ttl=10080
refresh_pattern \.etology\?                                     43200 999999% 43200 override-expire ignore-reload ignore-no-cache
refresh_pattern galleries\.video(\?|sz)                         43200 999999% 43200 override-expire ignore-reload ignore-no-cache
refresh_pattern brazzers\?                                      43200 999999% 43200 override-expire ignore-reload ignore-no-cache
refresh_pattern \.adtology\?                                    43200 999999% 43200 override-expire ignore-reload ignore-no-cache
refresh_pattern ^.*(utm\.gif|ads\?|rmxads\.com|ad\.z5x\.net|bh\.contextweb\.com|bstats\.adbrite\.com|a1\.interclick\.com|ad\.trafficmp\.com|ads\.cubics\.com|ad\.xtendmedia\.com|\.googlesyndication\.com|advertising\.com|yieldmanager|game-advertising\.com|pixel\.quantserve\.com|adperium\.com|doubleclick\.net|adserving\.cpxinteractive\.com|syndication\.com|media.fastclick.net).* 43200 20% 43200 ignore-no-cache  ignore-private override-expire ignore-reload ignore-auth   negative-ttl=40320 max-stale=10
refresh_pattern ^.*safebrowsing.*google  43200 999999% 43200 override-expire ignore-reload ignore-no-cache ignore-private ignore-auth  negative-ttl=10080
refresh_pattern ^http://((cbk|mt|khm|mlt)[0-9]?)\.google\.co(m|\.uk)    43200 999999% 43200 override-expire ignore-reload ignore-private  negative-ttl=10080
refresh_pattern ytimg\.com.*\.jpg                                       43200 999999% 43200 override-expire ignore-reload
refresh_pattern images\.friendster\.com.*\.(png|gif)                    43200 999999% 43200 override-expire ignore-reload
refresh_pattern garena\.com                                             43200 999999% 43200 override-expire reload-into-ims
refresh_pattern photobucket.*\.(jp(e?g|e|2)|tiff?|bmp|gif|png)          43200 999999% 43200 override-expire ignore-reload
refresh_pattern vid\.akm\.dailymotion\.com.*\.on2\?                     43200 999999% 43200 ignore-no-cache override-expire override-lastmod
refresh_pattern mediafire.com\/images.*\.(jp(e?g|e|2)|tiff?|bmp|gif|png)    43200 999999% 43200 reload-into-ims override-expire ignore-private
refresh_pattern ^http:\/\/images|pics|thumbs[0-9]\.                     43200 999999% 43200 reload-into-ims ignore-no-cache  ignore-reload override-expire
refresh_pattern ^http:\/\/www.onemanga.com.*\/                          43200 999999% 43200 reload-into-ims ignore-no-cache  ignore-reload override-expire
refresh_pattern ^http://v\.okezone\.com/get_video\/([a-zA-Z0-9]) 43200 999999% 43200 override-expire ignore-reload ignore-no-cache  ignore-private ignore-auth override-lastmod  negative-ttl=10080

#images facebook
refresh_pattern -i \.facebook.com.*\.(jpg|png|gif)                      129600 999999% 129600 ignore-reload override-expire ignore-no-cache
refresh_pattern -i \.fbcdn.net.*\.(jpg|gif|png|swf|mp3)                 129600 999999% 129600 ignore-reload override-expire ignore-no-cache
refresh_pattern  static\.ak\.fbcdn\.net*\.(jpg|gif|png)                 129600 999999% 129600 ignore-reload override-expire ignore-no-cache
refresh_pattern ^http:\/\/profile\.ak\.fbcdn.net*\.(jpg|gif|png)        129600 999999% 129600 ignore-reload override-expire ignore-no-cache

#All File
refresh_pattern -i \.(3gp|7z|ace|asx|bin|deb|divx|dvr-ms|ram|rpm|exe|inc|cab|qt)       43200 999999% 43200 ignore-no-cache   override-expire override-lastmod reload-into-ims
refresh_pattern -i \.(rar|jar|gz|tgz|bz2|iso|m1v|m2(v|p)|mo(d|v)|arj|lha|lzh|zip|tar)  43200 999999% 43200 ignore-no-cache   override-expire override-lastmod reload-into-ims
refresh_pattern -i \.(jp(e?g|e|2)|gif|pn[pg]|bm?|tiff?|ico|swf|dat|ad|txt|dll)         43200 999999% 43200 ignore-no-cache   override-expire override-lastmod reload-into-ims
refresh_pattern -i \.(avi|ac4|mp(e?g|a|e|1|2|3|4)|mk(a|v)|ms(i|u|p)|og(x|v|a|g)|rm|r(a|p)m|snd|vob) 43200 999999% 43200 ignore-no-cache   override-expire override-lastmod reload-into-ims
refresh_pattern -i \.(pp(t?x)|s|t)|pdf|rtf|wax|wm(a|v)|wmx|wpl|cb(r|z|t)|xl(s?x)|do(c?x)|flv|x-flv) 43200 999999% 43200 ignore-no-cache   override-expire override-lastmod reload-into-ims

refresh_pattern -i (/cgi-bin/|\?)  0  0%  0
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern ^ftp:           10080   95% 43200 override-lastmod reload-into-ims
refresh_pattern .               1440    95% 43200 override-lastmod reload-into-ims
</pre></p>
<p>Save &amp; Exit.</p>
<p>Now create <strong>storeurl.pl</strong> which will be used to pull youtube video from cache.</p>
<p><strong>touch /etc/squid/storeurl.pl</strong><br />
<strong>chmod +x /etc/squid/storeurl.pl</strong></p>
<p>Now edit this file and paste the following contents.</p>
<p><strong>nano /etc/squid/storeurl.pl</strong></p>
<p><pre class="brush: plain;">#!/usr/bin/perl
# $Rev$
# by chudy_fernandez@yahoo.com
# Updates at http://wiki.squid-cache.org/ConfigExamples/DynamicContent/YouTube/Discussion
$|=1;
while (&lt;&gt;) {
@X = split;
$X[1] =~ s/&amp;sig=.*//;
$x = $X[0] . &quot; &quot;;
$_ = $X[1];
$u = $X[1];

# compatibility for old cached get_video?video_id
if (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com).*?(videoplayback\?id=.*?|video_id=.*?)\&amp;(.*?)/) {
$z = $2; $z =~ s/video_id=/get_video?video_id=/;
print $x . &quot;http://video-srv.youtube.com.SQUIDINTERNAL/&quot; . $z . &quot;\n&quot;;

# youtube HD itag=22
} elsif (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com).*?\&amp;(itag=22).*?\&amp;(id=[a-zA-Z0-9]*)/) {
print $x . &quot;http://video-srv.youtube.com.SQUIDINTERNAL/&quot; . $2 . &quot;&amp;&quot; . $3 . &quot;\n&quot;;

# youtube Normal screen always HD itag 35, Normal screen never HD itag 34, itag=18 &lt;--normal?
} elsif (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com).*?\&amp;(itag=[0-9]*).*?\&amp;(id=[a-zA-Z0-9]*)/) {
print $x . &quot;http://video-srv.youtube.com.SQUIDINTERNAL/&quot; . $3 . &quot;\n&quot;;

} elsif (m/^http:\/\/www\.google-analytics\.com\/__utm\.gif\?.*/) {
print $x . &quot;http://www.google-analytics.com/__utm.gif\n&quot;;

#Cache High Latency Ads
} elsif (m/^http:\/\/([a-z0-9.]*)(\.doubleclick\.net|\.quantserve\.com|\.googlesyndication\.com|yieldmanager|cpxinteractive)(.*)/) {
$y = $3;$z = $2;
for ($y) {
s/pixel;.*/pixel/;
s/activity;.*/activity/;
s/(imgad[^&amp;]*).*/\1/;
s/;ord=[?0-9]*//;
s/;&amp;timestamp=[0-9]*//;
s/[&amp;?]correlator=[0-9]*//;
s/&amp;cookie=[^&amp;]*//;
s/&amp;ga_hid=[^&amp;]*//;
s/&amp;ga_vid=[^&amp;]*//;
s/&amp;ga_sid=[^&amp;]*//;
# s/&amp;prev_slotnames=[^&amp;]*//
# s/&amp;u_his=[^&amp;]*//;
s/&amp;dt=[^&amp;]*//;
s/&amp;dtd=[^&amp;]*//;
s/&amp;lmt=[^&amp;]*//;
s/(&amp;alternate_ad_url=http%3A%2F%2F[^(%2F)]*)[^&amp;]*/\1/;
s/(&amp;url=http%3A%2F%2F[^(%2F)]*)[^&amp;]*/\1/;
s/(&amp;ref=http%3A%2F%2F[^(%2F)]*)[^&amp;]*/\1/;
s/(&amp;cookie=http%3A%2F%2F[^(%2F)]*)[^&amp;]*/\1/;
s/[;&amp;?]ord=[?0-9]*//;
s/[;&amp;]mpvid=[^&amp;;]*//;
s/&amp;xpc=[^&amp;]*//;
# yieldmanager
s/\?clickTag=[^&amp;]*//;
s/&amp;u=[^&amp;]*//;
s/&amp;slotname=[^&amp;]*//;
s/&amp;page_slots=[^&amp;]*//;
}
print $x . &quot;http://&quot; . $1 . $2 . $y . &quot;\n&quot;;

#cache high latency ads
} elsif (m/^http:\/\/(.*?)\/(ads)\?(.*?)/) {
print $x . &quot;http://&quot; . $1 . &quot;/&quot; . $2  . &quot;\n&quot;;

# spicific servers starts here....
} elsif (m/^http:\/\/(www\.ziddu\.com.*\.[^\/]{3,4})\/(.*?)/) {
print $x . &quot;http://&quot; . $1 . &quot;\n&quot;;

#cdn, varialble 1st path
} elsif (($u =~ /filehippo/) &amp;&amp; (m/^http:\/\/(.*?)\.(.*?)\/(.*?)\/(.*)\.([a-z0-9]{3,4})(\?.*)?/)) {
@y = ($1,$2,$4,$5);
$y[0] =~ s/[a-z0-9]{2,5}/cdn./;
print $x . &quot;http://&quot; . $y[0] . $y[1] . &quot;/&quot; . $y[2] . &quot;.&quot; . $y[3] . &quot;\n&quot;;

#rapidshare
} elsif (($u =~ /rapidshare/) &amp;&amp; (m/^http:\/\/(([A-Za-z]+[0-9-.]+)*?)([a-z]*\.[^\/]{3}\/[a-z]*\/[0-9]*)\/(.*?)\/([^\/\?\&amp;]{4,})$/)) {
print $x . &quot;http://cdn.&quot; . $3 . &quot;/SQUIDINTERNAL/&quot; . $5 . &quot;\n&quot;;

} elsif (($u =~ /maxporn/) &amp;&amp; (m/^http:\/\/([^\/]*?)\/(.*?)\/([^\/]*?)(\?.*)?$/)) {
print $x . &quot;http://&quot; . $1 . &quot;/SQUIDINTERNAL/&quot; . $3 . &quot;\n&quot;;

#like porn hub variables url and center part of the path, filename etention 3 or 4 with or without ? at the end
} elsif (($u =~ /tube8|pornhub|xvideos/) &amp;&amp; (m/^http:\/\/(([A-Za-z]+[0-9-.]+)*?)\.([a-z]*[0-9]?\.[^\/]{3}\/[a-z]*)(.*?)((\/[a-z]*)?(\/[^\/]*){4}\.[^\/\?]{3,4})(\?.*)?$/)) {
print $x . &quot;http://cdn.&quot; . $3 . $5 . &quot;\n&quot;;
#...spicific servers end here.

#photos-X.ak.fbcdn.net where X a-z
} elsif (m/^http:\/\/photos-[a-z].ak.fbcdn.net\/(.*)/) {
print $x . &quot;http://photos.ak.fbcdn.net/&quot; . $1  . &quot;\n&quot;;

#general purpose for cdn servers. add above your specific servers.
} elsif (m/^http:\/\/([0-9.]*?)\/\/(.*?)\.(.*)\?(.*?)/) {
print $x . &quot;http://squid-cdn-url//&quot; . $2  . &quot;.&quot; . $3 . &quot;\n&quot;;

#for yimg.com doubled
} elsif (m/^http:\/\/(.*?)\.yimg\.com\/(.*?)\.yimg\.com\/(.*?)\?(.*)/) {
print $x . &quot;http://cdn.yimg.com/&quot;  . $3 . &quot;\n&quot;;

#for yimg.com with &amp;sig=
} elsif (m/^http:\/\/(.*?)\.yimg\.com\/(.*)/) {
@y = ($1,$2);
$y[0] =~ s/[a-z]+[0-9]+/cdn/;
$y[1] =~ s/&amp;sig=.*//;
print $x . &quot;http://&quot; . $y[0] . &quot;.yimg.com/&quot;  . $y[1] . &quot;\n&quot;;

#generic http://variable.domain.com/path/filename.&quot;ext&quot; or &quot;exte&quot; with or withour &quot;?&quot;
} elsif (m/^http:\/\/(.*)([^\.\-]*?\..*?)\/(.*)\.([^\/\?\&amp;]{3,4})(\?.*)?$/) {
@y = ($1,$2,$3,$4);
$y[0] =~ s/(([a-zA-A-]+[0-9-]+)|(.*cdn.*)|(.*cache.*))/cdn/;
print $x . &quot;http://&quot; . $y[0] . $y[1] . &quot;/&quot; . $y[2] . &quot;.&quot; . $y[3] . &quot;\n&quot;;

# generic http://variable.domain.com/...
} elsif (m/^http:\/\/(([A-Za-z]+[0-9-]+)*?|.*cdn.*|.*cache.*)\.(.*?)\.(.*?)\/(.*)$/) {
print $x . &quot;http://cdn.&quot; . $3 . &quot;.&quot; . $4 . &quot;/&quot; . $5 .  &quot;\n&quot;;

# spicific extention that ends with ?
} elsif (m/^http:\/\/(.*?)\/(.*?)\.(jp(e?g|e|2)|gif|png|tiff?|bmp|ico|flv|on2)\?(.*)/) {
print $x . &quot;http://&quot; . $1 . &quot;/&quot; . $2  . &quot;.&quot; . $3 . &quot;\n&quot;;

# all that ends with ;
} elsif (m/^http:\/\/(.*?)\/(.*?)\;(.*)/) {
print $x . &quot;http://&quot; . $1 . &quot;/&quot; . $2  . &quot;\n&quot;;

} else {
print $x . $_ . &quot;\n&quot;;
}
}

</pre></p>
<p><strong>Save</strong> &amp; <strong>Exit</strong>.</p>
<p>Now create <strong>cache dir</strong> and assign proper permission to proxy user</p>
<p><strong>mkdir /cache1</strong><br />
<strong>chown proxy:proxy /cache1</strong><br />
<strong> chmod -R  777 /cache1</strong></p>
<p>Now  initialize squid cache directories by</p>
<p><strong>squid -z</strong></p>
<p>You should see Following message</p>
<p><strong>Creating Swap Directories</strong></p>
<p>After this, start SQUID service by</p>
<p><strong>service squid start</strong></p>
<p>Now Test your youtube video, and test it again and you will see the cache hit in squid logs, you can view them by</p>
<p><strong>tail -f /var/log/squid/access.log | grep HIT</strong></p>
<p>More information can be found at</p>
<p><strong>http://aacable.wordpress.com/tag/aacable-howto-cache-youtube/</strong></p>
<br />Filed under: <a href='http://aacable.wordpress.com/category/uncategorized/'>Uncategorized</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aacable.wordpress.com/1810/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aacable.wordpress.com/1810/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aacable.wordpress.com/1810/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aacable.wordpress.com/1810/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aacable.wordpress.com/1810/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aacable.wordpress.com/1810/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aacable.wordpress.com/1810/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aacable.wordpress.com/1810/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aacable.wordpress.com/1810/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aacable.wordpress.com/1810/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aacable.wordpress.com/1810/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aacable.wordpress.com/1810/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aacable.wordpress.com/1810/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aacable.wordpress.com/1810/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aacable.wordpress.com&amp;blog=10450829&amp;post=1810&amp;subd=aacable&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aacable.wordpress.com/2012/01/19/youtube-caching-with-squid-2-7-using-storeurl-pl/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<georss:point>24.851000 67.008300</georss:point>
		<geo:lat>24.851000</geo:lat>
		<geo:long>67.008300</geo:long>
		<media:content url="http://1.gravatar.com/avatar/b78d8775aa603cf6f5db83b6370e1692?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">zaib</media:title>
		</media:content>
	</item>
		<item>
		<title>Howto Recover Mikrotik ADMIN account Forgotten Password</title>
		<link>http://aacable.wordpress.com/2012/01/14/howto-recover-mikrotik-admin-account-forgotten-password/</link>
		<comments>http://aacable.wordpress.com/2012/01/14/howto-recover-mikrotik-admin-account-forgotten-password/#comments</comments>
		<pubDate>Sat, 14 Jan 2012 07:24:38 +0000</pubDate>
		<dc:creator>Syed Jahanzaib / Pinochio~:)</dc:creator>
				<category><![CDATA[Mikrotik Related]]></category>
		<category><![CDATA[forgotten password recovery]]></category>
		<category><![CDATA[mikrotik admin password recovery]]></category>
		<category><![CDATA[mikrotik forgotten password]]></category>
		<category><![CDATA[mikrotik password recovery]]></category>
		<category><![CDATA[mikrotik routerboard password recovery]]></category>

		<guid isPermaLink="false">http://aacable.wordpress.com/?p=1787</guid>
		<description><![CDATA[According to information on Mikrotik WIKI and forums, it is not possible to recover the passwords without loosing configuration. However following are few methods to recover it. 1# Recover password from BACKUP file using a website http://mikrotikpasswordrecovery.com/ 2# Recover password from BACKUP file using Linux LIVE CD 3# Recover password by mounting Mikrotik Hard disk [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aacable.wordpress.com&amp;blog=10450829&amp;post=1787&amp;subd=aacable&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;"><a href="http://aacable.files.wordpress.com/2012/01/lock1.jpg"><img title="lock" src="http://aacable.files.wordpress.com/2012/01/lock1.jpg?w=191&#038;h=206" alt="" width="191" height="206" /></a></p>
<p>According to information on <strong>Mikrotik</strong> <strong>WIKI</strong> and forums, it is not possible to recover the passwords without loosing configuration.<br />
However following are few methods to recover it.</p>
<p><strong>1# Recover password from BACKUP file using a website http://mikrotikpasswordrecovery.com/</strong></p>
<p><strong>2# Recover password from BACKUP file using Linux LIVE CD<br />
</strong></p>
<p><strong>3# Recover password by mounting Mikrotik Hard disk in Linux LIVE CD  and do recovery</strong></p>
<h2><span style="color:#0000ff;"><strong>1# Recover password from BACKUP file using a website http://mikrotikpasswordrecovery.com/</strong></span></h2>
<p>You can easily recover your forgotten password if you have BACKUP file.<br />
Backup file is done by following command.</p>
<p><pre class="brush: plain;">/system backup save name=zaibmikrotik</pre></p>
<p>Open Following web site.<br />
<a title="Mikrotik Password Recovery Site - Syed Jahanzaib" href="http://mikrotikpasswordrecovery.com/default.aspx" target="_blank">http://mikrotikpasswordrecovery.com/default.aspx</a></p>
<p>Click on <strong>Browse</strong>, and select your backup file,<br />
Now click on &#8221; <strong>Shows Passwords</strong> &#8220;</p>
<p>It will show you your Password in few seconds. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<span style="text-decoration:underline;"><em>As shown in the image below . . .</em></span></p>
<p><a href="http://aacable.files.wordpress.com/2012/01/mikrotik-passwd-recovery-web-site.png"><img title="mikrotik passwd recovery web site" src="http://aacable.files.wordpress.com/2012/01/mikrotik-passwd-recovery-web-site.png?w=608&#038;h=675" alt="" width="608" height="675" /></a></p>
<p><span style="color:#ff00ff;">Simple enough ?? <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </span></p>
<h2><strong>2# Recover password from BACKUP file using Linux</strong></h2>
<p>Login to your Ubuntu / Linux Box,<br />
Download <strong>mikrotik password recovery tool</strong> and compile it by following commands,</p>
<p><pre class="brush: plain;">mkdir /temp
cd /temp
wget http://manio.skyboo.net/mikrotik/mtpass-0.7.tar.bz2
tar jxvf mtpass-0.7.tar.bz2
cd mtpass-0.7
make</pre></p>
<p>Now copy your Mikrotik Backup File to /<strong>temp</strong> folder ( Either using WEBMIN File Manager,  via USB or any other method you like)<br />
Now Issue the following command</p>
<p><pre class="brush: plain;"> ./mtpass /temp/zaibmikrotik.backup</pre></p>
<p>It will show you all account passwords in few seconds.<br />
<span style="text-decoration:underline;"><em>As shown in the image below . . .</em></span></p>
<p><a href="http://aacable.files.wordpress.com/2012/01/mtpass-passwd-tool.png"><img title="mtpass-passwd-tool" src="http://aacable.files.wordpress.com/2012/01/mtpass-passwd-tool.png?w=725&#038;h=394" alt="" width="725" height="394" /></a></p>
<h2><strong>3# Recover password of x86 PC Version </strong></h2>
<p>Boot from <strong>Ubuntu LIVE CD</strong><br />
(I used Ubuntu 9.1 Desktop CD in this example, you can download it from following link.</p>
<p><pre class="brush: plain;">http://old-releases.ubuntu.com/releases/karmic/ubuntu-9.10-desktop-i386.iso</pre></p>
<p>Select &#8220;<strong>Try Ubuntu</strong>&#8220;<br />
<span style="text-decoration:underline;"><em>As Shown in the image below . . .</em></span></p>
<p><a href="http://aacable.files.wordpress.com/2012/01/mikrotik-pc-ver-passwd-recovery-1.png"><img title="mikrotik-PC-Ver-passwd-recovery-1" src="http://aacable.files.wordpress.com/2012/01/mikrotik-pc-ver-passwd-recovery-1.png?w=360&#038;h=234" alt="" width="360" height="234" /></a></p>
<p>After you see Desktop, Open <strong>TERMINAL</strong> from <strong>APPLICATION &gt; ACCESSORIES &gt; TERMINAL</strong></p>
<p>Now change to root user by<br />
<strong>sudo su</strong></p>
<p>Now check your partitions by issuing<br />
<strong>fdisk -l</strong></p>
<p>you will see something like below image.</p>
<p><a href="http://aacable.files.wordpress.com/2012/01/mounting-mt-disk.png"><img title="mounting-mt-disk" src="http://aacable.files.wordpress.com/2012/01/mounting-mt-disk.png?w=510&#038;h=192" alt="" width="510" height="192" /></a></p>
<p>You partition can be different, use your judgment to see what partition mt is in, either by mounting it one by one.</p>
<p>Now mount it any folder , for example</p>
<p><strong>mkdir /temp</strong><br />
<strong> mount -t auto /dev/sda2 /temp</strong></p>
<p>Now check its content by<strong> ls /temp</strong> and you will something like below image</p>
<p>*********************************************************<a href="http://aacable.files.wordpress.com/2012/01/ls-temp-nova1.png"><img title="ls temp-nova" src="http://aacable.files.wordpress.com/2012/01/ls-temp-nova1.png?w=604&#038;h=68" alt="" width="604" height="68" /></a></p>
<p><strong>*********************************************************</strong></p>
<p>Now Copy the ‘<strong>mikrotik password file</strong>’, (in newer <strong>ROS</strong> , it is located in <strong>/rw/store/user.dat</strong>) to <strong>USB</strong> flash drive, It will be used to decode the password.<br />
(The <strong>USB</strong> flash drive should be ‘plug and play’ in <strong>Ubuntu</strong> <strong>Live</strong>. Just plug it in usb port and it will appear on desktop in few seconds , OR you can also copy it your network pc via configuring interface lan card accordingly)<br />
(Note: In older <strong>ROS</strong> it is<strong> /nova/store/user.dat</strong>)</p>
<p>Now shutdown live cd.</p>
<p>then Boot from your Ubuntu box, and use the <span style="color:#ff0000;"><strong>Method # 2</strong></span> , described earlier in this article to decode password using <strong>mtpass tool</strong>  from this file.</p>
<p>Copy the <strong>user.dat</strong> file where you have decompressed <strong>mt password tool</strong> . e.g /temp , now use the mt pass tool to recover password from this file.</p>
<p><strong>./mtpass user.dat</strong></p>
<p>and you will see your admin password.</p>
<p><a href="http://aacable.files.wordpress.com/2012/01/mt-pc-ver-password.png"><img title="mt-pc-ver-password" src="http://aacable.files.wordpress.com/2012/01/mt-pc-ver-password.png?w=643&#038;h=275" alt="" width="643" height="275" /></a></p>
<p>As Now you have seen the password now, you can login into mikrotik pc router  with your Old Password <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong><br />
</strong></p>
<p>If your architecture is <strong>ROUTERBOARD</strong> RB series, Please follow the below guide.</p>
<p><strong>http://manio.skyboo.net/mikrotik/</strong></p>
<p>Also it&#8217;s possible for you to <span style="text-decoration:underline;">send</span> an <strong>SMS</strong> to your router, tell it to run a script (parameters supported) and the router can even respond, as it also supports SMS sending! More here:<br />
<a href="http://wiki.mikrotik.com/wiki/Sms">http://wiki.mikrotik.com/wiki/Sms</a></p>
<p>You can setup an script just in case you forgot your password , and via sending sms, it can reset it to default. or send you return the new/original password.</p>
<p>Regard&#8217;s<br />
<strong>SYED JAHANZAIB</p>
<p>http://aacable.wordpress.com</p>
<p></strong></p>
<br />Filed under: <a href='http://aacable.wordpress.com/category/mikrotik-related/'>Mikrotik Related</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aacable.wordpress.com/1787/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aacable.wordpress.com/1787/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aacable.wordpress.com/1787/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aacable.wordpress.com/1787/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aacable.wordpress.com/1787/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aacable.wordpress.com/1787/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aacable.wordpress.com/1787/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aacable.wordpress.com/1787/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aacable.wordpress.com/1787/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aacable.wordpress.com/1787/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aacable.wordpress.com/1787/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aacable.wordpress.com/1787/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aacable.wordpress.com/1787/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aacable.wordpress.com/1787/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aacable.wordpress.com&amp;blog=10450829&amp;post=1787&amp;subd=aacable&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aacable.wordpress.com/2012/01/14/howto-recover-mikrotik-admin-account-forgotten-password/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<georss:point>24.851000 67.008300</georss:point>
		<geo:lat>24.851000</geo:lat>
		<geo:long>67.008300</geo:long>
		<media:content url="http://1.gravatar.com/avatar/b78d8775aa603cf6f5db83b6370e1692?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">zaib</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/lock1.jpg" medium="image">
			<media:title type="html">lock</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/mikrotik-passwd-recovery-web-site.png" medium="image">
			<media:title type="html">mikrotik passwd recovery web site</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/mtpass-passwd-tool.png" medium="image">
			<media:title type="html">mtpass-passwd-tool</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/mikrotik-pc-ver-passwd-recovery-1.png" medium="image">
			<media:title type="html">mikrotik-PC-Ver-passwd-recovery-1</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/mounting-mt-disk.png" medium="image">
			<media:title type="html">mounting-mt-disk</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/ls-temp-nova1.png" medium="image">
			<media:title type="html">ls temp-nova</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/mt-pc-ver-password.png" medium="image">
			<media:title type="html">mt-pc-ver-password</media:title>
		</media:content>
	</item>
		<item>
		<title>Howto Cache Youtube with SQUID / LUSCA and bypass Cached Videos from Mikrotik Queue</title>
		<link>http://aacable.wordpress.com/2012/01/11/howto-cache-youtube-with-squid-lusca-and-bypass-cached-videos-from-mikrotik-queue/</link>
		<comments>http://aacable.wordpress.com/2012/01/11/howto-cache-youtube-with-squid-lusca-and-bypass-cached-videos-from-mikrotik-queue/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 07:31:38 +0000</pubDate>
		<dc:creator>Syed Jahanzaib / Pinochio~:)</dc:creator>
				<category><![CDATA[Linux Related]]></category>
		<category><![CDATA[Mikrotik Related]]></category>
		<category><![CDATA[aacable howto cache youtube]]></category>
		<category><![CDATA[cache youtube with squid]]></category>
		<category><![CDATA[cache youtube with squid lusca]]></category>
		<category><![CDATA[howto cache youtube]]></category>
		<category><![CDATA[Youtube]]></category>
		<category><![CDATA[youtube pakistan]]></category>

		<guid isPermaLink="false">http://aacable.wordpress.com/?p=1759</guid>
		<description><![CDATA[What is LUSCA/SQUID ? LUSCA is an advance version or Fork of  SQUID 2. The Lusca project aims to fix the shortcomings in the Squid-2. It also supports a variety of clustering protocols. By Using it, you can cache some dynamic contents that you previously can&#8217;t do with the squid. For example #  Video Cachingi.e [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aacable.wordpress.com&amp;blog=10450829&amp;post=1759&amp;subd=aacable&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://aacable.files.wordpress.com/2012/01/ubuntu-logo1.png"><img class="aligncenter" title="ubuntu-logo" src="http://aacable.files.wordpress.com/2012/01/ubuntu-logo1.png?w=193&#038;h=198" alt="" width="193" height="198" /></a></p>
<h2 style="text-align:center;"><span style="color:#0000ff;"><strong>What is LUSCA/SQUID ?</strong></span></h2>
<p style="text-align:left;"><strong>LUSCA</strong> is an advance version or Fork of  <strong>SQUID 2</strong>. The <strong>Lusca</strong> project aims to fix the shortcomings in the Squid-2. It also supports a variety of clustering protocols. By Using it, you can cache some dynamic contents that you previously can&#8217;t do with the squid.</p>
<p style="text-align:left;">For example<br />
#  Video Cachingi.e Youtube / tube etc . . .<br />
#  Windows / Linux Updates / Anti-virus , Anti-Malware i.e. Avira/ Avast / MBAM etc . . .<br />
#  Well known sites i.e. facebook / google / yahoo etch. etch.<br />
#  Download caching mp3&#8242;s/mpeg/avi etc . . .</p>
<h2 style="text-align:center;"><span style="text-decoration:underline;"><span style="color:#0000ff;text-decoration:underline;"><strong>Advantages of Youtube Caching   !!!</strong></span></span></h2>
<p>In most part of the world, bandwidth is very expensive, therefore it is (in some scenarios) very useful to Cache Youtube videos or any other flash videos, so if one of user downloads video / flash file , why again the same user or other user <strong>can&#8217;t</strong> download the same file from the CACHE, why he sucking the internet pipe for same content again n again<strong>?</strong><br />
Peoples on same LAN ,sometimes watch similar videos. If I put some youtube video link on on <strong>FACEBOOK</strong>, <strong>TWITTER</strong> or likewise , and all my friend will  watch that video and that particular video gets viewed many times in few hours. Usually the videos are shared over facebook or other social networking sites so the chances are high for multiple hits per popular videos for my lan users / friends.</p>
<p>This is the reason why I wrote this article. I have implemented <strong>Ubuntu</strong> with <strong>LUSCA</strong>/<strong> Squid</strong> on it and its working great, but to achieve some results you need to have <span style="text-decoration:underline;"><strong>some TB</strong></span> of storage drives in your proxy machine.</p>
<h2 style="text-align:center;"><span style="text-decoration:underline;"><span style="color:#ff0000;text-decoration:underline;"><strong>Disadvantages of Youtube Caching   !!!</strong></span></span></h2>
<p>The chances, that another user will watch the same video, is really slim. if I search for something specific on youtube, i get more then hundreds of search results for same video. What is the chance that another user will search for the same thing, and will click on the same link / result? Youtube hosts more than 10 million videos. Which is too much to cache anyway. You need lot of space to cache videos. Also accordingly you will be needing ultra modern fast hardware with <strong>tons of RAM</strong> to handle such kind of cache giant. anyhow Try it</p>
<p>We will divide this article in following Sections</p>
<p><span style="color:#0000ff;"><strong>1#  Installing SQUID / LUSCA in UBUNTU</strong></span><br />
<span style="color:#0000ff;"><strong>2#  Setting up SQUID / LUSCA Configuration files </strong></span><br />
<span style="color:#0000ff;"><strong>3#  Performing some Tests, testing your Cache HIT<br />
4# Using ZPH TOS to deliver cached contents to clients vai mikrotik at full LAN speed, Bypassing the User Queue for cached contents.<br />
</strong></span></p>
<h2><strong>1#  Installing SQUID / LUSCA in UBUNTU</strong></h2>
<p>I assume your ubuntu box have 2 interfaces configured, one for LAN and second for WAN. You have internet sharing already configured. Now moving on to <strong>LUSCA</strong> / <strong>SQUID</strong> installation.</p>
<p>Download <strong>LUSCA</strong> source and compile it using,</p>
<p><pre class="brush: plain;">mkdir /temp
cd /temp
wget http://lusca-cache.googlecode.com/files/LUSCA_HEAD-r14809.tar.gz
tar xzvf LUSCA_HEAD-r14809.tar.gz</pre></p>
<p>Update &amp; Install some tools for ubuntu</p>
<p><pre class="brush: plain;">sudo apt-get update
sudo apt-get install gcc build-essential sharutils ccze libzip-dev automake1.9
cd LUSCA_HEAD-r14809</pre></p>
<p>Now compile LUSCA with following options</p>
<p><pre class="brush: plain;">./configure '--prefix=/usr/local/squid' '--enable-removal-policies=heap,lru' '--disable-dependency-tracking' '--disable-arp-acl' '--disable-cache-digests' '--enable-cachemgr-hostname=localhost' '--disable-delay-pools' '--enable-epoll' '--enable-external-acl-helpers=ip_user' '--disable-ident-lookups' '--enable-linux-netfilter' '--disable-referer-log' '--enable-removal-policies=heap,lru' '--disable-snmp' '--disable-ssl' '--enable-storeio=aufs,null,coss' '--disable-useragent-log' '--disable-wccpv2' '--with-aio' '--with-maxfd=1048576' '--with-dl' '--with-pthreads' 'build_alias=i686-redhat-linux-gnu' 'host_alias=i686-redhat-linux-gnu' 'targe_alias=i686-redhat-linux-gnu''--enable-truncate' '--disable-unlinkd' '--with-large-files' '--disable-htcp'
sudo make all
sudo make install</pre></p>
<p>All of <strong>Lusca/Squid</strong> configuration files can be found at <strong></strong></p>
<p>/usr/local/squid/etc/<br />
and squid executable can be found at<br />
<strong>/usr/local/squid/sbin/</strong></p>
<p>Now We will edit <strong>squid</strong>.<strong>conf</strong> file to make it customize according to our requirements by . . .</p>
<p><pre class="brush: plain;">nano /usr/local/squid/etc/squid.conf</pre></p>
<p><span style="color:#ff0000;"><strong>Delete</strong></span> all previously lines , and paste the following lines.</p>
<p>Remember following <strong>squid</strong>.<strong>conf</strong> is not very neat and clean , you will find many un necessary junk entries in it, but as I didn&#8217;t had time to clean them all, so you may clean them as per your targets and goals.</p>
<p><pre class="brush: plain;">
# SQUID / LUSCS TEST CONFIG FILE
# Email: aacable@hotmail.com
# Web  : http://aacable.wordpress.com

# PORT and Transparent Option
http_port 8080 transparent
server_http11 on
icp_port 0

# Cache Directory , modify it according to your system.
# but first create directory in root by mkdir /cache1
# and then issue this command  chown proxy:proxy /cache1
# [for ubuntu user is proxy, in Fedora user is SQUID]
# I have set 10 GB for caching reserved just for caching ,
# adjust it according to your need.
# My recommendation is to have one cache_dir per drive. zzz

#store_dir_select_algorithm round-robin
cache_dir aufs /cache1 10000 16 256
cache_replacement_policy heap LFUDA
memory_replacement_policy heap GDSF

# If you want to enable DATE time n SQUID Logs,use following
emulate_httpd_log on
logformat squid %tl %6tr %&gt;a %Ss/%03Hs %&lt;st %rm %ru %un %Sh/%&lt;A %mt
log_fqdn off

# How much days to keep users access web logs
# You need to rotate your log files with a cron job. For example:
# 0 0 * * * /usr/local/squid/bin/squid -k rotate
logfile_rotate 14
debug_options ALL,1
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log

#I used DNSAMSQ service for fast dns resolving
#so install by using &quot;apt-get install dnsmasq&quot; first
dns_nameservers 127.0.0.1 192.168.2.4 192.168.2.3
ftp_user anonymous@
ftp_list_width 32
ftp_passive on
ftp_sanitycheck on

#ACL Section
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563 # https, snews
acl SSL_ports port 873 # rsync
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl Safe_ports port 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access allow all
http_reply_access allow all
icp_access allow all

#==========================
# Administrative Parameters
#==========================

# I used UBUNTU so user is proxy, in FEDORA you may use use squid
cache_effective_user proxy
cache_effective_group proxy
cache_mgr aacable@hotmail.com
visible_hostname proxy.aacable.net
unique_hostname aacable@hotmail.com

#=============
# ACCELERATOR
#=============
half_closed_clients off
quick_abort_min 0 KB
quick_abort_max 0 KB
quick_abort_pct 100
vary_ignore_expire on
reload_into_ims on
pipeline_prefetch on
range_offset_limit 512 KB
read_timeout 30 minutes
log_fqdn off
memory_pools off

# If you want to hide your proxy machine from being detected at various site use following
via off

#============================================
# OPTIONS WHICH AFFECT THE CACHE SIZE / zaib
#============================================
# If you have 4GB memory in Squid box, we will use formula of 1/3
# You can adjust it according to your need. IF squid is taking too much of RAM
# Then decrease it to 128 MB or even less.
cache_mem 128 MB
minimum_object_size 0 bytes
maximum_object_size 700 MB
maximum_object_size_in_memory 128 KB

#============================================================$
# SNMP , if you want to generate graphs for SQUID via MRTG
#============================================================$
#acl snmppublic snmp_community gl
#snmp_port 3401
#snmp_access allow snmppublic all
#snmp_access allow all

#============================================================
# ZPH , To enable cache content to be delivered at full lan speed,
# To bypass the queue at MT.
#============================================================
tcp_outgoing_tos 0x30 all
zph_mode tos
zph_local 0x30
zph_parent 0
zph_option 136

# Caching Youtube
acl videocache_allow_url url_regex -i \.youtube\.com\/get_video\?
acl videocache_allow_url url_regex -i \.youtube\.com\/videoplayback \.youtube\.com\/videoplay \.youtube\.com\/get_video\?
acl videocache_allow_url url_regex -i \.youtube\.[a-z][a-z]\/videoplayback \.youtube\.[a-z][a-z]\/videoplay \.youtube\.[a-z][a-z]\/get_video\?
acl videocache_allow_url url_regex -i \.googlevideo\.com\/videoplayback \.googlevideo\.com\/videoplay \.googlevideo\.com\/get_video\?
acl videocache_allow_url url_regex -i \.google\.com\/videoplayback \.google\.com\/videoplay \.google\.com\/get_video\?
acl videocache_allow_url url_regex -i \.google\.[a-z][a-z]\/videoplayback \.google\.[a-z][a-z]\/videoplay \.google\.[a-z][a-z]\/get_video\?
acl videocache_allow_url url_regex -i proxy[a-z0-9\-][a-z0-9][a-z0-9][a-z0-9]?\.dailymotion\.com\/
acl videocache_allow_url url_regex -i vid\.akm\.dailymotion\.com\/
acl videocache_allow_url url_regex -i [a-z0-9][0-9a-z][0-9a-z]?[0-9a-z]?[0-9a-z]?\.xtube\.com\/(.*)flv
acl videocache_allow_url url_regex -i \.vimeo\.com\/(.*)\.(flv|mp4)
acl videocache_allow_url url_regex -i va\.wrzuta\.pl\/wa[0-9][0-9][0-9][0-9]?
acl videocache_allow_url url_regex -i \.youporn\.com\/(.*)\.flv
acl videocache_allow_url url_regex -i \.msn\.com\.edgesuite\.net\/(.*)\.flv
acl videocache_allow_url url_regex -i \.tube8\.com\/(.*)\.(flv|3gp)
acl videocache_allow_url url_regex -i \.mais\.uol\.com\.br\/(.*)\.flv
acl videocache_allow_url url_regex -i \.blip\.tv\/(.*)\.(flv|avi|mov|mp3|m4v|mp4|wmv|rm|ram|m4v)
acl videocache_allow_url url_regex -i \.apniisp\.com\/(.*)\.(flv|avi|mov|mp3|m4v|mp4|wmv|rm|ram|m4v)
acl videocache_allow_url url_regex -i \.break\.com\/(.*)\.(flv|mp4)
acl videocache_allow_url url_regex -i redtube\.com\/(.*)\.flv
acl videocache_allow_dom dstdomain .mccont.com .metacafe.com .cdn.dailymotion.com
acl videocache_deny_dom  dstdomain .download.youporn.com .static.blip.tv
acl dontrewrite url_regex redbot\.org \.php
acl getmethod method GET

storeurl_access deny dontrewrite
storeurl_access deny !getmethod
storeurl_access deny videocache_deny_dom
storeurl_access allow videocache_allow_url
storeurl_access allow videocache_allow_dom
storeurl_access deny all

storeurl_rewrite_program /etc/squid/storeurl.pl
storeurl_rewrite_children 7
storeurl_rewrite_concurrency 10

acl store_rewrite_list urlpath_regex -i \/(get_video\?|videodownload\?|videoplayback.*id)
acl store_rewrite_list urlpath_regex -i \.flv$ \.mp3$ \.mp4$ \.swf$ \
storeurl_access allow store_rewrite_list
storeurl_access deny all

refresh_pattern -i \.flv$ 5259487 99999999% 5259487  override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-no-store ignore-private ignore-auth store-stale negative-ttl=0
refresh_pattern -i \.mp3$ 5259487 99999999% 5259487  override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-no-store ignore-private ignore-auth store-stale negative-ttl=0
refresh_pattern -i \.mp4$ 5259487 99999999% 5259487  override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-no-store ignore-private ignore-auth store-stale negative-ttl=0
refresh_pattern -i \.swf$ 5259487 99999999% 5259487  override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-no-store ignore-private ignore-auth store-stale negative-ttl=0
refresh_pattern -i \.gif$ 5259487 99999999% 5259487  override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-no-store ignore-private ignore-auth store-stale negative-ttl=0
refresh_pattern -i \.jpg$ 5259487 99999999% 5259487  override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-no-store ignore-private ignore-auth store-stale negative-ttl=0
refresh_pattern -i \.jpeg$ 5259487 99999999% 5259487  override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-no-store ignore-private  ignore-auth store-stale negative-ttl=0
refresh_pattern -i \.exe$ 5259487 99999999% 5259487  override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-no-store ignore-private  ignore-auth store-stale negative-ttl=0

# 1 year = 525600 mins, 1 month = 43200 mins, 1 day = 1440
refresh_pattern (get_video\?|videoplayback\?|videodownload\?|\.flv?)    43200 999999% 43200 ignore-no-cache ignore-no-store ignore-private override-expire override-lastmod reload-into-ims store-stale
refresh_pattern (get_video\?|videoplayback\?id|videoplayback.*id|videodownload\?|\.flv?)    43200 999999% 43200 ignore-no-cache ignore-no-store ignore-private override-expire override-lastmod reload-into-ims store-stale
refresh_pattern \.(ico|video-stats) 43200 999999% 43200 override-expire ignore-reload ignore-no-cache ignore-no-store ignore-private ignore-auth override-lastmod  negative-ttl=10080 store-stale
refresh_pattern \.etology\?                                     43200 999999% 43200 override-expire ignore-reload ignore-no-cache store-stale
refresh_pattern galleries\.video(\?|sz)                         43200 999999% 43200 override-expire ignore-reload ignore-no-cache store-stale
refresh_pattern brazzers\?                                      43200 999999% 43200 override-expire ignore-reload ignore-no-cache store-stale
refresh_pattern \.adtology\?                                    43200 999999% 43200 override-expire ignore-reload ignore-no-cache store-stale
refresh_pattern ^.*(utm\.gif|ads\?|rmxads\.com|ad\.z5x\.net|bh\.contextweb\.com|bstats\.adbrite\.com|a1\.interclick\.com|ad\.trafficmp\.com|ads\.cubics\.com|ad\.xtendmedia\.com|\.googlesyndication\.com|advertising\.com|yieldmanager|game-advertising\.com|pixel\.quantserve\.com|adperium\.com|doubleclick\.net|adserving\.cpxinteractive\.com|syndication\.com|media.fastclick.net).* 43200 20% 43200 ignore-no-cache ignore-no-store ignore-private override-expire ignore-reload ignore-auth  store-stale negative-ttl=40320 max-stale=10
refresh_pattern ^.*safebrowsing.*google  43200 999999% 43200 override-expire ignore-reload ignore-no-cache ignore-private ignore-auth  negative-ttl=10080 store-stale
refresh_pattern ^http://((cbk|mt|khm|mlt)[0-9]?)\.google\.co(m|\.uk)    43200 999999% 43200 override-expire ignore-reload ignore-private store-stale negative-ttl=10080
refresh_pattern ytimg\.com.*\.jpg                                       43200 999999% 43200 override-expire ignore-reload store-stale
refresh_pattern images\.friendster\.com.*\.(png|gif)                    43200 999999% 43200 override-expire ignore-reload store-stale
refresh_pattern garena\.com                                             43200 999999% 43200 override-expire reload-into-ims store-stale
refresh_pattern photobucket.*\.(jp(e?g|e|2)|tiff?|bmp|gif|png)          43200 999999% 43200 override-expire ignore-reload store-stale
refresh_pattern vid\.akm\.dailymotion\.com.*\.on2\?                     43200 999999% 43200 ignore-no-cache override-expire override-lastmod store-stale
refresh_pattern mediafire.com\/images.*\.(jp(e?g|e|2)|tiff?|bmp|gif|png)    43200 999999% 43200 reload-into-ims override-expire ignore-private    store-stale
refresh_pattern ^http:\/\/images|pics|thumbs[0-9]\.                     43200 999999% 43200 reload-into-ims ignore-no-cache ignore-no-store ignore-reload override-expire store-stale
refresh_pattern ^http:\/\/www.onemanga.com.*\/                          43200 999999% 43200 reload-into-ims ignore-no-cache ignore-no-store ignore-reload override-expire store-stale
refresh_pattern ^http://v\.okezone\.com/get_video\/([a-zA-Z0-9]) 43200 999999% 43200 override-expire ignore-reload ignore-no-cache ignore-no-store ignore-private ignore-auth override-lastmod  negative-ttl=10080 store-stale

#images facebook
refresh_pattern -i \.facebook.com.*\.(jpg|png|gif)                      129600 999999% 129600 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale
refresh_pattern -i \.fbcdn.net.*\.(jpg|gif|png|swf|mp3)                 129600 999999% 129600 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale
refresh_pattern  static\.ak\.fbcdn\.net*\.(jpg|gif|png)                 129600 999999% 129600 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale
refresh_pattern ^http:\/\/profile\.ak\.fbcdn.net*\.(jpg|gif|png)        129600 999999% 129600 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale

#All File
refresh_pattern -i \.(3gp|7z|ace|asx|bin|deb|divx|dvr-ms|ram|rpm|exe|inc|cab|qt)       43200 999999% 43200 ignore-no-cache ignore-no-store  override-expire override-lastmod reload-into-ims store-stale
refresh_pattern -i \.(rar|jar|gz|tgz|bz2|iso|m1v|m2(v|p)|mo(d|v)|arj|lha|lzh|zip|tar)  43200 999999% 43200 ignore-no-cache ignore-no-store  override-expire override-lastmod reload-into-ims store-stale
refresh_pattern -i \.(jp(e?g|e|2)|gif|pn[pg]|bm?|tiff?|ico|swf|dat|ad|txt|dll)         43200 999999% 43200 ignore-no-cache ignore-no-store  override-expire override-lastmod reload-into-ims store-stale
refresh_pattern -i \.(avi|ac4|mp(e?g|a|e|1|2|3|4)|mk(a|v)|ms(i|u|p)|og(x|v|a|g)|rm|r(a|p)m|snd|vob) 43200 999999% 43200 ignore-no-cache ignore-no-store  override-expire override-lastmod reload-into-ims store-stale
refresh_pattern -i \.(pp(t?x)|s|t)|pdf|rtf|wax|wm(a|v)|wmx|wpl|cb(r|z|t)|xl(s?x)|do(c?x)|flv|x-flv) 43200 999999% 43200 ignore-no-cache ignore-no-store  override-expire override-lastmod reload-into-ims store-stale

refresh_pattern -i (/cgi-bin/|\?)  0  0%  0
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern ^ftp:           10080   95% 43200 override-lastmod reload-into-ims store-stale
refresh_pattern .               1440    95% 43200 override-lastmod reload-into-ims store-stale
</pre></p>
<p>Now create <strong>cache</strong> <strong>dir</strong> and <strong>logs</strong> <strong>files</strong> , and assign them necessary permissions.</p>
<p><pre class="brush: plain;">
mkdir /cache1
chown proxy:proxy /cache1
mkdir /var/log/squid
chmod 777 /var/log/squid
</pre></p>
<p>Now initialize <strong>cache</strong> <strong>dir</strong> by</p>
<p><pre class="brush: plain;">/usr/local/squid/sbin/squid -z</pre></p>
<p><span style="text-decoration:underline;"><span style="color:#ff0000;text-decoration:underline;"><strong>SOTEURL.PL</strong></span></span><br />
Now We have to create an important file name<strong> storeurl.pl</strong> , which is very important and actually it does the<br />
main job to pull video from cache.</p>
<p><pre class="brush: plain;">mkdir /etc/squid
touch /etc/squid/storeurl.pl
chmod +x /etc/squid/storeurl.pl
nano /etc/squid/storeurl.pl</pre></p>
<p>Now paste the following lines, then Save and exit.</p>
<p><pre class="brush: plain;">#!/usr/bin/perl
# $Rev$
# by chudy_fernandez@yahoo.com
# Updates at http://wiki.squid-cache.org/ConfigExamples/DynamicContent/YouTube/Discussion
$|=1;
while (&lt;&gt;) {
@X = split;
$X[1] =~ s/&amp;sig=.*//;
$x = $X[0] . &quot; &quot;;
$_ = $X[1];
$u = $X[1];

# compatibility for old cached get_video?video_id
if (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com).*?(videoplayback\?id=.*?|video_id=.*?)\&amp;(.*?)/) {
$z = $2; $z =~ s/video_id=/get_video?video_id=/;
print $x . &quot;http://video-srv.youtube.com.SQUIDINTERNAL/&quot; . $z . &quot;\n&quot;;

# youtube HD itag=22
} elsif (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com).*?\&amp;(itag=22).*?\&amp;(id=[a-zA-Z0-9]*)/) {
print $x . &quot;http://video-srv.youtube.com.SQUIDINTERNAL/&quot; . $2 . &quot;&amp;&quot; . $3 . &quot;\n&quot;;

# youtube Normal screen always HD itag 35, Normal screen never HD itag 34, itag=18 &lt;--normal?
} elsif (m/^http:\/\/([0-9.]{4}|.*\.youtube\.com|.*\.googlevideo\.com|.*\.video\.google\.com).*?\&amp;(itag=[0-9]*).*?\&amp;(id=[a-zA-Z0-9]*)/) {
print $x . &quot;http://video-srv.youtube.com.SQUIDINTERNAL/&quot; . $3 . &quot;\n&quot;;

} elsif (m/^http:\/\/www\.google-analytics\.com\/__utm\.gif\?.*/) {
print $x . &quot;http://www.google-analytics.com/__utm.gif\n&quot;;

#Cache High Latency Ads
} elsif (m/^http:\/\/([a-z0-9.]*)(\.doubleclick\.net|\.quantserve\.com|\.googlesyndication\.com|yieldmanager|cpxinteractive)(.*)/) {
$y = $3;$z = $2;
for ($y) {
s/pixel;.*/pixel/;
s/activity;.*/activity/;
s/(imgad[^&amp;]*).*/\1/;
s/;ord=[?0-9]*//;
s/;&amp;timestamp=[0-9]*//;
s/[&amp;?]correlator=[0-9]*//;
s/&amp;cookie=[^&amp;]*//;
s/&amp;ga_hid=[^&amp;]*//;
s/&amp;ga_vid=[^&amp;]*//;
s/&amp;ga_sid=[^&amp;]*//;
# s/&amp;prev_slotnames=[^&amp;]*//
# s/&amp;u_his=[^&amp;]*//;
s/&amp;dt=[^&amp;]*//;
s/&amp;dtd=[^&amp;]*//;
s/&amp;lmt=[^&amp;]*//;
s/(&amp;alternate_ad_url=http%3A%2F%2F[^(%2F)]*)[^&amp;]*/\1/;
s/(&amp;url=http%3A%2F%2F[^(%2F)]*)[^&amp;]*/\1/;
s/(&amp;ref=http%3A%2F%2F[^(%2F)]*)[^&amp;]*/\1/;
s/(&amp;cookie=http%3A%2F%2F[^(%2F)]*)[^&amp;]*/\1/;
s/[;&amp;?]ord=[?0-9]*//;
s/[;&amp;]mpvid=[^&amp;;]*//;
s/&amp;xpc=[^&amp;]*//;
# yieldmanager
s/\?clickTag=[^&amp;]*//;
s/&amp;u=[^&amp;]*//;
s/&amp;slotname=[^&amp;]*//;
s/&amp;page_slots=[^&amp;]*//;
}
print $x . &quot;http://&quot; . $1 . $2 . $y . &quot;\n&quot;;

#cache high latency ads
} elsif (m/^http:\/\/(.*?)\/(ads)\?(.*?)/) {
print $x . &quot;http://&quot; . $1 . &quot;/&quot; . $2  . &quot;\n&quot;;

# spicific servers starts here....
} elsif (m/^http:\/\/(www\.ziddu\.com.*\.[^\/]{3,4})\/(.*?)/) {
print $x . &quot;http://&quot; . $1 . &quot;\n&quot;;

#cdn, varialble 1st path
} elsif (($u =~ /filehippo/) &amp;&amp; (m/^http:\/\/(.*?)\.(.*?)\/(.*?)\/(.*)\.([a-z0-9]{3,4})(\?.*)?/)) {
@y = ($1,$2,$4,$5);
$y[0] =~ s/[a-z0-9]{2,5}/cdn./;
print $x . &quot;http://&quot; . $y[0] . $y[1] . &quot;/&quot; . $y[2] . &quot;.&quot; . $y[3] . &quot;\n&quot;;

#rapidshare
} elsif (($u =~ /rapidshare/) &amp;&amp; (m/^http:\/\/(([A-Za-z]+[0-9-.]+)*?)([a-z]*\.[^\/]{3}\/[a-z]*\/[0-9]*)\/(.*?)\/([^\/\?\&amp;]{4,})$/)) {
print $x . &quot;http://cdn.&quot; . $3 . &quot;/SQUIDINTERNAL/&quot; . $5 . &quot;\n&quot;;

} elsif (($u =~ /maxporn/) &amp;&amp; (m/^http:\/\/([^\/]*?)\/(.*?)\/([^\/]*?)(\?.*)?$/)) {
print $x . &quot;http://&quot; . $1 . &quot;/SQUIDINTERNAL/&quot; . $3 . &quot;\n&quot;;

#like porn hub variables url and center part of the path, filename etention 3 or 4 with or without ? at the end
} elsif (($u =~ /tube8|pornhub|xvideos/) &amp;&amp; (m/^http:\/\/(([A-Za-z]+[0-9-.]+)*?)\.([a-z]*[0-9]?\.[^\/]{3}\/[a-z]*)(.*?)((\/[a-z]*)?(\/[^\/]*){4}\.[^\/\?]{3,4})(\?.*)?$/)) {
print $x . &quot;http://cdn.&quot; . $3 . $5 . &quot;\n&quot;;
#...spicific servers end here.

#photos-X.ak.fbcdn.net where X a-z
} elsif (m/^http:\/\/photos-[a-z].ak.fbcdn.net\/(.*)/) {
print $x . &quot;http://photos.ak.fbcdn.net/&quot; . $1  . &quot;\n&quot;;

#general purpose for cdn servers. add above your specific servers.
} elsif (m/^http:\/\/([0-9.]*?)\/\/(.*?)\.(.*)\?(.*?)/) {
print $x . &quot;http://squid-cdn-url//&quot; . $2  . &quot;.&quot; . $3 . &quot;\n&quot;;

#for yimg.com doubled
} elsif (m/^http:\/\/(.*?)\.yimg\.com\/(.*?)\.yimg\.com\/(.*?)\?(.*)/) {
print $x . &quot;http://cdn.yimg.com/&quot;  . $3 . &quot;\n&quot;;

#for yimg.com with &amp;sig=
} elsif (m/^http:\/\/(.*?)\.yimg\.com\/(.*)/) {
@y = ($1,$2);
$y[0] =~ s/[a-z]+[0-9]+/cdn/;
$y[1] =~ s/&amp;sig=.*//;
print $x . &quot;http://&quot; . $y[0] . &quot;.yimg.com/&quot;  . $y[1] . &quot;\n&quot;;

#generic http://variable.domain.com/path/filename.&quot;ext&quot; or &quot;exte&quot; with or withour &quot;?&quot;
} elsif (m/^http:\/\/(.*)([^\.\-]*?\..*?)\/(.*)\.([^\/\?\&amp;]{3,4})(\?.*)?$/) {
@y = ($1,$2,$3,$4);
$y[0] =~ s/(([a-zA-A-]+[0-9-]+)|(.*cdn.*)|(.*cache.*))/cdn/;
print $x . &quot;http://&quot; . $y[0] . $y[1] . &quot;/&quot; . $y[2] . &quot;.&quot; . $y[3] . &quot;\n&quot;;

# generic http://variable.domain.com/...
} elsif (m/^http:\/\/(([A-Za-z]+[0-9-]+)*?|.*cdn.*|.*cache.*)\.(.*?)\.(.*?)\/(.*)$/) {
print $x . &quot;http://cdn.&quot; . $3 . &quot;.&quot; . $4 . &quot;/&quot; . $5 .  &quot;\n&quot;;

# spicific extention that ends with ?
} elsif (m/^http:\/\/(.*?)\/(.*?)\.(jp(e?g|e|2)|gif|png|tiff?|bmp|ico|flv|on2)\?(.*)/) {
print $x . &quot;http://&quot; . $1 . &quot;/&quot; . $2  . &quot;.&quot; . $3 . &quot;\n&quot;;

# all that ends with ;
} elsif (m/^http:\/\/(.*?)\/(.*?)\;(.*)/) {
print $x . &quot;http://&quot; . $1 . &quot;/&quot; . $2  . &quot;\n&quot;;

} else {
print $x . $_ . &quot;\n&quot;;
}
}
</pre></p>
<p>Now start <strong>SQUID</strong>Server by</p>
<p><pre class="brush: plain;">/usr/local/squid/sbin/squid</pre></p>
<p><strong>TIP</strong>:<br />
To start <strong>SQUID</strong> Server in <strong>Debug</strong> mode, to check any erros, use<br />
<code></code></p>
<p><pre class="brush: plain;">/usr/local/squid/sbin/squid -d1</pre></p>
<h2></h2>
<h2><span style="color:#0000ff;"><strong>3# TESTING YOUR CACHE HIT</strong></span></h2>
<p>It&#8217;s time to hit the <strong>ROAD</strong> and do performing some tests.</p>
<h2><strong>YOUTUBE TEST</strong></h2>
<p>Open <strong>Youtube</strong> and watch any Video. After complete download, Check the same video from another client. You will notice that it download very quickly , you can watch the bar moving fast.<br />
<span style="text-decoration:underline;"><em>As Shown in the example Below . . .</em></span></p>
<p><a href="http://aacable.files.wordpress.com/2012/01/youtube-video_cache_hit_bar.png"><img title="Youtube-Video_cache_HIT_BAR" src="http://aacable.files.wordpress.com/2012/01/youtube-video_cache_hit_bar.png?w=657&#038;h=518" alt="" width="657" height="518" /></a></p>
<p>monitor the <strong>Squid</strong> <strong>access</strong> <strong>LOG</strong>. You will see cache hit <strong>TPC</strong>_<strong>HIT</strong> for this video.<br />
<span style="text-decoration:underline;"><em>As Shown in the example Below . . .</em></span></p>
<p><a href="http://aacable.files.wordpress.com/2012/01/youtube-video_cache_hit-2nd-client.png"><img title="Youtube-Video_cache_HIT-2nd-client" src="http://aacable.files.wordpress.com/2012/01/youtube-video_cache_hit-2nd-client.png?w=963&#038;h=182" alt="" width="963" height="182" /></a></p>
<h2><strong>MUSIC DOWNLOAD TEST</strong></h2>
<p>Now test any music download. For example Go to<br />
<strong>http://www.apniisp.com/songs/indian-movie-songs/ladies-vs-ricky-bahl/690/1.html<br />
</strong><span style="text-decoration:underline;"><em>As Shown in the example Below . . .<strong><br />
</strong></em></span></p>
<p><a href="http://aacable.files.wordpress.com/2012/01/apniisp-download.png"><img title="apniisp download" src="http://aacable.files.wordpress.com/2012/01/apniisp-download.png?w=468&#038;h=205" alt="" width="468" height="205" /></a></p>
<p>and download any song , after its downloaded, goto 2nd client pc, and download the same song, and monitor the <strong>Squid</strong> <strong>access</strong> <strong>LOG</strong>. You will see cache hit <strong>TPC</strong>_<strong>HIT</strong> for this song.</p>
<p><span style="text-decoration:underline;"><em>As Shown in the example Below . . .</em></span></p>
<p><a href="http://aacable.files.wordpress.com/2012/01/apniisp_log_cache_hit.png"><img title="apniisp_log_cache_hit" src="http://aacable.files.wordpress.com/2012/01/apniisp_log_cache_hit.png?w=960&#038;h=108" alt="" width="960" height="108" /></a></p>
<h2><strong><strong>EXE / PROGRAM  DOWNLOAD TEST</strong></strong></h2>
<p>Now test any <strong>.exe</strong> file download.<br />
Goto <strong>http://www.rarlabs.com</strong> and download any package. After Download completes, goto <strong>2nd</strong> <strong>client</strong> <strong>pc</strong> , and download the same file again. and monitor the <strong>Squid access LOG</strong>. You will see cache hit <strong>TPC</strong>_<strong>HIT</strong> for this file.</p>
<p><span style="text-decoration:underline;"><em>As Shown in the example Below . . .</em></span></p>
<p><a href="http://aacable.files.wordpress.com/2012/01/winrar-download-page.png"><img title="winrar-download-page" src="http://aacable.files.wordpress.com/2012/01/winrar-download-page.png?w=529&#038;h=273" alt="" width="529" height="273" /></a></p>
<p><strong>SQUID LOGS</strong></p>
<p><a href="http://aacable.files.wordpress.com/2012/01/exe_file_cache_hit.png"><img title="exe_file_cache_HIT" src="http://aacable.files.wordpress.com/2012/01/exe_file_cache_hit.png?w=644&#038;h=149" alt="" width="644" height="149" /></a></p>
<p>More to come , , ,</p>
<p>Regard&#8217;s<br />
<strong>SYED JAHANZAIB</p>
<p>http://aacable.wordpress.com</p>
<p></strong></p>
<br />Filed under: <a href='http://aacable.wordpress.com/category/linux-related/'>Linux Related</a>, <a href='http://aacable.wordpress.com/category/mikrotik-related/'>Mikrotik Related</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aacable.wordpress.com/1759/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aacable.wordpress.com/1759/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aacable.wordpress.com/1759/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aacable.wordpress.com/1759/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aacable.wordpress.com/1759/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aacable.wordpress.com/1759/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aacable.wordpress.com/1759/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aacable.wordpress.com/1759/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aacable.wordpress.com/1759/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aacable.wordpress.com/1759/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aacable.wordpress.com/1759/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aacable.wordpress.com/1759/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aacable.wordpress.com/1759/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aacable.wordpress.com/1759/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aacable.wordpress.com&amp;blog=10450829&amp;post=1759&amp;subd=aacable&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aacable.wordpress.com/2012/01/11/howto-cache-youtube-with-squid-lusca-and-bypass-cached-videos-from-mikrotik-queue/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		<georss:point>24.851000 67.008300</georss:point>
		<geo:lat>24.851000</geo:lat>
		<geo:long>67.008300</geo:long>
		<media:content url="http://1.gravatar.com/avatar/b78d8775aa603cf6f5db83b6370e1692?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">zaib</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/ubuntu-logo1.png" medium="image">
			<media:title type="html">ubuntu-logo</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/youtube-video_cache_hit_bar.png" medium="image">
			<media:title type="html">Youtube-Video_cache_HIT_BAR</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/youtube-video_cache_hit-2nd-client.png" medium="image">
			<media:title type="html">Youtube-Video_cache_HIT-2nd-client</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/apniisp-download.png" medium="image">
			<media:title type="html">apniisp download</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/apniisp_log_cache_hit.png" medium="image">
			<media:title type="html">apniisp_log_cache_hit</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/winrar-download-page.png" medium="image">
			<media:title type="html">winrar-download-page</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/exe_file_cache_hit.png" medium="image">
			<media:title type="html">exe_file_cache_HIT</media:title>
		</media:content>
	</item>
		<item>
		<title>Using WEBMIN to create Forward/Reverse ZONE in BIND / UBUNTU</title>
		<link>http://aacable.wordpress.com/2012/01/09/using-webmin-to-create-forwardreverse-zone-in-ubuntu/</link>
		<comments>http://aacable.wordpress.com/2012/01/09/using-webmin-to-create-forwardreverse-zone-in-ubuntu/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 08:08:01 +0000</pubDate>
		<dc:creator>Syed Jahanzaib / Pinochio~:)</dc:creator>
				<category><![CDATA[Linux Related]]></category>
		<category><![CDATA[*** Can't find server name]]></category>
		<category><![CDATA[aacable bind]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[bind with webmin]]></category>
		<category><![CDATA[bind9]]></category>
		<category><![CDATA[FORWARD ZONE]]></category>
		<category><![CDATA[Howto install BIND in UBUNTU via webmin]]></category>
		<category><![CDATA[Install WEBMIN Using DKPKG]]></category>
		<category><![CDATA[Install WEBMIN Using the Webmin APT repository]]></category>
		<category><![CDATA[INSTALLING BIND via webmin]]></category>
		<category><![CDATA[nslookup]]></category>
		<category><![CDATA[REVERSE ZONE]]></category>
		<category><![CDATA[ubuntu howto install bind]]></category>

		<guid isPermaLink="false">http://aacable.wordpress.com/?p=1733</guid>
		<description><![CDATA[For some people , installing and configuring BIND for local network using CLI can be a typical task. However it can be done easily in few steps via using GUI base controller known as WEBMIN which is a very nice and powergul GUI to manage  almost every service of your Linux box via your browser. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aacable.wordpress.com&amp;blog=10450829&amp;post=1733&amp;subd=aacable&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;"><a href="http://aacable.files.wordpress.com/2012/01/ubuntu-logo.png"><img title="ubuntu-logo" src="http://aacable.files.wordpress.com/2012/01/ubuntu-logo.png?w=453&#038;h=400" alt="" width="453" height="400" /></a></p>
<p>For some people , installing and configuring <strong>BIND</strong> for local network using <strong>CLI</strong> can be a typical task. However it can be done easily in few steps via using <strong>GUI</strong> base controller known as <strong>WEBMIN</strong> which is a very nice and powergul <strong>GUI</strong> to manage  almost every <strong>service</strong> of your <strong>Linux</strong> box via your <strong>browser</strong>.</p>
<p>In this article we will discuss following topics.</p>
<p><strong><span style="color:#0000ff;">1# Install WEBMIN (Using 2 different methods)</span></strong><br />
<strong><span style="color:#0000ff;">2# Install BIND (Using WEBMIN)</span></strong><br />
<strong><span style="color:#0000ff;">3# Create Forward Zone for our domain</span></strong><br />
<strong><span style="color:#0000ff;">4# Create Reverse Zones for our domain</span></strong><br />
<strong><span style="color:#0000ff;">5# Test Zones via nslookup</span></strong></p>
<h2>1# Install WEBMIN Using DKPKG</h2>
<p>First we need to install <strong>webmin</strong>. you can either download it from <strong>webmin</strong> site and install it by issuing following commands.</p>
<p><pre class="brush: plain;">wget http://prdownloads.sourceforge.net/webadmin/webmin-1.570_all.deb
# then run the following command
dpkg --install webmin_1.570_all.deb</pre></p>
<p>You should now be able to login to Webmin via your browser using the URL <a href="http://localhost:10000/"></p>
<p>http://192.168.2.1:10000/</a></p>
<p>OR<br />
<a href="http://localhost:10000/">https://192.168.2.1:10000/</a></p>
<p>IF the above method fails to install <strong>WEBMIN</strong> on your system, Follow this alternate method to install it.</p>
<h2>1# Install WEBMIN Using the Webmin APT repository [Alternate Way]</h2>
<p>install and update Webmin via APT, edit the <strong><tt>/etc/apt/sources.list</tt></strong> file by using the following command</p>
<p><strong>nano <tt>/etc/apt/sources.list</tt></strong><br />
and add these lines at end.</p>
<p><pre class="brush: plain;">deb http://download.webmin.com/download/repository sarge contrib
deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib</pre></p>
<p>Now Save the file and exit.</p>
<p>You should also fetch and install my GPG key with which the repository is signed, with the commands :</p>
<p><pre class="brush: plain;">cd /root
wget http://www.webmin.com/jcameron-key.asc
apt-key add jcameron-key.asc</pre></p>
<p>You will now be able to install with the commands :</p>
<p><pre class="brush: plain;">apt-get update
apt-get install webmin</pre></p>
<p>For more information on other distribution installation , please visit <strong>http://www.webmin.com</strong></p>
<h2>2# INSTALLING BIND via webmin.</h2>
<p>After logging in to <strong>Webmin</strong> ,<br />
Goto <strong>SERVERS</strong> &gt; <strong>BIND DNS Server</strong></p>
<p>It will inform you that <strong>bind</strong> is not installed, install it via click on &#8220;<em>Click Here</em>&#8220;<br />
<span style="text-decoration:underline;"><em>As shown in the image below . . .</em></span></p>
<p><a href="http://aacable.files.wordpress.com/2012/01/add-bind-via-webmin.png"><img title="add-bind-via-webmin" src="http://aacable.files.wordpress.com/2012/01/add-bind-via-webmin.png?w=836&#038;h=249" alt="" width="836" height="249" /></a></p>
<p><a href="http://aacable.files.wordpress.com/2012/01/add-bind-via-webmin.png"><br />
</a>Now it will download BIND and install it. Make sure your Linux box is connected with the internet. After installation it will show you something<br />
<em>As shown in the image below . . .</em></p>
<p><a href="http://aacable.files.wordpress.com/2012/01/bind-installation-completes.png" target="_blank"><img title="bind-installation-completes" src="http://aacable.files.wordpress.com/2012/01/bind-installation-completes.png?w=569&#038;h=489" alt="" width="569" height="489" /></a></p>
<p>Now that <strong>BIND</strong> is installed, We have to create <strong>Forward</strong> and <strong>Reverse</strong> zones for our new domain. In last we will check it by doing <strong>nslookup</strong>.</p>
<h2>3# Adding FORWARD ZONE for our domain</h2>
<p>Goto <strong>SERVERS</strong> &gt; <strong>BIND DNS Server</strong></p>
<p>Now you will see <strong>BIND DNS SERVER</strong> and various icons.<br />
First we have to create forward zone,<br />
Click on <strong>CREATE MASTER ZONE</strong><br />
<em>As shown in the image below . . .</em></p>
<p><a href="http://aacable.files.wordpress.com/2012/01/create-master-zone.png"><img class="aligncenter size-full wp-image-1736" title="create-master-zone" src="http://aacable.files.wordpress.com/2012/01/create-master-zone.png" alt="" width="760" height="588" /></a></p>
<p>&gt; in <strong>Zone Type</strong> : Select <strong>Forward</strong><br />
&gt; in <strong>Domain name / Network</strong> , type the name you want to configure your domain with.<br />
<em>As shown in the image below . . .</em></p>
<p><a href="http://aacable.files.wordpress.com/2012/01/create-master-zone-2.png"><img title="create-master-zone-2" src="http://aacable.files.wordpress.com/2012/01/create-master-zone-2.png?w=580&#038;h=344" alt="" width="580" height="344" /></a></p>
<h2>4# Adding REVERSE ZONE for our domain</h2>
<p>Goto <strong>SERVERS</strong> &gt; <strong>BIND DNS Server<br />
</strong>Now we have to create<strong> Reverse Zone</strong>,<br />
Click on <strong>CREATE MASTER ZONE<br />
</strong><em>As shown in the image below . . .</em></p>
<p><strong><a href="http://aacable.files.wordpress.com/2012/01/create-master-reversezone-2.png" target="_blank"><img title="create-master-reversezone-2" src="http://aacable.files.wordpress.com/2012/01/create-master-reversezone-2.png?w=669&#038;h=332" alt="" width="669" height="332" /></a></strong></p>
<p>Now on your <strong>TOP RIGHT</strong>, click on <strong>APPLY CHANGES</strong>.</p>
<p><a href="http://aacable.files.wordpress.com/2012/01/apply-configuration.png"><img title="apply-configuration" src="http://aacable.files.wordpress.com/2012/01/apply-configuration.png?w=785&#038;h=72" alt="" width="785" height="72" /></a></p>
<h2><strong>5# TESTING YOUR NEWLY CREATED ZONE using nslookup<br />
</strong></h2>
<p>Login to your client pc, open command prompt and issue the following command.<br />
<strong>nslookup &#8211; 192.168.2.1</strong></p>
<p>now type zaib.com and you should see your Linux box ip in response.<br />
<em>As shown in the image below . . .</em></p>
<p><a href="http://aacable.files.wordpress.com/2012/01/nslookup.png" target="_blank"><img title="nslookup" src="http://aacable.files.wordpress.com/2012/01/nslookup.png?w=582&#038;h=182" alt="" width="582" height="182" /></a></p>
<p>All Done. Now you can careate hosts record / MX record etc using GUI base DNS MANAGEMENT CONSOLE <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2><strong>BIND TIP&#8217;S N TRICKS</strong></h2>
<h2><strong>*** Can&#8217;t find server name *** ERROR<br />
</strong></h2>
<p>When you do NSLOOKUP, you see an error something like.<br />
<strong>*** Can&#8217;t find server name for address 192.168.2.1: Non-existent domain, Default ServeR: UnKnown</strong></p>
<p>To solve this , jsut add reverse lookup entry for your domain.<br />
Goto <strong>SERVERS</strong> &gt; <strong>BIND DNS Server</strong><br />
Open your newly created zone in <strong>EXISTING DNS ZONES</strong><br />
<em>As shown in the image below . . .</em></p>
<p><a href="http://aacable.files.wordpress.com/2012/01/open-zaib-com.png"><img title="open-zaib.com" src="http://aacable.files.wordpress.com/2012/01/open-zaib-com.png?w=299&#038;h=251" alt="" width="299" height="251" /></a></p>
<p>After opening <strong>zaib.com</strong> or your zone,<br />
Click on <strong>ADDRESS</strong><br />
Here create an address<br />
<strong>In Name: </strong>zaib.com<br />
<strong>In Address: </strong>192.168.2.1<br />
Click on CREATE and then APPLY CHANGES.<br />
Now from you client side, try to do <strong>nslookup</strong>, and this time you wont see any error.</p>
<h2><strong><strong>Create MX record for MAIL Server <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
</strong></strong></h2>
<p><strong>Creating an MX Record (Mail Exchange Record).</strong></p>
<p>1) Open your zone , for example zaib.com ,<br />
Click on<strong> Mail Server</strong><br />
2) For the <strong>name</strong>, type in the domain e.g <strong>zaib.com</strong><br />
3) For the <strong>mail</strong> <strong>server</strong>, type in <strong>zaib</strong>.<strong>com</strong><br />
4) Set the <strong>priority</strong> to what you like.. <strong>10</strong> is usually default.<br />
5) Click on <strong>SAVE</strong> and aplpy changes.</p>
<h2><strong>Make sure your Linux box have your BIND Server IP at top.</strong></h2>
<p>Edit your resolv.conf and set dns name server search order.</p>
<p><pre class="brush: plain;"># Generated by NetworkManager
search zaib.com
nameserver 127.0.0.1
nameserver 192.168.2.4</pre></p>
<h2><strong><strong>Adding Forwarding Entry (For resolving External Hosts)</strong></strong></h2>
<p>Goto <strong>SERVERS</strong> &gt;<strong> BIND DNS Server<br />
</strong>Click on <strong>Forwarding and Transfers<br />
</strong>In <strong>Servers to forward queries to</strong><strong>, </strong>type your ISP&#8217;s DNS Server IP<strong><br />
</strong><span style="text-decoration:underline;"><em>As shown in the image below . . .</em><strong></strong></span></p>
<p><a href="http://aacable.files.wordpress.com/2012/01/add-bind-forwarder.png"><img title="add-bind-forwarder" src="http://aacable.files.wordpress.com/2012/01/add-bind-forwarder.png?w=527&#038;h=365" alt="" width="527" height="365" /></a></p>
<p>Now when your client will do query , <strong>BIND</strong> will first check in <strong>zaib</strong>.<strong>com</strong>, if it doesn&#8217;t fin any entry, it will forward this query to <strong>ISP&#8217;</strong>S <strong>DNS</strong> Server.</p>
<p>Have Fun <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong> SYED JAHANZAIB</strong></p>
<br />Filed under: <a href='http://aacable.wordpress.com/category/linux-related/'>Linux Related</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aacable.wordpress.com/1733/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aacable.wordpress.com/1733/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aacable.wordpress.com/1733/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aacable.wordpress.com/1733/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aacable.wordpress.com/1733/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aacable.wordpress.com/1733/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aacable.wordpress.com/1733/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aacable.wordpress.com/1733/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aacable.wordpress.com/1733/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aacable.wordpress.com/1733/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aacable.wordpress.com/1733/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aacable.wordpress.com/1733/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aacable.wordpress.com/1733/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aacable.wordpress.com/1733/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aacable.wordpress.com&amp;blog=10450829&amp;post=1733&amp;subd=aacable&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aacable.wordpress.com/2012/01/09/using-webmin-to-create-forwardreverse-zone-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<georss:point>24.851000 67.008300</georss:point>
		<geo:lat>24.851000</geo:lat>
		<geo:long>67.008300</geo:long>
		<media:content url="http://1.gravatar.com/avatar/b78d8775aa603cf6f5db83b6370e1692?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">zaib</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/ubuntu-logo.png" medium="image">
			<media:title type="html">ubuntu-logo</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/add-bind-via-webmin.png" medium="image">
			<media:title type="html">add-bind-via-webmin</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/bind-installation-completes.png" medium="image">
			<media:title type="html">bind-installation-completes</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/create-master-zone.png" medium="image">
			<media:title type="html">create-master-zone</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/create-master-zone-2.png" medium="image">
			<media:title type="html">create-master-zone-2</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/create-master-reversezone-2.png" medium="image">
			<media:title type="html">create-master-reversezone-2</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/apply-configuration.png" medium="image">
			<media:title type="html">apply-configuration</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/nslookup.png" medium="image">
			<media:title type="html">nslookup</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/open-zaib-com.png" medium="image">
			<media:title type="html">open-zaib.com</media:title>
		</media:content>

		<media:content url="http://aacable.files.wordpress.com/2012/01/add-bind-forwarder.png" medium="image">
			<media:title type="html">add-bind-forwarder</media:title>
		</media:content>
	</item>
	</channel>
</rss>
