<?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>S.G. Vulcan &#187; *nix</title>
	<atom:link href="http://www.sgvulcan.com/category/systems/nix/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sgvulcan.com</link>
	<description>Silviu&#039;s tech blog. Resources and informations about linux, windows, symbian systems, networks, reviews, microcontrollers, and more.</description>
	<lastBuildDate>Wed, 08 Feb 2012 09:39:01 +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>Adding pcntl_fork support on a cpanel server</title>
		<link>http://www.sgvulcan.com/adding-pcntl_fork-support-on-a-cpanel-server/</link>
		<comments>http://www.sgvulcan.com/adding-pcntl_fork-support-on-a-cpanel-server/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 09:20:13 +0000</pubDate>
		<dc:creator>silviu</dc:creator>
				<category><![CDATA[*nix]]></category>
		<category><![CDATA[Tips and tricks]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[easyapache]]></category>
		<category><![CDATA[pcntl]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.sgvulcan.com/?p=2082</guid>
		<description><![CDATA[A php application on a cpanel server kept throwing this: Fatal error: Call to undefined function pcntl_fork() in /path/blah.php on line 5 The fix requires recompiling php with &#8211;enable-pcntl Fortunately cpanel offers the Easy Apache script. The bad part is that it doesn&#8217;t have an option for pcntl. So you have to specify it as a custom compile time option. Edit (or create &#8211; for PHP5) and add /var/cpanel/easy/apache/rawopts/all_php5 View Code INI1 --enable-pcntl On one line Then rebuild Easy Apache. &#160;]]></description>
			<content:encoded><![CDATA[<p>A php application on a cpanel server kept throwing this:</p>
<p><strong>Fatal error</strong>: Call to undefined function pcntl_fork() in <strong>/path/blah.php </strong>on line <strong>5</strong></p>
<p>The fix requires recompiling php with <strong>&#8211;enable-pcntl</strong> Fortunately cpanel offers the Easy Apache script. The bad part is that it doesn&#8217;t have an option for pcntl. So you have to specify it as a custom compile time option. Edit (or create &#8211; for PHP5) and add<strong> /var/cpanel/easy/apache/rawopts/all_php5</strong></p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p2082code2'); return false;">View Code</a> INI</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p20822"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p2082code2"><pre class="ini" style="font-family:monospace;">--enable-pcntl</pre></td></tr></table></div>

<p>On one line</p>
<p>Then rebuild Easy Apache.</p>
<p>&nbsp;</p>
<div id="in_post_ad_bottom_1" style="clear:both;margin: 5px;padding: 0px;"><p> </p>
<div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-7825242150714747";
/* Dupa articol 468x60, created 8/19/09 */
google_ad_slot = "8916341192";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div></div><div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://www.sgvulcan.com/adding-pcntl_fork-support-on-a-cpanel-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Got a packet bigger than &#8216;max_allowed_packet&#8217; bytes</title>
		<link>http://www.sgvulcan.com/got-a-packet-bigger-than-max_allowed_packet-bytes/</link>
		<comments>http://www.sgvulcan.com/got-a-packet-bigger-than-max_allowed_packet-bytes/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 09:02:49 +0000</pubDate>
		<dc:creator>silviu</dc:creator>
				<category><![CDATA[*nix]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[mysq]]></category>

		<guid isPermaLink="false">http://www.sgvulcan.com/?p=2077</guid>
		<description><![CDATA[I got this on a newly installed server when I tried to import a database: View Code BASH1 2 3 &#91;root@host ~&#93;# mysql -u user -pPassword database &#38;lt; database.sql Enter password: ERROR 1153 &#40;08S01&#41; at line 53: Got a packet bigger than 'max_allowed_packet' bytes It&#8217;s easily fixable. The default is probably 16M, I added the following in /etc/my.cnf View Code INI1 max_allowed_packet=32M And restarted mysql (depending on your distro you will do this differently): View Code BASH1 service mysqld restart]]></description>
			<content:encoded><![CDATA[<p>I got this on a newly installed server when I tried to import a database:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p2077code6'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p20776"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p2077code6"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>host ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># mysql -u user -pPassword database &amp;lt; database.sql</span>
Enter password:
ERROR <span style="color: #000000;">1153</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>08S01<span style="color: #7a0874; font-weight: bold;">&#41;</span> at line <span style="color: #000000;">53</span>: Got a packet bigger than <span style="color: #ff0000;">'max_allowed_packet'</span> bytes</pre></td></tr></table></div>

<p>It&#8217;s easily fixable. The default is probably 16M, I added the following in /etc/my.cnf</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p2077code7'); return false;">View Code</a> INI</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p20777"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p2077code7"><pre class="ini" style="font-family:monospace;"><span style="color: #000099;">max_allowed_packet</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">32M</span></pre></td></tr></table></div>

<p>And restarted mysql (depending on your distro you will do this differently):</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p2077code8'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p20778"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p2077code8"><pre class="bash" style="font-family:monospace;">service mysqld restart</pre></td></tr></table></div>

<div id="in_post_ad_bottom_1" style="clear:both;margin: 5px;padding: 0px;"><p> </p>
<div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-7825242150714747";
/* Dupa articol 468x60, created 8/19/09 */
google_ad_slot = "8916341192";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div></div><div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://www.sgvulcan.com/got-a-packet-bigger-than-max_allowed_packet-bytes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up master-slave replication for mysql</title>
		<link>http://www.sgvulcan.com/setting-up-master-slave-replication-for-mysql/</link>
		<comments>http://www.sgvulcan.com/setting-up-master-slave-replication-for-mysql/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 19:27:08 +0000</pubDate>
		<dc:creator>silviu</dc:creator>
				<category><![CDATA[*nix]]></category>
		<category><![CDATA[Articles]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[master]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[replication]]></category>
		<category><![CDATA[slave]]></category>
		<category><![CDATA[slow]]></category>

		<guid isPermaLink="false">http://www.sgvulcan.com/?p=2073</guid>
		<description><![CDATA[&#160; So, I had to set-up master-slave replication. Here&#8217;s how you do it: Why would one want to set-up this? Easy. 1)Spread the read load across multiple servers:  you can use the MySQL master for writing (inserts, updates) and the slave(s) for reading (SELECT) This should speed up things nicely for your application. 2)Do the backups from the slave. You might have noticed that backing-up, especially big databases, slows things down. That happens because mysqldump locks tables as it reads them. This can slow a big site or even takes it down from a few seconds to a few minute. Reading from the slave affects nothing. You can even stop the slave, read the /var/lib/mysql folder and start it back. Following are the steps on how to set it up, but first let&#8217;s not a few assumptions. Also please note that this sets up only the basic things. Many more settings can be tweaked to improve MySQL performance. Master server ip: 192.168.0.1 Slave server ip: 192.168.0.2 Slave username: slaveusr Slave pw: slavepass Your data directory is: /var/lib/mysql Add the following lines in your master my.cnf file under [mysqld] section: # master my.cnf server-id = 1 relay-log = /var/lib/mysql/mysql-relay-bin relay-log-index = [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>So, I had to set-up master-slave replication. Here&#8217;s how you do it:</p>
<p>Why would one want to set-up this? Easy.</p>
<p>1)Spread the read load across multiple servers:  you can use the MySQL master for writing (inserts, updates) and the slave(s) for reading (SELECT) This should speed up things nicely for your application.</p>
<p>2)Do the backups from the slave. You might have noticed that backing-up, especially big databases, slows things down. That happens because mysqldump locks tables as it reads them. This can slow a big site or even takes it down from a few seconds to a few minute. Reading from the slave affects nothing. You can even stop the slave, read the /var/lib/mysql folder and start it back.</p>
<p>Following are the steps on how to set it up, but first let&#8217;s not a few assumptions. Also please note that this sets up only the basic things. Many more settings can be tweaked to improve MySQL performance.</p>
<blockquote><p>Master server ip: 192.168.0.1<br />
Slave server ip: 192.168.0.2<br />
Slave username: slaveusr<br />
Slave pw: slavepass<br />
Your data directory is: /var/lib/mysql</p></blockquote>
<p>Add the following lines in your master my.cnf file under [mysqld] section:</p>
<p><code># master my.cnf<br />
server-id = 1<br />
relay-log = /var/lib/mysql/mysql-relay-bin<br />
relay-log-index = <code>/var/lib/mysql/</code>mysql-relay-bin.index<br />
log-error = <code>/var/lib/mysql/</code>mysql.err<br />
master-info-file = <code>/var/lib/mysql/</code>mysql-master.info<br />
relay-log-info-file = <code>/var/lib/mysql/</code>mysql-relay-log.info<br />
datadir = <code>/var/lib/mysql</code><br />
log-bin = <code>/var/lib/mysql/</code>mysql-bin<br />
# end master <code></code><br />
</code></p>
<p>The following settings are for the slave’s my.cnf under the same [mysqld] section:</p>
<p><code># slave's my.cnf<br />
server-id = 2<br />
relay-log = <code>/var/lib/mysql/</code>mysql-relay-bin<br />
relay-log-index = <code>/var/lib/mysql/</code>mysql-relay-bin.index<br />
log-error = <code>/var/lib/mysql/</code>mysql.err<br />
master-info-file = <code>/var/lib/mysql/</code>mysql-master.info<br />
relay-log-info-file = <code>/var/lib/mysql/</code>mysql-relay-log.info<br />
datadir = <code>/var/lib/mysql</code><br />
# end slave settings</code></p>
<p>Restart both mysql instances after changing the settings in my.cnf</p>
<p>Create the slave user on master server:<br />
<code>mysql&gt; grant replication slave on *.* to slaveusr@'10.0.0.2' identified by 'slavepass';</code></p>
<p>Dump the full data and copy it (scp, etc.) to the slave<br />
<code></code></p>
<p><code>mysqldump -u root -pROOTPASS --all-databases --single-transaction --master-data=1 &gt; masterdump.sql</code></p>
<p>import this dump on the slave server:<br />
<code></code></p>
<p><code>mysql -u root -pROOTPASS &lt; masterdump.sql</code></p>
<p>After dump is imported go in to mysql client by typing mysql. Let us tell the slave which master to connect to and what login/password to use:<br />
<code>mysql&gt; CHANGE MASTER TO MASTER_HOST='192.168.0.1', MASTER_USER='slaveusr', MASTER_PASSWORD='slavepass';</code></p>
<p>Start the slave:<br />
<code>mysql&gt; start slave;</code></p>
<p>&nbsp;</p>
<p>Check the status on the slave:<br />
<code>mysql&gt; show slave status\G</code></p>
<p>The last row will tell how many seconds the slave runs behind the master. No worries if it&#8217;s not 0, it should catch up quickly (at that time it will show Seconds_Behind_Master: 0) If it reads NULL, maybe the slave is not started (you can start by typing: start slave) or it could be that there is a problem(shows up in Last_errno: and Last_error under show slave status).</p>
<div id="in_post_ad_bottom_1" style="clear:both;margin: 5px;padding: 0px;"><p> </p>
<div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-7825242150714747";
/* Dupa articol 468x60, created 8/19/09 */
google_ad_slot = "8916341192";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div></div><div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://www.sgvulcan.com/setting-up-master-slave-replication-for-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make sensors report temperature on slacware64-current with an Intel I7 2600k</title>
		<link>http://www.sgvulcan.com/make-sensors-report-temperature-on-slacware64-current-with-an-intel-i7-2600k/</link>
		<comments>http://www.sgvulcan.com/make-sensors-report-temperature-on-slacware64-current-with-an-intel-i7-2600k/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 20:01:49 +0000</pubDate>
		<dc:creator>silviu</dc:creator>
				<category><![CDATA[*nix]]></category>
		<category><![CDATA[2600k]]></category>
		<category><![CDATA[i7]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[slackware]]></category>
		<category><![CDATA[temperature]]></category>

		<guid isPermaLink="false">http://www.sgvulcan.com/?p=2049</guid>
		<description><![CDATA[For some reasons the required modules don&#8217;t get loaded. Add the following to /etc/rc.d/rc.modules right above the line reading ### Mouse support: View Code BASH1 2 3 ### by SV for i2600k temperature /sbin/modprobe coretemp /sbin/modprobe pkgtemp Now sensors report the temperatures.]]></description>
			<content:encoded><![CDATA[<p>For some reasons the required modules don&#8217;t get loaded. Add the following to /etc/rc.d/rc.modules right above the line reading ### Mouse support:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p2049code10'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p204910"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p2049code10"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">### by SV for i2600k temperature</span>
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>modprobe coretemp
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>modprobe pkgtemp</pre></td></tr></table></div>

<p>Now sensors report the temperatures.</p>
<div id="in_post_ad_bottom_1" style="clear:both;margin: 5px;padding: 0px;"><p> </p>
<div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-7825242150714747";
/* Dupa articol 468x60, created 8/19/09 */
google_ad_slot = "8916341192";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div></div><div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://www.sgvulcan.com/make-sensors-report-temperature-on-slacware64-current-with-an-intel-i7-2600k/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recursively remove digikam&#8217;s xmp embeded tags</title>
		<link>http://www.sgvulcan.com/recursively-remove-digikams-xmp-embeded-tags/</link>
		<comments>http://www.sgvulcan.com/recursively-remove-digikams-xmp-embeded-tags/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 22:06:44 +0000</pubDate>
		<dc:creator>silviu</dc:creator>
				<category><![CDATA[*nix]]></category>
		<category><![CDATA[Tips and tricks]]></category>
		<category><![CDATA[digikam]]></category>
		<category><![CDATA[exiftool]]></category>
		<category><![CDATA[sidecar]]></category>
		<category><![CDATA[tags]]></category>
		<category><![CDATA[xmp]]></category>

		<guid isPermaLink="false">http://www.sgvulcan.com/?p=2036</guid>
		<description><![CDATA[Because digikam made a mess of the tags I started to add to my pictures I decided to start from scratch. Note that I tried to get the max and I had set to write tags both to .xmp sidecar files and inside the image files. I also use the mysql backend. One of the above broken everything (I started seeing _digikam_root_tag) and some of my tags were doubled. So all in all I wanted to delete them all: Remove your collection from digikam Drop all tables from the digikam database Remove all .xmp files. In the folder containing your collection: find . -name *.xmp -exec rm {} \; Remove all embedded xmp tags (again in the folder containing you collection) exiftool -r -P -xmp:TagsList= -xmp:LastKeywordXMP= -xmp:HierarchicalSubject= -xmp:Subject= -iptc:Keywords= * DON&#8217;T FOLLOW THIS BLINDLY This is just a sketch of the process. If you don&#8217;t understand what are you doing don&#8217;t do it! I also kept all .original files exiftool generated, just in case I discover something later on. &#160;]]></description>
			<content:encoded><![CDATA[<p>Because digikam made a mess of the tags I started to add to my pictures I decided to start from scratch. Note that I tried to get the max and I had set to write tags both to .xmp sidecar files and inside the image files. I also use the mysql backend.</p>
<p>One of the above broken everything (I started seeing _digikam_root_tag) and some of my tags were doubled. So all in all I wanted to delete them all:</p>
<ul>
<li>Remove your collection from digikam</li>
<li>Drop all tables from the digikam database</li>
<li>Remove all .xmp files. In the folder containing your collection:<br />
find . -name *.xmp -exec rm {} \;</li>
<li>Remove all embedded xmp tags (again in the folder containing you collection)<br />
exiftool -r -P -xmp:TagsList= -xmp:LastKeywordXMP= -xmp:HierarchicalSubject= -xmp:Subject= -iptc:Keywords= *</li>
</ul>
<p><strong>DON&#8217;T FOLLOW THIS BLINDLY</strong></p>
<p>This is just a sketch of the process. If you don&#8217;t understand what are you doing don&#8217;t do it! I also kept all .original files exiftool generated, just in case I discover something later on.</p>
<p>&nbsp;</p>
<div id="in_post_ad_bottom_1" style="clear:both;margin: 5px;padding: 0px;"><p> </p>
<div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-7825242150714747";
/* Dupa articol 468x60, created 8/19/09 */
google_ad_slot = "8916341192";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div></div><div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://www.sgvulcan.com/recursively-remove-digikams-xmp-embeded-tags/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unpacking a .deb file (including scripts)</title>
		<link>http://www.sgvulcan.com/unpacking-a-deb-file-including-scripts/</link>
		<comments>http://www.sgvulcan.com/unpacking-a-deb-file-including-scripts/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 10:11:54 +0000</pubDate>
		<dc:creator>silviu</dc:creator>
				<category><![CDATA[*nix]]></category>
		<category><![CDATA[deb]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[extract]]></category>
		<category><![CDATA[package]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[slackware]]></category>
		<category><![CDATA[tar.gz]]></category>
		<category><![CDATA[tgz]]></category>

		<guid isPermaLink="false">http://www.sgvulcan.com/?p=2034</guid>
		<description><![CDATA[While attempting to install a deb package on a slackware system I wanted to check the install script that the package runs. I tried the deb2tgz utility but unfortunately that only left me the files in the package in a ready to install .tgz file. Here&#8217;s how to unpack a .deb to obtain both scripts and files: View Code BASH1 2 cd /tmp/somefolder ar x somepackage.deb This leaves you with two files: control.tar.gz and data.tar.gz The first contains the pre and post install scripts and the second contains the files.]]></description>
			<content:encoded><![CDATA[<p>While attempting to install a deb package on a slackware system I wanted to check the install script that the package runs. I tried the deb2tgz utility but unfortunately that only left me the files in the package in a ready to install .tgz file.</p>
<p>Here&#8217;s how to unpack a .deb to obtain both scripts and files:</p>
<div>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p2034code12'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p203412"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p2034code12"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>somefolder
<span style="color: #c20cb9; font-weight: bold;">ar</span> x somepackage.deb</pre></td></tr></table></div>

<p>This leaves you with two files:</p>
<p>control.tar.gz and data.tar.gz The first contains the pre and post install scripts and the second contains the files.
</p></div>
<div id="in_post_ad_bottom_1" style="clear:both;margin: 5px;padding: 0px;"><p> </p>
<div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-7825242150714747";
/* Dupa articol 468x60, created 8/19/09 */
google_ad_slot = "8916341192";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div></div><div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://www.sgvulcan.com/unpacking-a-deb-file-including-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Log dropped packets using CentOS Firewall</title>
		<link>http://www.sgvulcan.com/log-dropped-packets-using-centos-firewall/</link>
		<comments>http://www.sgvulcan.com/log-dropped-packets-using-centos-firewall/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 07:16:42 +0000</pubDate>
		<dc:creator>silviu</dc:creator>
				<category><![CDATA[*nix]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[dropped]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[packets]]></category>

		<guid isPermaLink="false">http://www.sgvulcan.com/?p=2032</guid>
		<description><![CDATA[Please take care modifying your firewall. If you don&#8217;t understand what&#8217;s being done here you may lock yourself out of your machine. You&#8217;ve been warned ! In order to log dropped packets on the INPUT chain I replaced this: View Code BASH1 -A INPUT -i eth0 -j REJECT --reject-with icmp-host-prohibited with this View Code BASH1 2 3 4 -N LOGDROP -A LOGDROP -i eth0 -j LOG -A LOGDROP -i eth0 -j REJECT --reject-with icmp-host-prohibited -A INPUT -i eth0 -j LOGDROP Of course you can use DROP instead of REJECT &#8211;reject-with icmp-host-prohibited]]></description>
			<content:encoded><![CDATA[<p>Please take care modifying your firewall. If you don&#8217;t understand what&#8217;s being done here you may lock yourself out of your machine. You&#8217;ve been warned <img src='http://www.sgvulcan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  !</p>
<p>In order to log dropped packets on the INPUT chain I replaced this:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p2032code15'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p203215"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p2032code15"><pre class="bash" style="font-family:monospace;"><span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-i</span> eth0 <span style="color: #660033;">-j</span> REJECT <span style="color: #660033;">--reject-with</span> icmp-host-prohibited</pre></td></tr></table></div>

<p>with this</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p2032code16'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p203216"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p2032code16"><pre class="bash" style="font-family:monospace;"><span style="color: #660033;">-N</span> LOGDROP
<span style="color: #660033;">-A</span> LOGDROP <span style="color: #660033;">-i</span> eth0 <span style="color: #660033;">-j</span> LOG
<span style="color: #660033;">-A</span> LOGDROP <span style="color: #660033;">-i</span> eth0 <span style="color: #660033;">-j</span> REJECT <span style="color: #660033;">--reject-with</span> icmp-host-prohibited
<span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-i</span> eth0 <span style="color: #660033;">-j</span> LOGDROP</pre></td></tr></table></div>

<p>Of course you can use DROP instead of REJECT &#8211;reject-with icmp-host-prohibited</p>
<div id="in_post_ad_bottom_1" style="clear:both;margin: 5px;padding: 0px;"><p> </p>
<div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-7825242150714747";
/* Dupa articol 468x60, created 8/19/09 */
google_ad_slot = "8916341192";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div></div><div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://www.sgvulcan.com/log-dropped-packets-using-centos-firewall/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling the MySQL slow query log</title>
		<link>http://www.sgvulcan.com/enabling-the-mysql-slow-query-log/</link>
		<comments>http://www.sgvulcan.com/enabling-the-mysql-slow-query-log/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 16:32:49 +0000</pubDate>
		<dc:creator>silviu</dc:creator>
				<category><![CDATA[*nix]]></category>
		<category><![CDATA[log_slow_query]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[slow]]></category>

		<guid isPermaLink="false">http://www.sgvulcan.com/?p=1994</guid>
		<description><![CDATA[If you have a slow web app or website it might be because of unoptimized sql queries. You want to track and fix those and the mysql slow query log is very helpful here. Enabling the slow query log MySQL prior to 5.1.0 requires adding a setting to the MySQL my.cnf file and restart the mysql daemon in order to log slow queries; from MySQL 5.1.0 onwards you can also change this dynamically without having to restart. To make the setting permanent every time you start MySQL (or you have a version prior to 5.1.0) add (ow uncomment) the following in my.cnf (usually /etc/my.cnf or /etc/mysql/my.cnf) log_slow_queries = /var/log/mysql/mysql-slow.log You can skip the path or leave it blank completely and mysql will create the log in the default location. The default is to log the queries into a file in the MySQL data directory. To enable or disable the setting dynamically in MySQL 5.1.0 run the following query to enable it: set log_slow_queries = ON; and to disable it: set log_slow_queries = OFF; Changing the long query time You can also set how long a query needs to take before it&#8217;s considered a &#8220;long&#8221; query. The default is 10 seconds. [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-thumbnail wp-image-1996" title="Logo-mysql" src="http://www.sgvulcan.com/wp-content/uploads/2012/01/Logo-mysql-145x145.jpg" alt="" width="145" height="145" />If you have a slow web app or website it might be because of unoptimized sql queries. You want to track and fix those and the mysql slow query log is very helpful here.</p>
<h3>Enabling the slow query log</h3>
<p>MySQL prior to 5.1.0 requires adding a setting to the MySQL my.cnf file and restart the mysql daemon in order to log slow queries; from MySQL 5.1.0 onwards you can also change this dynamically without having to restart.</p>
<p>To make the setting permanent every time you start MySQL (or you have a version prior to 5.1.0) add (ow uncomment) the following in my.cnf (usually /etc/my.cnf or /etc/mysql/my.cnf)</p>
<pre>log_slow_queries = /var/log/mysql/mysql-slow.log</pre>
<p>You can skip the path or leave it blank completely and mysql will create the log in the default location. The default is to log the queries into a file in the MySQL data directory.</p>
<p>To enable or disable the setting dynamically in MySQL 5.1.0 run the following query to enable it:</p>
<pre>set log_slow_queries = ON;</pre>
<p>and to disable it:</p>
<pre>set log_slow_queries = OFF;</pre>
<h3>Changing the long query time</h3>
<p>You can also set how long a query needs to take before it&#8217;s considered a &#8220;long&#8221; query. The default is 10 seconds. I usually like to set it lower:</p>
<p>To change it to 5 seconds add in my.cnf:</p>
<pre>long_query_time = 5</pre>
<p>This can be changed dynamically in MySQL 5.0.0+ (and possibly earlier versions) by running the following query:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1994code20'); return false;">View Code</a> MYSQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p199420"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1994code20"><pre class="mysql" style="font-family:monospace;"><a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=SET"><span style="color: #990099; font-weight: bold;">set</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=GLOBAL"><span style="color: #990099; font-weight: bold;">global</span></a> long_query_time <span style="color: #CC0099;">=</span> <span style="color: #008080;">5</span><span style="color: #000033;">;</span></pre></td></tr></table></div>

<p>This will only work for new connections; any connections which have already been established will continue to use the old setting. Once the user disconnects and reconnects their new connection will use the new setting.</p>
<h3>Errors you can get applying these settings dynamically</h3>
<p>If the following error message appears when attempting to change the log_slow_queries setting dynamically means you are using a version of MySQL that does not support changing the setting dynamically:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1994code21'); return false;">View Code</a> MYSQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p199421"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1994code21"><pre class="mysql" style="font-family:monospace;">ERROR <span style="color: #008080;">1193</span> <span style="color: #FF00FF;">&#40;</span>HY000<span style="color: #FF00FF;">&#41;</span>: Unknown system variable <span style="color: #008000;">'log<span style="color: #008080; font-weight: bold;">_</span>slow<span style="color: #008080; font-weight: bold;">_</span>queries'</span></pre></td></tr></table></div>

<p>The long_query_time value must be integer; if it&#8217;s not (e.g. you set long_query_time = 2.5;) then you&#8217;ll see this error:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1994code22'); return false;">View Code</a> MYSQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p199422"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1994code22"><pre class="mysql" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#1232 - Incorrect argument type to variable 'long_query_time'</span></pre></td></tr></table></div>

<p>Note also that if you set the long_query_time to 0 it will not fail, but the actual setting applied will be 1 and not 0.</p>
<div id="in_post_ad_bottom_1" style="clear:both;margin: 5px;padding: 0px;"><p> </p>
<div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-7825242150714747";
/* Dupa articol 468x60, created 8/19/09 */
google_ad_slot = "8916341192";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div></div><div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://www.sgvulcan.com/enabling-the-mysql-slow-query-log/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cadsoft Eagle on Slackware Current 64bit</title>
		<link>http://www.sgvulcan.com/cadsoft-eagle-on-slackware-current-64bit/</link>
		<comments>http://www.sgvulcan.com/cadsoft-eagle-on-slackware-current-64bit/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 09:00:29 +0000</pubDate>
		<dc:creator>silviu</dc:creator>
				<category><![CDATA[*nix]]></category>
		<category><![CDATA[Tips and tricks]]></category>
		<category><![CDATA[cadsoft]]></category>
		<category><![CDATA[current]]></category>
		<category><![CDATA[eagle]]></category>
		<category><![CDATA[eaglepcb]]></category>
		<category><![CDATA[slackwre]]></category>

		<guid isPermaLink="false">http://www.sgvulcan.com/?p=1821</guid>
		<description><![CDATA[I want to start building some new electronics projects and I wanted to use some tool to build my schematics. Even if not open source Cadsoft&#8217;s Eagle seems to be the de-facto standard between hobbyists. Unfortunately trying to run the setup on Slackware gives the errors regarding to /&#8230;/bin/eagle: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory libssl.so.1.0.0 and libcrypto.so.1.0.0 I run a multilib setup so that&#8217;s not it. It turns that all I had to do was: View Code BASH1 2 3 cd /lib ln -s libssl.so.0.9.8 libssl.so.1.0.0 ln -s libcrypt-2.14.1.so libcrypto.so.1.0.0 in /lib Hope that helps.]]></description>
			<content:encoded><![CDATA[<p>I want to start building some new electronics projects and I wanted to use some tool to build my schematics. Even if not open source <a href="http://www.cadsoftusa.com/" target="_blank">Cadsoft&#8217;s Eagle</a> seems to be the de-facto standard between hobbyists.</p>
<p>Unfortunately trying to run the setup on Slackware gives the errors regarding to</p>
<p>/&#8230;/bin/eagle: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory</p>
<p>libssl.so.1.0.0 and libcrypto.so.1.0.0</p>
<p>I run a multilib setup so that&#8217;s not it. It turns that all I had to do was:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1821code24'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p182124"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p1821code24"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>lib
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> libssl.so.0.9.8 libssl.so.1.0.0
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> libcrypt-2.14.1.so libcrypto.so.1.0.0</pre></td></tr></table></div>

<p>in /lib</p>
<p>Hope that helps.</p>
<div id="in_post_ad_bottom_1" style="clear:both;margin: 5px;padding: 0px;"><p> </p>
<div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-7825242150714747";
/* Dupa articol 468x60, created 8/19/09 */
google_ad_slot = "8916341192";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div></div><div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://www.sgvulcan.com/cadsoft-eagle-on-slackware-current-64bit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Search and replace text in many files</title>
		<link>http://www.sgvulcan.com/search-and-replace-text-in-many-files/</link>
		<comments>http://www.sgvulcan.com/search-and-replace-text-in-many-files/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 07:48:46 +0000</pubDate>
		<dc:creator>silviu</dc:creator>
				<category><![CDATA[Bash scripting]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[regexp]]></category>
		<category><![CDATA[replace]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://www.sgvulcan.com/?p=1864</guid>
		<description><![CDATA[This is a handy one liner that searches and replaces text in multiple files. (You can use find for example to run it in multiple folders) View Code BASH1 perl -pi -e 's/old_text/new_text/g' *.conf This line replaces old_text with new_text in all the .conf files in the current folder. Of course you can use regular expressions.]]></description>
			<content:encoded><![CDATA[<p>This is a handy one liner that searches and replaces text in multiple files. (You can use <a href="http://manpages.sgvulcan.com/find.1.php">find</a> for example to run it in multiple folders)</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1864code26'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p186426"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1864code26"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-pi</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/old_text/new_text/g'</span> <span style="color: #000000; font-weight: bold;">*</span>.conf</pre></td></tr></table></div>

<p>This line replaces old_text with new_text in all the .conf files in the current folder. Of course you can use regular expressions.</p>
<div id="in_post_ad_bottom_1" style="clear:both;margin: 5px;padding: 0px;"><p> </p>
<div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-7825242150714747";
/* Dupa articol 468x60, created 8/19/09 */
google_ad_slot = "8916341192";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div></div><div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://www.sgvulcan.com/search-and-replace-text-in-many-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

