<?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:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Serbian Cafe</title>
	<atom:link href="http://serbiancafe.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://serbiancafe.wordpress.com</link>
	<description></description>
	<lastBuildDate>Fri, 16 Oct 2009 02:00:10 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language></language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='serbiancafe.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/feef390f15ee5deb77f2d95b019d7931?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Serbian Cafe</title>
		<link>http://serbiancafe.wordpress.com</link>
	</image>
			<item>
		<title>Subversion pre-commit hook for detection of byte-order marks (BOMs)</title>
		<link>http://serbiancafe.wordpress.com/2009/09/30/subversion-pre-commit-hook-for-detection-of-byte-order-marks-boms/</link>
		<comments>http://serbiancafe.wordpress.com/2009/09/30/subversion-pre-commit-hook-for-detection-of-byte-order-marks-boms/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 03:52:06 +0000</pubDate>
		<dc:creator>serbiancafe</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[bom]]></category>
		<category><![CDATA[byte-order mark]]></category>
		<category><![CDATA[hook]]></category>

		<guid isPermaLink="false">http://serbiancafe.wordpress.com/?p=55</guid>
		<description><![CDATA[Byte-order marks can mess up your code badly. Some of my CodeIgniter PHP code was receiving &#8220;headers already sent&#8221;, thanks to BOM&#8217;s alone. So, our goal is to reject a commit that contains one or more PHP files with BOMs. You can easily change the script to filter other files as well. The script is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serbiancafe.wordpress.com&blog=26819&post=55&subd=serbiancafe&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Byte-order marks can mess up your code badly. Some of my CodeIgniter PHP code was receiving &#8220;headers already sent&#8221;, thanks to BOM&#8217;s alone. So, our goal is to reject a commit that contains one or more PHP files with BOMs. You can easily change the script to filter other files as well. The script is known to work on Dreamhost.</p>
<p>Enough of talking, here is the pre-commit hook, a bash script, you were desperately searching the Internet for:<br />
<code>
<pre>#!/bin/bash

REPOS="$1"
TXN="$2"

PHP="/usr/local/bin/php"
SVNLOOK="/usr/bin/svnlook"
AWK="/usr/bin/awk"
GREP="/bin/egrep"
SED="/bin/sed"

CHANGED=`$SVNLOOK changed -t "$TXN" "$REPOS" | $GREP "^[U|A]" | $AWK '{print $2}' | $GREP \.php$`

REGEX=$'\xEF\xBB\xBF'
GREP2="grep -l $REGEX"

for FILE in $CHANGED
do
    MESSAGE=`$SVNLOOK cat -t "$TXN" "$REPOS" "$FILE" | $GREP2`
    if [ $? -eq 0 ]
    then
        echo 1&gt;&amp;2
        echo "***********************************" 1&gt;&amp;2
        echo "Byte order mark error in: $FILE:" 1&gt;&amp;2
        #echo `echo "$MESSAGE" | $SED "s| -| $FILE|g"` 1&gt;&amp;2
        echo "***********************************" 1&gt;&amp;2
        exit 1
    fi
done</pre>
<p></code></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/serbiancafe.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/serbiancafe.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/serbiancafe.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/serbiancafe.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/serbiancafe.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/serbiancafe.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/serbiancafe.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/serbiancafe.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/serbiancafe.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/serbiancafe.wordpress.com/55/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serbiancafe.wordpress.com&blog=26819&post=55&subd=serbiancafe&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://serbiancafe.wordpress.com/2009/09/30/subversion-pre-commit-hook-for-detection-of-byte-order-marks-boms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e80f91f962f901b1cf6473adbc1c543e?s=96&#38;d=identicon" medium="image">
			<media:title type="html">serbiancafe</media:title>
		</media:content>
	</item>
		<item>
		<title>Make MAMP PRO not ask about passwords on service restart</title>
		<link>http://serbiancafe.wordpress.com/2009/03/20/make-mamp-pro-not-ask-about-passwords-on-service-restart/</link>
		<comments>http://serbiancafe.wordpress.com/2009/03/20/make-mamp-pro-not-ask-about-passwords-on-service-restart/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 17:54:59 +0000</pubDate>
		<dc:creator>serbiancafe</dc:creator>
				<category><![CDATA[Mac OS]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mamp]]></category>
		<category><![CDATA[mamp pro]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://serbiancafe.wordpress.com/?p=51</guid>
		<description><![CDATA[Change your default MAMP password from &#8216;root&#8217; to something more useful:
/Applications/MAMP/bin/mysql4/bin/mysqladmin -u root -p password newpassword

Edit the following files:

/Applications/MAMP/bin/phpMyAdmin-X.X.X/config.inc.php
$cfg['Servers'][$i]['password'] = 'newpassword'; // change root to your new password

/Applications/MAMP/bin/mamp/index.php
$link = @mysql_connect(’:/Applications/MAMP/tmp/mysql/mysql.sock’, &#8216;root&#8217;, &#8216;newpassword&#8216;);

 /Applications/MAMP/bin/stopMysql.sh
# /bin/sh
/Applications/MAMP/bin/mysql4/bin/mysqladmin -u root -pnewpassword –socket=/Applications/MAMP/tmp/mysql/mysql.sock shutdown

Tip taken from this site.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serbiancafe.wordpress.com&blog=26819&post=51&subd=serbiancafe&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Change your default MAMP password from &#8216;root&#8217; to something more useful:<br />
<code>/Applications/MAMP/bin/mysql4/bin/mysqladmin -u root -p password <em>newpassword</em><br />
</code></p>
<p>Edit the following files:</p>
<ul>
<li>/Applications/MAMP/bin/phpMyAdmin-X.X.X/config.inc.php
<p><code>$cfg['Servers'][$i]['password'] = '<em>newpassword</em>'; // change root to your new password<br />
</code></li>
<li>/Applications/MAMP/bin/mamp/index.php
<p><span style="font-family:0;">$link = @mysql_connect(’:/Applications/MAMP/tmp/mysql/mysql.sock’, &#8216;root&#8217;, &#8216;<em>newpassword</em>&#8216;);<br />
</span></li>
<li><code> <span style="font-family:Georgia;">/Applications/MAMP/bin/stopMysql.sh
<p><span style="font-family:0;"># /bin/sh<br />
/Applications/MAMP/bin/mysql4/bin/mysqladmin -u root -p<em>newpassword</em> –socket=/Applications/MAMP/tmp/mysql/mysql.sock shutdown</span></span></code></li>
</ul>
<p>Tip taken from <a href="http://irrashai.wordpress.com/2008/09/08/mamp-password-and-hibernate-mode/">this site</a>.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/serbiancafe.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/serbiancafe.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/serbiancafe.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/serbiancafe.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/serbiancafe.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/serbiancafe.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/serbiancafe.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/serbiancafe.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/serbiancafe.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/serbiancafe.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serbiancafe.wordpress.com&blog=26819&post=51&subd=serbiancafe&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://serbiancafe.wordpress.com/2009/03/20/make-mamp-pro-not-ask-about-passwords-on-service-restart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e80f91f962f901b1cf6473adbc1c543e?s=96&#38;d=identicon" medium="image">
			<media:title type="html">serbiancafe</media:title>
		</media:content>
	</item>
		<item>
		<title>Rotating Apache logs with logrotate</title>
		<link>http://serbiancafe.wordpress.com/2009/02/27/rotating-apache-logs/</link>
		<comments>http://serbiancafe.wordpress.com/2009/02/27/rotating-apache-logs/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 06:39:24 +0000</pubDate>
		<dc:creator>serbiancafe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://serbiancafe.wordpress.com/2009/02/27/rotating-apache-logs/</guid>
		<description><![CDATA[It&#8217;s pretty easy to set this up on Linux as most distros come with rotatelog functionality.
All I had to do was to create a file /etc/logrotate.d/apache2 with this content:
/usr/local/apache/domlogs/www3.serbiancafe.com.short {
daily
missingok
rotate 5
ifempty
copytruncate
olddir /usr/local/apache/domlogs/oldlogs
}
/usr/local/apache/logs/*_log {
rotate 3
size 100M
copytruncate
}

If plain English:
First log is rotated on a daily basis regardless if the log is there or empty. Last 5 logs [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serbiancafe.wordpress.com&blog=26819&post=44&subd=serbiancafe&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>It&#8217;s pretty easy to set this up on Linux as most distros come with rotatelog functionality.</p>
<p>All I had to do was to create a file /etc/logrotate.d/apache2 with this content:</p>
<p><code>/usr/local/apache/domlogs/www3.serbiancafe.com.short {<br />
daily<br />
missingok<br />
rotate 5<br />
ifempty<br />
copytruncate<br />
olddir /usr/local/apache/domlogs/oldlogs<br />
}</p>
<p>/usr/local/apache/logs/*_log {<br />
rotate 3<br />
size 100M<br />
copytruncate<br />
}<br />
</code></p>
<p>If plain English:<br />
First log is rotated on a daily basis regardless if the log is there or empty. Last 5 logs are kept in &#8220;olddir&#8221; directory. And, you don&#8217;t have to restart Apache when you use copytruncate directive.</p>
<p>Second group defines a rotation for all files ending with &#8220;_log&#8221;. They rotate three files when their size is over 100M.</p>
<p>More options can be found in <a href="http://linuxcommand.org/man_pages/logrotate8.html">logrotate man page</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/serbiancafe.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/serbiancafe.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/serbiancafe.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/serbiancafe.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/serbiancafe.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/serbiancafe.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/serbiancafe.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/serbiancafe.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/serbiancafe.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/serbiancafe.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serbiancafe.wordpress.com&blog=26819&post=44&subd=serbiancafe&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://serbiancafe.wordpress.com/2009/02/27/rotating-apache-logs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e80f91f962f901b1cf6473adbc1c543e?s=96&#38;d=identicon" medium="image">
			<media:title type="html">serbiancafe</media:title>
		</media:content>
	</item>
		<item>
		<title>Coda books with custom images for Code Igniter, MySQL, PHP&#8230;</title>
		<link>http://serbiancafe.wordpress.com/2008/12/12/coda-books-with-custom-images-for-code-igniter-mysql-php/</link>
		<comments>http://serbiancafe.wordpress.com/2008/12/12/coda-books-with-custom-images-for-code-igniter-mysql-php/#comments</comments>
		<pubDate>Fri, 12 Dec 2008 17:29:58 +0000</pubDate>
		<dc:creator>serbiancafe</dc:creator>
				<category><![CDATA[Code Igniter]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coda]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://serbiancafe.wordpress.com/2008/12/12/coda-books-with-custom-images-for-code-igniter-mysql-php/</guid>
		<description><![CDATA[http://blog.drastudio.com/past/2008/11/29/adding_more_coda_books/
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serbiancafe.wordpress.com&blog=26819&post=40&subd=serbiancafe&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a title="Custom Coda book images" href="http://blog.drastudio.com/past/2008/11/29/adding_more_coda_books/">http://blog.drastudio.com/past/2008/11/29/adding_more_coda_books/</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/serbiancafe.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/serbiancafe.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/serbiancafe.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/serbiancafe.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/serbiancafe.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/serbiancafe.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/serbiancafe.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/serbiancafe.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/serbiancafe.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/serbiancafe.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serbiancafe.wordpress.com&blog=26819&post=40&subd=serbiancafe&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://serbiancafe.wordpress.com/2008/12/12/coda-books-with-custom-images-for-code-igniter-mysql-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e80f91f962f901b1cf6473adbc1c543e?s=96&#38;d=identicon" medium="image">
			<media:title type="html">serbiancafe</media:title>
		</media:content>
	</item>
		<item>
		<title>MAMP: ERROR 2002 (HY000): Can&#8217;t connect to local MySQL server through socket &#8216;/tmp/mysql.sock&#8217; (2)</title>
		<link>http://serbiancafe.wordpress.com/2008/11/26/mamp-error-2002-hy000-cant-connect-to-local-mysql-server-through-socket-tmpmysqlsock-2/</link>
		<comments>http://serbiancafe.wordpress.com/2008/11/26/mamp-error-2002-hy000-cant-connect-to-local-mysql-server-through-socket-tmpmysqlsock-2/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 20:07:24 +0000</pubDate>
		<dc:creator>serbiancafe</dc:creator>
				<category><![CDATA[Mac OS]]></category>
		<category><![CDATA[mamp]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://serbiancafe.wordpress.com/?p=36</guid>
		<description><![CDATA[I instaled MAMP and it worked great. However, when I tried to access mysql from the shell I was getting
$ mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

However, using a full path to MAMP binary worked.
$ /Applications/MAMP/Library/bin/mysql -u root -p

MAMP&#8217;s mysql works with another socket file [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serbiancafe.wordpress.com&blog=26819&post=36&subd=serbiancafe&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I instaled MAMP and it worked great. However, when I tried to access mysql from the shell I was getting</p>
<p><code>$ mysql -u root -p<br />
Enter password:<br />
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)<br />
</code></p>
<p>However, using a full path to MAMP binary worked.<br />
<code>$ /Applications/MAMP/Library/bin/mysql -u root -p<br />
</code></p>
<p>MAMP&#8217;s mysql works with another socket file which is located at /Applications/MAMP/tmp/mysql/mysql.sock</p>
<p>All you have to do is:<br />
<code>sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock</code></p>
<p><strong>UPDATE:</strong> As it turns out the above soft link gets erased by the system, so you need to run the command every once in a while. At one point it got too frustrating so I figured out a permanent way to take care of this problem. Open /etc/my.cnf and add/edit these lines:<br />
<code>[mysqld]<br />
socket=/Applications/MAMP/tmp/mysql/mysql.sock</p>
<p>[client]<br />
socket=/Applications/MAMP/tmp/mysql/mysql.sock</code></p>
<p>Instead of telling MAMP which socket file to use, you are instructing the mysql client to use MAMP&#8217;s default socket.</p>
<p>Let me know if this works for you.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/serbiancafe.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/serbiancafe.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/serbiancafe.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/serbiancafe.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/serbiancafe.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/serbiancafe.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/serbiancafe.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/serbiancafe.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/serbiancafe.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/serbiancafe.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serbiancafe.wordpress.com&blog=26819&post=36&subd=serbiancafe&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://serbiancafe.wordpress.com/2008/11/26/mamp-error-2002-hy000-cant-connect-to-local-mysql-server-through-socket-tmpmysqlsock-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e80f91f962f901b1cf6473adbc1c543e?s=96&#38;d=identicon" medium="image">
			<media:title type="html">serbiancafe</media:title>
		</media:content>
	</item>
		<item>
		<title>How to fix /tmp 100% usage problems</title>
		<link>http://serbiancafe.wordpress.com/2008/07/23/how-to-fix-tmp-100-usage-problems/</link>
		<comments>http://serbiancafe.wordpress.com/2008/07/23/how-to-fix-tmp-100-usage-problems/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 17:38:30 +0000</pubDate>
		<dc:creator>serbiancafe</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://serbiancafe.wordpress.com/?p=33</guid>
		<description><![CDATA[This was happening a lot on my main server (RHEL Linux with cPanel). Ever since I chose a cPanel installation, the /tmp directory was often spiking to 100%. The mistery was that I couldn&#8217;t list the files to see the cause of those spikes in /tmp usage. Regular &#8216;ls&#8217; command was showing files, but nothing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serbiancafe.wordpress.com&blog=26819&post=33&subd=serbiancafe&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This was happening a lot on my main server (RHEL Linux with cPanel). Ever since I chose a cPanel installation, the /tmp directory was often spiking to 100%. The mistery was that I couldn&#8217;t list the files to see the cause of those spikes in /tmp usage. Regular &#8216;ls&#8217; command was showing files, but nothing alarmingly big, and nowhere close to 1G that I had allocated to /tmp.</p>
<p>I first changed a temporary directory for my Web applications. Instead of /tmp I used /tmp-sc, and fixed my applications accordingly. When /tmp goes to 100% at least my applications were able to use a disk cache.</p>
<p>Next, I decided to have MySQL use /tmp-mysql. Created a new directory with proper permissions and added a tmpdir option to mysqld section of /etc/my.cnf</p>
<p><code>[mysqld]<br />
tmpdir          = /tmp-mysql</code></p>
<p>I restarted MySQL and voila, all my troubles were gone.</p>
<p>The server with 2GB of ram and 2 cores now serves over 1 million PHP pages + many many more static images and the best part is that the load on the server rarely goes above 1.</p>
<p>If you find this tip helpful, let me know.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/serbiancafe.wordpress.com/33/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/serbiancafe.wordpress.com/33/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/serbiancafe.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/serbiancafe.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/serbiancafe.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/serbiancafe.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/serbiancafe.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/serbiancafe.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/serbiancafe.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/serbiancafe.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/serbiancafe.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/serbiancafe.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serbiancafe.wordpress.com&blog=26819&post=33&subd=serbiancafe&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://serbiancafe.wordpress.com/2008/07/23/how-to-fix-tmp-100-usage-problems/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e80f91f962f901b1cf6473adbc1c543e?s=96&#38;d=identicon" medium="image">
			<media:title type="html">serbiancafe</media:title>
		</media:content>
	</item>
		<item>
		<title>Common Linux server commands on a new box</title>
		<link>http://serbiancafe.wordpress.com/2008/06/05/common-linux-server-commands-on-a-new-box/</link>
		<comments>http://serbiancafe.wordpress.com/2008/06/05/common-linux-server-commands-on-a-new-box/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 18:31:51 +0000</pubDate>
		<dc:creator>serbiancafe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://serbiancafe.wordpress.com/?p=31</guid>
		<description><![CDATA[Changing a time zone
Log in as root and type these commands:
mv /etc/localtime /etc/localtime-old
ln -sf /usr/share/zoneinfo/America/Toronto /etc/localtime
To be continued
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serbiancafe.wordpress.com&blog=26819&post=31&subd=serbiancafe&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>Changing a time zone</strong></p>
<p>Log in as root and type these commands:<br />
<code>mv /etc/localtime /etc/localtime-old<br />
ln -sf /usr/share/zoneinfo/America/Toronto /etc/localtime</code></p>
<p>To be continued</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/serbiancafe.wordpress.com/31/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/serbiancafe.wordpress.com/31/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/serbiancafe.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/serbiancafe.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/serbiancafe.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/serbiancafe.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/serbiancafe.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/serbiancafe.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/serbiancafe.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/serbiancafe.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/serbiancafe.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/serbiancafe.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serbiancafe.wordpress.com&blog=26819&post=31&subd=serbiancafe&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://serbiancafe.wordpress.com/2008/06/05/common-linux-server-commands-on-a-new-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e80f91f962f901b1cf6473adbc1c543e?s=96&#38;d=identicon" medium="image">
			<media:title type="html">serbiancafe</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Windows printers on Mac OS X 10.5 (Leopard)</title>
		<link>http://serbiancafe.wordpress.com/2008/05/22/using-windows-printers-on-mac-os-x-105-leopard/</link>
		<comments>http://serbiancafe.wordpress.com/2008/05/22/using-windows-printers-on-mac-os-x-105-leopard/#comments</comments>
		<pubDate>Thu, 22 May 2008 23:16:42 +0000</pubDate>
		<dc:creator>serbiancafe</dc:creator>
				<category><![CDATA[Mac OS]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[printer]]></category>
		<category><![CDATA[printing]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://serbiancafe.wordpress.com/?p=29</guid>
		<description><![CDATA[Some Windows printers are hard to configure. Here&#8217;s how you do it:
1. Open &#8220;System Preferences&#8221;
2. Click &#8220;Print and Fax&#8221;
3. Click &#8220;+&#8221; to add a new printer.
4. Click &#8220;Advanced&#8221; from the tab options. If you don&#8217;t see it, than right-click or CTRL-click in the toolbar area (gray on top) and select &#8220;Customize Toolbar&#8221;. Drag the Advanced [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serbiancafe.wordpress.com&blog=26819&post=29&subd=serbiancafe&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Some Windows printers are hard to configure. Here&#8217;s how you do it:</p>
<p>1. Open &#8220;System Preferences&#8221;</p>
<p>2. Click &#8220;Print and Fax&#8221;</p>
<p>3. Click &#8220;+&#8221; to add a new printer.</p>
<p>4. Click &#8220;Advanced&#8221; from the tab options. If you don&#8217;t see it, than right-click or CTRL-click in the toolbar area (gray on top) and select &#8220;Customize Toolbar&#8221;. Drag the Advanced icon to the toolbar, click &#8220;Done&#8221; and click &#8220;Advanced&#8221;.</p>
<p>5. Be patient. It takes up to a minute for this screen to fill the options. Once done, select type &#8220;Windows&#8221;, device &#8220;Another device&#8221; and enter URL as:</p>
<p>smb://username:password@workgroup/machine/printer</p>
<p>My example connection is for user named &#8220;serbian&#8221; with password &#8220;cafe012&#8243;. Domain name is &#8220;Workgroup&#8221;, computer name &#8220;silver&#8221; and printer was shared by Windows as &#8220;Optra&#8221;. Fill the rest of the data as you please.</p>
<p><a href="http://serbiancafe.files.wordpress.com/2008/05/addprinter.jpg"><img class="aligncenter size-full wp-image-30" src="http://serbiancafe.files.wordpress.com/2008/05/addprinter.jpg?w=480&#038;h=493" alt="" width="480" height="493" /></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/serbiancafe.wordpress.com/29/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/serbiancafe.wordpress.com/29/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/serbiancafe.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/serbiancafe.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/serbiancafe.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/serbiancafe.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/serbiancafe.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/serbiancafe.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/serbiancafe.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/serbiancafe.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/serbiancafe.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/serbiancafe.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serbiancafe.wordpress.com&blog=26819&post=29&subd=serbiancafe&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://serbiancafe.wordpress.com/2008/05/22/using-windows-printers-on-mac-os-x-105-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e80f91f962f901b1cf6473adbc1c543e?s=96&#38;d=identicon" medium="image">
			<media:title type="html">serbiancafe</media:title>
		</media:content>

		<media:content url="http://serbiancafe.files.wordpress.com/2008/05/addprinter.jpg" medium="image" />
	</item>
		<item>
		<title>Deleting too many files</title>
		<link>http://serbiancafe.wordpress.com/2008/02/29/deleting-too-many-files/</link>
		<comments>http://serbiancafe.wordpress.com/2008/02/29/deleting-too-many-files/#comments</comments>
		<pubDate>Fri, 29 Feb 2008 07:03:28 +0000</pubDate>
		<dc:creator>serbiancafe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://serbiancafe.wordpress.com/?p=28</guid>
		<description><![CDATA[When you try to delete a big number of files in a directory of thousands using:
rm *
You&#8217;ll get an error. Linux complains about &#8220;Argument list too long&#8221;.  Issue this command from a directory where files are located to get rid of them:
find . -exec rm {} \;
If you want to delete a large number [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serbiancafe.wordpress.com&blog=26819&post=28&subd=serbiancafe&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>When you try to delete a big number of files in a directory of thousands using:</p>
<p><code>rm *</code></p>
<p>You&#8217;ll get an error. Linux complains about &#8220;Argument list too long&#8221;.  Issue this command from a directory where files are located to get rid of them:</p>
<p><code>find . -exec rm {} \;</code></p>
<p>If you want to delete a large number of cache files, without deleting them all, the best way is to delete the files that were not recently accessed. Say you want to keep the popular cache hits which were accessed in the last 5 days and remove older files, your command would be:</p>
<p><code>find . -atime +5 -exec rm {} \;</code></p>
<p>If you try to use a wildcard when using find, you&#8217;ll be limited to the maximum number of pages your argument list can accept, which is a kernel limit. So, to work around this, I created a subdirectory for each cache group so I can use a directory name as the first parameter of find. The following example deletes items from cache which were not accessed in more than 4 days. This Something like this:</p>
<p><code>find /www/site/ci/system/cache/khcache/ -atime +4 -exec rm {} \;</code></p>
<p>Previously, I was using a wildcarded &#8216;find&#8217; which was failing:</p>
<p><code>find /www/site/ci/system/cache/khcache_* -atime +4 -exec rm {} \;</code></p>
<p>Don&#8217;t forget to fix your cache directory setting in your configuration files.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/serbiancafe.wordpress.com/28/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/serbiancafe.wordpress.com/28/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/serbiancafe.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/serbiancafe.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/serbiancafe.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/serbiancafe.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/serbiancafe.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/serbiancafe.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/serbiancafe.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/serbiancafe.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/serbiancafe.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/serbiancafe.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serbiancafe.wordpress.com&blog=26819&post=28&subd=serbiancafe&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://serbiancafe.wordpress.com/2008/02/29/deleting-too-many-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e80f91f962f901b1cf6473adbc1c543e?s=96&#38;d=identicon" medium="image">
			<media:title type="html">serbiancafe</media:title>
		</media:content>
	</item>
		<item>
		<title>Leopard fixes</title>
		<link>http://serbiancafe.wordpress.com/2007/10/28/leopard-fixes/</link>
		<comments>http://serbiancafe.wordpress.com/2007/10/28/leopard-fixes/#comments</comments>
		<pubDate>Mon, 29 Oct 2007 03:52:48 +0000</pubDate>
		<dc:creator>serbiancafe</dc:creator>
				<category><![CDATA[Mac OS]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://serbiancafe.wordpress.com/2007/10/28/leopard-fixes/</guid>
		<description><![CDATA[Mac OS X 10.5 Leopard is great, but as any other OS, it has it&#8217;s growing pains.
Here&#8217;s issues I encountered with it:
1. MailActOn doesn&#8217;t work with new Mail.app
UPDATE: The Leopard install has been released. Works great.
2. When starting Terminal.app I got this error message:
&#8220;You are not authorized to run this application. The administrator has set [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serbiancafe.wordpress.com&blog=26819&post=27&subd=serbiancafe&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Mac OS X 10.5 Leopard is great, but as any other OS, it has it&#8217;s growing pains.</p>
<p>Here&#8217;s issues I encountered with it:</p>
<p><strike>1. MailActOn doesn&#8217;t work with new Mail.app</strike><br />
UPDATE: The Leopard install has been released. Works great.</p>
<p>2. When starting Terminal.app I got this error message:</p>
<p>&#8220;<span style="font-family:Helvetica;font-size:12px;line-height:normal;" class="Apple-style-span">You are not authorized to run this application. The administrator has set your shell to an illegal value.&#8221;</span></p>
<p><span style="font-family:Helvetica;font-size:12px;line-height:normal;" class="Apple-style-span"><span style="font-family:Georgia;font-size:16px;line-height:20px;" class="Apple-style-span"></span></span>I downloaded iTerm from <span style="font-family:Helvetica;font-size:12px;line-height:normal;" class="Apple-style-span"><a href="http://iterm.sourceforge.net" title="SourceForge">http://iterm.sourceforge.net</a>/<span style="font-family:Georgia;font-size:16px;line-height:20px;" class="Apple-style-span"> and issued a command:</span></span><span style="font-family:Helvetica;font-size:12px;line-height:normal;" class="Apple-style-span"><span style="font-family:Georgia;font-size:16px;line-height:20px;" class="Apple-style-span"></span></span><span style="font-family:Helvetica;font-size:12px;line-height:normal;" class="Apple-style-span"><span style="font-family:Georgia;font-size:16px;line-height:20px;" class="Apple-style-span"></span></span><code></code></p>
<p><code>sudo chsh -s /bin/bash <span style="font-style:italic;" class="Apple-style-span">my_username</span></code></p>
<p><span style="font-family:Helvetica;font-size:12px;line-height:normal;" class="Apple-style-span"><span style="font-family:Georgia;font-size:16px;line-height:20px;" class="Apple-style-span">That fixed it.</span></span></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/serbiancafe.wordpress.com/27/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/serbiancafe.wordpress.com/27/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/serbiancafe.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/serbiancafe.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/serbiancafe.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/serbiancafe.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/serbiancafe.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/serbiancafe.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/serbiancafe.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/serbiancafe.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/serbiancafe.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/serbiancafe.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=serbiancafe.wordpress.com&blog=26819&post=27&subd=serbiancafe&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://serbiancafe.wordpress.com/2007/10/28/leopard-fixes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e80f91f962f901b1cf6473adbc1c543e?s=96&#38;d=identicon" medium="image">
			<media:title type="html">serbiancafe</media:title>
		</media:content>
	</item>
	</channel>
</rss>