<?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>Open source blog, linux, php, python, security</title>
	<atom:link href="http://www.alonon.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alonon.net</link>
	<description></description>
	<lastBuildDate>Wed, 18 Aug 2010 20:03:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>

   <image>
    <title>Open source blog, linux, php, python, security</title>
    <url>http://1.gravatar.com/avatar/5152c5736f5f8dd9570ffb2f9068e8ab?s=</url>
    <link>http://www.alonon.net</link>
   </image>
		<item>
		<title>Richard Stallman  &#8211; Free Software Song</title>
		<link>http://www.alonon.net/richard-stallman-free-software-song/</link>
		<comments>http://www.alonon.net/richard-stallman-free-software-song/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 20:03:38 +0000</pubDate>
		<dc:creator>ALonon</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[free software song]]></category>
		<category><![CDATA[richard stallman]]></category>

		<guid isPermaLink="false">http://www.alonon.net/?p=358</guid>
		<description><![CDATA[The best video i have ever watched ! : )) Tags: free software song, richard stallman Related posts No related posts.]]></description>
			<content:encoded><![CDATA[<p>The best video i have ever watched ! : ))</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="360" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://www.dailymotion.com/swf/video/x1zkpz?additionalInfos=0" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="360" src="http://www.dailymotion.com/swf/video/x1zkpz?additionalInfos=0" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>

	Tags: <a href="http://www.alonon.net/tag/free-software-song/" title="free software song" rel="tag">free software song</a>, <a href="http://www.alonon.net/tag/richard-stallman/" title="richard stallman" rel="tag">richard stallman</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.alonon.net/richard-stallman-free-software-song/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Top Command and Hot Keys</title>
		<link>http://www.alonon.net/top-command-and-hot-keys/</link>
		<comments>http://www.alonon.net/top-command-and-hot-keys/#comments</comments>
		<pubDate>Sat, 14 Aug 2010 17:23:32 +0000</pubDate>
		<dc:creator>ALonon</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[cpu usage]]></category>
		<category><![CDATA[top]]></category>

		<guid isPermaLink="false">http://www.alonon.net/?p=354</guid>
		<description><![CDATA[In unix system to view real-time system process activity you can use top And some usefull hot keys t     Displays summary information off and on. m     Displays memory information off and on. A     Sorts the display by top consumers of various system resources. Useful for quick identification of performance-hungry tasks on a &#8230; <a href="http://www.alonon.net/top-command-and-hot-keys/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In unix system to view real-time system process activity you can use</p>
<blockquote><p>top</p></blockquote>
<p><a href="http://www.alonon.net/wp-content/uploads//2010/08/Screenshot-2.png"><img class="alignnone size-medium wp-image-355" title="top" src="http://www.alonon.net/wp-content/uploads//2010/08/Screenshot-2-300x98.png" alt="" width="300" height="98" /></a></p>
<p>And some usefull hot keys</p>
<p>t     Displays summary information off and on.<br />
m     Displays memory information off and on.<br />
A     Sorts the display by top consumers of various system resources. Useful for quick identification of performance-hungry tasks on a system.<br />
f     Enters an interactive configuration screen for top. Helpful for setting up top for a specific task.<br />
o     Enables you to interactively select the ordering within top.<br />
r     Issues renice command.<br />
k     Issues kill command.<br />
z     Turn on or off color/mono</p>

	Tags: <a href="http://www.alonon.net/tag/cpu-usage/" title="cpu usage" rel="tag">cpu usage</a>, <a href="http://www.alonon.net/tag/top/" title="top" rel="tag">top</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.alonon.net/server-optimization-errors/" title="My server errors and optimization steps (August 3, 2010)">My server errors and optimization steps</a> (2)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.alonon.net/top-command-and-hot-keys/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Server optimizations 2</title>
		<link>http://www.alonon.net/server-optimizations-steps-2/</link>
		<comments>http://www.alonon.net/server-optimizations-steps-2/#comments</comments>
		<pubDate>Fri, 13 Aug 2010 20:47:16 +0000</pubDate>
		<dc:creator>ALonon</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ab]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[apc]]></category>
		<category><![CDATA[mod]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.alonon.net/?p=345</guid>
		<description><![CDATA[http://www.alonon.net/server-optimization-errors/ after this, i found some new things to use server hardware more efficiency. (I&#8217;m using ubuntu so that codes listed below works for only ubuntu servers.) 1.  Using a Php Accelerator I found apc. There are some such as Xcache and eAccelerator. Apc is creating php files cache. Before install it, you can test &#8230; <a href="http://www.alonon.net/server-optimizations-steps-2/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.alonon.net/server-optimization-errors/">http://www.alonon.net/server-optimization-errors/</a> after this, i found some new things to use server hardware more efficiency.</p>
<p>(I&#8217;m using ubuntu so that codes listed below works for only ubuntu servers.)</p>
<h2>1.  Using a Php Accelerator</h2>
<p>I found <a href="http://pecl.php.net/package/APC">apc</a>. There are some such as <a href="http://trac.lighttpd.net/xcache/">Xcache</a> and <a href="http://eaccelerator.net/">eAccelerator</a>. Apc is creating php files cache. Before install it, you can test your apache performanse with <a href="http://manpages.ubuntu.com/manpages/jaunty/man8/ab.8.html">ab</a>.</p>
<blockquote><p>ab -c5 -n100 http://www.yoursite.com/index.php<br />
-c <span style="text-decoration: underline;">concurrency</span><br />
Number of multiple requests to perform at a time. Default is one<br />
request at a time.</p>
<p>-n <span style="text-decoration: underline;">requests</span><br />
Number  of requests to perform for the benchmarking session. The<br />
default is to just perform a single request which usually  leads<br />
to non-representative benchmarking results.</p></blockquote>
<p>After testing you can easily install apc with typing:</p>
<blockquote><p>sudo apt-get install php-apc</p>
<p>sudo service apache2 restart</p></blockquote>
<p>Than test again.</p>
<blockquote><p>ab -c5 -n100 http://www.yoursite.com/index.php</p></blockquote>
<p>You can see the difference. Apc comes with a simple control script in /usr/share/doc/php-apc/apc.php.gz to use it</p>
<blockquote><p>gunzip /usr/share/doc/php-apc/apc.php.gz<br />
cp /usr/share/doc/php-apc/apc.php /yousites.com/apc.php</p></blockquote>
<h2>2. Enable browser caching with apache2</h2>
<p>Firstly to check browser caching, install firebug (ff extension)<a href="http://getfirebug.com"> http://getfirebug.com/.</a> After that open firebug and click network tab (Net). Than refresh your web page. You can see get process for each file in your webpage (js,png,gif,ico). There is a green bar symbolizing connection. If you are using browser caching this green bar should be &#8220;0&#8243; after second reload of page. If not</p>
<p>enable expires module of apache2</p>
<blockquote><p>sudo a2enmod expires</p></blockquote>
<p>restart apache</p>
<blockquote><p>sudo service apache2 restart</p></blockquote>
<p>Add this line to your .htaccess file</p>
<blockquote><p>ExpiresActive on<br />
ExpiresByType application/javascript &#8220;access plus 1 months&#8221;<br />
ExpiresByType image/jpg &#8220;access plus 1 month&#8221;<br />
ExpiresByType image/jpeg &#8220;access plus 1 month&#8221;<br />
ExpiresByType image/gif &#8220;access plus 1 month&#8221;<br />
ExpiresByType image/png &#8220;access plus 1 month&#8221;<br />
ExpiresByType text/css &#8220;access plus 1 months&#8221;</p></blockquote>
<p>access plus means access time for each visitor. Also you can use your website .conf file to use it.</p>

	Tags: <a href="http://www.alonon.net/tag/ab/" title="ab" rel="tag">ab</a>, <a href="http://www.alonon.net/tag/apache2/" title="apache2" rel="tag">apache2</a>, <a href="http://www.alonon.net/tag/apc/" title="apc" rel="tag">apc</a>, <a href="http://www.alonon.net/tag/mod/" title="mod" rel="tag">mod</a>, <a href="http://www.alonon.net/tag/optimization/" title="optimization" rel="tag">optimization</a>, <a href="http://www.alonon.net/tag/ubuntu/" title="ubuntu" rel="tag">ubuntu</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.alonon.net/user-groups-and-users-in-ubuntu/" title="User groups and Users in Ubuntu (March 16, 2010)">User groups and Users in Ubuntu</a> (0)</li>
	<li><a href="http://www.alonon.net/ubuntu-9-10-karmic-koala-released%e2%80%8e/" title="Ubuntu 9.10, Karmic Koala, released‎ (October 31, 2009)">Ubuntu 9.10, Karmic Koala, released‎</a> (0)</li>
	<li><a href="http://www.alonon.net/server-optimization-errors/" title="My server errors and optimization steps (August 3, 2010)">My server errors and optimization steps</a> (2)</li>
	<li><a href="http://www.alonon.net/install-php-apache-mysql-phpmyadmin/" title="install php apache mysql phpmyadmin (January 1, 2009)">install php apache mysql phpmyadmin</a> (3)</li>
	<li><a href="http://www.alonon.net/how-to-learn-ubuntu-version/" title="How to learn ubuntu version (April 3, 2010)">How to learn ubuntu version</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.alonon.net/server-optimizations-steps-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grub2 Configurations</title>
		<link>http://www.alonon.net/grub2-configurations/</link>
		<comments>http://www.alonon.net/grub2-configurations/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 15:42:48 +0000</pubDate>
		<dc:creator>ALonon</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[boot]]></category>
		<category><![CDATA[grub2]]></category>
		<category><![CDATA[memtest]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.alonon.net/?p=341</guid>
		<description><![CDATA[Q: How to delete old version of kernels in grub2 menu ? A: Delete them from /boot directory. Both initrd and vmlinuz files. Than run update-grub. Q: How to hide recovery mode in grub2 menu ? A: Change this line #GRUB_DISABLE_LINUX_RECOVERY=&#8221;true&#8221; as GRUB_DISABLE_LINUX_RECOVERY=&#8221;true&#8221; (delete command character.) in /etc/default/boot. Than run update-grub. Q: How to disable &#8230; <a href="http://www.alonon.net/grub2-configurations/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Q: How to delete old version of kernels in grub2 menu ?</strong></p>
<p>A: Delete them from /boot directory. Both initrd and vmlinuz files. Than run update-grub.</p>
<p><strong>Q: How to hide recovery mode in grub2 menu ?</strong></p>
<p>A: Change this line #GRUB_DISABLE_LINUX_RECOVERY=&#8221;true&#8221; as GRUB_DISABLE_LINUX_RECOVERY=&#8221;true&#8221; (delete command character.) in /etc/default/boot. Than run update-grub.</p>
<p><strong>Q: How to disable memtest in grub2 menu ?</strong></p>
<blockquote><p>cd /etc/grub.d</p>
<p>sudo chmod -x 20_memtest86+</p>
<p>update grub</p></blockquote>
<p>Some other changes in grub menu. In /etc/grub.d there are 6 executable files. These are</p>
<blockquote>
<ul>
<li><strong>00_header</strong> Sets initial  appearance items such as the graphics mode, default selection, timeout,  etc.  These settings are normally imported from information from <em>/etc/default/grub</em>. Users normally do not need to make changes to this file.</li>
<li><strong>05_debian_theme</strong> The settings in this file set splash image, text colors, selection  highlighting and themes. In the absence of a splash image, this file  sets a monochromatic theme for the initial menu display. How to set font  renderings and splash images are discussed in detail in the <em>Splash Images and Themes</em> section.</li>
<li><strong>10_hurd</strong> Locates Hurd kernels. Not currently used.</li>
<li><strong>10_linux</strong> Locates kernels on the root device for the operating system currently  in use. It takes this information and establishes the names displayed on  the menu for these kernels.  Thanks to the code in <strong>10_linux</strong>, it is <em>not</em> necessary (or even possible) to explicitly contruct the list of kernel names displayed on the menu.  <strong>Note:</strong> If you don&#8217;t want all your old kernels to appear in the menu list, remove their files from <em>/boot</em>.</li>
<li><strong>20_memtest86+</strong> Searches for <em>/boot/memtest86+.bin</em> and includes it as an option on the GRUB 2 boot menu. There is  currently no line option to remove this entry from the menu. The display  of <em>memtest86+</em> can be inhibited by removing the executable bit from this file:  <tt>sudo chmod -x /etc/grub.d/20_memtest86+</tt> and then running <tt>sudo update-grub</tt>.</li>
<li><strong>30_os-prober</strong> This file uses <em>os-prober</em>, which searches for Linux and other operating systems. Results are placed in <em>grub.cfg</em> based on the scripts in this file. The file is divided into 4 sections,  representing the types of operating systems handled by the scripts:  Windows, Linux, OSX, and Hurd. Variables in this file determine the  format of the displayed names in <em>/boot/grub/grub.cfg</em> and on the  GRUB 2 menu. Users familiar with basic scripting can alter these  variables to change the format of the displayed menu entries.  Alternatively, the user can insert an entry into <em>/etc/default/grub</em> which disables this script. (See below)</li>
<li><strong>40_custom</strong> A template for adding custom menu entries which will be inserted into <em>grub.cfg</em> upon execution of the <tt>update-grub</tt> command. The contents of this file, below the &#8220;<em>exec tail -n +3 $0</em>&#8221; line and the default comments, are imported directly into <em>/boot/grub/grub.cfg</em> without any changes.</li>
</ul>
</blockquote>
<p>By setting executables bits of these file &#8220;0&#8243;,  you can disable function of file for grub menu. Forexample, if you want to disable memtest in grub2 menu, just set &#8220;0&#8243; to executable bit of 20_memtest86. <span style="text-decoration: underline;">sudo chmod -x 20_memtest86+</span> than <span style="text-decoration: underline;">update-grub.</span> To make it enable set &#8220;1&#8243; <span style="text-decoration: underline;">sudo chmod +x 20_memtest86+</span> and <span style="text-decoration: underline;">update-grub.</span></p>
<p><span style="text-decoration: underline;"><br />
</span></p>

	Tags: <a href="http://www.alonon.net/tag/boot/" title="boot" rel="tag">boot</a>, <a href="http://www.alonon.net/tag/grub2/" title="grub2" rel="tag">grub2</a>, <a href="http://www.alonon.net/tag/memtest/" title="memtest" rel="tag">memtest</a>, <a href="http://www.alonon.net/tag/ubuntu/" title="ubuntu" rel="tag">ubuntu</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.alonon.net/user-groups-and-users-in-ubuntu/" title="User groups and Users in Ubuntu (March 16, 2010)">User groups and Users in Ubuntu</a> (0)</li>
	<li><a href="http://www.alonon.net/ubuntu-9-10-karmic-koala-released%e2%80%8e/" title="Ubuntu 9.10, Karmic Koala, released‎ (October 31, 2009)">Ubuntu 9.10, Karmic Koala, released‎</a> (0)</li>
	<li><a href="http://www.alonon.net/server-optimizations-steps-2/" title="Server optimizations 2 (August 13, 2010)">Server optimizations 2</a> (0)</li>
	<li><a href="http://www.alonon.net/install-php-apache-mysql-phpmyadmin/" title="install php apache mysql phpmyadmin (January 1, 2009)">install php apache mysql phpmyadmin</a> (3)</li>
	<li><a href="http://www.alonon.net/how-to-learn-ubuntu-version/" title="How to learn ubuntu version (April 3, 2010)">How to learn ubuntu version</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.alonon.net/grub2-configurations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My server errors and optimization steps</title>
		<link>http://www.alonon.net/server-optimization-errors/</link>
		<comments>http://www.alonon.net/server-optimization-errors/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 21:45:07 +0000</pubDate>
		<dc:creator>ALonon</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[cpu]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[inode]]></category>
		<category><![CDATA[iostat]]></category>
		<category><![CDATA[mytop]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[top]]></category>

		<guid isPermaLink="false">http://www.alonon.net/?p=331</guid>
		<description><![CDATA[After 10K user for arabuldinle.com, i understood that optimization is very very important. In this article, I&#8217;ll explain optimization error that i have faced.  Also i researched some monitoring command such as top,mytop,free,iostat so you can find information about these command in detail. Session Error Error code: Warning: session_start() [function.session-start]: open(/var/lib/php5/ &#8230;) Because i&#8217;m using &#8230; <a href="http://www.alonon.net/server-optimization-errors/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After 10K user for arabuldinle.com, i understood that optimization is very very important. In this article, I&#8217;ll explain optimization error that i have faced.  Also i researched some monitoring command such as top,mytop,free,iostat so you can find information about these command in detail.</p>
<h1>Session Error</h1>
<p><strong>Error code: Warning: session_start() [function.session-start]:  open(/var/lib/php5/ &#8230;) </strong></p>
<p>Because i&#8217;m using lots of session_start() command in a page (it&#8217;s a big mistake), php was creating too much sessions and could not delete them. So that my server used all<strong> <span style="text-decoration: underline;">inodes</span></strong>.  (var/lib/php5). Moreover, my server has began to exceed disk io rate. (To delete all sessions: http://www.alonon.net/rm-argument-list-too-long-solution/)</p>
<p>What is inode ? You can think it as a pointer. It point begining of the file.  Each file has different inode: <a href="http://www.angelfire.com/myband/binusoman/Unix.html#inode">http://www.angelfire.com/myband/binusoman/Unix.html#inode</a> for more information.</p>
<p>As a solution, i tried to store sessions in databases <a href="http://www.devshed.com/c/a/PHP/Storing-PHP-Sessions-in-a-Database/">(http://www.devshed.com/c/a/PHP/Storing-PHP-Sessions-in-a-Database/)</a>. But because of using ajax, there was a problem about updating sessions. According to me, you can try storing php sesssion in database as a solution. After that i analyse my web sites code. I deleted unnecessary session code and change user group and chmod options of /var/lib/php5. Now It&#8217;s ok.</p>
<h1>CPU Usage Error</h1>
<p>We&#8217;re saving all searched data in arabuldinle.com. After more than 500.000 records, inserting a new record took about  2 seconds.  I found an app to view mysql query named mytop. By typing mytop on shell you can display mysql query. It&#8217;s working like &#8220;top&#8221;. In ubuntu you can install mytop with:</p>
<blockquote><p>sudo apt-get install mytop</p></blockquote>
<p>With typing</p>
<blockquote><p>sudo mytop -u mysql_user -p mysql_pass</p></blockquote>
<p>Mytop display something like that (More about mytop <a href="http://jeremy.zawodny.com/mysql/mytop/mytop.html">http://jeremy.zawodny.com/mysql/mytop/mytop.html</a>)</p>
<blockquote><p><a href="http://www.alonon.net/wp-content/uploads//2010/08/Screenshot-1.png"><img class="alignnone size-medium wp-image-333" title="Screenshot-1" src="http://www.alonon.net/wp-content/uploads//2010/08/Screenshot-1-300x47.png" alt="" width="300" height="47" /></a></p></blockquote>
<p>With those information i discovered that,  i had to make some changes in my mysql table. Here is the table structure:</p>
<p>id  (primary_key , btree) | title | secondary_id</p>
<p>Problem Query: select id from MYTABLE where title = &#8216;$title&#8217;. It was searching by linear search which takes lots of time (<a href="http://en.wikipedia.org/wiki/Linear_search">http://en.wikipedia.org/wiki/Linear_search</a>). I define  index to title field. So it started to search on btrees <a href="(http://en.wikipedia.org/wiki/Btree">(http://en.wikipedia.org/wiki/Btree</a>) which takes less time. After that operation my cpu usage decreased 40%.</p>
<p>However with more user , i faced with cpu problem again. With &#8220;top&#8221; command,  which used for displaying cpu process, user www-data was using 80% of cpu.  With changing some variable in apache2.conf , cpu usage decreased again. You can find changes here: <a href="http://library.linode.com/troubleshooting/memory-networking">http://library.linode.com/troubleshooting/memory-networking</a>. There&#8217;s one command that i want to mention: &#8220;iostat&#8221;. This command is coming with sysstat.</p>
<blockquote><p>sudo apt-get install sysstat</p></blockquote>
<p>With typing</p>
<blockquote><p>iostat</p></blockquote>
<p>You can view cpu and i/o statistics for devices. For more information<a href="http://sebastien.godard.pagesperso-orange.fr/features.html"> http://sebastien.godard.pagesperso-orange.fr/features.html</a>.</p>
<p>Lastly, there is an another command named free. With typing:</p>
<blockquote><p>free -m</p></blockquote>
<p>You can display, ram and swap usage for your computer.</p>
<blockquote><p>free -ms 10</p></blockquote>
<p>With this you can view memory usage by  10 seconds periods . For more information about free: <a href="http://www.linfo.org/free.html">http://www.linfo.org/free.html</a></p>
<p>With all these error, i find out lots of new command and learned lots of thing.</p>
<p>I hope with this article helps you.</p>

	Tags: <a href="http://www.alonon.net/tag/cpu/" title="cpu" rel="tag">cpu</a>, <a href="http://www.alonon.net/tag/free/" title="free" rel="tag">free</a>, <a href="http://www.alonon.net/tag/inode/" title="inode" rel="tag">inode</a>, <a href="http://www.alonon.net/tag/iostat/" title="iostat" rel="tag">iostat</a>, <a href="http://www.alonon.net/tag/mytop/" title="mytop" rel="tag">mytop</a>, <a href="http://www.alonon.net/tag/optimization/" title="optimization" rel="tag">optimization</a>, <a href="http://www.alonon.net/tag/session/" title="session" rel="tag">session</a>, <a href="http://www.alonon.net/tag/top/" title="top" rel="tag">top</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.alonon.net/top-command-and-hot-keys/" title="Top Command and Hot Keys (August 14, 2010)">Top Command and Hot Keys</a> (0)</li>
	<li><a href="http://www.alonon.net/server-optimizations-steps-2/" title="Server optimizations 2 (August 13, 2010)">Server optimizations 2</a> (0)</li>
	<li><a href="http://www.alonon.net/rm-argument-list-too-long-solution/" title="Rm &#8211; Argument list too long solution (June 1, 2010)">Rm &#8211; Argument list too long solution</a> (1)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.alonon.net/server-optimization-errors/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Php database class</title>
		<link>http://www.alonon.net/php-database-class/</link>
		<comments>http://www.alonon.net/php-database-class/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 07:55:35 +0000</pubDate>
		<dc:creator>ALonon</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[database class]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[insert]]></category>
		<category><![CDATA[select]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://www.alonon.net/?p=326</guid>
		<description><![CDATA[I&#8217;m using this class to my little framework. You can insert a data with sending column name and a array $data['mysql_field'] = &#8216;insert_value&#8217;, Update data with sending column,array and where option Delete data sending cloumn name and where option @q_fetch_all : Return all data with information in column, just take sql. @q_result : Taking: sql, &#8230; <a href="http://www.alonon.net/php-database-class/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using this class to my little framework.</p>
<ul>
<li> You can insert a data with sending column name and a array $data['mysql_field'] = &#8216;insert_value&#8217;,</li>
<li>Update data with sending column,array and where option</li>
<li>Delete data sending cloumn name and where option</li>
<li>@q_fetch_all : Return all data with information in column, just take sql.</li>
<li>@q_result : Taking: sql, order and field.</li>
</ul>
<pre class="brush: php;">
&lt;?php
class main {
	static $query_array = array ();
	protected function q_query($sql) {
			$query = mysql_query ( $sql ) or die(mysql_error());
			if (! $query) {
				$message = 'Invalid query: ' . mysql_error () . &quot;\n&quot;;
				$message .= 'Whole query: ' . $query;
				die ( $message );
			}

			return $query;

	}

	static function q_update($column, $data, $where) {
		foreach ($data as $form_name =&gt; $value) {
			$data_set .= $form_name.&quot;='&quot;.mysql_real_escape_string(htmlspecialchars(stripslashes($value))).&quot;',&quot;;
		}
		$data_set = substr($data_set,0,-1);
		return self::q_query ( &quot;update $column set $data_set $where&quot; );
	}

	protected function q_delete($column, $where) {
		return  self::q_query ( &quot;delete from $column $where&quot; );
	}

	protected function q_insert($column, $data) {
		foreach ( $data as $form_name =&gt; $value ) {
			$values [] =  mysql_real_escape_string(htmlspecialchars(stripslashes($value)));
			$column_name [] = $form_name;
		}
		$postdata = &quot;'&quot; . implode ( &quot;','&quot;, $values ) . &quot;'&quot;;
		$columnname = implode ( ', ', $column_name );
		return  self::q_query (&quot;INSERT INTO $column($columnname) VALUES ($postdata)&quot;);
	}

	public static function q_num_row($sql) {
		$query = self::q_query ( $sql );
		return @mysql_num_rows ( $query );
	}

	public static function q_fetch_all($sql) {
		$query = self::q_query ( $sql );
		while ( $result [] = mysql_fetch_assoc ( $query ) ) {
		}
		array_pop ( $result );
		return $result;
	}

	public static function q_fetch_array($sql) {
		$query = self::q_query ( $sql );
		return @mysql_fetch_array ( $query );
	}

	public static function q_fetch_assoc($sql) {
		$query = self::q_query ( $sql );
		return mysql_fetch_assoc ( $query );
	}

	public static function q_result($sql, $order = '0', $field) {
		$query = self::q_query ( $sql );
		return @mysql_result ($query, $order, $field );
	}
}
?&gt;
</pre>

	Tags: <a href="http://www.alonon.net/tag/database-class/" title="database class" rel="tag">database class</a>, <a href="http://www.alonon.net/tag/delete/" title="delete" rel="tag">delete</a>, <a href="http://www.alonon.net/tag/insert/" title="insert" rel="tag">insert</a>, <a href="http://www.alonon.net/tag/select/" title="select" rel="tag">select</a>, <a href="http://www.alonon.net/tag/update/" title="update" rel="tag">update</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.alonon.net/php-database-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inception</title>
		<link>http://www.alonon.net/inception/</link>
		<comments>http://www.alonon.net/inception/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 08:55:24 +0000</pubDate>
		<dc:creator>ALonon</dc:creator>
				<category><![CDATA[Movies]]></category>
		<category><![CDATA[film]]></category>
		<category><![CDATA[Inception]]></category>
		<category><![CDATA[leonardo]]></category>
		<category><![CDATA[movie]]></category>
		<category><![CDATA[nolan]]></category>

		<guid isPermaLink="false">http://www.alonon.net/?p=324</guid>
		<description><![CDATA[Again Christopher Nolan ( The Prestige, Memento, The Dark Knight ), again a perfect film. If you like complex scenario, visual effect you will like this film. Our hero named Cobb (Leonardo DiCaprio) can enter people&#8217;s dream and steal ideas. But it&#8217;s not enough for him, he tries to insert an idea to someone&#8217;s mind. &#8230; <a href="http://www.alonon.net/inception/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="200" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://www.dailymotion.com/swf/video/xd9a11?additionalInfos=0" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="200" src="http://www.dailymotion.com/swf/video/xd9a11?additionalInfos=0" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Again Christopher Nolan ( The Prestige, Memento, The Dark Knight ), again a perfect film. If you like complex scenario, visual effect you will like this film.</p>
<p>Our hero named Cobb (Leonardo DiCaprio) can enter people&#8217;s dream and steal ideas. But it&#8217;s not enough for him, he tries to insert an idea to someone&#8217;s mind. It&#8217;s the only way to return home.</p>

	Tags: <a href="http://www.alonon.net/tag/film/" title="film" rel="tag">film</a>, <a href="http://www.alonon.net/tag/inception/" title="Inception" rel="tag">Inception</a>, <a href="http://www.alonon.net/tag/leonardo/" title="leonardo" rel="tag">leonardo</a>, <a href="http://www.alonon.net/tag/movie/" title="movie" rel="tag">movie</a>, <a href="http://www.alonon.net/tag/nolan/" title="nolan" rel="tag">nolan</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.alonon.net/leaves-of-grass/" title="Leaves of Grass (March 23, 2010)">Leaves of Grass</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.alonon.net/inception/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wake On Lan</title>
		<link>http://www.alonon.net/wake-on-lan/</link>
		<comments>http://www.alonon.net/wake-on-lan/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 08:11:16 +0000</pubDate>
		<dc:creator>ALonon</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ethtool]]></category>
		<category><![CDATA[ifconfig]]></category>
		<category><![CDATA[wakeonlan]]></category>

		<guid isPermaLink="false">http://www.alonon.net/?p=311</guid>
		<description><![CDATA[With two simple application you can open your computer via lan. Firstly (under ubuntu) sudo apt-get install ethtool Control your ethernet card is supporting wake on lan or not. sudo ethtool eth0 if sth like that in output: Supports Wake-on: pumbg It&#8217;s ok.Than learn your mac address and write it somewhere. ifconfig &#124; grep HWaddr &#8230; <a href="http://www.alonon.net/wake-on-lan/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>With two simple application you can open your computer via lan.</p>
<p>Firstly (under ubuntu)</p>
<blockquote><p>sudo apt-get install ethtool</p></blockquote>
<p>Control your ethernet card is supporting wake on lan or not.</p>
<blockquote><p>sudo ethtool eth0</p></blockquote>
<p>if sth like that in output:</p>
<blockquote><p>Supports Wake-on: pumbg</p></blockquote>
<p>It&#8217;s ok.Than learn your mac address and write it somewhere.</p>
<blockquote><p>ifconfig | grep HWaddr</p></blockquote>
<p>Configure ethtool than shutdown your computer.</p>
<blockquote><p>ethtool ­s eth0 wol g</p></blockquote>
<p>To open your computer,  use a computer with same lan. Firstly install wakeonlan ( a simple program )</p>
<blockquote><p>sudo apt-get install wakeonlan</p></blockquote>
<p>And than open your comptuer</p>
<blockquote><p>wakeonlan XX:XX:XX:XX:XX:XX</p></blockquote>
<p>To disable it</p>
<blockquote><p>sudo ethtool -s eth0 autoneg off</p></blockquote>

	Tags: <a href="http://www.alonon.net/tag/ethtool/" title="ethtool" rel="tag">ethtool</a>, <a href="http://www.alonon.net/tag/ifconfig/" title="ifconfig" rel="tag">ifconfig</a>, <a href="http://www.alonon.net/tag/wakeonlan/" title="wakeonlan" rel="tag">wakeonlan</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.alonon.net/wake-on-lan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rm &#8211; Argument list too long solution</title>
		<link>http://www.alonon.net/rm-argument-list-too-long-solution/</link>
		<comments>http://www.alonon.net/rm-argument-list-too-long-solution/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 20:05:22 +0000</pubDate>
		<dc:creator>ALonon</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[argument]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[rm]]></category>
		<category><![CDATA[session]]></category>

		<guid isPermaLink="false">http://www.alonon.net/?p=308</guid>
		<description><![CDATA[Today my all web sites that working with session was giving that error: Warning: session_start() [function.session-start]: open(/var/lib/php5/sess_1812dbcc1b2e606c5f44f7c4d277c22e, O_RDWR) failed: No space left on device (28) in /**/theme/default/header.php on line 5 After a little searching i found that i didn&#8217;t have any free space. My applications could not delete session in  /var/lib/php5 folder. So i tried &#8230; <a href="http://www.alonon.net/rm-argument-list-too-long-solution/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today my all web sites that working with session was giving that error:</p>
<blockquote><p>Warning: session_start() [function.session-start]:  open(/var/lib/php5/sess_1812dbcc1b2e606c5f44f7c4d277c22e, O_RDWR)  failed: No space left on device (28) in  /**/theme/default/header.php  on line 5</p></blockquote>
<p>After a little searching i found that i didn&#8217;t have any free space. My applications could not delete session in  /var/lib/php5 folder. So i tried to delete manualy with this command.</p>
<blockquote><p>rm -rf *</p></blockquote>
<p>But because of there were lots of session files. I took</p>
<blockquote><p>Argument list too long</p></blockquote>
<p>To solve this problem i write.</p>
<blockquote><p>find . -name &#8220;*&#8221; -print | xargs rm -v</p></blockquote>
<p>But i don&#8217;t have any idea about what this command do !</p>

	Tags: <a href="http://www.alonon.net/tag/argument/" title="argument" rel="tag">argument</a>, <a href="http://www.alonon.net/tag/find/" title="find" rel="tag">find</a>, <a href="http://www.alonon.net/tag/rm/" title="rm" rel="tag">rm</a>, <a href="http://www.alonon.net/tag/session/" title="session" rel="tag">session</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.alonon.net/server-optimization-errors/" title="My server errors and optimization steps (August 3, 2010)">My server errors and optimization steps</a> (2)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.alonon.net/rm-argument-list-too-long-solution/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>File upload class php</title>
		<link>http://www.alonon.net/file-upload-class-php/</link>
		<comments>http://www.alonon.net/file-upload-class-php/#comments</comments>
		<pubDate>Sun, 09 May 2010 16:13:03 +0000</pubDate>
		<dc:creator>ALonon</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://www.alonon.net/?p=291</guid>
		<description><![CDATA[PHP UPLOAD CLASS Properties You can choose type of file to be uploaded. For every type of file to be uploaded, you can choose biggest size of file which is allowed. Day, month and year choices are assigned as folder.( day/month/year or year/day depends on your wish.) Usage 1- Write type of file and the &#8230; <a href="http://www.alonon.net/file-upload-class-php/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2><a name="eng">PHP UPLOAD CLASS</a></h2>
<h3><strong>Properties</strong></h3>
<p>You can choose type of file to be uploaded.<br />
For every type of file to be uploaded, you can choose biggest size of  file which is allowed.<br />
Day, month and year choices are assigned as folder.( day/month/year or  year/day depends on your wish.)</p>
<h3><strong>Usage</strong></h3>
<p>1- Write type of file and the biggest size of file as byte format to  $file_types variable.For example, for jpep type “image/jpeg” =&gt;  30000. For more mime type, you can visit:</p>
<p>http://www.w3schools.com/media/media_mimeref.asp</p>
<p>2- Write the file to be uploaded to $path variable. For year  “%year%”    is used, for month  “ %month% ” for day %day% are also  used.As a example, your file name is af and for archiving the file  monthly,                 “af %month%” is used.</p>
<p>3- To rename your file, choice of $new_name must be true otherwise  choice must be changed as false.</p>
<p>4- $path_right is used for new file to be created.</p>
<p>5- Include “af_fileupload_class.php” file to the file to be used.</p>
<p>6- Create a new class, $a= new af_upload();</p>
<p>7- Send received file to upload function,</p>
<p>$a-&gt;upload ($_FILES ['uploadedfile']);</p>
<p><span style="color: #ff0000;">af_fileupload_class.php</span></p>
<pre class="brush: php;">
&lt;?php
/*
 * @ Author: Onur AKTAŞ (alonon@gmail.com)
 * @ Homepage: http://www.acikfikir.org
 * @ Release date: 02.05.2010
 * @ Version 1.0
 * @ Thanks Süleyman Çelik, Alper İpek, Emre Çamalan
 */
class af_upload {
 /* mime types and max size (as byte)
 * 1000 byte = 1 KB
 * for more  mime type visit http://www.w3schools.com/media/media_mimeref.asp
 */
 var $file_types = array (&quot;image/jpeg&quot; =&gt; 30000, &quot;application/pdf&quot; =&gt; 4000 );
 // %year% for year, %month% for month, %day% for day, or just write exact path.
 var $path ='alper/%year%/%month%/%day%';
 // false don't give a new name, true give a new name.
 var $new_name = FALSE;
 var $path_right = '0777';
 var $error = &quot;&quot;;
 var $is_error = FALSE;
 public function control_file($file) {
 if (!array_key_exists ( $file ['type'], $this-&gt;file_types )) {
 $this-&gt;error='this type is not allowed';
 $this-&gt;is_error = TRUE;
 }
 else {
 if ($file ['size'] &gt; $this-&gt;file_types [$file ['type']]) {
 $this-&gt;error=&quot;file is too big&quot;;
 $this-&gt;is_error = TRUE;
 }
 }
 }

 public function upload($file,$path=&quot;&quot;,$new_name=&quot;&quot;) {
 $this-&gt;control_file($file);
 if ($this-&gt;is_error) {
 echo $this-&gt;error;
 }
 else {
 $ext = substr(basename($file['name']), strrpos(basename($file['name']), '.') + 1);
 //giving name start
 if($this-&gt;new_name)
 $filename = time().&quot;.&quot;.$ext;
 else
 $filename = basename($file['name']);
 //giving name finish

 // Replace path with real value start
 $path_keys = array('%year%','%month%','%day%');
 $replace_keys = array(date(&quot;Y&quot;),date(&quot;m&quot;),date(&quot;d&quot;));
 for($i=0;$i&lt;=2;$i++) {
 $this-&gt;path =str_replace($path_keys[$i], $replace_keys[$i], $this-&gt;path);
 }
 $umask = umask(0);
 if(!is_dir($this-&gt;path)) {

 if(!@mkdir($this-&gt;path,0777,true)) {
 $this-&gt;error=&quot;can not create a folder&quot;;
 $this-&gt;is_error = TRUE;
 }

 }
 if(!@move_uploaded_file($file['tmp_name'], $this-&gt;path.'/'.$filename)) {
 $this-&gt;error=&quot;can not upload file&quot;;
 $this-&gt;is_error = TRUE;
 }
 umask($umask);
 }
 }
}
?&gt;
</pre>
<p><span style="color: #ff0000;">index.html</span></p>
<pre class="brush: xml;">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;&gt;
&lt;title&gt; Af php upload sınıfı&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form enctype=&quot;multipart/form-data&quot; action=&quot;example.php&quot; method=&quot;POST&quot;&gt;
Dosya seçin: &lt;input name=&quot;uploadedfile&quot; type=&quot;file&quot; /&gt; &lt;br /&gt;
&lt;input type=&quot;submit&quot; value=&quot;Upload File&quot; /&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><span style="color: #ff0000;">example.php</span></p>
<pre class="brush: php;">
&lt;?php
include &quot;af_fileupload_class.php&quot;;
&lt;pre&gt;$a = new af_upload ();
$a-&gt;upload ($_FILES ['uploadedfile']);
?&gt;
</pre>
<p>To download, use this adress:  <a href="http://www.acikfikir.org/dosyalar/af_upload_class.tar.gz">www.acikfikir.org/dosyalar/af_upload_class.tar.gz</a> For advice and question, contact mail : alonon {@} gmail.com</p>

	Tags: <a href="http://www.alonon.net/tag/class/" title="class" rel="tag">class</a>, <a href="http://www.alonon.net/tag/php/" title="Php" rel="tag">Php</a>, <a href="http://www.alonon.net/tag/script/" title="script" rel="tag">script</a>, <a href="http://www.alonon.net/tag/upload/" title="upload" rel="tag">upload</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.alonon.net/unlimited-subcategory-with-adjacency-list-model/" title="Unlimited Subcategory with Adjacency List Model (February 1, 2009)">Unlimited Subcategory with Adjacency List Model</a> (8)</li>
	<li><a href="http://www.alonon.net/ubuntu-install-gd-support-for-apach/" title="Ubuntu install GD support for apache (December 11, 2009)">Ubuntu install GD support for apache</a> (0)</li>
	<li><a href="http://www.alonon.net/notice-use-of-undefined-constantvariable/" title="Notice: Use of undefined constant/variable (March 12, 2010)">Notice: Use of undefined constant/variable</a> (0)</li>
	<li><a href="http://www.alonon.net/mysql_insert_id/" title="mysql_insert_id (January 25, 2009)">mysql_insert_id</a> (0)</li>
	<li><a href="http://www.alonon.net/installing-apache-php-and-mysql-on-pardus/" title="installing apache php and mysql on Pardus (November 13, 2008)">installing apache php and mysql on Pardus</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.alonon.net/file-upload-class-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
