<?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/"
	>

<channel>
	<title>Sysbible</title>
	<atom:link href="http://sysbible.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://sysbible.org</link>
	<description>A paradise for Sysads. Hosted on Leanservers.</description>
	<lastBuildDate>Tue, 20 Mar 2012 16:07:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Implementing Apache&#8217;s force proxy flag for rewrite rules under NGINX</title>
		<link>http://sysbible.org/2010/08/02/implementing-apaches-force-proxy-flag-for-rewrite-rules-under-nginx/</link>
		<comments>http://sysbible.org/2010/08/02/implementing-apaches-force-proxy-flag-for-rewrite-rules-under-nginx/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 03:47:34 +0000</pubDate>
		<dc:creator>unai</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[web-serving]]></category>

		<guid isPermaLink="false">http://leanwired.com/sysbible/?p=291</guid>
		<description><![CDATA[NGINX&#8217;s default behavior for rewrite rules (at least up to version 0.7.65) is to redirect if the replacement part begins with &#8216;http://&#8217;. Let me quote some info from NGINX&#8217; wiki: rewrite syntax: rewrite regex replacement flag [...] If the replacement &#8230; <a href="http://sysbible.org/2010/08/02/implementing-apaches-force-proxy-flag-for-rewrite-rules-under-nginx/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>NGINX&#8217;s default behavior for rewrite rules (at least up to version 0.7.65) is to redirect if the replacement part begins with &#8216;http://&#8217;. Let me quote some info from <a href="http://wiki.nginx.org/NginxHttpRewriteModule">NGINX&#8217; wiki</a>:</p>
<blockquote>
<h2>rewrite</h2>
<p><strong>syntax:</strong> <em>rewrite regex replacement flag</em></p>
<p><em>[...]</em></p>
<p>If the replacement string begins with <code>http://</code> then the client will be redirected, and any further rewrite directives are terminated.</p></blockquote>
<p>It is important to take this into consideration while designing new rules because the behavior of the rule itself is bound to the place we are retrieving data from.</p>
<p>Apache does this differently since it offers a flag that can be set per rule which instructs the web server to just &#8220;proxy&#8221; the request (i.e. do not redirect, just get the response of that request in the background and send it back to the client). Taken from Apache&#8217;s site, this flag is:</p>
<blockquote><p>&#8216;<strong><code>proxy|P</code></strong>&#8216; (force <strong>p</strong>roxy)<br />
This flag forces the substitution part to be internally sent as a proxy request and immediately (rewrite processing stops here) put through the <a href="http://httpd.apache.org/docs/2.0/mod/mod_proxy.html">proxy module</a>. You must make sure that the substitution string is a valid URI (typically starting with <code>http://</code><em>hostname</em>) which can be handled by the Apache proxy module. If not, you will get an error from the proxy module. Use this flag to achieve a more powerful implementation of the <a href="http://httpd.apache.org/docs/2.0/mod/mod_proxy.html#proxypass">ProxyPass</a> directive, to map remote content into the namespace of the local server.</p>
<p>Note: <code><a href="http://httpd.apache.org/docs/2.0/mod/mod_proxy.html">mod_proxy</a></code> must be enabled in order to use this flag.</p></blockquote>
<p><strong>How to implement this under NGINX</strong></p>
<p>I have been able to get similar behavior under NGINX using &#8216;rewrite&#8217; and &#8216;proxy_pass&#8217; directives.</p>
<p>The following example implements a regular expression based rewrite rule serving content from domain2 to the client&#8217;s request on domain1.</p>
<pre class="crayon-plain-tag"><code>server {
  listen 1.2.3.4:80;
  server_name domain1.com;

  location / {
    rewrite ^/([0-9][0-9]/[0-9][0-9]/.+)$ /example/?t=$1 last;
    proxy_pass http://domain2.com;
  }
}</code></pre>
<p>Using that NGINX configuration, the client can request:</p>
<pre class="crayon-plain-tag"><code>http://domain1.com/12/34/test</code></pre>
<p>which will be proxied to:</p>
<pre class="crayon-plain-tag"><code>http://domain2.com/exanple?t=12/34/test/</code></pre>
<p>and served back to her &#8220;apparently&#8221; from http://domain1.com/12/34/test (i.e. there won&#8217;t be any URL redirection).</p>
]]></content:encoded>
			<wfw:commentRss>http://sysbible.org/2010/08/02/implementing-apaches-force-proxy-flag-for-rewrite-rules-under-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Revoking MySQL Permissions</title>
		<link>http://sysbible.org/2010/05/20/revoking-mysql-permissions/</link>
		<comments>http://sysbible.org/2010/05/20/revoking-mysql-permissions/#comments</comments>
		<pubDate>Thu, 20 May 2010 07:27:37 +0000</pubDate>
		<dc:creator>unai</dc:creator>
				<category><![CDATA[cookbook]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://sysbible.org/x/?p=247</guid>
		<description><![CDATA[Usage: mysql&#62; revoke PRIVILEGES [, GRANT OPTION] from 'USERNAME'@'SERVER'; mysql&#62; flush privileges; Example: mysql&#62; revoke all privileges, grant option from 'comsiteuatusr'@'10.135.7.114'; Query OK, 0 rows affected (0.00 sec) mysql&#62; flush privileges; Query OK, 0 rows affected (0.00 sec) See Also &#8230; <a href="http://sysbible.org/2010/05/20/revoking-mysql-permissions/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Usage:</p>
<pre class="crayon-plain-tag"><code>mysql&gt; revoke PRIVILEGES [, GRANT OPTION] from 'USERNAME'@'SERVER';
mysql&gt; flush privileges;</code></pre>
<p>Example:</p>
<pre class="crayon-plain-tag"><code>mysql&gt; revoke all privileges, grant option from 'comsiteuatusr'@'10.135.7.114';
Query OK, 0 rows affected (0.00 sec)</code></pre>
<pre class="crayon-plain-tag"><code>mysql&gt; flush privileges;
Query OK, 0 rows affected (0.00 sec)</code></pre>
<p><strong>See Also</strong></p>
<ul>
<li><a href="http://sysbible.org/x/2008/07/25/granting-mysql-permissions/">Granting MySQL Permissions</a></li>
<li><a href="http://www.java2s.com/Code/SQL/User-Permission/ShowPermission.htm">Show Permission</a></li>
<li><a href="http://www.acodedb.com/65/mysql-commands/">MySQL Commands</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://sysbible.org/2010/05/20/revoking-mysql-permissions/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to pass parameters to a PHP script executed through the command line</title>
		<link>http://sysbible.org/2010/01/28/how-to-pass-parameters-to-a-php-script-executed-through-the-command-line/</link>
		<comments>http://sysbible.org/2010/01/28/how-to-pass-parameters-to-a-php-script-executed-through-the-command-line/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 03:01:48 +0000</pubDate>
		<dc:creator>unai</dc:creator>
				<category><![CDATA[cookbook]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[command-line]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://sysbible.org/x/?p=242</guid>
		<description><![CDATA[The syntax to pass parameters to PHP scripts executed command line is:php script.php arg1 arg2 arg3 For more information: Control your scripts with command-line PHP PHP CLI: Sending parameters via command line]]></description>
			<content:encoded><![CDATA[<p>The syntax to pass parameters to PHP scripts executed command line is:</p><pre class="crayon-plain-tag"><code>php script.php arg1 arg2 arg3</code></pre><p>
For more information:</p>
<ul>
<li><a href="http://articles.techrepublic.com.com/5100-10878_11-5889263.html">Control your scripts with command-line PHP</a></li>
<li><a href="http://coding.derkeiler.com/Archive/PHP/comp.lang.php/2008-03/msg01635.html">PHP CLI: Sending parameters via command line</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://sysbible.org/2010/01/28/how-to-pass-parameters-to-a-php-script-executed-through-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick and dirty fix for VMware Linux guests loosing clock accuracy</title>
		<link>http://sysbible.org/2010/01/22/quick-and-dirty-fix-for-vmware-linux-guests-loosing-clock-accuracy/</link>
		<comments>http://sysbible.org/2010/01/22/quick-and-dirty-fix-for-vmware-linux-guests-loosing-clock-accuracy/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 03:45:28 +0000</pubDate>
		<dc:creator>unai</dc:creator>
				<category><![CDATA[cookbook]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://sysbible.org/x/?p=237</guid>
		<description><![CDATA[I covered on a previous post how to keep the clock synchronized for VMware Linux guest(s). Well this seems to not work at least for recent versions VMware Server 2 (i.e. the one with web based management console). For now &#8230; <a href="http://sysbible.org/2010/01/22/quick-and-dirty-fix-for-vmware-linux-guests-loosing-clock-accuracy/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I covered on a <a href="http://sysbible.org/x/2008/07/27/fixing-vmware-clock-synchronization-problems/">previous post</a> how to keep the clock synchronized for VMware Linux guest(s). Well this seems to not work at least for recent versions VMware Server 2 (i.e. the one with web based management console). For now the quick&amp; dirty solution I am using is putting a cron job that executes ntpdate pretty often&#8230;</p>
<p>My cron job looks like this:</p>
<pre class="crayon-plain-tag"><code>#
# Temporary fix for the time getting lost
#
0-59/10 * * * * /usr/sbin/ntpdate north-america.pool.ntp.org &gt; /dev/null 2&gt;1</code></pre>
<p>Yes, this fix requires to have NTPDATE installed (apt-get install ntpdate under Debian).</p>
]]></content:encoded>
			<wfw:commentRss>http://sysbible.org/2010/01/22/quick-and-dirty-fix-for-vmware-linux-guests-loosing-clock-accuracy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dumping a mysql database excluding one or several tables</title>
		<link>http://sysbible.org/2010/01/15/dumping-a-mysql-database-excluding-one-or-several-tables/</link>
		<comments>http://sysbible.org/2010/01/15/dumping-a-mysql-database-excluding-one-or-several-tables/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 06:42:11 +0000</pubDate>
		<dc:creator>unai</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://sysbible.org/x/?p=232</guid>
		<description><![CDATA[If we need to dump a MySQL database and want to exclude table(s) we should use the option: --ignore-table=db_name.tbl_name Do not dump the given table, which must be specified using both the database and table names. To ignore multiple tables, &#8230; <a href="http://sysbible.org/2010/01/15/dumping-a-mysql-database-excluding-one-or-several-tables/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If we need to dump a MySQL database and want to exclude table(s) we should use the option:</p>
<blockquote><p><a href="http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_ignore-table"><code>--ignore-table=<em><code>db_name.tbl_name</code></em></code></a></p>
<p>Do not dump the given table, which must be specified using             both the database and table names. To ignore multiple             tables, use this option multiple times. This option also can             be used to ignore views. <a href="http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html">Citation</a>.</p></blockquote>
<p>Example:</p><pre class="crayon-plain-tag"><code>mysqldump --ignore-table=cars.brands cars &gt; cars.dump</code></pre>
<p><strong>References</strong></p>
<ul>
<li><a href="http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html">mysqldump — A Database Backup Program</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://sysbible.org/2010/01/15/dumping-a-mysql-database-excluding-one-or-several-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

