<?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>Jonny.ro</title>
	<atom:link href="http://www.jonny.ro/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jonny.ro</link>
	<description>programming ...</description>
	<lastBuildDate>Wed, 18 Aug 2010 17:51:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-alpha</generator>
		<item>
		<title>Let php show all errors</title>
		<link>http://www.jonny.ro/let-php-show-all-errors/</link>
		<comments>http://www.jonny.ro/let-php-show-all-errors/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 17:51:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP programming]]></category>
		<category><![CDATA[error_reporting]]></category>
		<category><![CDATA[E_ALL]]></category>
		<category><![CDATA[init_set]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.jonny.ro/?p=233</guid>
		<description><![CDATA[If server has default config set not to show the errors use this at the begining of your php file: error_reporting(E_ALL); ini_set(&#8216;display_errors&#8217;, &#8217;1&#8242;);]]></description>
			<content:encoded><![CDATA[<p>If server has default config set not to show the errors use this at the begining of your php file:</p>
<p><strong>error_reporting(E_ALL);<br />
ini_set(&#8216;display_errors&#8217;, &#8217;1&#8242;);</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonny.ro/let-php-show-all-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Script Optimization techniques</title>
		<link>http://www.jonny.ro/php-script-optimization-techniques/</link>
		<comments>http://www.jonny.ro/php-script-optimization-techniques/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 07:30:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP programming]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php optimization]]></category>
		<category><![CDATA[php script]]></category>
		<category><![CDATA[php techniques]]></category>

		<guid isPermaLink="false">http://www.jonny.ro/?p=230</guid>
		<description><![CDATA[1. If a method can be static, declare it static. Speed improvement is by a factor of 4. 2. Avoid magic like __get, __set, __autoload 3. require_once() is expensive 4. Use full paths in includes and requires, less time spent on resolving the OS paths. 5. If you need to find out the time when [...]]]></description>
			<content:encoded><![CDATA[<p>1. If a method can be static, declare it static. Speed improvement is by a factor of 4.</p>
<p>2. Avoid magic like __get, __set, __autoload</p>
<p>3. require_once() is expensive</p>
<p>4. Use full paths in includes and requires, less time spent on resolving the OS paths.</p>
<p>5. If you need to find out the time when the script started executing, $_SERVER[’REQUEST_TIME’] is preferred to time()</p>
<p>6. See if you can use strncasecmp, strpbrk and stripos instead of regex<br />
<span id="more-230"></span><br />
7. str_replace is faster than preg_replace, but strtr is faster than str_replace by a factor of 4</p>
<p>8. If the function, such as string replacement function, accepts both arrays and single characters as arguments, and<br />
if your argument list is not too long, consider writing a few redundant replacement statements, passing one character<br />
at a time, instead of one line of code that accepts arrays as search and replace arguments.</p>
<p>9. Error suppression with @ is very slow.</p>
<p>10. $row[’id’] is 7 times faster than $row[id]</p>
<p>11. Error messages are expensive</p>
<p>12. Do not use functions inside of for loop, such as for ($x=0; $x &lt; count($array); $x) The count()<br />
function gets called each time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonny.ro/php-script-optimization-techniques/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to change desktop icon size in Ubuntu</title>
		<link>http://www.jonny.ro/how-to-change-desktop-icon-size-in-ubuntu/</link>
		<comments>http://www.jonny.ro/how-to-change-desktop-icon-size-in-ubuntu/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 20:54:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux tutorials]]></category>
		<category><![CDATA[desktop icons ubuntu]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.jonny.ro/?p=228</guid>
		<description><![CDATA[1. type &#8220;nautilus&#8221; into a terminal 2. in the edit menu select PREFERENCES 3. under ICON VIEW DEFAULTS  and LIST VIEW DEFAULTS  change the zoom level to 66%  /  50 % or &#8230; 4. DONE!]]></description>
			<content:encoded><![CDATA[<p>1. type &#8220;nautilus&#8221; into a terminal</p>
<p>2. in the edit menu select PREFERENCES</p>
<p>3. under ICON VIEW DEFAULTS  and LIST VIEW DEFAULTS  change the zoom level to 66%  /  50 % or &#8230;</p>
<p>4. DONE!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonny.ro/how-to-change-desktop-icon-size-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setup OpenVPN</title>
		<link>http://www.jonny.ro/setup-openvpn/</link>
		<comments>http://www.jonny.ro/setup-openvpn/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 15:50:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux tutorials]]></category>
		<category><![CDATA[openvpn]]></category>

		<guid isPermaLink="false">http://www.jonny.ro/?p=223</guid>
		<description><![CDATA[Here is a short tutorial that will help you to have a working vpn server. First you need to install OpenVPN from sources or precompiled distro packet. Then you need to setup of the Certificate Authority (CA) Keep in mind that the CA should be on client not on the the server. OpenVPN install comes [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a short tutorial that will help you to have a working vpn server.</p>
<p>First you need to install OpenVPN from sources or precompiled distro packet.</p>
<p>Then you need to setup of the Certificate Authority (CA)</p>
<p>Keep in mind that the CA should be on client not on the the server. OpenVPN install comes with scripts that can easy create certificates. You should copy them in to /etc/openvpn:</p>
<p>cp -a /usr/share/doc/openvpn/examples/easy-rsa /etc/openvpn<br />
<span id="more-223"></span><br />
cd /etc/openvpn/easy-rsa</p>
<p>Edit the file called vars and adapt the last KEY_xxx vars to your needs. For my Slackware install the path is: export KEY_DIR=$D/../keys. After that run:</p>
<p>. vars</p>
<p>./clean-all</p>
<p>./build-ca</p>
<p>To create a certificate and sign it in one single step (do that only if the certificate can be transferred to the client via a secure channel, otherwise generate the certificate and the request on the client and sign it on the CA), without password:</p>
<p>For the server, use (don&#8217;t forget to give a Common Name):</p>
<p>./build-key-server server</p>
<p>For a client: (don&#8217;t forget to give a Common Name)</p>
<p>./build-key Hercule</p>
<p>We also need to make Diffie Hellman key:</p>
<p>./build-dh</p>
<p>For other situations, see easy-rsa/README</p>
<p>To see content of a certificate:</p>
<p>openssl x509 -in server.crt -text</p>
<p>Next you need to configure the server:</p>
<p># cat server.conf<br />
port 1194<br />
proto udp<br />
dev tap</p>
<p>ca /etc/openvpn/keys/ca.crt<br />
cert /etc/openvpn/keys/server.crt<br />
key /etc/openvpn/keys/server.key # This file should be kept secret<br />
dh /etc/openvpn/keys/dh1024.pem<br />
client-to-client # To allow clients to see each other<br />
server 192.168.10.0 255.255.255.0 # Set to virtual network and subnet mask<br />
client-config-dir /etc/openvpn/ccd<br />
ifconfig-pool-persist ipp.txt</p>
<p>#push &#8220;dhcp-option DNS x.x.x.x&#8221;<br />
#push &#8220;dhcp-option DNS x.x.x.x&#8221;<br />
#push &#8220;redirect-gateway def1&#8243;</p>
<p>keepalive 10 120<br />
#cipher AES-128-CBC # AES<br />
cipher none<br />
comp-lzo<br />
persist-key<br />
persist-tun<br />
user nobody<br />
group nobody<br />
status openvpn-status.log<br />
verb 3</p>
<p>Start the server:</p>
<p>openvpn &#8211;config server.conf</p>
<p>Next set up the client:</p>
<p>Copy from server to client files: ca.crt, Hercule.crt, Hercule.key, Hercule.csr</p>
<p>cp /usr/share/doc/openvpn/examples/sample-config-files/client.conf Hercule.ovpn</p>
<p>Edit the lines like this:</p>
<p>diff /usr/share/doc/openvpn/examples/sample-config-files/client.conf Hercule.ovpn<br />
23,24c23,24<br />
&lt; ;dev tap<br />
&lt; dev tun<br />
&#8212;<br />
&gt; dev tap<br />
&gt; ;dev tun<br />
42c42<br />
&lt; remote my-server-1 1194<br />
&#8212;<br />
&gt; remote x.x.x.x 1194<br />
89,90c89,90<br />
&lt; cert client.crt<br />
&lt; key client.key<br />
&#8212;<br />
&gt; cert Hercule.crt<br />
&gt; key Hercule.key<br />
112c112<br />
&lt; ;cipher x<br />
&#8212;<br />
&gt; cipher none</p>
<p>Start the client:</p>
<p>openvpn &#8211;config /etc/openvpn/Hercule/Hercule.ovpn &#8211;cd /etc/openvpn/Hercule/</p>
<p>That&#8217;s it, you should have the setup working.</p>
<p>If you use diffrent type of version of openvpn of server and client don&#8217;t forget to set up the mtu:</p>
<p>tun-mtu 1500<br />
tun-mtu-extra 32<br />
link-mtu 1590<br />
mssfix</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonny.ro/setup-openvpn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP5 Support allong with PHP4</title>
		<link>http://www.jonny.ro/php5-support-allong-with-php4/</link>
		<comments>http://www.jonny.ro/php5-support-allong-with-php4/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 15:49:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux tutorials]]></category>
		<category><![CDATA[PHP programming]]></category>
		<category><![CDATA[php4]]></category>
		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">http://www.jonny.ro/?p=221</guid>
		<description><![CDATA[The following are the steps I took to get php5+gd+mysql support (in parallel with the default install of php) working with my Plesk hosted sites on FC2. Hopeful it might help someone else. mkdir /usr/local/php5libpng cd /usr/local/php5libpng yum install zlib-devel wget http://kent.dl.sourceforge.net/sourc&#8230;-config.tar.gz gunzip libpng-1.2.8-config.tar.gz tar -xvf libpng-1.2.8-config.tar (remove extra dir’s created by the unzipping) ./configure [...]]]></description>
			<content:encoded><![CDATA[<p>The following are the steps I took to get php5+gd+mysql support (in parallel with the default install of php) working with my Plesk hosted sites on FC2. Hopeful it might help someone else.</p>
<p>mkdir /usr/local/php5libpng<br />
cd /usr/local/php5libpng</p>
<p>yum install zlib-devel</p>
<p>wget http://kent.dl.sourceforge.net/sourc&#8230;-config.tar.gz<br />
gunzip libpng-1.2.8-config.tar.gz<br />
tar -xvf libpng-1.2.8-config.tar<br />
<span id="more-221"></span><br />
(remove extra dir’s created by the unzipping)</p>
<p>./configure &#8216;&#8211;prefix=/usr/local/php5libpng&#8217; &#8216;&#8211;exec-prefix=/usr/local/php5libpng&#8217;<br />
make<br />
make install</p>
<p>yum install mysql-devel<br />
yum install libjpeg-devel</p>
<p>mkdir /usr/local/php5<br />
cd /usr/local/php5</p>
<p>yum install libxml2-devel</p>
<p>yum install curl-devel</p>
<p>wget http://uk2.php.net/get/php-5.1.2.tar&#8230;php.net/mirror<br />
gunzip php-5.1.2.tar.gz<br />
tar -xvf php-5.1.2.tar</p>
<p>(remove extra dir’s created by the unzipping)</p>
<p>./configure &#8216;&#8211;host=i386-redhat-linux&#8217; &#8216;&#8211;build=i386-redhat-linux&#8217; &#8216;&#8211;target=i386-redhat-linux-gnu&#8217; &#8216;&#8211;prefix=/usr/local/php5&#8242; &#8216;&#8211;exec-prefix=/usr/local/php5&#8242; &#8216;&#8211;program-suffix=5&#8242; &#8216;&#8211;enable-force-cgi-redirect&#8217; &#8216;&#8211;enable-discard-path&#8217; &#8216;&#8211;enable-exif&#8217; &#8216;&#8211;enable-ftp&#8217; &#8216;&#8211;with-curl&#8217; &#8216;&#8211;with-bz2&#8242; &#8216;&#8211;enable-memory-limit&#8217; &#8216;&#8211;enable-inline-optimization&#8217; &#8216;&#8211;with-openssl&#8217; &#8216;&#8211;with-png&#8217; &#8216;&#8211;with-regex=system&#8217; &#8216;&#8211;with-xml&#8217; &#8216;&#8211;with-zlib&#8217; &#8216;&#8211;enable-sockets&#8217; &#8216;&#8211;enable-mbstring=shared&#8217; &#8216;&#8211;enable-mbstr-enc-trans&#8217; &#8216;&#8211;with-zlib&#8217; &#8216;&#8211;with-png-dir=/usr/local/php5libpng&#8217; &#8216;&#8211;with-gd&#8217; &#8216;&#8211;with-jpeg-dir=/usr/local/php5libjpeg&#8217; &#8216;&#8211;enable-gd-native-ttf&#8217; &#8216;&#8211;with-mysql&#8217;</p>
<p>make<br />
make install</p>
<p>Create the file /home/httpd/vhosts/example.com/conf/vhost.conf with the following in it for each site:</p>
<p>ScriptAlias /php5-cgi-custom /home/httpd/vhosts/example.com/httpdocs<br />
Action application/x-httpd-php5-custom &#8220;/php5-cgi-custom/php5&#8243;</p>
<p>Run: /usr/local/psa/admin/sbin/websrvmng &#8211;reconfigure-vhost &#8211;vhost-name=example.com</p>
<p>Create a .htaccess file with the following in the directories that need to be run by php5:</p>
<p>AddType application/x-httpd-php5-custom .php</p>
<p>Also don&#8217;t forget about short_open_tag ( &lt;? vs &lt;?php ). You may also need to add this to your  .htaccess file:</p>
<p>php_flag short_open_tag On</p>
<p>For each of the sites go to the base httpdocs directory (after ssh’ing in as the site user, not root): /home/httpd/vhosts/example.com/httpdocs/ and run cp /usr/local/php5/bin/php5 ./php5</p>
<p>Then chmod “php5” to 755 (php5 needs to be copied and run locally, since otherwise you get issues with suexec. If you have problems run cat /var/log/httpd/suexec_log and check any errors.</p>
<p>PHP5 should now work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonny.ro/php5-support-allong-with-php4/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP hardening</title>
		<link>http://www.jonny.ro/php-hardening/</link>
		<comments>http://www.jonny.ro/php-hardening/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 15:48:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux tutorials]]></category>
		<category><![CDATA[PHP programming]]></category>
		<category><![CDATA[php settings]]></category>

		<guid isPermaLink="false">http://www.jonny.ro/?p=219</guid>
		<description><![CDATA[I highly recommend you enable safe_mode on production servers, especially in shared environments. This will stop exec functions and others that can easily prevent a security breach. Disable Dangerous PHP Functions PHP has a lot of potential to mess up your server and hack user accounts and even get root. I&#8217;ve seen many times where [...]]]></description>
			<content:encoded><![CDATA[<p>I highly recommend you enable safe_mode on production servers, especially in shared environments. This will stop exec functions and others that can easily prevent a security breach.</p>
<p>Disable Dangerous PHP Functions</p>
<p>PHP has a lot of potential to mess up your server and hack user accounts and even get root. I&#8217;ve seen many times where users use an insecure PHP script as an entry point to a server to start unleashing dangerous commands and taking control.</p>
<p>Search the php.ini file for:<br />
disable_functions =<br />
<span id="more-219"></span><br />
Add the following:</p>
<p>disable_functions = dl,system,exec,passthru,shell_exec<br />
disable_functions = dl,system,exec,passthru,shell_exec,proc_open,proc_close<br />
disable_functions = dl,system,exec,passthru,shell_exec,proc_open,proc_get_status,proc_terminate,proc_close,dir,readfile,virtual,</p>
<p>popen,curl_exec,curl_multi_exec,parse_ini_file,show_source</p>
<p>Turn off Register Globals</p>
<p>Register_globals will inject your scripts with all sorts of variables, like request variables from HTML forms. This coupled with the fact that PHP doesn&#8217;t require variable initialization means writing insecure code is that much easier.<br />
See http://us2.php.net/register_globals</p>
<p>register_globals = On</p>
<p>Replace it with</p>
<p>register_globals = Off</p>
<p>Run PHP through PHPsuexec Preventing Nobody Access</p>
<p>The biggest problem with PHP is that on cPanel servers is that PHP will run as nobody. When someone sets a script to 777 access that means the nobody user has write access to that file. So if someone on the same shared server wrote a script to search the system for 777 files they could inject anything they wanted, compromising the unsuspecting users account.</p>
<p>PHPsuexec makes PHP run as the user so 777 permissions are not allowed. There are a few downfalls to PHPsuexec but I think it&#8217;s required on a shared environment for the security of everyone.  Safe_mode doesn&#8217;t prevent you from compromising other users files. This is where PHPsuexec comes in, it stops the user from being able to read another users files. It also makes it easier for you, the administrator, to track PHP mail function spamming and lots of other issues caused by PHP scripts because now you can easily track it ot the users account responsible.</p>
<p>For this you will need to recompile PHP with suexec. On cPanel /scripts/easyapach has this build in.</p>
<p>I hope this has summed up some of the things you can do to help secure PHP on your server. There&#8217;s also open_base protection which you can use to prevent users from reading other users files.</p>
<p>In addition to that you can hide the version of the server you&#8217;re using, and avoid advertising the version of any modules loaded in your servers response.</p>
<p>If you alter your httpd.conf file to include the following two lines the presence, and version, of the PHP module will be hidden &#8211; as will the version of Apache you&#8217;re using:<br />
ServerSignature Off<br />
ServerTokens production</p>
<p>Disallow Dangerous Functions</p>
<p>Like perl, or C, PHP has a &#8220;system&#8221; function which allows scripts to execute commands.</p>
<p>If you&#8217;re happy you don&#8217;t need this ability in the scripts you&#8217;re using then you can disable this function, in case it&#8217;s abused by a remote attacker.</p>
<p>To disable functions you merely add their name to the disable_functions option. For example:<br />
disable_functions = dl, phpinfo, system, mail &#8230;<br />
Limit Resources</p>
<p>To avoid your PHP installation from consuming too many resources you can place limits on their usage.</p>
<p>The following settings are all useful ways of adjusting the resources your PHP scripts can consume:<br />
; Maximum execution time of each script, in seconds<br />
max_execution_time = 30</p>
<p>; Maximum amount of time each script may spend parsing request data<br />
max_input_time = 60</p>
<p>; Maximum amount of memory a script may consume (8MB)<br />
memory_limit = 8M</p>
<p>; Maximum size of POST data that PHP will accept.<br />
post_max_size = 8M</p>
<p>; Whether to allow HTTP file uploads.<br />
file_uploads = Off</p>
<p>; Maximum allowed size for uploaded files.<br />
upload_max_filesize = 2M</p>
<p>Avoid Opening Remote Files</p>
<p>One of the useful abilities of PHP is the ability to open files remotely without any complex processing.</p>
<p>Many simple scripts use this ability, for example a comic viewer might open up images from a remote server just using the fopen function &#8211; which is ordinarily used to open files.</p>
<p>It is an ability has often been abused in insecure scripts though.</p>
<p>If you have a script which tries to open a file and the filename is controllable by a remote user two things can happen:<br />
Any file on the local system which the webserver can read can be viewed by the remote attacker.<br />
Arbitary commands can be executed upon your server if the user can cause a remote PHP file to be opened.</p>
<p>To disable this attack you can set the following in your php.ini file:<br />
; Whether to allow the treatment of URLs (like http:// or ftp://) as files.<br />
;<br />
; This is turned off to avoid variable redefinition by remote attacker<br />
; that attempts to have the server download (and execute) a remote file<br />
; from a compromised host. This behaviour has been observed in automatic<br />
; scanning against badly written applications:<br />
; http://myhost/myapplication.php?include=http://roguesever/rogueapp.php<br />
allow_url_fopen = Off</p>
<p>More examples of tightening up PHP security can be found on the PHP website.</p>
<p>display_errors = Off<br />
log_errors     = On<br />
error_log      = syslog<br />
ignore_repeated_errors = On</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonny.ro/php-hardening/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Optimize server load</title>
		<link>http://www.jonny.ro/optimize-server-load/</link>
		<comments>http://www.jonny.ro/optimize-server-load/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 15:46:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux tutorials]]></category>
		<category><![CDATA[linux server load]]></category>
		<category><![CDATA[server load]]></category>

		<guid isPermaLink="false">http://www.jonny.ro/?p=217</guid>
		<description><![CDATA[Sysct is an interface that allows you to make changes to a running Linux/Unix system. This includes many advanced options of the TCP/IP stack and virtual memory system that can dramatically improve performance for an experienced system administrator. Over five hundred system variables can be read and set using sysctl.conf.You can find every variable explained [...]]]></description>
			<content:encoded><![CDATA[<p>Sysct is an interface that allows you to make changes to a running Linux/Unix system. This includes many advanced options of the TCP/IP stack and virtual memory system that can dramatically improve performance for an experienced system administrator. Over five hundred system variables can be read and set using sysctl.conf.You can find every variable explained here:</p>
<p>/usr/src/linux-`uname -r`/Documentation/networking/ip-sysctl.txt</p>
<p>Next configuration brought my load down from the teens to 99% of the time under 2.</p>
<p>Now, I have a dedicated Linux box running dual xeons and 2gb ram. If you don&#8217;t have SSh access, you can pretty much forget about trying this.</p>
<p>Make backups of anything and everything before trying this. I can&#8217;t be held responsible for anything u mess up. proceed with caution.</p>
<p>Open /etc/sysctl.conf and replace what is in there with this</p>
<p># Kernel sysctl configuration file for Red Hat Linux<br />
<span id="more-217"></span></p>
<p># Controls IP packet forwarding</p>
<p>net.ipv4.ip_forward = 0</p>
<p># Controls source route verification</p>
<p>net.ipv4.conf.all.rp_filter = 1</p>
<p>net.ipv4.conf.lo.rp_filter = 1</p>
<p>net.ipv4.conf.eth0.rp_filter = 1</p>
<p>net.ipv4.conf.default.rp_filter = 1</p>
<p># Disables IP source routing</p>
<p>net.ipv4.conf.all.accept_source_route = 0</p>
<p>net.ipv4.conf.lo.accept_source_route = 0</p>
<p>net.ipv4.conf.eth0.accept_source_route = 0</p>
<p>net.ipv4.conf.default.accept_source_route = 0</p>
<p># Controls the System Request debugging functionality of the kernel</p>
<p>kernel.sysrq = 0</p>
<p># Controls whether core dumps will append the PID to the core filename.</p>
<p># Useful for debugging multi-threaded applications.</p>
<p>kernel.core_uses_pid = 1</p>
<p># Increase maximum amount of memory allocated to shm</p>
<p># kernel.shmmax = 1073741824</p>
<p># Disable ICMP Redirect Acceptance</p>
<p>net.ipv4.conf.all.accept_redirects = 0</p>
<p>net.ipv4.conf.lo.accept_redirects = 0</p>
<p>net.ipv4.conf.eth0.accept_redirects = 0</p>
<p>net.ipv4.conf.default.accept_redirects = 0</p>
<p># Enable Log Spoofed Packets, Source Routed Packets, Redirect Packets</p>
<p>net.ipv4.conf.all.log_martians = 1</p>
<p>net.ipv4.conf.lo.log_martians = 1</p>
<p>net.ipv4.conf.eth0.log_martians = 1</p>
<p># Decrease the time default value for tcp_fin_timeout connection</p>
<p>net.ipv4.tcp_fin_timeout = 30</p>
<p># Decrease the time default value for tcp_keepalive_time connection</p>
<p>net.ipv4.tcp_keepalive_time = 1800</p>
<p># Turn on the tcp_window_scaling</p>
<p>net.ipv4.tcp_window_scaling = 1</p>
<p># Turn on the tcp_sack</p>
<p>net.ipv4.tcp_sack = 1</p>
<p># tcp_fack should be on because of sack</p>
<p>net.ipv4.tcp_fack = 1</p>
<p># Turn on the tcp_timestamps</p>
<p>net.ipv4.tcp_timestamps = 1</p>
<p># Enable TCP SYN Cookie Protection</p>
<p>net.ipv4.tcp_syncookies = 1</p>
<p># Enable ignoring broadcasts request</p>
<p>net.ipv4.icmp_echo_ignore_broadcasts = 1</p>
<p># Enable bad error message Protection</p>
<p>net.ipv4.icmp_ignore_bogus_error_responses = 1</p>
<p># Make more local ports available</p>
<p># net.ipv4.ip_local_port_range = 1024 65000</p>
<p># Set TCP Re-Ordering value in kernel to &#8217;5&#8242;</p>
<p>net.ipv4.tcp_reordering = 5</p>
<p># Set SYN ACK retry attempts to &#8217;3&#8242;</p>
<p>net.ipv4.tcp_synack_retries = 3</p>
<p># Various Settings</p>
<p>net.core.netdev_max_backlog = 1024</p>
<p># Increase the maximum number of skb-heads to be cached</p>
<p>net.core.hot_list_length = 256</p>
<p># Increase the tcp-time-wait buckets pool size</p>
<p>net.ipv4.tcp_max_tw_buckets = 360000</p>
<p># This will increase the amount of memory available for socket input/output queues</p>
<p>net.core.rmem_default = 65535</p>
<p>net.core.rmem_max = 8388608</p>
<p>net.ipv4.tcp_rmem = 4096 87380 8388608</p>
<p>net.core.wmem_default = 65535</p>
<p>net.core.wmem_max = 8388608</p>
<p>net.ipv4.tcp_wmem = 4096 65535 8388608</p>
<p>net.ipv4.tcp_mem = 8388608 8388608 8388608</p>
<p>net.core.optmem_max = 40960</p>
<p>After you make the changes to make them effective without rebooting, simply run the following commands:</p>
<p>/sbin/sysctl -p</p>
<p>/sbin/sysctl -w net.ipv4.route.flush=1</p>
<p>Another example is of a host wich was under a 5mbit syn flood attack for the past few days. Enabling syncookies instantly dropped the load averages. Despite still being under attack, the site is as responsive as ever:</p>
<p>net.ipv4.ip_forward=0</p>
<p>kernel.sysrq=0</p>
<p>kernel.core_uses_pid=1</p>
<p>kernel.shmmax = 134217728</p>
<p>net.ipv4.conf.all.rp_filter = 1</p>
<p>net.ipv4.conf.lo.rp_filter = 1</p>
<p>net.ipv4.conf.eth0.rp_filter = 1</p>
<p>net.ipv4.conf.default.rp_filter = 1</p>
<p>net.ipv4.conf.all.accept_source_route = 0</p>
<p>net.ipv4.conf.lo.accept_source_route = 0</p>
<p>net.ipv4.conf.eth0.accept_source_route = 0</p>
<p>net.ipv4.conf.default.accept_source_route = 0</p>
<p>net.ipv4.conf.all.accept_redirects = 0</p>
<p>net.ipv4.conf.lo.accept_redirects = 0</p>
<p>net.ipv4.conf.eth0.accept_redirects = 0</p>
<p>net.ipv4.conf.default.accept_redirects = 0</p>
<p>net.ipv4.tcp_fin_timeout = 20</p>
<p>net.ipv4.tcp_keepalive_time = 1800</p>
<p>net.ipv4.tcp_sack = 1</p>
<p>net.ipv4.tcp_fack = 1</p>
<p>net.ipv4.tcp_syncookies = 1</p>
<p>net.ipv4.icmp_echo_ignore_broadcasts = 1</p>
<p>net.ipv4.icmp_ignore_bogus_error_responses = 1</p>
<p>net.ipv4.ip_local_port_range = 16384 65536</p>
<p>net.core.netdev_max_backlog = 512</p>
<p>net.core.rmem_default = 65535</p>
<p>net.core.rmem_max = 8388608</p>
<p>net.ipv4.tcp_rmem = 4096 87380 8388608</p>
<p>net.core.wmem_default = 65535</p>
<p>net.core.wmem_max = 8388608</p>
<p>net.ipv4.tcp_wmem = 4096 65535 8388608</p>
<p>net.ipv4.tcp_mem = 8388608 8388608 8388608</p>
<p>net.core.optmem_max = 40960</p>
<p>fs.file-max=16384</p>
<p>kernel.threads-max=2048</p>
<p>A tcp_max_syn_backlog variable defines how many half-open connections can be kept by the backlog queue. For instance 256 is a total number of half-open connections handled in memory by Linux RedHat 7.3. The TCP/IP stack variables can be configured by sysctl or standard Unix commands. The following example shows how to change the default size of the backlog queue by the sysctl command:</p>
<p># sysctl -w net.ipv4.tcp_max_syn_backlog=&#8221;2048&#8243;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonny.ro/optimize-server-load/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Optimize Apache for performance</title>
		<link>http://www.jonny.ro/optimize-apache-for-performance/</link>
		<comments>http://www.jonny.ro/optimize-apache-for-performance/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 15:45:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux tutorials]]></category>

		<guid isPermaLink="false">http://www.jonny.ro/?p=215</guid>
		<description><![CDATA[Today we will talk about Linux and apache tips and tricks that will help webmaster to tune their dedicated server to handle high traffic. Apache configuration httpd.conf is a file file, usually located at /usr/local/apache/conf/httpd.conf path containing configuration settings for apache server. Cannot find the location of the file? Use locate command: &#62;cd / then [...]]]></description>
			<content:encoded><![CDATA[<p>Today we will talk about Linux and apache tips and tricks that will help webmaster to tune their dedicated server to handle high traffic.</p>
<p>Apache configuration</p>
<p>httpd.conf is a file file, usually located at /usr/local/apache/conf/httpd.conf path containing configuration settings for apache server. Cannot find the location of the file? Use locate command: &gt;cd / then &gt;locate httpd.conf. You may find the values in conf/extra directory. Search for http-mpm.conf and http-default.conf</p>
<p>Main parameters to tune are:</p>
<p>In Apache MPM Prefork Module:<br />
<span id="more-215"></span><br />
1. StartServers<br />
2. MinSpareServers<br />
3. MaxSpareServers<br />
4. ServerLimit<br />
5. MaxClients<br />
6. MaxRequestsPerChild</p>
<p>KeepAlive options:</p>
<p>1. KeepAlive<br />
2. KeepAliveTimeout<br />
3. MaxKeepAliveRequests</p>
<p>Timeout options:</p>
<p>1. Timeout</p>
<p>Apache MPM Prefork Module</p>
<p>Another handy tweak is to make some adjustments to the Apache MPM prefork module. This is assuming you are using Apache in prefork mode, which is highly recommended and likely if you are on a small VPS.</p>
<p>This module controls the number of processes and spare processes Apache will start and run. This is especially important if you are running a small VPS that is handling MySQL and Apache. Unless you are getting slammed with really heavy traffic on a regular basis (in which case you should be on a dedicated server) there is no need to be running the default configuration. Find these lines in your httpd.conf file:<br />
&lt;IfModule prefork.c&gt;<br />
StartServers 8<br />
MinSpareServers 5<br />
MaxSpareServers 20<br />
ServerLimit 256<br />
MaxClients 256<br />
MaxRequestsPerChild 4000<br />
&lt;/IfModule&gt;</p>
<p>MinSpareservers and MaxSpareServers control the number of spare processes your webserver is permitted to run and StartServers controls how many are started by default.</p>
<p>ServerLimit &#8211; controls the maximum configured value for MaxClients.</p>
<p>MaxClients – sets the limit on the number of simultaneous requests that can be supported.</p>
<p>Reducing MaxClients on a webserver that is serving dynamic content (e.g. WordPress) can make a big difference. If you experience a traffic spike on your VPS and your MaxClients is set too high your server will more than likely get stuck in an endless loop of swapping pages from physical memory to virtual memory, commonly referred to as thrashing. The accepted way of calculating an appropriate MaxClients value is dividing your total available system memory by the size per Apache process. For example, if you had a 500MB left for Apache to use and each Apache process was using around 20MB you would set your MaxClients to (512-12) / 10 = 50. To check real time memory usage on your VPS use top.Want to set it to a larger value? Add more physical RAM.  In other words, calculate the average of your httpd process, divide total available memory by the average leaving some for the system. E.g. in case of 1 Gig RAM and average httpd process size 7MB on this server it is safe to set it to 100.</p>
<p>If you use MySQL database, MaxClients parameter should be equal or close to max_connections parameter in MySQL conf file (my.cnf)</p>
<p>MaxRequestsPerChild -  limits the number of requests a child server will handle during it’s life. We can safely reduce this value and realize a small gain.</p>
<p>So let’s go ahead and pare down those values:<br />
&lt;IfModule prefork.c&gt;<br />
StartServers 3<br />
MinSpareServers 3<br />
MaxSpareServers 10<br />
ServerLimit 50<br />
MaxClients 50<br />
MaxRequestsPerChild 2000<br />
&lt;/IfModule&gt;</p>
<p>Remember these are not concrete “best” values, they depend on the size of your VPS and how small or large you Apache process is.</p>
<p>Optimize Your KeepAlive</p>
<p>KeepAlive allows your visitors to issue multiple requests over the same TCP connection, in theory this helps improve latency because your visitors can request your webpage, images, and javascripts all over one connection. Unfortunately, Apache must use a worker process to service each and every request. The worker process stays busy servicing each request for a full 15 seconds by default, even if your visitor is no longer using it! This means you have less worker processes available on your system at any given time. With the limited system resources you have on your small VPS we always want open worker processes to be actually working. One way of accomplishing this is turning off KeepAlive. Find this line in your httpd.conf file:<br />
KeepAlive On</p>
<p>and change it to:<br />
KeepAlive Off</p>
<p>If you have a site with lots of images and javascripts it is usually better leave KeepAlive turned on and make some additional tweaks.</p>
<p>If you decide to leave KeepAlive turned on it is important you change the default KeepAliveTimeout value. This prevents unused connections from staying open for excessive amounts of time. Find this line in your httpd.conf file:<br />
KeepAliveTimeout 15</p>
<p>You want to leave this connection open for 2 seconds, just long enough for the client to request most if not all of the necessary files. It is best to se it to minimum, 1-3 seconds. So change that line to:<br />
KeepAliveTimeout 2</p>
<p>If you are going to leave KeepAlive on you will want to increase MaxKeepAliveRequests. Setting this higher allows more requests per connection and increases efficiency. Find this line:<br />
MaxKeepAliveRequests 100</p>
<p>and change it to:<br />
MaxKeepAliveRequests 200</p>
<p>MaxRequestsPerChild – sets how many requests to serve per new httpd child process. You may set it very low, thus constantly freeing the memory, however on a particular case values like 15 or 20 may work well. As an example our site showing 10 images per page has this parameter set to 15.</p>
<p>MinSpareServers</p>
<p>MaxSpareServers</p>
<p>StartServers</p>
<p>Adjust Timeout</p>
<p>Another minor tweak that will give you a small performance boost as well as help reduce the effects of a DOS attack is changing the TimeOut Directive. This directive tells Apache how many seconds to wait while receiving an incoming request, processing it, and sending back a response. Find this line:<br />
Timeout 120</p>
<p>and change it to:<br />
Timeout 40</p>
<p>After you change settings in httpd.conf do not forget to restart apache. You may do this from control panel or from command line &gt; service httpd restart</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonny.ro/optimize-apache-for-performance/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mobile phone access via bluetooth</title>
		<link>http://www.jonny.ro/mobile-phone-access-via-bluetooth/</link>
		<comments>http://www.jonny.ro/mobile-phone-access-via-bluetooth/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 15:43:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux tutorials]]></category>

		<guid isPermaLink="false">http://www.jonny.ro/?p=213</guid>
		<description><![CDATA[In the next example I will show you how you can upload files from command line to your mobile phone using Bluetooth: First you need to run sdptool search OPUSH to see if your phone provide Object PUSH and on which channel it was provided and also the mac address of the phone. My results [...]]]></description>
			<content:encoded><![CDATA[<p>In the next example I will show you how you can upload files from command line to your mobile phone using Bluetooth:<br />
First you need to run sdptool search OPUSH to see if your phone provide Object PUSH and on which channel it was provided and also the mac address of the phone. My results were as follows:</p>
<p># sdptool search OPUSH</p>
<p>Inquiring &#8230;</p>
<p>Searching for OPUSH on 00:1F:01:28:B2:36 &#8230;</p>
<p>Service Name: OBEX Object Push</p>
<p>Service RecHandle: 0&#215;10001</p>
<p>Service Class ID List:</p>
<p>&#8220;OBEX Object Push&#8221; (0&#215;1105)</p>
<p>Protocol Descriptor List:</p>
<p>&#8220;L2CAP&#8221; (0&#215;0100)<br />
<span id="more-213"></span><br />
&#8220;RFCOMM&#8221; (0&#215;0003)</p>
<p>Channel: 9</p>
<p>&#8220;OBEX&#8221; (0&#215;0008)</p>
<p>Language Base Attr List:</p>
<p>code_ISO639: 0x656e</p>
<p>encoding: 0x6a</p>
<p>base_offset: 0&#215;100</p>
<p>Profile Descriptor List:</p>
<p>&#8220;OBEX Object Push&#8221; (0&#215;1105)</p>
<p>Version: 0&#215;0100</p>
<p>As you can see it runs on channel 9. Now to upload some files:</p>
<p># obex_test -b 00:1F:01:28:B2:36 9</p>
<p>Using Bluetooth RFCOMM transport</p>
<p>OBEX Interactive test client/server.</p>
<p>&gt; c</p>
<p>Connect OK!</p>
<p>Version: 0&#215;10. Flags: 0&#215;00</p>
<p>&gt; p</p>
<p>PUT file (local, remote)&gt; /root/www_starhost_ro.jpg www_starhost_ro.jpg</p>
<p>name=/root/www_starhost_ro.jpg, size=72674</p>
<p>Going to send 72674 bytes</p>
<p>Made some progress&#8230;</p>
<p>Made some progress&#8230;</p>
<p>Made some progress&#8230;</p>
<p>PUT successful!</p>
<p>&gt;</p>
<p>q</p>
<p>#</p>
<p>Somne other intresting commands:</p>
<p># hcitool scan</p>
<p>Scanning &#8230;</p>
<p>00:12:D2:30:E8:00 Adelita</p>
<p>#</p>
<p># sdptool browse 00:1F:01:28:B2:36</p>
<p>Browsing 00:1F:01:28:B2:36 &#8230;</p>
<p>Service Name: Network Access Point Service</p>
<p>Service Description: Personal Ad-hoc Network Service which provides access to a network</p>
<p>Service RecHandle: 0&#215;10000</p>
<p>Service Class ID List:</p>
<p>&#8220;Network Access Point&#8221; (0&#215;1116)</p>
<p>Protocol Descriptor List:</p>
<p>&#8220;L2CAP&#8221; (0&#215;0100)</p>
<p>PSM: 15</p>
<p>&#8220;BNEP&#8221; (0x000f)</p>
<p>Version: 0&#215;0100</p>
<p>SEQ8: dd 6</p>
<p>Language Base Attr List:</p>
<p>code_ISO639: 0x656e</p>
<p>encoding: 0x6a</p>
<p>base_offset: 0&#215;100</p>
<p>Profile Descriptor List:</p>
<p>&#8220;Network Access Point&#8221; (0&#215;1116)</p>
<p>Version: 0&#215;0100</p>
<p>Service Name: OBEX Object Push</p>
<p>Service RecHandle: 0&#215;10001</p>
<p>Service Class ID List:</p>
<p>&#8220;OBEX Object Push&#8221; (0&#215;1105)</p>
<p>Protocol Descriptor List:</p>
<p>&#8220;L2CAP&#8221; (0&#215;0100)</p>
<p>&#8220;RFCOMM&#8221; (0&#215;0003)</p>
<p>Channel: 9</p>
<p>&#8220;OBEX&#8221; (0&#215;0008)</p>
<p>Language Base Attr List:</p>
<p>code_ISO639: 0x656e</p>
<p>encoding: 0x6a</p>
<p>base_offset: 0&#215;100</p>
<p>Profile Descriptor List:</p>
<p>&#8220;OBEX Object Push&#8221; (0&#215;1105)</p>
<p>Version: 0&#215;0100</p>
<p>Service Name: OBEX File Transfer</p>
<p>Service RecHandle: 0&#215;10002</p>
<p>Service Class ID List:</p>
<p>&#8220;OBEX File Transfer&#8221; (0&#215;1106)</p>
<p>Protocol Descriptor List:</p>
<p>&#8220;L2CAP&#8221; (0&#215;0100)</p>
<p>&#8220;RFCOMM&#8221; (0&#215;0003)</p>
<p>Channel: 10</p>
<p>&#8220;OBEX&#8221; (0&#215;0008)</p>
<p>Language Base Attr List:</p>
<p>code_ISO639: 0x656e</p>
<p>encoding: 0x6a</p>
<p>base_offset: 0&#215;100</p>
<p>Profile Descriptor List:</p>
<p>&#8220;OBEX File Transfer&#8221; (0&#215;1106)</p>
<p>Version: 0&#215;0100</p>
<p>Service Name: Dial-up networking</p>
<p>Service RecHandle: 0&#215;10003</p>
<p>Service Class ID List:</p>
<p>&#8220;Dialup Networking&#8221; (0&#215;1103)</p>
<p>&#8220;Generic Networking&#8221; (0&#215;1201)</p>
<p>Protocol Descriptor List:</p>
<p>&#8220;L2CAP&#8221; (0&#215;0100)</p>
<p>&#8220;RFCOMM&#8221; (0&#215;0003)</p>
<p>Channel: 1</p>
<p>Language Base Attr List:</p>
<p>code_ISO639: 0x656e</p>
<p>encoding: 0x6a</p>
<p>base_offset: 0&#215;100</p>
<p>Profile Descriptor List:</p>
<p>&#8220;Dialup Networking&#8221; (0&#215;1103)</p>
<p>Version: 0&#215;0100</p>
<p>Service Name: Nokia PC Suite</p>
<p>Service RecHandle: 0&#215;10004</p>
<p>Service Class ID List:</p>
<p>&#8220;Serial Port&#8221; (0&#215;1101)</p>
<p>Protocol Descriptor List:</p>
<p>&#8220;L2CAP&#8221; (0&#215;0100)</p>
<p>&#8220;RFCOMM&#8221; (0&#215;0003)</p>
<p>Channel: 15</p>
<p>Language Base Attr List:</p>
<p>code_ISO639: 0x656e</p>
<p>encoding: 0x6a</p>
<p>base_offset: 0&#215;100</p>
<p>Service Name: COM 1</p>
<p>Service RecHandle: 0&#215;10005</p>
<p>Service Class ID List:</p>
<p>&#8220;Serial Port&#8221; (0&#215;1101)</p>
<p>Protocol Descriptor List:</p>
<p>&#8220;L2CAP&#8221; (0&#215;0100)</p>
<p>&#8220;RFCOMM&#8221; (0&#215;0003)</p>
<p>Channel: 3</p>
<p>Language Base Attr List:</p>
<p>code_ISO639: 0x656e</p>
<p>encoding: 0x6a</p>
<p>base_offset: 0&#215;100</p>
<p>Service Name: Voice Gateway</p>
<p>Service RecHandle: 0&#215;10006</p>
<p>Service Class ID List:</p>
<p>&#8220;Handsfree Audio Gateway&#8221; (0x111f)</p>
<p>&#8220;Generic Audio&#8221; (0&#215;1203)</p>
<p>Protocol Descriptor List:</p>
<p>&#8220;L2CAP&#8221; (0&#215;0100)</p>
<p>&#8220;RFCOMM&#8221; (0&#215;0003)</p>
<p>Channel: 13</p>
<p>Language Base Attr List:</p>
<p>code_ISO639: 0x656e</p>
<p>encoding: 0x6a</p>
<p>base_offset: 0&#215;100</p>
<p>Profile Descriptor List:</p>
<p>&#8220;Handsfree&#8221; (0x111e)</p>
<p>Version: 0&#215;0105</p>
<p>Service Name: Audio Gateway</p>
<p>Service RecHandle: 0&#215;10007</p>
<p>Service Class ID List:</p>
<p>&#8220;Headset Audio Gateway&#8221; (0&#215;1112)</p>
<p>&#8220;Generic Audio&#8221; (0&#215;1203)</p>
<p>Protocol Descriptor List:</p>
<p>&#8220;L2CAP&#8221; (0&#215;0100)</p>
<p>&#8220;RFCOMM&#8221; (0&#215;0003)</p>
<p>Channel: 12</p>
<p>Language Base Attr List:</p>
<p>code_ISO639: 0x656e</p>
<p>encoding: 0x6a</p>
<p>base_offset: 0&#215;100</p>
<p>Profile Descriptor List:</p>
<p>&#8220;Headset&#8221; (0&#215;1108)</p>
<p>Version: 0&#215;0100</p>
<p>Service Name: SyncML Client</p>
<p>Service RecHandle: 0&#215;10009</p>
<p>Service Class ID List:</p>
<p>UUID 128: 00000002-0000-1000-8000-0002ee000002</p>
<p>Protocol Descriptor List:</p>
<p>&#8220;L2CAP&#8221; (0&#215;0100)</p>
<p>&#8220;RFCOMM&#8221; (0&#215;0003)</p>
<p>Channel: 11</p>
<p>&#8220;OBEX&#8221; (0&#215;0008)</p>
<p>Language Base Attr List:</p>
<p>code_ISO639: 0x656e</p>
<p>encoding: 0x6a</p>
<p>base_offset: 0&#215;100</p>
<p>Service Name: SIM ACCESS</p>
<p>Service RecHandle: 0x1000e</p>
<p>Service Class ID List:</p>
<p>&#8220;SIM Access&#8221; (0x112d)</p>
<p>&#8220;Generic Telephony&#8221; (0&#215;1204)</p>
<p>Protocol Descriptor List:</p>
<p>&#8220;L2CAP&#8221; (0&#215;0100)</p>
<p>&#8220;RFCOMM&#8221; (0&#215;0003)</p>
<p>Channel: 4</p>
<p>Language Base Attr List:</p>
<p>code_ISO639: 0x656e</p>
<p>encoding: 0x6a</p>
<p>base_offset: 0&#215;100</p>
<p>Profile Descriptor List:</p>
<p>&#8220;SIM Access&#8221; (0x112d)</p>
<p>Version: 0&#215;0101</p>
<p>rfcomm connect rfcomm0 00:1F:01:28:B2:36 1</p>
<p># rfcomm</p>
<p>rfcomm0: 00:1F:01:28:B2:36 channel 1 clean</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonny.ro/mobile-phone-access-via-bluetooth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install Zend &amp; APC PHP Optimizers</title>
		<link>http://www.jonny.ro/install-zend-apc-php-optimizers/</link>
		<comments>http://www.jonny.ro/install-zend-apc-php-optimizers/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 15:42:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux tutorials]]></category>
		<category><![CDATA[apc php optimizers]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.jonny.ro/?p=211</guid>
		<description><![CDATA[Zend Optimizer is a free application that allows PHP to run files encoded by Zend Guard. Zend Optimizer greatly enhances the performance of PHP applications. The Zend Optimizer goes over the code generated by the standard Zend run-time compiler and optimizes it for faster execution. The standard Zend run-time compiler used by PHP is indeed [...]]]></description>
			<content:encoded><![CDATA[<p>Zend Optimizer is a free application that allows PHP to run files encoded by Zend Guard. Zend Optimizer greatly enhances the performance of PHP applications.</p>
<p>The Zend Optimizer goes over the code generated by the standard Zend run-time compiler and optimizes it for faster execution. The standard Zend run-time compiler used by PHP is indeed very fast, generating code that is usually 2 to 10 times faster. But an application that uses Zend Optimizer can execute scripts another 40% to 100% faster.</p>
<p>Here are the steps for instaling it.</p>
<p>You must be root in order to install it.<span id="more-211"></span></p>
<p>Get optimizer form here:</p>
<p>http://www.zend.com/free_download/optimizer</p>
<p>#tar -vxzf ZendOptimizer-3.3.3-linux-glibc23-x86_64.tar.gz</p>
<p>#cd ZendOptimizer-3.3.3-linux-glibc23-x86_64</p>
<p>#./install.sh</p>
<p>Answer to those questions.</p>
<p>Add in your php.ini those lines:</p>
<p>[Zend]<br />
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.3<br />
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.3<br />
zend_optimizer.version=3.3.0<br />
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so<br />
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so</p>
<p>Restart apache:</p>
<p>/sbin/service httpd restart</p>
<p>You should have:</p>
<p># php -v | grep Optimizer<br />
with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies<br />
#</p>
<p>The Alternative PHP Cache (APC) is a free, open, and robust framework for caching and optimizing</p>
<p>PHP intermediate code. It&#8217;s an PECL extension which shares the packaging and distribution system</p>
<p>with its sister, PEAR.</p>
<p>Ubuntu/Debian install:</p>
<p>First you need to install dependencies for compilation:</p>
<p>$ sudo aptitude install apache2-dev php5-dev build-essential</p>
<p>Get current version of apc and install it</p>
<p>$ wget http://pecl.php.net/get/APC-3.0.16.tgz</p>
<p>$ tar xzf APC-3.0.16.tgz</p>
<p>$ cd APC-3.0.16</p>
<p>$ phpize</p>
<p>$ ./configure &#8211;enable-apc &#8211;enable-apc-mmap \</p>
<p>&#8211;with-apxs=/usr/bin/apxs2 \</p>
<p>&#8211;with-php-config=/usr/bin/php-config</p>
<p>$ make</p>
<p>$ sudo make install</p>
<p>You need to add in /etc/php5/apache2/php.ini extension=apc.so . After that just restart apache:</p>
<p>$ sudo apache2ctl restart</p>
<p>Slackware Install:</p>
<p># wget http://pecl.php.net/get/APC-3.0.19.tgz</p>
<p># tar -vxzf APC-3.0.19.tgz</p>
<p># cd APC-3.0.19</p>
<p>#phpize<br />
# which apxs<br />
/usr/sbin/apxs# which php-config<br />
/usr/bin/php-config<br />
# ./configure &#8211;enable-apc &#8211;enable-apc-mmap &#8211;with-apxs=/usr/sbin/apxs &#8211;with-php-config=/usr/bin/php-config<br />
#make<br />
#checkinstall &#8211;fstrans=no -S -y<br />
#installpkg APC-3.0.19-i386-1.tgz</p>
<p>Add extension=apc.so in /etc/httpd/php.ini and reload apache:</p>
<p># /etc/rc.d/rc.httpd restart</p>
<p>Now a phpinfo(); should show you a new apc section.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonny.ro/install-zend-apc-php-optimizers/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
